@foxy.io/elements 1.24.0-beta.4 → 1.24.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/foxy-access-recovery-form.js +1 -1
- package/dist/cdn/foxy-address-card.js +1 -1
- package/dist/cdn/foxy-address-form.js +1 -1
- package/dist/cdn/foxy-admin-subscription-card.js +1 -1
- package/dist/cdn/foxy-api-browser.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-card.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-applied-tax-card.js +1 -1
- package/dist/cdn/foxy-attribute-card.js +1 -1
- package/dist/cdn/foxy-attribute-form.js +1 -1
- package/dist/cdn/foxy-cancellation-form.js +1 -1
- package/dist/cdn/foxy-cart-card.js +1 -1
- package/dist/cdn/foxy-cart-form.js +1 -1
- package/dist/cdn/foxy-client-card.js +1 -1
- package/dist/cdn/foxy-client-form.js +1 -1
- package/dist/cdn/foxy-collection-page.js +1 -1
- package/dist/cdn/foxy-collection-pages.js +1 -1
- package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
- package/dist/cdn/foxy-coupon-card.js +1 -1
- package/dist/cdn/foxy-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-coupon-codes-form.js +1 -1
- package/dist/cdn/foxy-coupon-detail-card.js +1 -1
- package/dist/cdn/foxy-coupon-form.js +1 -1
- package/dist/cdn/foxy-custom-field-card.js +1 -1
- package/dist/cdn/foxy-custom-field-form.js +1 -1
- package/dist/cdn/foxy-customer-api.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 +2 -2
- package/dist/cdn/foxy-customer.js +1 -1
- package/dist/cdn/foxy-customers-table.js +1 -1
- package/dist/cdn/foxy-discount-builder.js +1 -1
- package/dist/cdn/foxy-discount-card.js +1 -1
- package/dist/cdn/foxy-discount-detail-card.js +1 -1
- package/dist/cdn/foxy-donation.js +1 -1
- package/dist/cdn/foxy-downloadable-card.js +1 -1
- package/dist/cdn/foxy-downloadable-form.js +1 -1
- package/dist/cdn/foxy-email-template-card.js +1 -1
- package/dist/cdn/foxy-email-template-form.js +1 -1
- package/dist/cdn/foxy-error-entry-card.js +1 -1
- package/dist/cdn/foxy-filter-attribute-card.js +1 -1
- package/dist/cdn/foxy-filter-attribute-form.js +1 -1
- package/dist/cdn/foxy-form-dialog.js +1 -1
- package/dist/cdn/foxy-generate-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-card.js +1 -1
- package/dist/cdn/foxy-gift-card-code-form.js +1 -1
- package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
- package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-form.js +1 -1
- package/dist/cdn/foxy-i18n-editor.js +2 -2
- package/dist/cdn/foxy-i18n.js +1 -1
- package/dist/cdn/foxy-integration-card.js +1 -1
- package/dist/cdn/foxy-integration-form.js +1 -1
- package/dist/cdn/foxy-item-card.js +1 -1
- package/dist/cdn/foxy-item-category-card.js +1 -1
- package/dist/cdn/foxy-item-category-form.js +1 -1
- package/dist/cdn/foxy-item-form.js +1 -1
- package/dist/cdn/foxy-item-option-card.js +1 -1
- package/dist/cdn/foxy-item-option-form.js +1 -1
- package/dist/cdn/foxy-items-form.js +1 -1
- package/dist/cdn/foxy-nucleon-element.js +1 -1
- package/dist/cdn/foxy-pagination.js +1 -1
- package/dist/cdn/foxy-passkey-card.js +1 -1
- package/dist/cdn/foxy-passkey-form.js +1 -1
- package/dist/cdn/foxy-payment-card.js +1 -1
- package/dist/cdn/foxy-payment-method-card.js +1 -1
- package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
- package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
- package/dist/cdn/foxy-payments-api.js +1 -1
- package/dist/cdn/foxy-query-builder.js +1 -1
- package/dist/cdn/foxy-report-form.js +4 -4
- package/dist/cdn/foxy-reports-table.js +1 -1
- package/dist/cdn/foxy-shipment-card.js +1 -1
- package/dist/cdn/foxy-shipping-method-card.js +1 -1
- package/dist/cdn/foxy-sign-in-form.js +1 -1
- package/dist/cdn/foxy-spinner.js +2 -2
- package/dist/cdn/foxy-store-card.js +1 -1
- package/dist/cdn/foxy-store-form.js +1 -1
- package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
- package/dist/cdn/foxy-subscription-card.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +2 -2
- package/dist/cdn/foxy-subscription-settings-form.js +1 -1
- package/dist/cdn/foxy-subscriptions-table.js +1 -1
- package/dist/cdn/foxy-table.js +1 -1
- package/dist/cdn/foxy-tax-card.js +1 -1
- package/dist/cdn/foxy-tax-form.js +1 -1
- package/dist/cdn/foxy-template-config-form.js +1 -1
- package/dist/cdn/foxy-template-form.js +1 -1
- package/dist/cdn/foxy-template-set-card.js +1 -1
- package/dist/cdn/foxy-template-set-form.js +1 -1
- package/dist/cdn/foxy-transaction-card.js +1 -1
- package/dist/cdn/foxy-transaction.js +1 -1
- package/dist/cdn/foxy-transactions-table.js +1 -1
- package/dist/cdn/foxy-user-card.js +1 -1
- package/dist/cdn/foxy-user-form.js +1 -1
- package/dist/cdn/foxy-users-table.js +1 -1
- package/dist/cdn/foxy-webhook-card.js +1 -1
- package/dist/cdn/foxy-webhook-form.js +1 -1
- package/dist/cdn/foxy-webhook-log-card.js +1 -1
- package/dist/cdn/foxy-webhook-status-card.js +1 -1
- package/dist/cdn/{shared-9caffb4d.js → shared-017ab35f.js} +1 -1
- package/dist/cdn/{shared-e6828dbf.js → shared-0689b25a.js} +5 -5
- package/dist/cdn/shared-0dabe195.js +15 -0
- package/dist/cdn/{shared-1b060170.js → shared-125d1a00.js} +1 -1
- package/dist/cdn/shared-13cc4ed4.js +9 -0
- package/dist/cdn/{shared-ff992ead.js → shared-15fe0f50.js} +1 -1
- package/dist/cdn/{shared-379b37e6.js → shared-19c9fe00.js} +7 -11
- package/dist/cdn/shared-1b2e0709.js +1 -0
- package/dist/cdn/shared-1e43b4db.js +1 -0
- package/dist/cdn/{shared-c7f2f1ab.js → shared-1fd59009.js} +1 -1
- package/dist/cdn/{shared-31651a9c.js → shared-2fa6a5a0.js} +1 -1
- package/dist/cdn/{shared-65318cc1.js → shared-3164d0c3.js} +1 -1
- package/dist/cdn/{shared-e10052d0.js → shared-31a891e8.js} +3 -3
- package/dist/cdn/{shared-b3ac59eb.js → shared-403af08d.js} +2 -2
- package/dist/cdn/{shared-a92ae606.js → shared-421e46e9.js} +1 -1
- package/dist/cdn/{shared-dccf0420.js → shared-42adf053.js} +1 -1
- package/dist/cdn/{shared-77a4d8e8.js → shared-46f3f71c.js} +1 -1
- package/dist/cdn/{shared-e84fa0ea.js → shared-4966b3e4.js} +1 -1
- package/dist/cdn/{shared-b48a83b0.js → shared-4a0298cb.js} +1 -1
- package/dist/cdn/{shared-17d0db7f.js → shared-4bd1efd7.js} +3 -3
- package/dist/cdn/{shared-51d28e6d.js → shared-527abf31.js} +1 -1
- package/dist/cdn/{shared-fe54babe.js → shared-53532131.js} +1 -1
- package/dist/cdn/{shared-9c626d58.js → shared-5616a12f.js} +1 -1
- package/dist/cdn/{shared-c97e0d6e.js → shared-57922341.js} +1 -1
- package/dist/cdn/shared-619bcf83.js +1 -0
- package/dist/cdn/{shared-ba658670.js → shared-6273b7e1.js} +1 -1
- package/dist/cdn/{shared-4904bca4.js → shared-639dda4b.js} +1 -1
- package/dist/cdn/{shared-d14c2060.js → shared-6b0498b2.js} +3 -3
- package/dist/cdn/{shared-6f84ac3e.js → shared-6b3be508.js} +1 -1
- package/dist/cdn/{shared-c6c6ba69.js → shared-6dffe67d.js} +1 -1
- package/dist/cdn/{shared-4c956a8e.js → shared-72a13fda.js} +1 -1
- package/dist/cdn/{shared-4b67d699.js → shared-763a6797.js} +1 -1
- package/dist/cdn/shared-7680d300.js +122 -0
- package/dist/cdn/shared-79d01877.js +1 -0
- package/dist/cdn/{shared-6abdfcf2.js → shared-7bf6e728.js} +1 -1
- package/dist/cdn/{shared-69a21b9d.js → shared-7d4e0011.js} +1 -1
- package/dist/cdn/shared-7e887e5b.js +1 -0
- package/dist/cdn/{shared-8474bc4a.js → shared-7ead930c.js} +1 -1
- package/dist/cdn/shared-7f33a83a.js +12 -12
- package/dist/cdn/{shared-6dc64a17.js → shared-8128b5e3.js} +1 -1
- package/dist/cdn/{shared-984fcdf5.js → shared-8134d8a7.js} +3 -3
- package/dist/cdn/{shared-c4240bc6.js → shared-8465a37a.js} +1 -1
- package/dist/cdn/{shared-e7c3b7b6.js → shared-848813a4.js} +1 -1
- package/dist/cdn/shared-8528906b.js +1 -0
- package/dist/cdn/{shared-a3c73e91.js → shared-897ab5e6.js} +1 -1
- package/dist/cdn/{shared-4bbd600d.js → shared-8fbab85c.js} +1 -1
- package/dist/cdn/{shared-4dc58b73.js → shared-90be9ac7.js} +1 -1
- package/dist/cdn/{shared-0a248c0d.js → shared-91eb066c.js} +1 -1
- package/dist/cdn/{shared-1d28220a.js → shared-9765be8f.js} +1 -1
- package/dist/cdn/{shared-e6997950.js → shared-9bdd5400.js} +1 -1
- package/dist/cdn/{shared-dfe2602a.js → shared-a134d313.js} +1 -1
- package/dist/cdn/shared-a6517170.js +1 -0
- package/dist/cdn/shared-a7475f62.js +212 -0
- package/dist/cdn/shared-a88c5cf1.js +29 -0
- package/dist/cdn/{shared-479ad951.js → shared-a96a2154.js} +1 -1
- package/dist/cdn/shared-aa22ee61.js +1 -0
- package/dist/cdn/shared-aa569a99.js +804 -0
- package/dist/cdn/{shared-e8e92fe3.js → shared-ad0256d0.js} +2 -2
- package/dist/cdn/{shared-25f64060.js → shared-b334c8b6.js} +1 -1
- package/dist/cdn/{shared-1d08a5ad.js → shared-bbbb8894.js} +1 -1
- package/dist/cdn/{shared-bafcab47.js → shared-bf2113a4.js} +3 -3
- package/dist/cdn/{shared-88e36564.js → shared-c541c9e9.js} +26 -27
- package/dist/cdn/{shared-36725fe3.js → shared-c758220c.js} +1 -1
- package/dist/cdn/{shared-4674063d.js → shared-c97f7178.js} +27 -27
- package/dist/cdn/shared-d2222c8d.js +1 -0
- package/dist/cdn/{shared-64f98a0f.js → shared-db06114b.js} +7 -2
- package/dist/cdn/{shared-665d6cc4.js → shared-e5786b8b.js} +1 -1
- package/dist/cdn/shared-e640e9fa.js +1 -0
- package/dist/cdn/{shared-30bebd39.js → shared-eb232194.js} +3 -3
- package/dist/cdn/{shared-bdb51db9.js → shared-f4822b9e.js} +1 -1
- package/dist/cdn/{shared-db21f6db.js → shared-fa5f0117.js} +2 -2
- package/dist/cdn/shared-fc77174e.js +1 -0
- package/dist/cdn/shared-fec6fd04.js +1 -0
- package/dist/cdn/translations/address-form/en.json +577 -0
- package/dist/cdn/translations/customer/en.json +577 -0
- package/dist/cdn/translations/customer-portal/en.json +579 -1
- package/dist/elements/public/AddressForm/AddressForm.d.ts +2 -1
- package/dist/elements/public/AddressForm/AddressForm.js +53 -17
- package/dist/elements/public/AddressForm/AddressForm.js.map +1 -1
- package/dist/elements/public/AddressForm/countries.d.ts +1 -1
- package/dist/elements/public/AddressForm/countries.js +554 -251
- package/dist/elements/public/AddressForm/countries.js.map +1 -1
- package/package.json +10 -10
- package/dist/cdn/shared-09d4fbb8.js +0 -29
- package/dist/cdn/shared-1eac92fa.js +0 -1
- package/dist/cdn/shared-307262a1.js +0 -15
- package/dist/cdn/shared-332f2997.js +0 -1
- package/dist/cdn/shared-39f3b48d.js +0 -1
- package/dist/cdn/shared-432c5183.js +0 -9
- package/dist/cdn/shared-4dee79d4.js +0 -1
- package/dist/cdn/shared-53061389.js +0 -1
- package/dist/cdn/shared-59042137.js +0 -201
- package/dist/cdn/shared-65ba8b39.js +0 -1
- package/dist/cdn/shared-7f5618ba.js +0 -1
- package/dist/cdn/shared-92f27a38.js +0 -1
- package/dist/cdn/shared-b0f534ef.js +0 -1
- package/dist/cdn/shared-be24dd36.js +0 -804
- package/dist/cdn/shared-bf62a65b.js +0 -1
- package/dist/cdn/shared-c2d3b32b.js +0 -1
- package/dist/cdn/shared-cf269a17.js +0 -1
- package/dist/cdn/shared-fef9ecc1.js +0 -122
- package/dist/elements/public/AddressForm/regions.d.ts +0 -1
- package/dist/elements/public/AddressForm/regions.js +0 -67
- package/dist/elements/public/AddressForm/regions.js.map +0 -1
- /package/dist/cdn/{shared-64657919.js → shared-343d1fd7.js} +0 -0
- /package/dist/cdn/{shared-d6276c83.js → shared-3ab0306f.js} +0 -0
- /package/dist/cdn/{shared-e6f3e9f0.js → shared-bb05cfed.js} +0 -0
- /package/dist/cdn/{shared-99065f2a.js → shared-d7be11de.js} +0 -0
- /package/dist/cdn/{shared-0479553e.js → shared-f9180815.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-e6997950.js";import"./shared-db21f6db.js";import"./shared-65318cc1.js";import"./shared-6abdfcf2.js";import"./shared-30bebd39.js";import"./shared-4dc58b73.js";import"./shared-4dee79d4.js";import"./shared-51d28e6d.js";import"./shared-8474bc4a.js";import"./shared-c4240bc6.js";import"./shared-a3c73e91.js";import{I as e}from"./shared-25f64060.js";import"./foxy-nucleon-element.js";import"./shared-77a4d8e8.js";import{_ as t}from"./shared-307262a1.js";import{R as o,a as i}from"./shared-09d4fbb8.js";import{i as r}from"./shared-d3bf9ac0.js";import{c as s}from"./shared-4e709717.js";import{h as n}from"./shared-7f33a83a.js";import{c as a}from"./shared-53061389.js";import"./shared-17d0db7f.js";import"./shared-59042137.js";import"./shared-b3ac59eb.js";import"./shared-e6828dbf.js";import"./shared-31651a9c.js";import"./shared-4674063d.js";import"./shared-dfe2602a.js";import"./shared-0a248c0d.js";import"./shared-0479553e.js";import"./shared-c7f2f1ab.js";import"./shared-4b67d699.js";import"./shared-c2d3b32b.js";import"./shared-1d08a5ad.js";import"./shared-64657919.js";import"./shared-d6276c83.js";import"./shared-332f2997.js";import"./shared-88e36564.js";import"./shared-d14c2060.js";import"./shared-d519a301.js";import"./shared-f3b35364.js";import"./shared-11c2efc8.js";import"./shared-fef9ecc1.js";import"./shared-432c5183.js";import"./shared-64f98a0f.js";import"./shared-e8e92fe3.js";import"./shared-6dc64a17.js";import"./shared-36725fe3.js";import"./foxy-spinner.js";import"./shared-c6c6ba69.js";import"./shared-fe54babe.js";let l,c,d,u,_,p,h,m,f,g,y,x,b,v,$,V,k,j,S,w,q=e=>e;const O=o(i(e,"store-form"));class C extends O{constructor(){super(...arguments),this.customerPasswordHashTypes=null,this.shippingAddressTypes=null,this.storeVersions=null,this.checkoutTypes=null,this.localeCodes=null,this.languages=null,this.timezones=null,this.countries=null,this.regions=null,this.templates={},this.__singleCheckboxGroupOptions=[{label:"option_checked",value:"checked"}],this.__appSessionTimeOptions=[{value:"s",label:"second"},{value:"m",label:"minute"},{value:"h",label:"hour"},{value:"d",label:"day"}],this.__getStoreEmailValue=()=>{var e;return(null!==(e=this.form.store_email)&&void 0!==e?e:"").split(",").map((e=>({value:e.trim()}))).filter((({value:e})=>e.length>0))},this.__setStoreEmailValue=e=>{this.edit({store_email:e.map((e=>e.value)).join(",")})},this.__getBccOnReceiptEmailValue=()=>this.form.bcc_on_receipt_email?["checked"]:[],this.__setBccOnReceiptEmailValue=e=>{this.edit({bcc_on_receipt_email:e.includes("checked")})},this.__getUseEmailDnsValue=()=>this.form.use_email_dns?["checked"]:[],this.__setUseEmailDnsValue=e=>{this.edit({use_email_dns:e.includes("checked")})},this.__getUseSmtpConfigValue=()=>this.form.smtp_config?["checked"]:[],this.__setUseSmtpConfigValue=e=>{e.includes("checked")?this.edit({smtp_config:JSON.stringify({username:"",password:"",security:"",host:"",port:""})}):this.edit({smtp_config:""})},this.__getFeaturesMultishipValue=()=>this.form.features_multiship?["checked"]:[],this.__setFeaturesMultishipValue=e=>{this.edit({features_multiship:e.includes("checked")})},this.__getRequireSignedShippingRatesValue=()=>this.form.require_signed_shipping_rates?["checked"]:[],this.__setRequireSignedShippingRatesValue=e=>{this.edit({require_signed_shipping_rates:e.includes("checked")})},this.__getAppSessionTimeValue=()=>{const e=this.form.app_session_time||43200;return e%86400==0?e/86400+"d":e%3600==0?e/3600+"h":e%60==0?e/60+"m":`${e}s`},this.__setAppSessionTimeValue=e=>{const t=e[e.length-1],o=parseInt(e.substring(0,e.length-1));this.edit({app_session_time:{d:86400,h:3600,m:60,s:1}[t]*o})},this.__getProductsRequireExpiresPropertyValue=()=>this.form.products_require_expires_property?["checked"]:[],this.__setProductsRequireExpiresPropertyValue=e=>{this.edit({products_require_expires_property:e.includes("checked")})},this.__getUseCartValidationValue=()=>this.form.use_cart_validation?["checked"]:[],this.__setUseCartValidationValue=e=>{this.edit({use_cart_validation:e.includes("checked")})},this.__getSingleSignOnUrlValue=()=>{var e;return this.form.use_single_sign_on&&null!==(e=this.form.single_sign_on_url)&&void 0!==e?e:""},this.__setSingleSignOnUrlValue=e=>{this.edit({use_single_sign_on:!!e,single_sign_on_url:e})},this.__getWebhookUrlValue=()=>{var e;return this.form.use_webhook&&null!==(e=this.form.webhook_url)&&void 0!==e?e:""},this.__setWebhookUrlValue=e=>{this.edit({use_webhook:!!e,webhook_url:e})},this.__setStoreDomainValue=e=>{if(e.endsWith(".foxycart.com")){const t=e.substring(0,e.length-13);this.edit({store_domain:t,use_remote_domain:t.includes(".")})}else this.edit({store_domain:e,use_remote_domain:e.includes(".")})}}static get properties(){return t(t({},super.properties),{},{customerPasswordHashTypes:{attribute:"customer-password-hash-types"},shippingAddressTypes:{attribute:"shipping-address-types"},storeVersions:{attribute:"store-versions"},checkoutTypes:{attribute:"checkout-types"},localeCodes:{attribute:"locale-codes"},languages:{},timezones:{},countries:{},regions:{}})}static get v8n(){return[({store_name:e})=>!!e||"store-name:v8n_required",({store_name:e})=>e&&e.length<=50||"store-name:v8n_too_long",({store_domain:e})=>!!e||"store-domain:v8n_required",({store_domain:e})=>e&&e.length<=50||"store-domain:v8n_too_long",({store_url:e})=>!!e||"store-url:v8n_required",({store_url:e})=>e&&e.length<=300||"store-url:v8n_too_long",({receipt_continue_url:e})=>!e||e.length<=300||"receipt-continue-url:v8n_too_long",({store_email:e})=>!!e||"store-email:v8n_required",({store_email:e})=>e&&e.length<=300||"store-email:v8n_too_long",({from_email:e})=>!e||e.length<=100||"from-email:v8n_too_long",({smtp_config:e})=>!e||e.length<=1e3||"use-smtp-config:v8n_too_long",({postal_code:e})=>!!e||"postal-code:v8n_required",({postal_code:e})=>e&&e.length<=50||"postal-code:v8n_too_long",({region:e})=>!!e||"region:v8n_required",({region:e})=>e&&e.length<=100||"region:v8n_too_long",({country:e})=>!!e||"country:v8n_required",({logo_url:e})=>!e||e.length<=100||"logo-url:v8n_too_long",({webhook_url:e,use_webhook:t})=>!t||!!e||"webhook-url:v8n_required",({webhook_url:e,use_webhook:t})=>!t||!e||e.length<=300||"webhook-url:v8n_too_long",({webhook_key:e,use_webhook:t,use_cart_validation:o})=>!t&&!o||!!e||"webhook-key:v8n_required",({webhook_key:e,use_webhook:t,use_cart_validation:o})=>!t&&!o||!e||e.length<=200||"webhook-key:v8n_too_long",({single_sign_on_url:e,use_single_sign_on:t})=>!t||!!e||"single-sign-on-url:v8n_required",({single_sign_on_url:e,use_single_sign_on:t})=>!t||!e||e.length<=300||"single-sign-on-url:v8n_too_long",({customer_password_hash_config:e})=>!e||String(e).length<=100||"customer-password-hash-config:v8n_too_long",({unified_order_entry_password:e})=>!e||String(e).length<=100||"unified-order-entry-password:v8n_too_long",({custom_display_id_config:e})=>!e||String(e).length<=100||"custom-display-id-config-enabled:v8n_too_long"]}renderBody(){var e,t,o,i,s,a,u,_,p,h,m,f,g,y,x,b,v,$,V,k,j,S,w;const O=this.form.use_email_dns&&!(null===(e=this.data)||void 0===e?void 0:e.use_email_dns)&&!this.hiddenSelector.matches("use-email-dns",!0),C=this.form.require_signed_shipping_rates&&!(null===(t=this.data)||void 0===t?void 0:t.require_signed_shipping_rates)&&!this.hiddenSelector.matches("require-signed-shipping-rates",!0),U=this.form.products_require_expires_property&&!(null===(o=this.data)||void 0===o?void 0:o.products_require_expires_property)&&!this.hiddenSelector.matches("products-require-expires-property",!0),N=this.form.use_cart_validation&&!(null===(i=this.data)||void 0===i?void 0:i.use_cart_validation)&&!this.hiddenSelector.matches("use-cart-validation",!0),R=this.t(this.form.use_remote_domain&&!(null===(s=this.data)||void 0===s?void 0:s.use_remote_domain)?"store-domain.custom_domain_note":"store-domain.helper_text"),E=!this.form.store_domain||this.form.store_domain.includes(".")?"":".foxycart.com",J=this.__renderLoader(1),M=this.__renderLoader(2),T=this.__renderLoader(3),P=this.__renderLoader(4),D=this.__renderLoader(5),L=this.__renderLoader(6),W=this.__renderLoader(7),A=this.__renderLoader(8),B=this.__renderLoader(9),G=Object.entries(null!==(u=null===(a=null==M?void 0:M.data)||void 0===a?void 0:a.values)&&void 0!==u?u:{}),I=null==P?void 0:P.data,z=null==D?void 0:D.data,F=null==L?void 0:L.data,H=null!==(p=null===(_=null==W?void 0:W.data)||void 0===_?void 0:_.values.timezone)&&void 0!==p?p:[],K=Object.values(null!==(m=null===(h=null==A?void 0:A.data)||void 0===h?void 0:h.values)&&void 0!==m?m:{}),Q=Object.values(null!==(g=null===(f=null==B?void 0:B.data)||void 0===f?void 0:f.values)&&void 0!==g?g:{}),X=Object.entries(null!==(x=null===(y=null==J?void 0:J.data)||void 0===y?void 0:y.values)&&void 0!==x?x:{}),Y=Object.entries(null!==(v=null===(b=null==T?void 0:T.data)||void 0===b?void 0:b.values)&&void 0!==v?v:{}),Z=Object.entries(null!==($=null==z?void 0:z.values)&&void 0!==$?$:{}),ee=Object.entries(null!==(V=null==F?void 0:F.values)&&void 0!==V?V:{}),te=X.map((e=>({label:e[1].description,value:e[0]}))),oe=G.map((([e,t])=>({label:t,value:e}))),ie=Y.map((([e,t])=>({label:t,value:e}))),re=Z.map((([e,t])=>({value:e,label:t}))),se=ee.map((([e,t])=>({value:e,label:t}))),ne=H.map((e=>({label:e.description,value:e.timezone}))),ae=K.map((e=>({label:e.default,value:e.cc2}))),le=Q.map((e=>({label:e.default,value:e.code})));let ce;try{const e=new URL(null!==(k=this.regions)&&void 0!==k?k:""),t=this.form.country;t&&e.searchParams.set("country_code",t),ce=e.toString()}catch(e){ce=void 0}return n(l||(l=q` ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} <div class="grid gap-m grid-cols-1 sm-grid-cols-2"> <foxy-internal-text-control infer="store-name"></foxy-internal-text-control> <foxy-internal-text-control infer="logo-url"></foxy-internal-text-control> <foxy-internal-text-control helper-text="${0}" suffix="${0}" infer="store-domain" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="store-url"></foxy-internal-text-control> <foxy-internal-editable-list-control infer="store-email" class="sm-col-span-2" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-select-control infer="timezone" class="sm-col-span-2" .options="${0}"> </foxy-internal-select-control> <foxy-internal-async-combo-box-control item-label-path="version" item-value-path="_links.self.href" infer="store-version-uri" first="${0}" .selectedItem="${0}"> </foxy-internal-async-combo-box-control> <foxy-internal-text-control infer="from-email" class="sm-col-span-2" placeholder="${0}"> </foxy-internal-text-control> <foxy-internal-checkbox-group-control infer="bcc-on-receipt-email" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-checkbox-group-control infer="use-email-dns" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} <foxy-internal-checkbox-group-control infer="use-smtp-config" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} <foxy-internal-select-control infer="country" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control infer="region" .options="${0}"> </foxy-internal-select-control> <foxy-internal-text-control infer="postal-code"></foxy-internal-text-control> <foxy-internal-select-control infer="shipping-address-type" .options="${0}"> </foxy-internal-select-control> <foxy-internal-checkbox-group-control infer="features-multiship" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-checkbox-group-control infer="require-signed-shipping-rates" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} <foxy-internal-select-control infer="language" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control infer="locale-code" .options="${0}"> </foxy-internal-select-control> ${0} ${0} <foxy-internal-text-control class="sm-col-span-2" infer="receipt-continue-url"> </foxy-internal-text-control> <foxy-internal-frequency-control class="sm-col-span-2" infer="app-session-time" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-frequency-control> <foxy-internal-checkbox-group-control infer="products-require-expires-property" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} <foxy-internal-checkbox-group-control infer="use-cart-validation" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} <foxy-internal-select-control infer="checkout-type" class="sm-col-span-2" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control infer="customer-password-hash-type" .options="${0}" .setValue="${0}"> </foxy-internal-select-control> ${0} <foxy-internal-password-control infer="unified-order-entry-password"> </foxy-internal-password-control> <foxy-internal-text-control infer="single-sign-on-url" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="webhook-url" class="sm-col-span-2" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> ${0} ${0} </div> ${0} `),J.render(this.customerPasswordHashTypes),M.render(this.shippingAddressTypes),T.render(this.checkoutTypes),P.render(this.form.store_version_uri),D.render(this.localeCodes),W.render(this.timezones),A.render(this.countries),L.render(this.languages),B.render(ce),R,E,this.__setStoreDomainValue,this.__getStoreEmailValue,this.__setStoreEmailValue,ne,r(null!==(j=this.storeVersions)&&void 0!==j?j:void 0),I,null!==(w=null===(S=this.__getStoreEmailValue()[0])||void 0===S?void 0:S.value)&&void 0!==w?w:this.t("from-email.placeholder"),this.__getBccOnReceiptEmailValue,this.__setBccOnReceiptEmailValue,this.__singleCheckboxGroupOptions,this.__getUseEmailDnsValue,this.__setUseEmailDnsValue,this.__singleCheckboxGroupOptions,O?this.__renderWarning("use_email_dns_helper_text",{href:"https://wiki.foxycart.com/v/1.1/emails#how_emails_are_sent_spf_dkim_dmarc_etc",caption:"How Emails Are Sent (SPF, DKIM, DMARC, etc.)"}):"",this.__getUseSmtpConfigValue,this.__setUseSmtpConfigValue,this.__singleCheckboxGroupOptions,this.form.smtp_config&&!this.hiddenSelector.matches("smtp-config",!0)?this.__renderSmtpConfig():"",ae,le,oe,this.__getFeaturesMultishipValue,this.__setFeaturesMultishipValue,this.__singleCheckboxGroupOptions,this.__getRequireSignedShippingRatesValue,this.__setRequireSignedShippingRatesValue,this.__singleCheckboxGroupOptions,C?this.__renderWarning("require_signed_shipping_rates_helper_text"):"",se,re,this.hiddenSelector.matches("currency-style",!0)?"":this.__renderCurrencyStyleSelector(),this.hiddenSelector.matches("custom-display-id-config",!0)?"":this.__renderCustomIDSettings(),this.__getAppSessionTimeValue,this.__setAppSessionTimeValue,this.__appSessionTimeOptions,this.__getProductsRequireExpiresPropertyValue,this.__setProductsRequireExpiresPropertyValue,this.__singleCheckboxGroupOptions,U?this.__renderWarning("products_require_expires_property_helper_text"):"",this.__getUseCartValidationValue,this.__setUseCartValidationValue,this.__singleCheckboxGroupOptions,N?this.__renderWarning("use_cart_validation_helper_text",{href:"https://wiki.foxycart.com/v/2.0/hmac_validation",caption:"HMAC Product Verification: Locking Down your Add-To-Cart Links and Forms"}):"",ie,te,(e=>{var t;const o=X.find((([t])=>t===e));this.edit({customer_password_hash_type:e,customer_password_hash_config:null!==(t=null==o?void 0:o[1].config)&&void 0!==t?t:""})}),"number"==typeof this.form.customer_password_hash_config?n(c||(c=q` <foxy-internal-number-control infer="customer-password-hash-config"> </foxy-internal-number-control> `)):n(d||(d=q` <foxy-internal-text-control infer="customer-password-hash-config"> </foxy-internal-text-control> `)),this.__getSingleSignOnUrlValue,this.__setSingleSignOnUrlValue,this.__getWebhookUrlValue,this.__setWebhookUrlValue,this.__renderWebhookKey(),this.data&&!this.hiddenSelector.matches("is-maintenance-mode",!0)?this.__renderMaintenanceModeSwitch():"",super.renderBody())}__renderWebhookKey(){var e,t;let o;try{o=JSON.parse(null!==(e=this.form.webhook_key)&&void 0!==e?e:"")}catch(e){const i=null!==(t=this.form.webhook_key)&&void 0!==t?t:"";o={cart_signing:i,xml_datafeed:i,api_legacy:i,sso:i}}return Object.keys(o).map((e=>n(u||(u=q` <foxy-internal-password-control infer="webhook-key-${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> `),e.replace("_","-"),(()=>o[e]),(t=>{o[e]=t,this.edit({webhook_key:JSON.stringify(o)})}))))}__renderMaintenanceModeSwitch(){var e;const t=!!(null===(e=this.data)||void 0===e?void 0:e.is_maintenance_mode),o=(t?"disable":"enable")+"_maintenance_mode",i=`maintenance_mode_${t?"on":"off"}_explainer`;return n(_||(_=q` <div data-testid="is-maintenance-mode" class="${0}"> <foxy-i18n infer="" class="block mb-s" key="${0}"></foxy-i18n> <vaadin-button theme="tertiary small ${0}" class="p-0" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="${0}"></foxy-i18n> </vaadin-button> </div> `),s({"rounded leading-s text-s sm-col-span-2":!0,"text-tertiary":!t,"text-error":t}),i,t?"contrast":"",this.disabledSelector.matches("is-maintenance-mode",!0),(()=>{this.edit({is_maintenance_mode:!this.form.is_maintenance_mode}),this.submit()}),o)}__renderCurrencyStyleSelector(){const e={101:0,100:0,"001":1,"000":2,111:3,110:3,"011":4,"010":5},t=[this.form.hide_currency_symbol,this.form.hide_decimal_characters,this.form.use_international_currency_symbol].map((e=>Number(Boolean(e)))).join(""),o=e[t],i=this.disabledSelector.matches("currency-style",!0),r=this.readonlySelector.matches("currency-style",!0);return n(p||(p=q` <div data-testid="currency-style" class="sm-col-span-2"> ${0} <div class="grid grid-cols-1 gap-xs transition-colors text-secondary hover-text-body sm-col-span-2"> <foxy-i18n infer="" class="font-medium text-s" key="currency_style_label"></foxy-i18n> <div class="grid grid-cols-3 bg-contrast-10 rounded" style="gap:1px;padding:1px"> ${0} </div> <foxy-i18n infer="" class="text-xs" key="currency_style_helper_text"></foxy-i18n> </div> ${0} </div> `),this.renderTemplateOrSlot("currency-style:before"),["12.34","USD 12.34","$12.34","12","USD 12","$12"].map(((t,a)=>n(h||(h=q` <label style="--lumo-border-radius:calc(var(--lumo-border-radius-m) - 1px)" class="${0}"> <span class="font-medium font-tnum">${0}</span> <input class="sr-only" value="${0}" type="radio" name="currency-style" ?checked="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> </label> `),s({"relative z-0 px-s h-m flex items-center transition-colors":!0,"hover-cursor-pointer":!0,"focus-within-z-10 focus-within-ring-2 focus-within-ring-primary-50":!0,"bg-base text-body hover-bg-transparent":a!==o,"bg-primary text-primary-contrast":a===o,"rounded-tl":0===a,"rounded-tr":2===a,"rounded-bl":3===a,"rounded-br":5===a}),t,a,a===o,i,r,(()=>{const t=Object.entries(e).find((e=>e[1]===a))[0];this.edit({hide_currency_symbol:Boolean(Number(t[0])),hide_decimal_characters:Boolean(Number(t[1])),use_international_currency_symbol:Boolean(Number(t[2]))})})))),this.renderTemplateOrSlot("currency-style:after"))}__renderCustomIDSettings(){var e;const t={enabled:!1,start:"0",length:"0",prefix:"",suffix:"",transaction_journal_entries:{enabled:!1,transaction_separator:"",log_detail_request_types:{transaction_authcapture:{prefix:""},transaction_capture:{prefix:""},transaction_refund:{prefix:""},transaction_void:{prefix:""}}}};let o;try{o=JSON.parse(null!==(e=this.form.custom_display_id_config)&&void 0!==e?e:"")}catch(e){o=a(t)}const i=parseInt(o.start||"0"),r=parseInt(o.length||"0")-o.prefix.length-o.suffix.length,s=Math.min(i+Math.floor(Math.random()*Math.pow(10,r)),Math.pow(10,r)-1),l=`${o.prefix}${s.toString().padStart(r,"0")}${o.suffix}`,c=Math.floor(1e3*Math.random()),d=String(c).padStart(3,"0");return n(m||(m=q` <foxy-internal-checkbox-group-control infer="custom-display-id-config-enabled" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} `),(()=>o.enabled?["checked"]:[]),(e=>{o.enabled=e.includes("checked"),this.edit({custom_display_id_config:JSON.stringify(o)})}),this.__singleCheckboxGroupOptions,o.enabled?n(f||(f=q` <div class="rounded-t-l rounded-b-l border border-contrast-10 p-m grid grid-cols-2 gap-m sm-col-span-2"> <foxy-internal-integer-control infer="custom-display-id-config-start" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-integer-control> <foxy-internal-integer-control infer="custom-display-id-config-length" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-integer-control> <foxy-internal-text-control infer="custom-display-id-config-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="custom-display-id-config-suffix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> ${0} </div> <foxy-internal-checkbox-group-control infer="custom-display-id-config-transaction-journal-entries-enabled" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} `),(()=>parseInt(o.start||"0")),(e=>{o.start=String(e),this.edit({custom_display_id_config:JSON.stringify(o)})}),(()=>parseInt(o.length||"0")),(e=>{o.length=String(e),this.edit({custom_display_id_config:JSON.stringify(o)})}),(()=>o.prefix),(e=>{o.prefix=e,this.edit({custom_display_id_config:JSON.stringify(o)})}),(()=>o.suffix),(e=>{o.suffix=e,this.edit({custom_display_id_config:JSON.stringify(o)})}),o.start&&o.length&&i/10<=r?n(g||(g=q` <table data-testid="custom-display-id-config-examples" style="font-family:monospace" class="col-span-2 text-xs text-secondary whitespace-nowrap"> <tbody> <tr> <td style="width:1%"> <foxy-i18n infer="" key="custom-display-id-config-first-example"> </foxy-i18n> </td> <td> ${0}${0}${0} </td> </tr> <tr style="width:1%"> <td> <foxy-i18n infer="" key="custom-display-id-config-random-example"> </foxy-i18n> </td> <td>${0}</td> </tr> </tbody> </table> `),o.prefix,i.toString().padStart(r,"0"),o.suffix,l):"",(()=>o.transaction_journal_entries.enabled?["checked"]:[]),(e=>{o.transaction_journal_entries.enabled=e.includes("checked"),this.edit({custom_display_id_config:JSON.stringify(o)})}),this.__singleCheckboxGroupOptions,o.transaction_journal_entries.enabled?n(y||(y=q` <div class="rounded-t-l rounded-b-l border border-contrast-10 p-m grid grid-cols-2 gap-m sm-col-span-2"> <foxy-internal-text-control infer="custom-display-id-config-transaction-journal-entries-transaction-separator" class="col-span-2" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="custom-display-id-config-transaction-journal-entries-log-detail-request-types-transaction-authcapture-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="custom-display-id-config-transaction-journal-entries-log-detail-request-types-transaction-capture-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="custom-display-id-config-transaction-journal-entries-log-detail-request-types-transaction-void-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="custom-display-id-config-transaction-journal-entries-log-detail-request-types-transaction-refund-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> ${0} </div> `),(()=>o.transaction_journal_entries.transaction_separator),(e=>{o.transaction_journal_entries.transaction_separator=e,this.edit({custom_display_id_config:JSON.stringify(o)})}),(()=>o.transaction_journal_entries.log_detail_request_types.transaction_authcapture.prefix),(e=>{o.transaction_journal_entries.log_detail_request_types.transaction_authcapture.prefix=e,this.edit({custom_display_id_config:JSON.stringify(o)})}),(()=>o.transaction_journal_entries.log_detail_request_types.transaction_capture.prefix),(e=>{o.transaction_journal_entries.log_detail_request_types.transaction_capture.prefix=e,this.edit({custom_display_id_config:JSON.stringify(o)})}),(()=>o.transaction_journal_entries.log_detail_request_types.transaction_void.prefix),(e=>{o.transaction_journal_entries.log_detail_request_types.transaction_void.prefix=e,this.edit({custom_display_id_config:JSON.stringify(o)})}),(()=>o.transaction_journal_entries.log_detail_request_types.transaction_refund.prefix),(e=>{o.transaction_journal_entries.log_detail_request_types.transaction_refund.prefix=e,this.edit({custom_display_id_config:JSON.stringify(o)})}),o.start&&o.length&&i/10<=r?n(x||(x=q` <table data-testid="custom-display-id-config-transaction-journal-entries-examples" style="font-family:monospace" class="col-span-2 text-xs text-secondary whitespace-nowrap"> <tbody> <tr> <td style="width:1%"> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-authcapture-example"> </foxy-i18n> </td> <td> ${0}${0}${0}${0} </td> </tr> <tr> <td style="width:1%"> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-capture-example"> </foxy-i18n> </td> <td> ${0}${0}${0}${0} </td> </tr> <tr> <td style="width:1%"> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-void-example"> </foxy-i18n> </td> <td> ${0}${0}${0}${0} </td> </tr> <tr> <td style="width:1%"> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-refund-example"> </foxy-i18n> </td> <td> ${0}${0}${0}${0} </td> </tr> </tbody> </table> `),l,o.transaction_journal_entries.transaction_separator,o.transaction_journal_entries.log_detail_request_types.transaction_authcapture.prefix,d,l,o.transaction_journal_entries.transaction_separator,o.transaction_journal_entries.log_detail_request_types.transaction_capture.prefix,d,l,o.transaction_journal_entries.transaction_separator,o.transaction_journal_entries.log_detail_request_types.transaction_void.prefix,d,l,o.transaction_journal_entries.transaction_separator,o.transaction_journal_entries.log_detail_request_types.transaction_refund.prefix,d):""):""):"")}__renderSmtpConfig(){return n(b||(b=q` <div class="grid grid-cols-2 gap-m p-m rounded-t-l rounded-b-l border border-contrast-10 sm-col-span-2"> ${0} </div> `),["host","port","username","password","security"].map((e=>{const t=()=>JSON.parse(this.form.smtp_config||"{}")[e],o=t=>{var o,i,r,s,n;const a=JSON.parse(this.form.smtp_config||"{}");this.edit({smtp_config:JSON.stringify({username:null!==(o=a.username)&&void 0!==o?o:"",password:null!==(i=a.password)&&void 0!==i?i:"",security:null!==(r=a.security)&&void 0!==r?r:"",host:null!==(s=a.host)&&void 0!==s?s:"",port:null!==(n=a.port)&&void 0!==n?n:"",[e]:t})})},i=`smtp-config-${e}`;return"password"===e?n(v||(v=q` <foxy-internal-password-control infer="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> `),i,t,o):"port"===e?n($||($=q` <foxy-internal-integer-control infer="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-integer-control> `),i,t,o):"security"===e?n(V||(V=q` <foxy-internal-radio-group-control infer="${0}" class="-mt-xs -mx-xs -mb-m col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> `),i,t,o,[{label:"option_ssl",value:"ssl"},{label:"option_tls",value:"tls"},{label:"option_none",value:""}]):n(k||(k=q` <foxy-internal-text-control infer="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> `),i,t,o)})))}__renderWarning(e,t){return n(j||(j=q` <div class="p-s leading-m text-s rounded bg-primary-10 text-primary sm-col-span-2"> <foxy-i18n infer="" key="${0}"></foxy-i18n> ${0} </div> `),e,t?n(S||(S=q` <a target="_blank" class="font-medium hover-underline rounded focus-outline-none focus-ring-2 focus-ring-primary" href="${0}" lang="en"> ${0} <iron-icon class="icon-inline" icon="icons:open-in-new"></iron-icon> </a> `),t.href,t.caption):"")}__renderLoader(e){var t;const o=`loader-${e}`;return{data:null===(t=this.renderRoot.querySelector(`#${o}`))||void 0===t?void 0:t.data,render:e=>n(w||(w=q` <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),r(null!=e?e:void 0),o,(()=>this.requestUpdate()))}}}customElements.define("foxy-store-form",C);export{C as StoreForm};
|
|
1
|
+
import"./shared-9bdd5400.js";import"./shared-fa5f0117.js";import"./shared-3164d0c3.js";import"./shared-7bf6e728.js";import"./shared-eb232194.js";import"./shared-90be9ac7.js";import"./shared-fec6fd04.js";import"./shared-527abf31.js";import"./shared-7ead930c.js";import"./shared-8465a37a.js";import"./shared-897ab5e6.js";import{I as e}from"./shared-b334c8b6.js";import"./foxy-nucleon-element.js";import"./shared-46f3f71c.js";import{_ as t}from"./shared-0dabe195.js";import{R as o,a as i}from"./shared-a88c5cf1.js";import{i as r}from"./shared-d3bf9ac0.js";import{c as s}from"./shared-4e709717.js";import{h as n}from"./shared-7f33a83a.js";import{c as a}from"./shared-aa22ee61.js";import"./shared-4bd1efd7.js";import"./shared-a7475f62.js";import"./shared-403af08d.js";import"./shared-0689b25a.js";import"./shared-2fa6a5a0.js";import"./shared-c97f7178.js";import"./shared-a134d313.js";import"./shared-91eb066c.js";import"./shared-f9180815.js";import"./shared-1fd59009.js";import"./shared-763a6797.js";import"./shared-a6517170.js";import"./shared-bbbb8894.js";import"./shared-343d1fd7.js";import"./shared-3ab0306f.js";import"./shared-8528906b.js";import"./shared-c541c9e9.js";import"./shared-6b0498b2.js";import"./shared-d519a301.js";import"./shared-f3b35364.js";import"./shared-11c2efc8.js";import"./shared-7680d300.js";import"./shared-13cc4ed4.js";import"./shared-db06114b.js";import"./shared-ad0256d0.js";import"./shared-8128b5e3.js";import"./shared-c758220c.js";import"./foxy-spinner.js";import"./shared-6dffe67d.js";import"./shared-53532131.js";let l,c,d,u,_,p,h,m,f,g,y,x,b,v,$,V,k,j,S,w,q=e=>e;const O=o(i(e,"store-form"));class C extends O{constructor(){super(...arguments),this.customerPasswordHashTypes=null,this.shippingAddressTypes=null,this.storeVersions=null,this.checkoutTypes=null,this.localeCodes=null,this.languages=null,this.timezones=null,this.countries=null,this.regions=null,this.templates={},this.__singleCheckboxGroupOptions=[{label:"option_checked",value:"checked"}],this.__appSessionTimeOptions=[{value:"s",label:"second"},{value:"m",label:"minute"},{value:"h",label:"hour"},{value:"d",label:"day"}],this.__getStoreEmailValue=()=>{var e;return(null!==(e=this.form.store_email)&&void 0!==e?e:"").split(",").map((e=>({value:e.trim()}))).filter((({value:e})=>e.length>0))},this.__setStoreEmailValue=e=>{this.edit({store_email:e.map((e=>e.value)).join(",")})},this.__getBccOnReceiptEmailValue=()=>this.form.bcc_on_receipt_email?["checked"]:[],this.__setBccOnReceiptEmailValue=e=>{this.edit({bcc_on_receipt_email:e.includes("checked")})},this.__getUseEmailDnsValue=()=>this.form.use_email_dns?["checked"]:[],this.__setUseEmailDnsValue=e=>{this.edit({use_email_dns:e.includes("checked")})},this.__getUseSmtpConfigValue=()=>this.form.smtp_config?["checked"]:[],this.__setUseSmtpConfigValue=e=>{e.includes("checked")?this.edit({smtp_config:JSON.stringify({username:"",password:"",security:"",host:"",port:""})}):this.edit({smtp_config:""})},this.__getFeaturesMultishipValue=()=>this.form.features_multiship?["checked"]:[],this.__setFeaturesMultishipValue=e=>{this.edit({features_multiship:e.includes("checked")})},this.__getRequireSignedShippingRatesValue=()=>this.form.require_signed_shipping_rates?["checked"]:[],this.__setRequireSignedShippingRatesValue=e=>{this.edit({require_signed_shipping_rates:e.includes("checked")})},this.__getAppSessionTimeValue=()=>{const e=this.form.app_session_time||43200;return e%86400==0?e/86400+"d":e%3600==0?e/3600+"h":e%60==0?e/60+"m":`${e}s`},this.__setAppSessionTimeValue=e=>{const t=e[e.length-1],o=parseInt(e.substring(0,e.length-1));this.edit({app_session_time:{d:86400,h:3600,m:60,s:1}[t]*o})},this.__getProductsRequireExpiresPropertyValue=()=>this.form.products_require_expires_property?["checked"]:[],this.__setProductsRequireExpiresPropertyValue=e=>{this.edit({products_require_expires_property:e.includes("checked")})},this.__getUseCartValidationValue=()=>this.form.use_cart_validation?["checked"]:[],this.__setUseCartValidationValue=e=>{this.edit({use_cart_validation:e.includes("checked")})},this.__getSingleSignOnUrlValue=()=>{var e;return this.form.use_single_sign_on&&null!==(e=this.form.single_sign_on_url)&&void 0!==e?e:""},this.__setSingleSignOnUrlValue=e=>{this.edit({use_single_sign_on:!!e,single_sign_on_url:e})},this.__getWebhookUrlValue=()=>{var e;return this.form.use_webhook&&null!==(e=this.form.webhook_url)&&void 0!==e?e:""},this.__setWebhookUrlValue=e=>{this.edit({use_webhook:!!e,webhook_url:e})},this.__setStoreDomainValue=e=>{if(e.endsWith(".foxycart.com")){const t=e.substring(0,e.length-13);this.edit({store_domain:t,use_remote_domain:t.includes(".")})}else this.edit({store_domain:e,use_remote_domain:e.includes(".")})}}static get properties(){return t(t({},super.properties),{},{customerPasswordHashTypes:{attribute:"customer-password-hash-types"},shippingAddressTypes:{attribute:"shipping-address-types"},storeVersions:{attribute:"store-versions"},checkoutTypes:{attribute:"checkout-types"},localeCodes:{attribute:"locale-codes"},languages:{},timezones:{},countries:{},regions:{}})}static get v8n(){return[({store_name:e})=>!!e||"store-name:v8n_required",({store_name:e})=>e&&e.length<=50||"store-name:v8n_too_long",({store_domain:e})=>!!e||"store-domain:v8n_required",({store_domain:e})=>e&&e.length<=50||"store-domain:v8n_too_long",({store_url:e})=>!!e||"store-url:v8n_required",({store_url:e})=>e&&e.length<=300||"store-url:v8n_too_long",({receipt_continue_url:e})=>!e||e.length<=300||"receipt-continue-url:v8n_too_long",({store_email:e})=>!!e||"store-email:v8n_required",({store_email:e})=>e&&e.length<=300||"store-email:v8n_too_long",({from_email:e})=>!e||e.length<=100||"from-email:v8n_too_long",({smtp_config:e})=>!e||e.length<=1e3||"use-smtp-config:v8n_too_long",({postal_code:e})=>!!e||"postal-code:v8n_required",({postal_code:e})=>e&&e.length<=50||"postal-code:v8n_too_long",({region:e})=>!!e||"region:v8n_required",({region:e})=>e&&e.length<=100||"region:v8n_too_long",({country:e})=>!!e||"country:v8n_required",({logo_url:e})=>!e||e.length<=100||"logo-url:v8n_too_long",({webhook_url:e,use_webhook:t})=>!t||!!e||"webhook-url:v8n_required",({webhook_url:e,use_webhook:t})=>!t||!e||e.length<=300||"webhook-url:v8n_too_long",({webhook_key:e,use_webhook:t,use_cart_validation:o})=>!t&&!o||!!e||"webhook-key:v8n_required",({webhook_key:e,use_webhook:t,use_cart_validation:o})=>!t&&!o||!e||e.length<=200||"webhook-key:v8n_too_long",({single_sign_on_url:e,use_single_sign_on:t})=>!t||!!e||"single-sign-on-url:v8n_required",({single_sign_on_url:e,use_single_sign_on:t})=>!t||!e||e.length<=300||"single-sign-on-url:v8n_too_long",({customer_password_hash_config:e})=>!e||String(e).length<=100||"customer-password-hash-config:v8n_too_long",({unified_order_entry_password:e})=>!e||String(e).length<=100||"unified-order-entry-password:v8n_too_long",({custom_display_id_config:e})=>!e||String(e).length<=100||"custom-display-id-config-enabled:v8n_too_long"]}renderBody(){var e,t,o,i,s,a,u,_,p,h,m,f,g,y,x,b,v,$,V,k,j,S,w;const O=this.form.use_email_dns&&!(null===(e=this.data)||void 0===e?void 0:e.use_email_dns)&&!this.hiddenSelector.matches("use-email-dns",!0),C=this.form.require_signed_shipping_rates&&!(null===(t=this.data)||void 0===t?void 0:t.require_signed_shipping_rates)&&!this.hiddenSelector.matches("require-signed-shipping-rates",!0),U=this.form.products_require_expires_property&&!(null===(o=this.data)||void 0===o?void 0:o.products_require_expires_property)&&!this.hiddenSelector.matches("products-require-expires-property",!0),N=this.form.use_cart_validation&&!(null===(i=this.data)||void 0===i?void 0:i.use_cart_validation)&&!this.hiddenSelector.matches("use-cart-validation",!0),R=this.t(this.form.use_remote_domain&&!(null===(s=this.data)||void 0===s?void 0:s.use_remote_domain)?"store-domain.custom_domain_note":"store-domain.helper_text"),E=!this.form.store_domain||this.form.store_domain.includes(".")?"":".foxycart.com",J=this.__renderLoader(1),M=this.__renderLoader(2),T=this.__renderLoader(3),P=this.__renderLoader(4),D=this.__renderLoader(5),L=this.__renderLoader(6),W=this.__renderLoader(7),A=this.__renderLoader(8),B=this.__renderLoader(9),G=Object.entries(null!==(u=null===(a=null==M?void 0:M.data)||void 0===a?void 0:a.values)&&void 0!==u?u:{}),I=null==P?void 0:P.data,z=null==D?void 0:D.data,F=null==L?void 0:L.data,H=null!==(p=null===(_=null==W?void 0:W.data)||void 0===_?void 0:_.values.timezone)&&void 0!==p?p:[],K=Object.values(null!==(m=null===(h=null==A?void 0:A.data)||void 0===h?void 0:h.values)&&void 0!==m?m:{}),Q=Object.values(null!==(g=null===(f=null==B?void 0:B.data)||void 0===f?void 0:f.values)&&void 0!==g?g:{}),X=Object.entries(null!==(x=null===(y=null==J?void 0:J.data)||void 0===y?void 0:y.values)&&void 0!==x?x:{}),Y=Object.entries(null!==(v=null===(b=null==T?void 0:T.data)||void 0===b?void 0:b.values)&&void 0!==v?v:{}),Z=Object.entries(null!==($=null==z?void 0:z.values)&&void 0!==$?$:{}),ee=Object.entries(null!==(V=null==F?void 0:F.values)&&void 0!==V?V:{}),te=X.map((e=>({label:e[1].description,value:e[0]}))),oe=G.map((([e,t])=>({label:t,value:e}))),ie=Y.map((([e,t])=>({label:t,value:e}))),re=Z.map((([e,t])=>({value:e,label:t}))),se=ee.map((([e,t])=>({value:e,label:t}))),ne=H.map((e=>({label:e.description,value:e.timezone}))),ae=K.map((e=>({label:e.default,value:e.cc2}))),le=Q.map((e=>({label:e.default,value:e.code})));let ce;try{const e=new URL(null!==(k=this.regions)&&void 0!==k?k:""),t=this.form.country;t&&e.searchParams.set("country_code",t),ce=e.toString()}catch(e){ce=void 0}return n(l||(l=q` ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} <div class="grid gap-m grid-cols-1 sm-grid-cols-2"> <foxy-internal-text-control infer="store-name"></foxy-internal-text-control> <foxy-internal-text-control infer="logo-url"></foxy-internal-text-control> <foxy-internal-text-control helper-text="${0}" suffix="${0}" infer="store-domain" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="store-url"></foxy-internal-text-control> <foxy-internal-editable-list-control infer="store-email" class="sm-col-span-2" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-select-control infer="timezone" class="sm-col-span-2" .options="${0}"> </foxy-internal-select-control> <foxy-internal-async-combo-box-control item-label-path="version" item-value-path="_links.self.href" infer="store-version-uri" first="${0}" .selectedItem="${0}"> </foxy-internal-async-combo-box-control> <foxy-internal-text-control infer="from-email" class="sm-col-span-2" placeholder="${0}"> </foxy-internal-text-control> <foxy-internal-checkbox-group-control infer="bcc-on-receipt-email" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-checkbox-group-control infer="use-email-dns" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} <foxy-internal-checkbox-group-control infer="use-smtp-config" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} <foxy-internal-select-control infer="country" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control infer="region" .options="${0}"> </foxy-internal-select-control> <foxy-internal-text-control infer="postal-code"></foxy-internal-text-control> <foxy-internal-select-control infer="shipping-address-type" .options="${0}"> </foxy-internal-select-control> <foxy-internal-checkbox-group-control infer="features-multiship" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-checkbox-group-control infer="require-signed-shipping-rates" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} <foxy-internal-select-control infer="language" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control infer="locale-code" .options="${0}"> </foxy-internal-select-control> ${0} ${0} <foxy-internal-text-control class="sm-col-span-2" infer="receipt-continue-url"> </foxy-internal-text-control> <foxy-internal-frequency-control class="sm-col-span-2" infer="app-session-time" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-frequency-control> <foxy-internal-checkbox-group-control infer="products-require-expires-property" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} <foxy-internal-checkbox-group-control infer="use-cart-validation" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} <foxy-internal-select-control infer="checkout-type" class="sm-col-span-2" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control infer="customer-password-hash-type" .options="${0}" .setValue="${0}"> </foxy-internal-select-control> ${0} <foxy-internal-password-control infer="unified-order-entry-password"> </foxy-internal-password-control> <foxy-internal-text-control infer="single-sign-on-url" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="webhook-url" class="sm-col-span-2" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> ${0} ${0} </div> ${0} `),J.render(this.customerPasswordHashTypes),M.render(this.shippingAddressTypes),T.render(this.checkoutTypes),P.render(this.form.store_version_uri),D.render(this.localeCodes),W.render(this.timezones),A.render(this.countries),L.render(this.languages),B.render(ce),R,E,this.__setStoreDomainValue,this.__getStoreEmailValue,this.__setStoreEmailValue,ne,r(null!==(j=this.storeVersions)&&void 0!==j?j:void 0),I,null!==(w=null===(S=this.__getStoreEmailValue()[0])||void 0===S?void 0:S.value)&&void 0!==w?w:this.t("from-email.placeholder"),this.__getBccOnReceiptEmailValue,this.__setBccOnReceiptEmailValue,this.__singleCheckboxGroupOptions,this.__getUseEmailDnsValue,this.__setUseEmailDnsValue,this.__singleCheckboxGroupOptions,O?this.__renderWarning("use_email_dns_helper_text",{href:"https://wiki.foxycart.com/v/1.1/emails#how_emails_are_sent_spf_dkim_dmarc_etc",caption:"How Emails Are Sent (SPF, DKIM, DMARC, etc.)"}):"",this.__getUseSmtpConfigValue,this.__setUseSmtpConfigValue,this.__singleCheckboxGroupOptions,this.form.smtp_config&&!this.hiddenSelector.matches("smtp-config",!0)?this.__renderSmtpConfig():"",ae,le,oe,this.__getFeaturesMultishipValue,this.__setFeaturesMultishipValue,this.__singleCheckboxGroupOptions,this.__getRequireSignedShippingRatesValue,this.__setRequireSignedShippingRatesValue,this.__singleCheckboxGroupOptions,C?this.__renderWarning("require_signed_shipping_rates_helper_text"):"",se,re,this.hiddenSelector.matches("currency-style",!0)?"":this.__renderCurrencyStyleSelector(),this.hiddenSelector.matches("custom-display-id-config",!0)?"":this.__renderCustomIDSettings(),this.__getAppSessionTimeValue,this.__setAppSessionTimeValue,this.__appSessionTimeOptions,this.__getProductsRequireExpiresPropertyValue,this.__setProductsRequireExpiresPropertyValue,this.__singleCheckboxGroupOptions,U?this.__renderWarning("products_require_expires_property_helper_text"):"",this.__getUseCartValidationValue,this.__setUseCartValidationValue,this.__singleCheckboxGroupOptions,N?this.__renderWarning("use_cart_validation_helper_text",{href:"https://wiki.foxycart.com/v/2.0/hmac_validation",caption:"HMAC Product Verification: Locking Down your Add-To-Cart Links and Forms"}):"",ie,te,(e=>{var t;const o=X.find((([t])=>t===e));this.edit({customer_password_hash_type:e,customer_password_hash_config:null!==(t=null==o?void 0:o[1].config)&&void 0!==t?t:""})}),"number"==typeof this.form.customer_password_hash_config?n(c||(c=q` <foxy-internal-number-control infer="customer-password-hash-config"> </foxy-internal-number-control> `)):n(d||(d=q` <foxy-internal-text-control infer="customer-password-hash-config"> </foxy-internal-text-control> `)),this.__getSingleSignOnUrlValue,this.__setSingleSignOnUrlValue,this.__getWebhookUrlValue,this.__setWebhookUrlValue,this.__renderWebhookKey(),this.data&&!this.hiddenSelector.matches("is-maintenance-mode",!0)?this.__renderMaintenanceModeSwitch():"",super.renderBody())}__renderWebhookKey(){var e,t;let o;try{o=JSON.parse(null!==(e=this.form.webhook_key)&&void 0!==e?e:"")}catch(e){const i=null!==(t=this.form.webhook_key)&&void 0!==t?t:"";o={cart_signing:i,xml_datafeed:i,api_legacy:i,sso:i}}return Object.keys(o).map((e=>n(u||(u=q` <foxy-internal-password-control infer="webhook-key-${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> `),e.replace("_","-"),(()=>o[e]),(t=>{o[e]=t,this.edit({webhook_key:JSON.stringify(o)})}))))}__renderMaintenanceModeSwitch(){var e;const t=!!(null===(e=this.data)||void 0===e?void 0:e.is_maintenance_mode),o=(t?"disable":"enable")+"_maintenance_mode",i=`maintenance_mode_${t?"on":"off"}_explainer`;return n(_||(_=q` <div data-testid="is-maintenance-mode" class="${0}"> <foxy-i18n infer="" class="block mb-s" key="${0}"></foxy-i18n> <vaadin-button theme="tertiary small ${0}" class="p-0" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="${0}"></foxy-i18n> </vaadin-button> </div> `),s({"rounded leading-s text-s sm-col-span-2":!0,"text-tertiary":!t,"text-error":t}),i,t?"contrast":"",this.disabledSelector.matches("is-maintenance-mode",!0),(()=>{this.edit({is_maintenance_mode:!this.form.is_maintenance_mode}),this.submit()}),o)}__renderCurrencyStyleSelector(){const e={101:0,100:0,"001":1,"000":2,111:3,110:3,"011":4,"010":5},t=[this.form.hide_currency_symbol,this.form.hide_decimal_characters,this.form.use_international_currency_symbol].map((e=>Number(Boolean(e)))).join(""),o=e[t],i=this.disabledSelector.matches("currency-style",!0),r=this.readonlySelector.matches("currency-style",!0);return n(p||(p=q` <div data-testid="currency-style" class="sm-col-span-2"> ${0} <div class="grid grid-cols-1 gap-xs transition-colors text-secondary hover-text-body sm-col-span-2"> <foxy-i18n infer="" class="font-medium text-s" key="currency_style_label"></foxy-i18n> <div class="grid grid-cols-3 bg-contrast-10 rounded" style="gap:1px;padding:1px"> ${0} </div> <foxy-i18n infer="" class="text-xs" key="currency_style_helper_text"></foxy-i18n> </div> ${0} </div> `),this.renderTemplateOrSlot("currency-style:before"),["12.34","USD 12.34","$12.34","12","USD 12","$12"].map(((t,a)=>n(h||(h=q` <label style="--lumo-border-radius:calc(var(--lumo-border-radius-m) - 1px)" class="${0}"> <span class="font-medium font-tnum">${0}</span> <input class="sr-only" value="${0}" type="radio" name="currency-style" ?checked="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> </label> `),s({"relative z-0 px-s h-m flex items-center transition-colors":!0,"hover-cursor-pointer":!0,"focus-within-z-10 focus-within-ring-2 focus-within-ring-primary-50":!0,"bg-base text-body hover-bg-transparent":a!==o,"bg-primary text-primary-contrast":a===o,"rounded-tl":0===a,"rounded-tr":2===a,"rounded-bl":3===a,"rounded-br":5===a}),t,a,a===o,i,r,(()=>{const t=Object.entries(e).find((e=>e[1]===a))[0];this.edit({hide_currency_symbol:Boolean(Number(t[0])),hide_decimal_characters:Boolean(Number(t[1])),use_international_currency_symbol:Boolean(Number(t[2]))})})))),this.renderTemplateOrSlot("currency-style:after"))}__renderCustomIDSettings(){var e;const t={enabled:!1,start:"0",length:"0",prefix:"",suffix:"",transaction_journal_entries:{enabled:!1,transaction_separator:"",log_detail_request_types:{transaction_authcapture:{prefix:""},transaction_capture:{prefix:""},transaction_refund:{prefix:""},transaction_void:{prefix:""}}}};let o;try{o=JSON.parse(null!==(e=this.form.custom_display_id_config)&&void 0!==e?e:"")}catch(e){o=a(t)}const i=parseInt(o.start||"0"),r=parseInt(o.length||"0")-o.prefix.length-o.suffix.length,s=Math.min(i+Math.floor(Math.random()*Math.pow(10,r)),Math.pow(10,r)-1),l=`${o.prefix}${s.toString().padStart(r,"0")}${o.suffix}`,c=Math.floor(1e3*Math.random()),d=String(c).padStart(3,"0");return n(m||(m=q` <foxy-internal-checkbox-group-control infer="custom-display-id-config-enabled" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} `),(()=>o.enabled?["checked"]:[]),(e=>{o.enabled=e.includes("checked"),this.edit({custom_display_id_config:JSON.stringify(o)})}),this.__singleCheckboxGroupOptions,o.enabled?n(f||(f=q` <div class="rounded-t-l rounded-b-l border border-contrast-10 p-m grid grid-cols-2 gap-m sm-col-span-2"> <foxy-internal-integer-control infer="custom-display-id-config-start" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-integer-control> <foxy-internal-integer-control infer="custom-display-id-config-length" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-integer-control> <foxy-internal-text-control infer="custom-display-id-config-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="custom-display-id-config-suffix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> ${0} </div> <foxy-internal-checkbox-group-control infer="custom-display-id-config-transaction-journal-entries-enabled" class="-mt-xs -mb-m sm-col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} `),(()=>parseInt(o.start||"0")),(e=>{o.start=String(e),this.edit({custom_display_id_config:JSON.stringify(o)})}),(()=>parseInt(o.length||"0")),(e=>{o.length=String(e),this.edit({custom_display_id_config:JSON.stringify(o)})}),(()=>o.prefix),(e=>{o.prefix=e,this.edit({custom_display_id_config:JSON.stringify(o)})}),(()=>o.suffix),(e=>{o.suffix=e,this.edit({custom_display_id_config:JSON.stringify(o)})}),o.start&&o.length&&i/10<=r?n(g||(g=q` <table data-testid="custom-display-id-config-examples" style="font-family:monospace" class="col-span-2 text-xs text-secondary whitespace-nowrap"> <tbody> <tr> <td style="width:1%"> <foxy-i18n infer="" key="custom-display-id-config-first-example"> </foxy-i18n> </td> <td> ${0}${0}${0} </td> </tr> <tr style="width:1%"> <td> <foxy-i18n infer="" key="custom-display-id-config-random-example"> </foxy-i18n> </td> <td>${0}</td> </tr> </tbody> </table> `),o.prefix,i.toString().padStart(r,"0"),o.suffix,l):"",(()=>o.transaction_journal_entries.enabled?["checked"]:[]),(e=>{o.transaction_journal_entries.enabled=e.includes("checked"),this.edit({custom_display_id_config:JSON.stringify(o)})}),this.__singleCheckboxGroupOptions,o.transaction_journal_entries.enabled?n(y||(y=q` <div class="rounded-t-l rounded-b-l border border-contrast-10 p-m grid grid-cols-2 gap-m sm-col-span-2"> <foxy-internal-text-control infer="custom-display-id-config-transaction-journal-entries-transaction-separator" class="col-span-2" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="custom-display-id-config-transaction-journal-entries-log-detail-request-types-transaction-authcapture-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="custom-display-id-config-transaction-journal-entries-log-detail-request-types-transaction-capture-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="custom-display-id-config-transaction-journal-entries-log-detail-request-types-transaction-void-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control infer="custom-display-id-config-transaction-journal-entries-log-detail-request-types-transaction-refund-prefix" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> ${0} </div> `),(()=>o.transaction_journal_entries.transaction_separator),(e=>{o.transaction_journal_entries.transaction_separator=e,this.edit({custom_display_id_config:JSON.stringify(o)})}),(()=>o.transaction_journal_entries.log_detail_request_types.transaction_authcapture.prefix),(e=>{o.transaction_journal_entries.log_detail_request_types.transaction_authcapture.prefix=e,this.edit({custom_display_id_config:JSON.stringify(o)})}),(()=>o.transaction_journal_entries.log_detail_request_types.transaction_capture.prefix),(e=>{o.transaction_journal_entries.log_detail_request_types.transaction_capture.prefix=e,this.edit({custom_display_id_config:JSON.stringify(o)})}),(()=>o.transaction_journal_entries.log_detail_request_types.transaction_void.prefix),(e=>{o.transaction_journal_entries.log_detail_request_types.transaction_void.prefix=e,this.edit({custom_display_id_config:JSON.stringify(o)})}),(()=>o.transaction_journal_entries.log_detail_request_types.transaction_refund.prefix),(e=>{o.transaction_journal_entries.log_detail_request_types.transaction_refund.prefix=e,this.edit({custom_display_id_config:JSON.stringify(o)})}),o.start&&o.length&&i/10<=r?n(x||(x=q` <table data-testid="custom-display-id-config-transaction-journal-entries-examples" style="font-family:monospace" class="col-span-2 text-xs text-secondary whitespace-nowrap"> <tbody> <tr> <td style="width:1%"> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-authcapture-example"> </foxy-i18n> </td> <td> ${0}${0}${0}${0} </td> </tr> <tr> <td style="width:1%"> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-capture-example"> </foxy-i18n> </td> <td> ${0}${0}${0}${0} </td> </tr> <tr> <td style="width:1%"> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-void-example"> </foxy-i18n> </td> <td> ${0}${0}${0}${0} </td> </tr> <tr> <td style="width:1%"> <foxy-i18n infer="" key="custom-display-id-config-transaction-journal-entries-refund-example"> </foxy-i18n> </td> <td> ${0}${0}${0}${0} </td> </tr> </tbody> </table> `),l,o.transaction_journal_entries.transaction_separator,o.transaction_journal_entries.log_detail_request_types.transaction_authcapture.prefix,d,l,o.transaction_journal_entries.transaction_separator,o.transaction_journal_entries.log_detail_request_types.transaction_capture.prefix,d,l,o.transaction_journal_entries.transaction_separator,o.transaction_journal_entries.log_detail_request_types.transaction_void.prefix,d,l,o.transaction_journal_entries.transaction_separator,o.transaction_journal_entries.log_detail_request_types.transaction_refund.prefix,d):""):""):"")}__renderSmtpConfig(){return n(b||(b=q` <div class="grid grid-cols-2 gap-m p-m rounded-t-l rounded-b-l border border-contrast-10 sm-col-span-2"> ${0} </div> `),["host","port","username","password","security"].map((e=>{const t=()=>JSON.parse(this.form.smtp_config||"{}")[e],o=t=>{var o,i,r,s,n;const a=JSON.parse(this.form.smtp_config||"{}");this.edit({smtp_config:JSON.stringify({username:null!==(o=a.username)&&void 0!==o?o:"",password:null!==(i=a.password)&&void 0!==i?i:"",security:null!==(r=a.security)&&void 0!==r?r:"",host:null!==(s=a.host)&&void 0!==s?s:"",port:null!==(n=a.port)&&void 0!==n?n:"",[e]:t})})},i=`smtp-config-${e}`;return"password"===e?n(v||(v=q` <foxy-internal-password-control infer="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> `),i,t,o):"port"===e?n($||($=q` <foxy-internal-integer-control infer="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-integer-control> `),i,t,o):"security"===e?n(V||(V=q` <foxy-internal-radio-group-control infer="${0}" class="-mt-xs -mx-xs -mb-m col-span-2" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> `),i,t,o,[{label:"option_ssl",value:"ssl"},{label:"option_tls",value:"tls"},{label:"option_none",value:""}]):n(k||(k=q` <foxy-internal-text-control infer="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> `),i,t,o)})))}__renderWarning(e,t){return n(j||(j=q` <div class="p-s leading-m text-s rounded bg-primary-10 text-primary sm-col-span-2"> <foxy-i18n infer="" key="${0}"></foxy-i18n> ${0} </div> `),e,t?n(S||(S=q` <a target="_blank" class="font-medium hover-underline rounded focus-outline-none focus-ring-2 focus-ring-primary" href="${0}" lang="en"> ${0} <iron-icon class="icon-inline" icon="icons:open-in-new"></iron-icon> </a> `),t.href,t.caption):"")}__renderLoader(e){var t;const o=`loader-${e}`;return{data:null===(t=this.renderRoot.querySelector(`#${o}`))||void 0===t?void 0:t.data,render:e=>n(w||(w=q` <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),r(null!=e?e:void 0),o,(()=>this.requestUpdate()))}}}customElements.define("foxy-store-form",C);export{C as StoreForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-65318cc1.js";import"./shared-db21f6db.js";import"./shared-c97e0d6e.js";import"./shared-4dee79d4.js";import"./shared-a3c73e91.js";import{I as e}from"./shared-25f64060.js";import"./foxy-nucleon-element.js";import{I as i}from"./shared-0a248c0d.js";import"./foxy-pagination.js";import"./shared-77a4d8e8.js";import"./foxy-spinner.js";import"./shared-b3ac59eb.js";import{_ as t,B as n}from"./shared-307262a1.js";import{C as s}from"./shared-c7f2f1ab.js";import{N as r}from"./shared-c2d3b32b.js";import{T as o,a as d}from"./shared-09d4fbb8.js";import{h as a}from"./shared-7f33a83a.js";import{i as l}from"./shared-d3bf9ac0.js";import{c as p}from"./shared-4e709717.js";import"./shared-88e36564.js";import"./shared-17d0db7f.js";import"./shared-59042137.js";import"./shared-31651a9c.js";import"./shared-d14c2060.js";import"./shared-4674063d.js";import"./shared-e6828dbf.js";import"./shared-dfe2602a.js";import"./shared-1d08a5ad.js";import"./shared-64657919.js";import"./shared-984fcdf5.js";import"./shared-e8e92fe3.js";import"./shared-e6997950.js";import"./shared-6dc64a17.js";import"./shared-36725fe3.js";import"./shared-4b67d699.js";import"./shared-d6276c83.js";import"./shared-332f2997.js";import"./shared-0479553e.js";import"./shared-c6c6ba69.js";let h,c=e=>e;const m=s(o(r));customElements.define("foxy-internal-store-shipping-method-form-services-page-item-content",class extends m{constructor(){super(...arguments),this.shippingServiceUri=null,this.shippingMethodUri=null}static get properties(){return t(t({},super.properties),{},{shippingServiceUri:{attribute:"shipping-service-uri"},shippingMethodUri:{attribute:"shipping-method-uri"}})}render(){return a(h||(h=c` <div class="h-full flex items-center"> <vaadin-checkbox data-testid="checkbox" class="w-full" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <slot></slot> </vaadin-checkbox> </div> `),!this.in("idle")||this.disabled,this.readonly,!!this.data,(e=>{var i,t;e.currentTarget.checked?(this.edit({shipping_service_uri:null!==(i=this.shippingServiceUri)&&void 0!==i?i:"",shipping_method_uri:null!==(t=this.shippingMethodUri)&&void 0!==t?t:""}),this.submit()):this.delete()}))}});let u,f=e=>e;const v=s(o(r));customElements.define("foxy-internal-store-shipping-method-form-services-page-item",class extends v{constructor(){super(...arguments),this.internationalAllowed=!1,this.shippingServiceUri=null,this.shippingMethodUri=null}static get properties(){return t(t({},super.properties),{},{internationalAllowed:{type:Boolean,attribute:"international-allowed"},shippingServiceUri:{attribute:"shipping-service-uri"},shippingMethodUri:{attribute:"shipping-method-uri"}})}render(){var e,i,t;const n=null===(e=this.data)||void 0===e?void 0:e._embedded["fx:store_shipping_services"][0],s=n?void 0:this.href,r=n?n._links.self.href:void 0;return a(u||(u=f` <foxy-internal-store-shipping-method-form-services-page-item-content shipping-service-uri="${0}" shipping-method-uri="${0}" data-testid="content" parent="${0}" class="h-full" infer="" href="${0}"> <slot></slot> <span class="${0}"> <slot name="suffix"></slot> </span> </foxy-internal-store-shipping-method-form-services-page-item-content> `),l(null!==(i=this.shippingServiceUri)&&void 0!==i?i:void 0),l(null!==(t=this.shippingMethodUri)&&void 0!==t?t:void 0),l(s),l(r),this.internationalAllowed||!r?"text-tertiary":"text-error")}});let g,_,x,y,b=e=>e;const $=s(o(d(r)));customElements.define("foxy-internal-store-shipping-method-form-services-page",class extends ${constructor(){super(...arguments),this.storeShippingServicesUri=null,this.internationalAllowed=!1,this.shippingMethodUri=null}static get properties(){return t(t({},super.properties),{},{storeShippingServicesUri:{attribute:"store-shipping-services-uri"},internationalAllowed:{type:Boolean,attribute:"international-allowed"},shippingMethodUri:{attribute:"shipping-method-uri"}})}render(){var e,i,t;const n=null!==(i=null===(e=this.data)||void 0===e?void 0:e._embedded["fx:shipping_services"])&&void 0!==i?i:[];let s=20;try{const e=parseInt(null!==(t=new URL(this.href).searchParams.get("limit"))&&void 0!==t?t:"");isNaN(e)||(s=e)}catch(e){}return a(g||(g=b` <div class="relative"> <div class="relative divide-y divide-contrast-10 ml-m"> ${0} </div> <div data-testid="spinner" class="${0}"> <foxy-spinner layout="vertical" state="${0}" class="m-auto p-m bg-base rounded-t-l rounded-b-l shadow-xs" infer=""> </foxy-spinner> </div> </div> `),new Array(s).fill(0).map(((e,i)=>{var t,s;const r=n[i];let o;if(r)try{const e=new URL(null!==(t=this.storeShippingServicesUri)&&void 0!==t?t:""),i=new URL(r._links.self.href).pathname.split("/").pop();e.searchParams.set("shipping_service_id",i),e.searchParams.set("limit","1"),o=e.toString()}catch(e){}return o?a(x||(x=b` <foxy-internal-store-shipping-method-form-services-page-item shipping-service-uri="${0}" shipping-method-uri="${0}" data-testclass="item" class="h-l truncate" infer="" href="${0}" ?international-allowed="${0}"> ${0} ${0} </foxy-internal-store-shipping-method-form-services-page-item> `),r._links.self.href,l(null!==(s=this.shippingMethodUri)&&void 0!==s?s:void 0),o,this.internationalAllowed,null==r?void 0:r.name,r.is_international?a(y||(y=b`<foxy-i18n infer="" slot="suffix" key="international_only"></foxy-i18n>`)):""):a(_||(_=b`<div class="h-l"></div>`))})),p({"pointer-events-none absolute inset-0 flex transition-opacity":!0,"opacity-0":!!this.data}),this.in("fail")?"error":this.in({idle:"template"})?"empty":"busy")}});let j,U,S=e=>e;customElements.define("foxy-internal-store-shipping-method-form-services-control",class extends i{renderControl(){var e,i;const t=null===(e=this.nucleon)||void 0===e?void 0:e.data,n=null===(i=this.nucleon)||void 0===i?void 0:i.form;if(!t)return a(j||(j=S``));const s=new URL(t._links["fx:shipping_services"].href);return s.searchParams.set("limit","10"),a(U||(U=S` <foxy-pagination first="${0}" infer=""> <foxy-i18n class="block text-s font-medium text-secondary leading-none mb-s" infer="" key="label"> </foxy-i18n> <foxy-internal-store-shipping-method-form-services-page store-shipping-services-uri="${0}" shipping-method-uri="${0}" class="border border-contrast-10 rounded mb-s" infer="" ?international-allowed="${0}"> </foxy-internal-store-shipping-method-form-services-page> </foxy-pagination> `),s.toString(),t._links["fx:store_shipping_services"].href,t._links["fx:shipping_method"].href,!!n.use_for_international)}});let k,w,M,T,P=e=>e;const E=d(e,"store-shipping-method-form"),I=e=>{try{return new URL(e),!0}catch(e){return!1}};class O extends E{constructor(){super(...arguments),this.shippingMethods=null,this.templates={},this.__destinations=[{value:"domestic",label:"domestic"},{value:"international",label:"international"}],this.__getDestinations=()=>{const e=[];return this.form.use_for_domestic&&e.push("domestic"),this.form.use_for_international&&e.push("international"),e},this.__setDestinations=e=>{this.edit({use_for_domestic:e.includes("domestic"),use_for_international:e.includes("international")})}}static get properties(){return t(t({},super.properties),{},{shippingMethods:{attribute:"shipping-methods"}})}static get v8n(){return[({shipping_method_uri:e})=>e&&I(e)||"shipping-method-uri:v8n_required",({accountid:e})=>!e||e.length<=50||"accountid:v8n_too_long",({password:e})=>!e||e.length<=50||"password:v8n_too_long",({meter_number:e})=>!e||e.length<=50||"meter-number:v8n_too_long",({authentication_key:e})=>!e||e.length<=50||"authentication-key:v8n_too_long",({custom_code:e})=>!e||new Blob([e]).size/1024<=64||"custom-code:v8n_too_long",e=>{var i,t;return"CUSTOM-ENDPOINT-POST"!==(null===(t=null===(i=e._embedded)||void 0===i?void 0:i["fx:shipping_method"])||void 0===t?void 0:t.code)||(e.accountid&&I(e.accountid)||"endpoint:v8n_required")},e=>{var i,t;const n=e.shipping_container_uri,s=null===(t=null===(i=e._embedded)||void 0===i?void 0:i["fx:shipping_method"])||void 0===t?void 0:t.code;return!s||!["USPS","FedEx","UPS"].includes(s)||(n&&I(n)||"shipping-container-uri:v8n_required")},e=>{var i,t;const n=e.shipping_drop_type_uri,s=null===(t=null===(i=e._embedded)||void 0===i?void 0:i["fx:shipping_method"])||void 0===t?void 0:t.code;return!s||!["FedEx","UPS"].includes(s)||(n&&I(n)||"shipping-drop-type-uri:v8n_required")}]}get hiddenSelector(){var e;const i=null===(e=this.form._embedded)||void 0===e?void 0:e["fx:shipping_method"].code;if(!i)return new n("not=shipping-method-uri,timestamps,create,delete");const t=["shipping-container-uri","shipping-drop-type-uri","destinations"],s=["authentication-key","meter-number","accountid","password"],r={"CUSTOM-ENDPOINT-POST":["endpoint"],"CUSTOM-CODE":["custom-code"],CUSTOM:["destinations","services"],FedEx:[...t,...s,"services"],USPS:[...t,"services"],UPS:[...t,...s,"services"]};if(r[i]){const e=["shipping-method-uri",...r[i],"timestamps","delete","create"];return new n(`not=${e.join()} ${super.hiddenSelector}`)}return super.hiddenSelector}renderBody(){var e,i,n,s,r,o,d,p,h;const c=null===(e=this.form._embedded)||void 0===e?void 0:e["fx:shipping_method"];return a(k||(k=P` ${0} <foxy-internal-async-combo-box-control item-value-path="_links.self.href" item-label-path="name" first="${0}" infer="shipping-method-uri" .selectedItem="${0}" @selected-item-changed="${0}"> </foxy-internal-async-combo-box-control> <foxy-internal-async-combo-box-control item-value-path="_links.self.href" item-label-path="name" first="${0}" infer="shipping-container-uri" .selectedItem="${0}" @selected-item-changed="${0}"> </foxy-internal-async-combo-box-control> <foxy-internal-async-combo-box-control item-value-path="_links.self.href" item-label-path="name" first="${0}" infer="shipping-drop-type-uri" .selectedItem="${0}" @selected-item-changed="${0}"> </foxy-internal-async-combo-box-control> <foxy-internal-checkbox-group-control infer="destinations" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-text-control infer="authentication-key"></foxy-internal-text-control> <foxy-internal-text-control infer="meter-number"></foxy-internal-text-control> ${0} <foxy-internal-password-control infer="password"></foxy-internal-password-control> <foxy-internal-text-area-control infer="custom-code"></foxy-internal-text-area-control> <foxy-internal-store-shipping-method-form-services-control infer="services"> </foxy-internal-store-shipping-method-form-services-control> ${0} `),["method","container","drop_type"].map((e=>{var i;const n=`fx:shipping_${e}`,s=`shipping_${e}_uri`;if(!(null===(i=this.form._embedded)||void 0===i?void 0:i[n])&&this.form[s])return a(w||(w=P` <foxy-nucleon class="hidden" infer="" href="${0}" @update="${0}"> </foxy-nucleon> `),this.form[s],(e=>{const i=e.currentTarget.data;if(i){const e=t(t({},this.form._embedded),{},{[n]:i});this.edit({_embedded:e})}}))})),l(null!==(i=this.shippingMethods)&&void 0!==i?i:null===(n=this.form._links)||void 0===n?void 0:n["fx:shipping_methods"].href),null!==(r=null===(s=this.form._embedded)||void 0===s?void 0:s["fx:shipping_method"])&&void 0!==r?r:null,(e=>{var i,t;const{selectedItem:n}=e.currentTarget,s={"fx:shipping_method":n};this.edit({_embedded:s,shipping_container_uri:"",shipping_drop_type_uri:"",shipping_method_uri:null!==(t=null===(i=n)||void 0===i?void 0:i._links.self.href)&&void 0!==t?t:""})}),l(null==c?void 0:c._links["fx:shipping_containers"].href),null!==(d=null===(o=this.form._embedded)||void 0===o?void 0:o["fx:shipping_container"])&&void 0!==d?d:null,(e=>{var i,n;const{selectedItem:s}=e.currentTarget,r=t(t({},this.form._embedded),{},{"fx:shipping_container":s});this.edit({shipping_container_uri:null!==(n=null===(i=s)||void 0===i?void 0:i._links.self.href)&&void 0!==n?n:"",_embedded:r})}),l(null==c?void 0:c._links["fx:shipping_drop_types"].href),null!==(h=null===(p=this.form._embedded)||void 0===p?void 0:p["fx:shipping_drop_type"])&&void 0!==h?h:null,(e=>{var i,n;const{selectedItem:s}=e.currentTarget,r=t(t({},this.form._embedded),{},{"fx:shipping_drop_type":s});this.edit({shipping_drop_type_uri:null!==(n=null===(i=s)||void 0===i?void 0:i._links.self.href)&&void 0!==n?n:"",_embedded:r})}),this.__getDestinations,this.__setDestinations,this.__destinations,"CUSTOM-ENDPOINT-POST"===(null==c?void 0:c.code)?a(M||(M=P` <foxy-internal-text-control infer="endpoint" property="accountid"> </foxy-internal-text-control> `)):a(T||(T=P`<foxy-internal-text-control infer="accountid"></foxy-internal-text-control>`)),super.renderBody())}}customElements.define("foxy-store-shipping-method-form",O);export{O as StoreShippingMethodForm};
|
|
1
|
+
import"./shared-3164d0c3.js";import"./shared-fa5f0117.js";import"./shared-57922341.js";import"./shared-fec6fd04.js";import"./shared-897ab5e6.js";import{I as e}from"./shared-b334c8b6.js";import"./foxy-nucleon-element.js";import{I as i}from"./shared-91eb066c.js";import"./foxy-pagination.js";import"./shared-46f3f71c.js";import"./foxy-spinner.js";import"./shared-403af08d.js";import{_ as t,B as n}from"./shared-0dabe195.js";import{C as s}from"./shared-1fd59009.js";import{N as r}from"./shared-a6517170.js";import{T as o,a as d}from"./shared-a88c5cf1.js";import{h as a}from"./shared-7f33a83a.js";import{i as l}from"./shared-d3bf9ac0.js";import{c as p}from"./shared-4e709717.js";import"./shared-c541c9e9.js";import"./shared-4bd1efd7.js";import"./shared-a7475f62.js";import"./shared-2fa6a5a0.js";import"./shared-6b0498b2.js";import"./shared-c97f7178.js";import"./shared-0689b25a.js";import"./shared-a134d313.js";import"./shared-bbbb8894.js";import"./shared-343d1fd7.js";import"./shared-8134d8a7.js";import"./shared-ad0256d0.js";import"./shared-9bdd5400.js";import"./shared-8128b5e3.js";import"./shared-c758220c.js";import"./shared-763a6797.js";import"./shared-3ab0306f.js";import"./shared-8528906b.js";import"./shared-f9180815.js";import"./shared-6dffe67d.js";let h,c=e=>e;const m=s(o(r));customElements.define("foxy-internal-store-shipping-method-form-services-page-item-content",class extends m{constructor(){super(...arguments),this.shippingServiceUri=null,this.shippingMethodUri=null}static get properties(){return t(t({},super.properties),{},{shippingServiceUri:{attribute:"shipping-service-uri"},shippingMethodUri:{attribute:"shipping-method-uri"}})}render(){return a(h||(h=c` <div class="h-full flex items-center"> <vaadin-checkbox data-testid="checkbox" class="w-full" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <slot></slot> </vaadin-checkbox> </div> `),!this.in("idle")||this.disabled,this.readonly,!!this.data,(e=>{var i,t;e.currentTarget.checked?(this.edit({shipping_service_uri:null!==(i=this.shippingServiceUri)&&void 0!==i?i:"",shipping_method_uri:null!==(t=this.shippingMethodUri)&&void 0!==t?t:""}),this.submit()):this.delete()}))}});let f,u=e=>e;const v=s(o(r));customElements.define("foxy-internal-store-shipping-method-form-services-page-item",class extends v{constructor(){super(...arguments),this.internationalAllowed=!1,this.shippingServiceUri=null,this.shippingMethodUri=null}static get properties(){return t(t({},super.properties),{},{internationalAllowed:{type:Boolean,attribute:"international-allowed"},shippingServiceUri:{attribute:"shipping-service-uri"},shippingMethodUri:{attribute:"shipping-method-uri"}})}render(){var e,i,t;const n=null===(e=this.data)||void 0===e?void 0:e._embedded["fx:store_shipping_services"][0],s=n?void 0:this.href,r=n?n._links.self.href:void 0;return a(f||(f=u` <foxy-internal-store-shipping-method-form-services-page-item-content shipping-service-uri="${0}" shipping-method-uri="${0}" data-testid="content" parent="${0}" class="h-full" infer="" href="${0}"> <slot></slot> <span class="${0}"> <slot name="suffix"></slot> </span> </foxy-internal-store-shipping-method-form-services-page-item-content> `),l(null!==(i=this.shippingServiceUri)&&void 0!==i?i:void 0),l(null!==(t=this.shippingMethodUri)&&void 0!==t?t:void 0),l(s),l(r),this.internationalAllowed||!r?"text-tertiary":"text-error")}});let g,_,x,y,b=e=>e;const $=s(o(d(r)));customElements.define("foxy-internal-store-shipping-method-form-services-page",class extends ${constructor(){super(...arguments),this.storeShippingServicesUri=null,this.internationalAllowed=!1,this.shippingMethodUri=null}static get properties(){return t(t({},super.properties),{},{storeShippingServicesUri:{attribute:"store-shipping-services-uri"},internationalAllowed:{type:Boolean,attribute:"international-allowed"},shippingMethodUri:{attribute:"shipping-method-uri"}})}render(){var e,i,t;const n=null!==(i=null===(e=this.data)||void 0===e?void 0:e._embedded["fx:shipping_services"])&&void 0!==i?i:[];let s=20;try{const e=parseInt(null!==(t=new URL(this.href).searchParams.get("limit"))&&void 0!==t?t:"");isNaN(e)||(s=e)}catch(e){}return a(g||(g=b` <div class="relative"> <div class="relative divide-y divide-contrast-10 ml-m"> ${0} </div> <div data-testid="spinner" class="${0}"> <foxy-spinner layout="vertical" state="${0}" class="m-auto p-m bg-base rounded-t-l rounded-b-l shadow-xs" infer=""> </foxy-spinner> </div> </div> `),new Array(s).fill(0).map(((e,i)=>{var t,s;const r=n[i];let o;if(r)try{const e=new URL(null!==(t=this.storeShippingServicesUri)&&void 0!==t?t:""),i=new URL(r._links.self.href).pathname.split("/").pop();e.searchParams.set("shipping_service_id",i),e.searchParams.set("limit","1"),o=e.toString()}catch(e){}return o?a(x||(x=b` <foxy-internal-store-shipping-method-form-services-page-item shipping-service-uri="${0}" shipping-method-uri="${0}" data-testclass="item" class="h-l truncate" infer="" href="${0}" ?international-allowed="${0}"> ${0} ${0} </foxy-internal-store-shipping-method-form-services-page-item> `),r._links.self.href,l(null!==(s=this.shippingMethodUri)&&void 0!==s?s:void 0),o,this.internationalAllowed,null==r?void 0:r.name,r.is_international?a(y||(y=b`<foxy-i18n infer="" slot="suffix" key="international_only"></foxy-i18n>`)):""):a(_||(_=b`<div class="h-l"></div>`))})),p({"pointer-events-none absolute inset-0 flex transition-opacity":!0,"opacity-0":!!this.data}),this.in("fail")?"error":this.in({idle:"template"})?"empty":"busy")}});let j,U,S=e=>e;customElements.define("foxy-internal-store-shipping-method-form-services-control",class extends i{renderControl(){var e,i;const t=null===(e=this.nucleon)||void 0===e?void 0:e.data,n=null===(i=this.nucleon)||void 0===i?void 0:i.form;if(!t)return a(j||(j=S``));const s=new URL(t._links["fx:shipping_services"].href);return s.searchParams.set("limit","10"),a(U||(U=S` <foxy-pagination first="${0}" infer=""> <foxy-i18n class="block text-s font-medium text-secondary leading-none mb-s" infer="" key="label"> </foxy-i18n> <foxy-internal-store-shipping-method-form-services-page store-shipping-services-uri="${0}" shipping-method-uri="${0}" class="border border-contrast-10 rounded mb-s" infer="" ?international-allowed="${0}"> </foxy-internal-store-shipping-method-form-services-page> </foxy-pagination> `),s.toString(),t._links["fx:store_shipping_services"].href,t._links["fx:shipping_method"].href,!!n.use_for_international)}});let k,w,M,T,P=e=>e;const E=d(e,"store-shipping-method-form"),I=e=>{try{return new URL(e),!0}catch(e){return!1}};class O extends E{constructor(){super(...arguments),this.shippingMethods=null,this.templates={},this.__destinations=[{value:"domestic",label:"domestic"},{value:"international",label:"international"}],this.__getDestinations=()=>{const e=[];return this.form.use_for_domestic&&e.push("domestic"),this.form.use_for_international&&e.push("international"),e},this.__setDestinations=e=>{this.edit({use_for_domestic:e.includes("domestic"),use_for_international:e.includes("international")})}}static get properties(){return t(t({},super.properties),{},{shippingMethods:{attribute:"shipping-methods"}})}static get v8n(){return[({shipping_method_uri:e})=>e&&I(e)||"shipping-method-uri:v8n_required",({accountid:e})=>!e||e.length<=50||"accountid:v8n_too_long",({password:e})=>!e||e.length<=50||"password:v8n_too_long",({meter_number:e})=>!e||e.length<=50||"meter-number:v8n_too_long",({authentication_key:e})=>!e||e.length<=50||"authentication-key:v8n_too_long",({custom_code:e})=>!e||new Blob([e]).size/1024<=64||"custom-code:v8n_too_long",e=>{var i,t;return"CUSTOM-ENDPOINT-POST"!==(null===(t=null===(i=e._embedded)||void 0===i?void 0:i["fx:shipping_method"])||void 0===t?void 0:t.code)||(e.accountid&&I(e.accountid)||"endpoint:v8n_required")},e=>{var i,t;const n=e.shipping_container_uri,s=null===(t=null===(i=e._embedded)||void 0===i?void 0:i["fx:shipping_method"])||void 0===t?void 0:t.code;return!s||!["USPS","FedEx","UPS"].includes(s)||(n&&I(n)||"shipping-container-uri:v8n_required")},e=>{var i,t;const n=e.shipping_drop_type_uri,s=null===(t=null===(i=e._embedded)||void 0===i?void 0:i["fx:shipping_method"])||void 0===t?void 0:t.code;return!s||!["FedEx","UPS"].includes(s)||(n&&I(n)||"shipping-drop-type-uri:v8n_required")}]}get hiddenSelector(){var e;const i=null===(e=this.form._embedded)||void 0===e?void 0:e["fx:shipping_method"].code;if(!i)return new n("not=shipping-method-uri,timestamps,create,delete");const t=["shipping-container-uri","shipping-drop-type-uri","destinations"],s=["authentication-key","meter-number","accountid","password"],r={"CUSTOM-ENDPOINT-POST":["endpoint"],"CUSTOM-CODE":["custom-code"],CUSTOM:["destinations","services"],FedEx:[...t,...s,"services"],USPS:[...t,"services"],UPS:[...t,...s,"services"]};if(r[i]){const e=["shipping-method-uri",...r[i],"timestamps","delete","create"];return new n(`not=${e.join()} ${super.hiddenSelector}`)}return super.hiddenSelector}renderBody(){var e,i,n,s,r,o,d,p,h;const c=null===(e=this.form._embedded)||void 0===e?void 0:e["fx:shipping_method"];return a(k||(k=P` ${0} <foxy-internal-async-combo-box-control item-value-path="_links.self.href" item-label-path="name" first="${0}" infer="shipping-method-uri" .selectedItem="${0}" @selected-item-changed="${0}"> </foxy-internal-async-combo-box-control> <foxy-internal-async-combo-box-control item-value-path="_links.self.href" item-label-path="name" first="${0}" infer="shipping-container-uri" .selectedItem="${0}" @selected-item-changed="${0}"> </foxy-internal-async-combo-box-control> <foxy-internal-async-combo-box-control item-value-path="_links.self.href" item-label-path="name" first="${0}" infer="shipping-drop-type-uri" .selectedItem="${0}" @selected-item-changed="${0}"> </foxy-internal-async-combo-box-control> <foxy-internal-checkbox-group-control infer="destinations" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-text-control infer="authentication-key"></foxy-internal-text-control> <foxy-internal-text-control infer="meter-number"></foxy-internal-text-control> ${0} <foxy-internal-password-control infer="password"></foxy-internal-password-control> <foxy-internal-text-area-control infer="custom-code"></foxy-internal-text-area-control> <foxy-internal-store-shipping-method-form-services-control infer="services"> </foxy-internal-store-shipping-method-form-services-control> ${0} `),["method","container","drop_type"].map((e=>{var i;const n=`fx:shipping_${e}`,s=`shipping_${e}_uri`;if(!(null===(i=this.form._embedded)||void 0===i?void 0:i[n])&&this.form[s])return a(w||(w=P` <foxy-nucleon class="hidden" infer="" href="${0}" @update="${0}"> </foxy-nucleon> `),this.form[s],(e=>{const i=e.currentTarget.data;if(i){const e=t(t({},this.form._embedded),{},{[n]:i});this.edit({_embedded:e})}}))})),l(null!==(i=this.shippingMethods)&&void 0!==i?i:null===(n=this.form._links)||void 0===n?void 0:n["fx:shipping_methods"].href),null!==(r=null===(s=this.form._embedded)||void 0===s?void 0:s["fx:shipping_method"])&&void 0!==r?r:null,(e=>{var i,t;const{selectedItem:n}=e.currentTarget,s={"fx:shipping_method":n};this.edit({_embedded:s,shipping_container_uri:"",shipping_drop_type_uri:"",shipping_method_uri:null!==(t=null===(i=n)||void 0===i?void 0:i._links.self.href)&&void 0!==t?t:""})}),l(null==c?void 0:c._links["fx:shipping_containers"].href),null!==(d=null===(o=this.form._embedded)||void 0===o?void 0:o["fx:shipping_container"])&&void 0!==d?d:null,(e=>{var i,n;const{selectedItem:s}=e.currentTarget,r=t(t({},this.form._embedded),{},{"fx:shipping_container":s});this.edit({shipping_container_uri:null!==(n=null===(i=s)||void 0===i?void 0:i._links.self.href)&&void 0!==n?n:"",_embedded:r})}),l(null==c?void 0:c._links["fx:shipping_drop_types"].href),null!==(h=null===(p=this.form._embedded)||void 0===p?void 0:p["fx:shipping_drop_type"])&&void 0!==h?h:null,(e=>{var i,n;const{selectedItem:s}=e.currentTarget,r=t(t({},this.form._embedded),{},{"fx:shipping_drop_type":s});this.edit({shipping_drop_type_uri:null!==(n=null===(i=s)||void 0===i?void 0:i._links.self.href)&&void 0!==n?n:"",_embedded:r})}),this.__getDestinations,this.__setDestinations,this.__destinations,"CUSTOM-ENDPOINT-POST"===(null==c?void 0:c.code)?a(M||(M=P` <foxy-internal-text-control infer="endpoint" property="accountid"> </foxy-internal-text-control> `)):a(T||(T=P`<foxy-internal-text-control infer="accountid"></foxy-internal-text-control>`)),super.renderBody())}}customElements.define("foxy-store-shipping-method-form",O);export{O as StoreShippingMethodForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-6dffe67d.js";import"./shared-c97f7178.js";import"./shared-f9180815.js";import"./foxy-spinner.js";import"./shared-46f3f71c.js";import{_ as t}from"./shared-0dabe195.js";import{h as s}from"./shared-7f33a83a.js";import{C as i}from"./shared-1fd59009.js";import{N as e}from"./shared-a6517170.js";import{R as a,T as n,a as r}from"./shared-a88c5cf1.js";import{c as o}from"./shared-4e709717.js";import{p as d}from"./shared-1e43b4db.js";import"./shared-a7475f62.js";import"./shared-763a6797.js";import"./shared-343d1fd7.js";import"./shared-d3bf9ac0.js";import"./shared-bbbb8894.js";import"./shared-3ab0306f.js";import"./shared-8528906b.js";let l,c=t=>t;const m=i(a(n(r(e,"subscription-card"))));class f extends m{render(){var t,i,e,a,n;const r=!!(null===(t=this.data)||void 0===t?void 0:t.is_active),d=!!(null===(i=this.data)||void 0===i?void 0:i.first_failed_transaction_date);return s(l||(l=c` <div class="relative text-left"> <div class="${0}"> <div class="${0}"> <iron-icon class="m-auto" icon="${0}"> </iron-icon> </div> <div class="flex-1 min-w-0 leading-xs flex flex-col sm-flex-row sm-items-center"> <div class="order-1 sm-order-0"> <div class="text-body font-medium origin-top-left text-m"> <foxy-i18n data-testid="summary" options="${0}" lang="${0}" key="transaction_summary" ns="${0}"> </foxy-i18n> ​ </div> <div class="${0}"> <foxy-i18n data-testid="status" options="${0}" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> ​ </div> </div> <div class="flex-1 font-medium leading-xs mb-xs sm-mb-0 sm-text-right text-xxs sm-text-l tracking-wide sm-tracking-normal uppercase sm-normal-case order-0 sm-order-1 font-tnum text-secondary sm-text-body"> <foxy-i18n data-testid="price" options="${0}" lang="${0}" key="price_${0}" ns="${0}"> </foxy-i18n> ​ </div> </div> </div> <div data-testid="spinner" class="${0}"> <foxy-spinner state="${0}" class="m-auto" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> ${0} `),o({"flex items-start sm-items-center space-x-m transition duration-150 ease-in-out":!0,"opacity-0":!this.in({idle:"snapshot"})}),o({"min-w-0 flex-shrink-0 rounded-full relative flex p-s":!0,"text-success bg-success-10":r&&!d,"text-body bg-contrast-5":!r&&!d,"text-error bg-error-10":d}),d?"error-outline":r?"done":"done-all",JSON.stringify(this.__getSummaryOptions()),this.lang,this.ns,o({"text-m":!0,"text-tertiary":!r&&!d,"text-success":r&&!d,"text-error":d}),JSON.stringify(this.__getStatusOptions()),this.lang,this.__getStatusKey(),this.ns,JSON.stringify(this.__getPriceOptions()),this.lang,".5m"===(null===(e=this.data)||void 0===e?void 0:e.frequency)?"twice_a_month":"recurring",this.ns,o({"pointer-events-none absolute inset-0 flex transition ease-in-out duration-150":!0,"opacity-0":this.in({idle:"snapshot"})}),this.in("fail")?"error":this.in({idle:"template"})?"empty":"busy",this.lang,this.ns,null!==(n=null===(a=customElements.get("foxy-spinner"))||void 0===a?void 0:a.defaultNS)&&void 0!==n?n:"",this.renderTemplateOrSlot())}__getSummaryOptions(){if(!this.in({idle:"snapshot"}))return{};const t=this.data._embedded["fx:transaction_template"]._embedded["fx:items"];return{most_expensive_item:[...t].sort(((t,s)=>t.price-s.price))[0],count_minus_one:t.length-1,count:t.length}}__getStatusOptions(){var t,s;return this.in({idle:"snapshot"})?{date:null!==(s=null!==(t=this.data.first_failed_transaction_date)&&void 0!==t?t:this.data.end_date)&&void 0!==s?s:this.data.next_transaction_date}:{}}__getPriceOptions(){if(!this.in({idle:"snapshot"}))return{};const s=this.data._embedded["fx:last_transaction"],i=`${s.total_order} ${s.currency_code}`;return t(t({},d(this.data.frequency)),{},{amount:i})}__getStatusKey(){var t,s,i;if(null===(t=this.data)||void 0===t?void 0:t.first_failed_transaction_date)return"subscription_failed";if(null===(s=this.data)||void 0===s?void 0:s.end_date){return new Date(this.data.end_date).getTime()>Date.now()?"subscription_will_be_cancelled":"subscription_cancelled"}return"subscription_"+((null===(i=this.data)||void 0===i?void 0:i.is_active)?"active":"inactive")}}customElements.define("foxy-subscription-card",f);export{f as SubscriptionCard};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{h as t,P as e}from"./shared-a7475f62.js";import{E as i,T as s}from"./shared-4bd1efd7.js";import"./shared-c97f7178.js";import"./shared-a96a2154.js";import{y as a,S as o,R as n,a as r}from"./shared-a88c5cf1.js";import{c as l,h as d}from"./shared-7f33a83a.js";import"./shared-c541c9e9.js";import"./shared-9bdd5400.js";import"./shared-6dffe67d.js";import{I as c}from"./shared-b334c8b6.js";import"./shared-9765be8f.js";import"./shared-7ead930c.js";import"./foxy-cancellation-form.js";import"./shared-f9180815.js";import"./foxy-transaction-card.js";import"./foxy-nucleon-element.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-customer-card.js";import"./foxy-form-dialog.js";import"./foxy-item-card.js";import"./shared-46f3f71c.js";import{_ as u,B as h}from"./shared-0dabe195.js";import{c as m}from"./shared-4e709717.js";import{C as f}from"./shared-619bcf83.js";import"./shared-c758220c.js";import{S as p}from"./shared-19c9fe00.js";import"./shared-7680d300.js";import"./shared-0689b25a.js";import"./shared-13cc4ed4.js";import"./shared-db06114b.js";import{G as _}from"./shared-639dda4b.js";import"./shared-2fa6a5a0.js";import{p as y}from"./shared-1e43b4db.js";import{s as v}from"./shared-79d0699c.js";import{i as b}from"./shared-d3bf9ac0.js";import{p as g}from"./shared-7e887e5b.js";import{j as x}from"./shared-e640e9fa.js";import"./shared-6b0498b2.js";import"./shared-91eb066c.js";import"./shared-1fd59009.js";import"./shared-763a6797.js";import"./shared-a6517170.js";import"./shared-bbbb8894.js";import"./shared-343d1fd7.js";import"./shared-3ab0306f.js";import"./shared-8528906b.js";import"./shared-8128b5e3.js";import"./foxy-spinner.js";import"./foxy-collection-page.js";import"./shared-d519a301.js";import"./shared-11c2efc8.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-a134d313.js";import"./shared-e5786b8b.js";import"./shared-8134d8a7.js";import"./shared-f4822b9e.js";import"./shared-7d4e0011.js";import"./shared-79d01877.js";import"./shared-421e46e9.js";a("vcf-tooltip",l`
|
|
2
2
|
:host {
|
|
3
3
|
/* Sizing */
|
|
4
4
|
--lumo-tooltip-size: var(--lumo-size-m);
|
|
@@ -11,7 +11,7 @@ import{P as t,h as e}from"./shared-59042137.js";import{E as i,T as s}from"./shar
|
|
|
11
11
|
-webkit-font-smoothing: antialiased;
|
|
12
12
|
-moz-osx-font-smoothing: grayscale;
|
|
13
13
|
}
|
|
14
|
-
`,{include:["lumo-color","lumo-typography"]});class $ extends(i(s(
|
|
14
|
+
`,{include:["lumo-color","lumo-typography"]});class $ extends(i(s(e))){static get template(){return t`
|
|
15
15
|
<style>
|
|
16
16
|
:host {
|
|
17
17
|
box-sizing: border-box;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-db21f6db.js";import"./shared-6abdfcf2.js";import"./shared-30bebd39.js";import"./shared-51d28e6d.js";import"./shared-a3c73e91.js";import{I as e}from"./shared-25f64060.js";import{I as t}from"./shared-dfe2602a.js";import"./shared-77a4d8e8.js";import{c as s,h as a}from"./shared-7f33a83a.js";import{y as i,a as r}from"./shared-09d4fbb8.js";import"./shared-b3ac59eb.js";import"./shared-17d0db7f.js";import"./shared-59042137.js";import"./shared-e6828dbf.js";import"./shared-31651a9c.js";import"./shared-4674063d.js";import"./shared-307262a1.js";import"./shared-d3bf9ac0.js";import"./shared-4e709717.js";import"./shared-d519a301.js";import"./shared-f3b35364.js";import"./shared-11c2efc8.js";import"./shared-fef9ecc1.js";import"./shared-432c5183.js";import"./shared-0a248c0d.js";import"./shared-0479553e.js";import"./shared-c7f2f1ab.js";import"./shared-4b67d699.js";import"./shared-c2d3b32b.js";import"./shared-1d08a5ad.js";import"./shared-64657919.js";import"./shared-d6276c83.js";import"./shared-332f2997.js";import"./shared-e6997950.js";import"./shared-6dc64a17.js";import"./shared-36725fe3.js";import"./foxy-spinner.js";import"./shared-c6c6ba69.js";let o,n,l,p=e=>e;let u,d,m=e=>e;const c=s(u||(u=m`:host(.foxy-internal-subscription-settings-form-reattempt-bypass) label{padding-bottom:var(--lumo-space-xs)}:host(.foxy-internal-subscription-settings-form-reattempt-bypass) [part=group-field]{display:flex;border:thin solid var(--lumo-contrast-10pct);border-radius:var(--lumo-border-radius);transition:border-color .15s ease}:host(.foxy-internal-subscription-settings-form-reattempt-bypass:not([disabled]):not([readonly]):hover) [part=group-field]{border-color:var(--lumo-contrast-20pct)}`)),_=s(d||(d=m`:host(.foxy-internal-subscription-settings-form-reattempt-bypass) label{display:flex}:host(.foxy-internal-subscription-settings-form-reattempt-bypass) [part=label]{flex:1}`));customElements.define("foxy-internal-subscription-settings-form-reattempt-bypass",class extends t{constructor(){super(...arguments),this.nucleon=null,this.__getReattemptBypassStringsValue=()=>{var e,t,s;return(null!==(s=null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.form.reattempt_bypass_strings)||void 0===t?void 0:t.split(","))&&void 0!==s?s:[]).map((e=>e.trim())).filter(((e,t,s)=>e&&s.indexOf(e)===t)).map((e=>({value:e})))},this.__setReattemptBypassStringsValue=e=>{var t,s;const a=this.renderRoot.querySelector("vaadin-radio-group"),i=null!==(t=null==a?void 0:a.value)&&void 0!==t?t:"reattempt_if_exists";null===(s=this.nucleon)||void 0===s||s.edit({reattempt_bypass_strings:e.map((({value:e})=>e)).join(),reattempt_bypass_logic:i})}}static get styles(){return[super.styles,s(o||(o=p`.visible-if-checked{display:none}[checked] .visible-if-checked{display:block}`))]}renderControl(){const e=a(n||(n=p` <foxy-internal-editable-list-control infer="reattempt-bypass-strings" class="w-full visible-if-checked" .getValue="${0}" .setValue="${0}" @mousedown="${0}" @mouseup="${0}" @keydown="${0}" @click="${0}"> </foxy-internal-editable-list-control> `),this.__getReattemptBypassStringsValue,this.__setReattemptBypassStringsValue,(e=>e.stopPropagation()),(e=>e.stopPropagation()),(e=>e.stopPropagation()),(e=>(e.preventDefault(),e.stopPropagation())));let t;const s=this.nucleon,i=null==s?void 0:s.form.reattempt_bypass_logic;return(null==s?void 0:s.form.reattempt_bypass_strings)?t=i:"reattempt_if_exists"===i?t="never_reattempt":"skip_if_exists"===i&&(t="always_reattempt"),a(l||(l=p` <vaadin-radio-group helper-text="${0}" label="${0}" class="foxy-internal-subscription-settings-form-reattempt-bypass w-full divide-y divide-contrast-10 group" theme="vertical" ?disabled="${0}" ?readonly="${0}" .value="${0}" @value-changed="${0}"> <vaadin-radio-button class="foxy-internal-subscription-settings-form-reattempt-bypass p-s w-full space-y-m transition-colors group-hover-divide-contrast-20" value="reattempt_if_exists"> <foxy-i18n infer="" key="option_reattempt_if_exists"></foxy-i18n> ${0} </vaadin-radio-button> <vaadin-radio-button class="foxy-internal-subscription-settings-form-reattempt-bypass p-s w-full space-y-m transition-colors group-hover-divide-contrast-20" value="skip_if_exists"> <foxy-i18n infer="" key="option_skip_if_exists"></foxy-i18n> ${0} </vaadin-radio-button> <vaadin-radio-button class="foxy-internal-subscription-settings-form-reattempt-bypass p-s w-full space-y-m transition-colors group-hover-divide-contrast-20" value="always_reattempt"> <foxy-i18n infer="" key="option_always_reattempt"></foxy-i18n> </vaadin-radio-button> <vaadin-radio-button class="foxy-internal-subscription-settings-form-reattempt-bypass p-s w-full space-y-m transition-colors group-hover-divide-contrast-20" value="never_reattempt"> <foxy-i18n infer="" key="option_never_reattempt"></foxy-i18n> </vaadin-radio-button> </vaadin-radio-group> `),this.helperText,this.label,this.disabled,this.readonly,t,this.__handleGroupValueChanged,e,e)}__handleGroupValueChanged(e){const t=e.currentTarget.value,s=this.nucleon;"never_reattempt"!==t&&"always_reattempt"!==t||("never_reattempt"===t?"reattempt_if_exists"!==(null==s?void 0:s.form.reattempt_bypass_logic)&&(null==s||s.edit({reattempt_bypass_logic:"reattempt_if_exists"})):"skip_if_exists"!==(null==s?void 0:s.form.reattempt_bypass_logic)&&(null==s||s.edit({reattempt_bypass_logic:"skip_if_exists"})),(null==s?void 0:s.form.reattempt_bypass_strings)&&(null==s||s.edit({reattempt_bypass_strings:""})))}}),i("vaadin-radio-group",c),i("vaadin-radio-button",_);let h,f,y=e=>e;const g=r(e,"subscription-settings-form");class b extends g{constructor(){super(...arguments),this.templates={},this.__sendEmailReceiptsForAutomatedBillingOptions=[{label:"option_checked",value:"checked"}],this.__automaticallyChargePastDueAmountOptions=[{label:"option_checked",value:"checked"}],this.__clearPastDueAmountsOnSuccessOptions=[{label:"option_checked",value:"checked"}],this.__resetNextDateOnMakeUpPaymentOptions=[{label:"option_checked",value:"checked"}],this.__pastDueAmountHandlingOptions=[{label:"option_increment",value:"increment"},{label:"option_replace",value:"replace"},{label:"option_ignore",value:"ignore"}],this.__positiveIntegerInputParams={type:"number",step:"1",min:"0"},this.__sendEmailReceiptsForAutomatedBillingGetValue=()=>this.form.send_email_receipts_for_automated_billing?["checked"]:[],this.__sendEmailReceiptsForAutomatedBillingSetValue=e=>{this.edit({send_email_receipts_for_automated_billing:e.includes("checked")})},this.__expiringSoonPaymentReminderScheduleGetValue=()=>{var e,t;return(null!==(t=null===(e=this.form.expiring_soon_payment_reminder_schedule)||void 0===e?void 0:e.split(","))&&void 0!==t?t:[]).map((e=>parseInt(e))).filter(((e,t,s)=>!isNaN(e)&&s.indexOf(e)===t)).sort(((e,t)=>t-e)).map((e=>({value:String(e),label:this.t("day",{count:e})})))},this.__expiringSoonPaymentReminderScheduleSetValue=e=>{this.edit({expiring_soon_payment_reminder_schedule:e.map((({value:e})=>e)).join()})},this.__automaticallyChargePastDueAmountGetValue=()=>this.form.automatically_charge_past_due_amount?["checked"]:[],this.__automaticallyChargePastDueAmountSetValue=e=>{const t=e.includes("checked");this.edit({automatically_charge_past_due_amount:t,clear_past_due_amounts_on_success:!t&&void 0,reset_nextdate_on_makeup_payment:!t&&void 0})},this.__clearPastDueAmountsOnSuccessGetValue=()=>this.form.clear_past_due_amounts_on_success?["checked"]:[],this.__clearPastDueAmountsOnSuccessSetValue=e=>{this.edit({clear_past_due_amounts_on_success:e.includes("checked")})},this.__resetNextDateOnMakeUpPaymentGetValue=()=>this.form.reset_nextdate_on_makeup_payment?["checked"]:[],this.__resetNextDateOnMakeUpPaymentSetValue=e=>{this.edit({reset_nextdate_on_makeup_payment:e.includes("checked")})},this.__reminderEmailScheduleGetValue=()=>{var e,t;return(null!==(t=null===(e=this.form.reminder_email_schedule)||void 0===e?void 0:e.split(","))&&void 0!==t?t:[]).map((e=>parseInt(e))).filter(((e,t,s)=>!isNaN(e)&&s.indexOf(e)===t)).sort(((e,t)=>e-t)).map((e=>({value:String(e),label:this.t("day",{count:e})})))},this.__reminderEmailScheduleSetValue=e=>{this.edit({reminder_email_schedule:e.map((({value:e})=>e)).join()})},this.__reattemptScheduleGetValue=()=>{var e,t;return(null!==(t=null===(e=this.form.reattempt_schedule)||void 0===e?void 0:e.split(","))&&void 0!==t?t:[]).map((e=>parseInt(e))).filter(((e,t,s)=>!isNaN(e)&&s.indexOf(e)===t)).sort(((e,t)=>e-t)).map((e=>({value:String(e),label:this.t("day",{count:e})})))},this.__reattemptScheduleSetValue=e=>{this.edit({reattempt_schedule:e.map((({value:e})=>e)).join()})}}static get v8n(){return[({expiring_soon_payment_reminder_schedule:e})=>!e||e.length<=100||"expiring-soon-payment-reminder-schedule:v8n_too_long",({reattempt_bypass_strings:e})=>!e||e.length<=400||"reattempt-bypass-strings:v8n_too_long",({reminder_email_schedule:e})=>!e||e.length<=100||"reminder-email-schedule:v8n_too_long",({reattempt_schedule:e})=>!e||e.length<=100||"reattempt-schedule:v8n_too_long"]}renderBody(){return a(h||(h=y` <foxy-internal-radio-group-control infer="past-due-amount-handling" theme="vertical list" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-checkbox-group-control infer="automatically-charge-past-due-amount" class="-mt-xs -mb-m" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} <foxy-internal-subscription-settings-form-reattempt-bypass infer="reattempt-bypass"> </foxy-internal-subscription-settings-form-reattempt-bypass> <foxy-internal-editable-list-control infer="reattempt-schedule" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-editable-list-control infer="reminder-email-schedule" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-editable-list-control infer="expiring-soon-payment-reminder-schedule" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-checkbox-group-control infer="send-email-receipts-for-automated-billing" class="-mt-xs -mb-m" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-integer-control suffix="${0}" infer="cancellation-schedule" min="1"> </foxy-internal-integer-control> <foxy-internal-text-control infer="modification-url"></foxy-internal-text-control> ${0} `),this.__pastDueAmountHandlingOptions,this.__automaticallyChargePastDueAmountGetValue,this.__automaticallyChargePastDueAmountSetValue,this.__automaticallyChargePastDueAmountOptions,this.form.automatically_charge_past_due_amount?"":a(f||(f=y` <foxy-internal-checkbox-group-control infer="clear-past-due-amounts-on-success" class="-mt-xs -mb-m" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-checkbox-group-control infer="reset-nextdate-on-makeup-payment" class="-mt-xs -mb-m" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> `),this.__clearPastDueAmountsOnSuccessGetValue,this.__clearPastDueAmountsOnSuccessSetValue,this.__clearPastDueAmountsOnSuccessOptions,this.__resetNextDateOnMakeUpPaymentGetValue,this.__resetNextDateOnMakeUpPaymentSetValue,this.__resetNextDateOnMakeUpPaymentOptions),this.__positiveIntegerInputParams,this.__reattemptScheduleGetValue,this.__reattemptScheduleSetValue,this.__positiveIntegerInputParams,this.__reminderEmailScheduleGetValue,this.__reminderEmailScheduleSetValue,this.__positiveIntegerInputParams,this.__expiringSoonPaymentReminderScheduleGetValue,this.__expiringSoonPaymentReminderScheduleSetValue,this.__sendEmailReceiptsForAutomatedBillingOptions,this.__sendEmailReceiptsForAutomatedBillingGetValue,this.__sendEmailReceiptsForAutomatedBillingSetValue,this.__cancellationScheduleSuffix,super.renderBody())}get __cancellationScheduleSuffix(){const e=this.form.cancellation_schedule;return e?this.t("day_suffix",{count:e}):""}}customElements.define("foxy-subscription-settings-form",b);export{b as SubscriptionSettingsForm};
|
|
1
|
+
import"./shared-fa5f0117.js";import"./shared-7bf6e728.js";import"./shared-eb232194.js";import"./shared-527abf31.js";import"./shared-897ab5e6.js";import{I as e}from"./shared-b334c8b6.js";import{I as t}from"./shared-a134d313.js";import"./shared-46f3f71c.js";import{c as s,h as a}from"./shared-7f33a83a.js";import{y as i,a as r}from"./shared-a88c5cf1.js";import"./shared-403af08d.js";import"./shared-4bd1efd7.js";import"./shared-a7475f62.js";import"./shared-0689b25a.js";import"./shared-2fa6a5a0.js";import"./shared-c97f7178.js";import"./shared-0dabe195.js";import"./shared-d3bf9ac0.js";import"./shared-4e709717.js";import"./shared-d519a301.js";import"./shared-f3b35364.js";import"./shared-11c2efc8.js";import"./shared-7680d300.js";import"./shared-13cc4ed4.js";import"./shared-91eb066c.js";import"./shared-f9180815.js";import"./shared-1fd59009.js";import"./shared-763a6797.js";import"./shared-a6517170.js";import"./shared-bbbb8894.js";import"./shared-343d1fd7.js";import"./shared-3ab0306f.js";import"./shared-8528906b.js";import"./shared-9bdd5400.js";import"./shared-8128b5e3.js";import"./shared-c758220c.js";import"./foxy-spinner.js";import"./shared-6dffe67d.js";let o,n,l,p=e=>e;let u,d,m=e=>e;const c=s(u||(u=m`:host(.foxy-internal-subscription-settings-form-reattempt-bypass) label{padding-bottom:var(--lumo-space-xs)}:host(.foxy-internal-subscription-settings-form-reattempt-bypass) [part=group-field]{display:flex;border:thin solid var(--lumo-contrast-10pct);border-radius:var(--lumo-border-radius);transition:border-color .15s ease}:host(.foxy-internal-subscription-settings-form-reattempt-bypass:not([disabled]):not([readonly]):hover) [part=group-field]{border-color:var(--lumo-contrast-20pct)}`)),_=s(d||(d=m`:host(.foxy-internal-subscription-settings-form-reattempt-bypass) label{display:flex}:host(.foxy-internal-subscription-settings-form-reattempt-bypass) [part=label]{flex:1}`));customElements.define("foxy-internal-subscription-settings-form-reattempt-bypass",class extends t{constructor(){super(...arguments),this.nucleon=null,this.__getReattemptBypassStringsValue=()=>{var e,t,s;return(null!==(s=null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.form.reattempt_bypass_strings)||void 0===t?void 0:t.split(","))&&void 0!==s?s:[]).map((e=>e.trim())).filter(((e,t,s)=>e&&s.indexOf(e)===t)).map((e=>({value:e})))},this.__setReattemptBypassStringsValue=e=>{var t,s;const a=this.renderRoot.querySelector("vaadin-radio-group"),i=null!==(t=null==a?void 0:a.value)&&void 0!==t?t:"reattempt_if_exists";null===(s=this.nucleon)||void 0===s||s.edit({reattempt_bypass_strings:e.map((({value:e})=>e)).join(),reattempt_bypass_logic:i})}}static get styles(){return[super.styles,s(o||(o=p`.visible-if-checked{display:none}[checked] .visible-if-checked{display:block}`))]}renderControl(){const e=a(n||(n=p` <foxy-internal-editable-list-control infer="reattempt-bypass-strings" class="w-full visible-if-checked" .getValue="${0}" .setValue="${0}" @mousedown="${0}" @mouseup="${0}" @keydown="${0}" @click="${0}"> </foxy-internal-editable-list-control> `),this.__getReattemptBypassStringsValue,this.__setReattemptBypassStringsValue,(e=>e.stopPropagation()),(e=>e.stopPropagation()),(e=>e.stopPropagation()),(e=>(e.preventDefault(),e.stopPropagation())));let t;const s=this.nucleon,i=null==s?void 0:s.form.reattempt_bypass_logic;return(null==s?void 0:s.form.reattempt_bypass_strings)?t=i:"reattempt_if_exists"===i?t="never_reattempt":"skip_if_exists"===i&&(t="always_reattempt"),a(l||(l=p` <vaadin-radio-group helper-text="${0}" label="${0}" class="foxy-internal-subscription-settings-form-reattempt-bypass w-full divide-y divide-contrast-10 group" theme="vertical" ?disabled="${0}" ?readonly="${0}" .value="${0}" @value-changed="${0}"> <vaadin-radio-button class="foxy-internal-subscription-settings-form-reattempt-bypass p-s w-full space-y-m transition-colors group-hover-divide-contrast-20" value="reattempt_if_exists"> <foxy-i18n infer="" key="option_reattempt_if_exists"></foxy-i18n> ${0} </vaadin-radio-button> <vaadin-radio-button class="foxy-internal-subscription-settings-form-reattempt-bypass p-s w-full space-y-m transition-colors group-hover-divide-contrast-20" value="skip_if_exists"> <foxy-i18n infer="" key="option_skip_if_exists"></foxy-i18n> ${0} </vaadin-radio-button> <vaadin-radio-button class="foxy-internal-subscription-settings-form-reattempt-bypass p-s w-full space-y-m transition-colors group-hover-divide-contrast-20" value="always_reattempt"> <foxy-i18n infer="" key="option_always_reattempt"></foxy-i18n> </vaadin-radio-button> <vaadin-radio-button class="foxy-internal-subscription-settings-form-reattempt-bypass p-s w-full space-y-m transition-colors group-hover-divide-contrast-20" value="never_reattempt"> <foxy-i18n infer="" key="option_never_reattempt"></foxy-i18n> </vaadin-radio-button> </vaadin-radio-group> `),this.helperText,this.label,this.disabled,this.readonly,t,this.__handleGroupValueChanged,e,e)}__handleGroupValueChanged(e){const t=e.currentTarget.value,s=this.nucleon;"never_reattempt"!==t&&"always_reattempt"!==t||("never_reattempt"===t?"reattempt_if_exists"!==(null==s?void 0:s.form.reattempt_bypass_logic)&&(null==s||s.edit({reattempt_bypass_logic:"reattempt_if_exists"})):"skip_if_exists"!==(null==s?void 0:s.form.reattempt_bypass_logic)&&(null==s||s.edit({reattempt_bypass_logic:"skip_if_exists"})),(null==s?void 0:s.form.reattempt_bypass_strings)&&(null==s||s.edit({reattempt_bypass_strings:""})))}}),i("vaadin-radio-group",c),i("vaadin-radio-button",_);let h,f,y=e=>e;const g=r(e,"subscription-settings-form");class b extends g{constructor(){super(...arguments),this.templates={},this.__sendEmailReceiptsForAutomatedBillingOptions=[{label:"option_checked",value:"checked"}],this.__automaticallyChargePastDueAmountOptions=[{label:"option_checked",value:"checked"}],this.__clearPastDueAmountsOnSuccessOptions=[{label:"option_checked",value:"checked"}],this.__resetNextDateOnMakeUpPaymentOptions=[{label:"option_checked",value:"checked"}],this.__pastDueAmountHandlingOptions=[{label:"option_increment",value:"increment"},{label:"option_replace",value:"replace"},{label:"option_ignore",value:"ignore"}],this.__positiveIntegerInputParams={type:"number",step:"1",min:"0"},this.__sendEmailReceiptsForAutomatedBillingGetValue=()=>this.form.send_email_receipts_for_automated_billing?["checked"]:[],this.__sendEmailReceiptsForAutomatedBillingSetValue=e=>{this.edit({send_email_receipts_for_automated_billing:e.includes("checked")})},this.__expiringSoonPaymentReminderScheduleGetValue=()=>{var e,t;return(null!==(t=null===(e=this.form.expiring_soon_payment_reminder_schedule)||void 0===e?void 0:e.split(","))&&void 0!==t?t:[]).map((e=>parseInt(e))).filter(((e,t,s)=>!isNaN(e)&&s.indexOf(e)===t)).sort(((e,t)=>t-e)).map((e=>({value:String(e),label:this.t("day",{count:e})})))},this.__expiringSoonPaymentReminderScheduleSetValue=e=>{this.edit({expiring_soon_payment_reminder_schedule:e.map((({value:e})=>e)).join()})},this.__automaticallyChargePastDueAmountGetValue=()=>this.form.automatically_charge_past_due_amount?["checked"]:[],this.__automaticallyChargePastDueAmountSetValue=e=>{const t=e.includes("checked");this.edit({automatically_charge_past_due_amount:t,clear_past_due_amounts_on_success:!t&&void 0,reset_nextdate_on_makeup_payment:!t&&void 0})},this.__clearPastDueAmountsOnSuccessGetValue=()=>this.form.clear_past_due_amounts_on_success?["checked"]:[],this.__clearPastDueAmountsOnSuccessSetValue=e=>{this.edit({clear_past_due_amounts_on_success:e.includes("checked")})},this.__resetNextDateOnMakeUpPaymentGetValue=()=>this.form.reset_nextdate_on_makeup_payment?["checked"]:[],this.__resetNextDateOnMakeUpPaymentSetValue=e=>{this.edit({reset_nextdate_on_makeup_payment:e.includes("checked")})},this.__reminderEmailScheduleGetValue=()=>{var e,t;return(null!==(t=null===(e=this.form.reminder_email_schedule)||void 0===e?void 0:e.split(","))&&void 0!==t?t:[]).map((e=>parseInt(e))).filter(((e,t,s)=>!isNaN(e)&&s.indexOf(e)===t)).sort(((e,t)=>e-t)).map((e=>({value:String(e),label:this.t("day",{count:e})})))},this.__reminderEmailScheduleSetValue=e=>{this.edit({reminder_email_schedule:e.map((({value:e})=>e)).join()})},this.__reattemptScheduleGetValue=()=>{var e,t;return(null!==(t=null===(e=this.form.reattempt_schedule)||void 0===e?void 0:e.split(","))&&void 0!==t?t:[]).map((e=>parseInt(e))).filter(((e,t,s)=>!isNaN(e)&&s.indexOf(e)===t)).sort(((e,t)=>e-t)).map((e=>({value:String(e),label:this.t("day",{count:e})})))},this.__reattemptScheduleSetValue=e=>{this.edit({reattempt_schedule:e.map((({value:e})=>e)).join()})}}static get v8n(){return[({expiring_soon_payment_reminder_schedule:e})=>!e||e.length<=100||"expiring-soon-payment-reminder-schedule:v8n_too_long",({reattempt_bypass_strings:e})=>!e||e.length<=400||"reattempt-bypass-strings:v8n_too_long",({reminder_email_schedule:e})=>!e||e.length<=100||"reminder-email-schedule:v8n_too_long",({reattempt_schedule:e})=>!e||e.length<=100||"reattempt-schedule:v8n_too_long"]}renderBody(){return a(h||(h=y` <foxy-internal-radio-group-control infer="past-due-amount-handling" theme="vertical list" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-checkbox-group-control infer="automatically-charge-past-due-amount" class="-mt-xs -mb-m" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} <foxy-internal-subscription-settings-form-reattempt-bypass infer="reattempt-bypass"> </foxy-internal-subscription-settings-form-reattempt-bypass> <foxy-internal-editable-list-control infer="reattempt-schedule" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-editable-list-control infer="reminder-email-schedule" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-editable-list-control infer="expiring-soon-payment-reminder-schedule" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-checkbox-group-control infer="send-email-receipts-for-automated-billing" class="-mt-xs -mb-m" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-integer-control suffix="${0}" infer="cancellation-schedule" min="1"> </foxy-internal-integer-control> <foxy-internal-text-control infer="modification-url"></foxy-internal-text-control> ${0} `),this.__pastDueAmountHandlingOptions,this.__automaticallyChargePastDueAmountGetValue,this.__automaticallyChargePastDueAmountSetValue,this.__automaticallyChargePastDueAmountOptions,this.form.automatically_charge_past_due_amount?"":a(f||(f=y` <foxy-internal-checkbox-group-control infer="clear-past-due-amounts-on-success" class="-mt-xs -mb-m" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-checkbox-group-control infer="reset-nextdate-on-makeup-payment" class="-mt-xs -mb-m" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> `),this.__clearPastDueAmountsOnSuccessGetValue,this.__clearPastDueAmountsOnSuccessSetValue,this.__clearPastDueAmountsOnSuccessOptions,this.__resetNextDateOnMakeUpPaymentGetValue,this.__resetNextDateOnMakeUpPaymentSetValue,this.__resetNextDateOnMakeUpPaymentOptions),this.__positiveIntegerInputParams,this.__reattemptScheduleGetValue,this.__reattemptScheduleSetValue,this.__positiveIntegerInputParams,this.__reminderEmailScheduleGetValue,this.__reminderEmailScheduleSetValue,this.__positiveIntegerInputParams,this.__expiringSoonPaymentReminderScheduleGetValue,this.__expiringSoonPaymentReminderScheduleSetValue,this.__sendEmailReceiptsForAutomatedBillingOptions,this.__sendEmailReceiptsForAutomatedBillingGetValue,this.__sendEmailReceiptsForAutomatedBillingSetValue,this.__cancellationScheduleSuffix,super.renderBody())}get __cancellationScheduleSuffix(){const e=this.form.cancellation_schedule;return e?this.t("day_suffix",{count:e}):""}}customElements.define("foxy-subscription-settings-form",b);export{b as SubscriptionSettingsForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./foxy-spinner.js";import"./shared-
|
|
1
|
+
import"./foxy-spinner.js";import"./shared-46f3f71c.js";import{S as s}from"./shared-848813a4.js";export{S as SubscriptionsTable}from"./shared-848813a4.js";import"./shared-c97f7178.js";import"./shared-a7475f62.js";import"./shared-a88c5cf1.js";import"./shared-0dabe195.js";import"./shared-7f33a83a.js";import"./shared-6dffe67d.js";import"./shared-763a6797.js";import"./shared-343d1fd7.js";import"./shared-4966b3e4.js";import"./shared-1fd59009.js";import"./shared-d3bf9ac0.js";import"./foxy-nucleon-element.js";import"./shared-a6517170.js";import"./shared-bbbb8894.js";import"./shared-3ab0306f.js";import"./shared-8528906b.js";import"./shared-4e709717.js";import"./shared-1e43b4db.js";customElements.define("foxy-subscriptions-table",s);
|
package/dist/cdn/foxy-table.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-f9180815.js";import"./foxy-spinner.js";import{T as s}from"./shared-4966b3e4.js";export{T as Table}from"./shared-4966b3e4.js";import"./shared-7f33a83a.js";import"./shared-c97f7178.js";import"./shared-a7475f62.js";import"./shared-a88c5cf1.js";import"./shared-0dabe195.js";import"./shared-6dffe67d.js";import"./shared-46f3f71c.js";import"./shared-343d1fd7.js";import"./shared-763a6797.js";import"./shared-1fd59009.js";import"./shared-d3bf9ac0.js";import"./foxy-nucleon-element.js";import"./shared-a6517170.js";import"./shared-bbbb8894.js";import"./shared-3ab0306f.js";import"./shared-8528906b.js";import"./shared-4e709717.js";customElements.define("foxy-table",s);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-79d01877.js";import{h as t}from"./shared-7f33a83a.js";import{a}from"./shared-a88c5cf1.js";import{C as r}from"./shared-1fd59009.js";import{I as e}from"./shared-421e46e9.js";import"./foxy-spinner.js";import"./shared-c97f7178.js";import"./shared-a7475f62.js";import"./shared-6dffe67d.js";import"./shared-46f3f71c.js";import"./shared-0dabe195.js";import"./shared-343d1fd7.js";import"./shared-763a6797.js";import"./shared-d3bf9ac0.js";import"./shared-a6517170.js";import"./shared-bbbb8894.js";import"./shared-3ab0306f.js";import"./shared-8528906b.js";import"./shared-4e709717.js";let s,i=t=>t;class d extends(a(r(e),"tax-card")){renderBody(){const a=this.data;return t(s||(s=i` <div class="flex justify-between gap-s"> <div data-testid="title" class="font-medium truncate flex-shrink-0"> ${0}​ </div> <div data-testid="subtitle" class="truncate text-tertiary"> ${0} • ${0} </div> </div> `),null==a?void 0:a.name,this.__typeLabel,this.__rateLabel)}get __typeLabel(){var t;const{type:a,country:r,region:e,city:s}=null!==(t=this.data)&&void 0!==t?t:{};return"global"===a?this.t("tax_global"):"union"===a?this.t("tax_union"):"country"===a?r:"region"===a?`${r}, ${e}`:"local"===a?`${r}, ${e}, ${s}`:void 0}get __rateLabel(){var t,a;if(!1===(null===(t=this.data)||void 0===t?void 0:t.is_live))return this.t("percent",{fraction:this.data.rate/100});const r=null===(a=this.data)||void 0===a?void 0:a.service_provider;return"onesource"===r?"Thomson Reuters ONESOURCE":"avalara"===r?"Avalara AvaTax 15":"taxjar"===r?"TaxJar":this.t("tax_rate_provider_default")}}customElements.define("foxy-tax-card",d);export{d as TaxCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-6dc64a17.js";import"./shared-0479553e.js";import"./foxy-spinner.js";import"./shared-77a4d8e8.js";import"./shared-fef9ecc1.js";import"./shared-e6828dbf.js";import"./shared-88e36564.js";import"./shared-e6997950.js";import{D as e}from"./shared-379b37e6.js";import{f as t,_ as i}from"./shared-307262a1.js";import{C as r}from"./shared-4c956a8e.js";import"./shared-b0f534ef.js";import"./shared-36725fe3.js";import{h as s}from"./shared-7f33a83a.js";import{T as a,S as n,a as o}from"./shared-09d4fbb8.js";import"./shared-432c5183.js";import"./shared-64f98a0f.js";import"./shared-17d0db7f.js";import"./shared-31651a9c.js";import"./shared-4674063d.js";import"./shared-479ad951.js";import{P as d}from"./shared-69a21b9d.js";import{c as l}from"./shared-4e709717.js";import{C as h}from"./shared-c7f2f1ab.js";import{N as c}from"./shared-c2d3b32b.js";import{i as _}from"./shared-d3bf9ac0.js";import{i as m}from"./shared-332f2997.js";import"./shared-c6c6ba69.js";import"./shared-59042137.js";import"./shared-4b67d699.js";import"./shared-64657919.js";import"./shared-d14c2060.js";import"./shared-bdb51db9.js";import"./shared-984fcdf5.js";import"./shared-11c2efc8.js";import"./shared-1d08a5ad.js";import"./shared-d6276c83.js";let p,u,y,g,v,f,$,b,x,S,T,E,j,k,O=e=>e;const C=["US","CA","AT","BE","BG","CY","CZ","DE","DK","EE","ES","FI","FR","GB","GR","HR","HU","IE","IM","IT","LT","LU","LV","MC","MT","NL","PL","PT","RO","SE","SI","SK"],w=[...C,"AU"],H=h(a(n(o(c,"tax-form"))));class A extends H{constructor(){var e;super(...arguments),e=this,this.templates={},this.__previousCountry=void 0,this.__countries="",this.__regions="",this.__countriesService=m(t.withConfig({services:{sendGet:async function(){const t=await new A.API(e).fetch(e.countries);if(!t.ok)throw new Error(await t.text());return await t.json()}}})),this.__regionsService=m(t.withConfig({services:{sendGet:async function(){var t;const i=new URL(e.regions);i.searchParams.set("country_code",null!==(t=e.form.country)&&void 0!==t?t:"US");const r=await new A.API(e).fetch(i.toString());if(!r.ok)throw new Error(await r.text());return await r.json()}}}))}static get scopedElements(){return{"vaadin-number-field":customElements.get("vaadin-number-field"),"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-combo-box":customElements.get("vaadin-combo-box"),"vaadin-button":customElements.get("vaadin-button"),"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"),"x-property-table":d,"x-checkbox":r,"x-dropdown":e}}static get properties(){return i(i({},super.properties),{},{countries:{type:String,noAccessor:!0},regions:{type:String,noAccessor:!0}})}static get v8n(){return[({name:e})=>!!e||"name_required",({name:e})=>!e||e.length<=30||"name_too_long",({country:e,type:t})=>"country"!==t||!!e||"country_required",({country:e,type:t})=>"region"!==t||!!e||"country_required",({country:e,use_origin_rates:t})=>!t||!!e||"country_required",({country:e})=>!e||!!e.match(/[A-Z]{2}/)||"country_invalid",({region:e,type:t})=>"region"!=t||!!e||"region_required",({region:e})=>!e||e.length<=20||"region_too_long",({city:e})=>!e||e.length<=50||"city_too_long",({city:e,type:t})=>"local"!=t||!!e||"city_required",({rate:e})=>!e||e<=100||"rate_invalid"]}get countries(){return this.__countries}set countries(e){this.__countries=e,e?this.__countriesService.send({type:"FETCH"}):this.__countriesService.send({type:"SET_DATA",data:null})}get regions(){return this.__regions}set regions(e){this.__regions=e,e?this.__regionsService.send({type:"FETCH"}):this.__regionsService.send({type:"SET_DATA",data:null})}connectedCallback(){super.connectedCallback(),this.__countriesService.onTransition((({changed:e})=>e&&this.requestUpdate())),this.__countriesService.onChange((()=>this.requestUpdate())),this.__countriesService.start(),this.__regionsService.onTransition((({changed:e})=>e&&this.requestUpdate())),this.__regionsService.onChange((()=>this.requestUpdate())),this.__regionsService.start()}render(){var e,t;return s(p||(p=O` <div class="relative space-y-m"> ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${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> `),this.__isNameHidden?null:this.__renderName(),this.__isTypeHidden?null:this.__renderType(),this.__isCountryHidden?null:this.__renderCountry(),this.__isRegionHidden?null:this.__renderRegion(),this.__isCityHidden?null:this.__renderCity(),this.__isProviderHidden?null:this.__renderProvider(),this.__isRateHidden?null:this.__renderRate(),this.__isApplyToShippingHidden?null:this.__renderApplyToShipping(),this.__isUseOriginRatesHidden?null:this.__renderUseOriginRates(),this.__isExemptAllCustomerTaxIdsHidden?null:this.__renderExemptAllCustomerTaxIds(),this.__isTimestampsHidden?null:this.__renderTimestamps(),this.__isCreateHidden?null:this.__renderCreate(),this.__isDeleteHidden?null:this.__renderDelete(),l({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":this.in("idle")}),this.in("fail")?"error":this.in("busy")?"busy":"empty",this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"")}updated(e){super.updated(e),this.form.country!==this.__previousCountry&&(this.__previousCountry=this.form.country,this.__regionsService.send({type:"FETCH"})),this.renderRoot.querySelectorAll("vaadin-combo-box").forEach((e=>e.validate()))}disconnectedCallback(){super.disconnectedCallback(),this.__countriesService.stop(),this.__regionsService.stop()}get __isNameHidden(){return this.hiddenSelector.matches("name",!0)}get __isTypeHidden(){return this.hiddenSelector.matches("type",!0)}get __isCountryHidden(){return!!this.hiddenSelector.matches("country",!0)||("union"===this.form.type?!this.form.use_origin_rates:!["country","region","local"].includes(this.form.type))}get __isRegionHidden(){return!!this.hiddenSelector.matches("region",!0)||"local"!==this.form.type&&"region"!==this.form.type}get __isCityHidden(){return!!this.hiddenSelector.matches("city",!0)||"local"!==this.form.type}get __isProviderHidden(){return!!this.hiddenSelector.matches("provider",!0)||(!this.form.type||"global"===this.form.type||"local"===this.form.type)}get __isRateHidden(){return!!this.hiddenSelector.matches("rate",!0)||(!this.form.type||!0===this.form.is_live)}get __isApplyToShippingHidden(){return!!this.hiddenSelector.matches("apply-to-shipping",!0)||(void 0===this.form.type||!!this.form.is_live&&C.includes(this.form.country))}get __isUseOriginRatesHidden(){return!!this.hiddenSelector.matches("use-origin-rates",!0)||("union"!==this.form.type||!this.form.is_live||!!this.form.service_provider)}get __isExemptAllCustomerTaxIdsHidden(){if(this.hiddenSelector.matches("exempt-all-customer-tax-ids",!0))return!0;const e=this.form.service_provider;return void 0===e||"onesource"===e||"avalara"===e}get __isTimestampsHidden(){return!!this.hiddenSelector.matches("timestamps",!0)||!this.data}get __isCreateHidden(){return!!this.hiddenSelector.matches("create",!0)||!!this.data}get __isDeleteHidden(){return!!this.hiddenSelector.matches("delete",!0)||!this.data}__getErrorMessage(e){const t=this.errors.find((t=>t.startsWith(e)));return t?this.t(t.replace(e,"v8n")).toString():""}__getValidator(e){return()=>!this.errors.some((t=>t.startsWith(e)))}__renderName(){return s(u||(u=O` <div> ${0} <vaadin-text-field data-testid="name" class="w-full" label="${0}" value="${0}" .checkValidity="${0}" .errorMessage="${0}" ?disabled="${0}" ?readonly="${0}" required @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot("name:before"),this.t("name"),_(this.form.name),this.__getValidator("name"),this.__getErrorMessage("name"),!this.in("idle")||this.disabledSelector.matches("name",!0),this.readonlySelector.matches("name",!0),this.__submitOnEnter,(e=>{const t=e.currentTarget.value;this.edit({name:t})}),this.renderTemplateOrSlot("name:after"))}__renderType(){return this.form.type||this.edit({type:"global"}),s(y||(y=O` <div> ${0} <x-dropdown data-testid="type" label="${0}" value="${0}" class="w-full" .items="${0}" .getText="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> </x-dropdown> ${0} </div> `),this.renderTemplateOrSlot("type:before"),this.t("type"),_(this.form.type),["global","union","country","region","local"],(e=>this.t(`tax_${e}`)),!this.in("idle")||this.disabledSelector.matches("type",!0),this.readonlySelector.matches("type",!0),(e=>{this.edit({type:e.detail,country:"",region:"",city:"",service_provider:"",apply_to_shipping:!1,use_origin_rates:!1,exempt_all_customer_tax_ids:!1,is_live:!1,rate:0})}),this.renderTemplateOrSlot("type:after"))}__renderCountry(){var e;const t=this.__countriesService.state.matches("busy"),i=this.in("busy"),r=t||i,a=this.in("fail"),n=this.__countriesService.state.context.data,o=Object.values(null!==(e=null==n?void 0:n.values)&&void 0!==e?e:{});return s(g||(g=O` <div> ${0} <vaadin-combo-box item-value-path="cc2" item-label-path="default" item-id-path="cc2" data-testid="country" label="${0}${0}" value="${0}" class="w-full" .checkValidity="${0}" .errorMessage="${0}" .items="${0}" ?allow-custom-value="${0}" ?disabled="${0}" ?readonly="${0}" required @change="${0}"> </vaadin-combo-box> ${0} </div> `),this.renderTemplateOrSlot("country:before"),this.t("country"),t?` • ${this.t("loading_busy")}`:"",_(t?void 0:this.form.country),this.__getValidator("country"),this.__getErrorMessage("country"),o,0===o.length,a||r||this.disabledSelector.matches("country",!0),this.readonlySelector.matches("country",!0),(e=>{this.edit({country:e.currentTarget.value,region:"",city:"",is_live:!1,service_provider:""}),this.__isApplyToShippingHidden&&this.edit({apply_to_shipping:!1}),this.__regionsService.send({type:"FETCH"})}),this.renderTemplateOrSlot("country:after"))}__renderRegion(){var e;const t=this.__regionsService.state.matches("busy"),i=this.in("busy"),r=t||i,a=this.in("fail"),n=this.__regionsService.state.context.data,o=Object.values(null!==(e=null==n?void 0:n.values)&&void 0!==e?e:{});return s(v||(v=O` <div> ${0} <vaadin-combo-box item-value-path="code" item-label-path="default" item-id-path="code" data-testid="region" label="${0}${0}" value="${0}" class="w-full" .checkValidity="${0}" .errorMessage="${0}" .items="${0}" ?allow-custom-value="${0}" ?disabled="${0}" ?readonly="${0}" required @change="${0}"> </vaadin-combo-box> ${0} </div> `),this.renderTemplateOrSlot("region:before"),this.t("region"),t?` • ${this.t("loading_busy")}`:"",_(t?void 0:this.form.region),this.__getValidator("region"),this.__getErrorMessage("region"),o,0===o.length,a||r||this.disabledSelector.matches("region",!0),this.readonlySelector.matches("region",!0),(e=>{const t=e.currentTarget.value;this.edit({region:t,city:""})}),this.renderTemplateOrSlot("region:after"))}__renderCity(){return s(f||(f=O` <div> ${0} <vaadin-text-field data-testid="city" class="w-full" label="${0}" value="${0}" .checkValidity="${0}" .errorMessage="${0}" ?disabled="${0}" ?readonly="${0}" required @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot("city:before"),this.t("city"),_(this.form.city),this.__getValidator("city"),this.__getErrorMessage("city"),!this.in("idle")||this.disabledSelector.matches("city",!0),this.readonlySelector.matches("city",!0),this.__submitOnEnter,(e=>{const t=e.currentTarget.value;this.edit({city:t})}),this.renderTemplateOrSlot("city:after"))}__renderProvider(){const e=[{label:this.t("tax_rate_provider_none"),value:"none"},{label:"Avalara AvaTax 15",value:"avalara"},{label:"Thomson Reuters ONESOURCE",value:"onesource"}];return("union"===this.form.type||C.includes(this.form.country))&&e.push({label:this.t("tax_rate_provider_default"),value:"default"}),w.includes(this.form.country)&&e.push({label:"TaxJar",value:"taxjar"}),s($||($=O` <div> ${0} <x-dropdown data-testid="provider" label="${0}" value="${0}" class="w-full" .items="${0}" .getText="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> </x-dropdown> ${0} </div> `),this.renderTemplateOrSlot("provider:before"),this.t("tax_rate_provider"),this.form.service_provider||(this.form.is_live?"default":"none"),e.map((e=>e.value)),(t=>{var i;return null===(i=e.find((e=>e.value===t)))||void 0===i?void 0:i.label}),!this.in("idle")||this.disabledSelector.matches("provider",!0),this.readonlySelector.matches("provider",!0),(e=>{const t=e.detail,i=["none","default"].includes(t)?"":t;this.edit({service_provider:i,is_live:"none"!==t}),this.__isExemptAllCustomerTaxIdsHidden&&this.edit({exempt_all_customer_tax_ids:!1}),this.__isApplyToShippingHidden&&this.edit({apply_to_shipping:!1}),this.__isUseOriginRatesHidden&&this.edit({use_origin_rates:!1})}),this.renderTemplateOrSlot("provider:after"))}__renderRate(){return s(b||(b=O` <div> ${0} <vaadin-number-field data-testid="rate" class="w-full" label="${0}" value="${0}" min="0" .checkValidity="${0}" .errorMessage="${0}" ?disabled="${0}" ?readonly="${0}" required @keydown="${0}" @change="${0}"> </vaadin-number-field> ${0} </div> `),this.renderTemplateOrSlot("rate:before"),this.t("tax_rate"),_(this.form.rate),this.__getValidator("rate"),this.__getErrorMessage("rate"),!this.in("idle")||this.disabledSelector.matches("rate",!0),this.readonlySelector.matches("rate",!0),this.__submitOnEnter,(e=>{const t=parseFloat(e.currentTarget.value);isNaN(t)||this.edit({rate:t})}),this.renderTemplateOrSlot("rate:after"))}__renderApplyToShipping(){return s(x||(x=O` <div> ${0} <x-checkbox data-testid="apply-to-shipping" class="leading-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="block text-m text-body" lang="${0}" key="tax_apply_to_shipping" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-s text-secondary" lang="${0}" key="tax_apply_to_shipping_explainer" ns="${0}"> </foxy-i18n> </x-checkbox> ${0} </div> `),this.renderTemplateOrSlot("apply-to-shipping:before"),!this.in("idle")||this.disabledSelector.matches("apply-to-shipping",!0),this.readonlySelector.matches("apply-to-shipping",!0),!!this.form.apply_to_shipping,(e=>this.edit({apply_to_shipping:e.detail})),this.lang,this.ns,this.lang,this.ns,this.renderTemplateOrSlot("apply-to-shipping:after"))}__renderUseOriginRates(){return s(S||(S=O` <div> ${0} <x-checkbox data-testid="use-origin-rates" class="leading-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="block text-m text-body" lang="${0}" key="tax_use_origin_rates" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-s text-secondary" lang="${0}" key="tax_use_origin_rates_explainer" ns="${0}"> </foxy-i18n> </x-checkbox> ${0} </div> `),this.renderTemplateOrSlot("use-origin-rates:before"),!this.in("idle")||this.disabledSelector.matches("use-origin-rates",!0),this.readonlySelector.matches("use-origin-rates",!0),!!this.form.use_origin_rates,(e=>this.edit({use_origin_rates:e.detail})),this.lang,this.ns,this.lang,this.ns,this.renderTemplateOrSlot("use-origin-rates:after"))}__renderExemptAllCustomerTaxIds(){const e="exempt-all-customer-tax-ids";return s(T||(T=O` <div> ${0} <x-checkbox data-testid="${0}" class="leading-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="block text-m text-body" lang="${0}" key="tax_exempt_all_customer_tax_ids" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-s text-secondary" lang="${0}" key="tax_exempt_all_customer_tax_ids_explainer" ns="${0}"> </foxy-i18n> </x-checkbox> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),e,!this.in("idle")||this.disabledSelector.matches(e,!0),this.readonlySelector.matches(e,!0),!!this.form.exempt_all_customer_tax_ids,(e=>{this.edit({exempt_all_customer_tax_ids:e.detail})}),this.lang,this.ns,this.lang,this.ns,this.renderTemplateOrSlot(`${e}:after`))}__renderTimestamps(){return s(E||(E=O` <div> ${0} <x-property-table data-testid="timestamps" .items="${0}"> </x-property-table> ${0} </div> `),this.renderTemplateOrSlot("timestamps: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("timestamps:after"))}__renderCreate(){const e=this.in({idle:{template:{clean:"invalid"}}}),t=this.in({idle:{template:{dirty:"invalid"}}}),i=this.in({idle:{snapshot:{clean:"invalid"}}}),r=this.in({idle:{snapshot:{dirty:"invalid"}}}),a=e||t||(i||r),n=this.in("idle");return s(j||(j=O` <div> ${0} <vaadin-button data-testid="create" class="w-full" theme="primary success" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="create" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("create:before"),!n||a||this.disabledSelector.matches("create",!0),this.submit,this.ns,this.lang,this.renderTemplateOrSlot("create:after"))}__renderDelete(){return s(k||(k=O` <div> <foxy-internal-confirm-dialog data-testid="confirm" message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" lang="${0}" ns="${0}" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> ${0} <vaadin-button data-testid="delete" theme="error" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="delete" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.lang,this.ns,(e=>!e.detail.cancelled&&this.delete()),this.renderTemplateOrSlot("delete:before"),!this.in("idle")||this.disabledSelector.matches("delete",!0),(e=>{this.renderRoot.querySelector("#confirm").show(e.currentTarget)}),this.ns,this.lang,this.renderTemplateOrSlot("delete:after"))}__submitOnEnter(e){"Enter"===e.key&&this.submit()}}customElements.define("foxy-tax-form",A);export{A as TaxForm};
|
|
1
|
+
import"./shared-8128b5e3.js";import"./shared-f9180815.js";import"./foxy-spinner.js";import"./shared-46f3f71c.js";import"./shared-7680d300.js";import"./shared-0689b25a.js";import"./shared-c541c9e9.js";import"./shared-9bdd5400.js";import{D as e}from"./shared-19c9fe00.js";import{e as t,_ as i}from"./shared-0dabe195.js";import{C as r}from"./shared-72a13fda.js";import"./shared-619bcf83.js";import"./shared-c758220c.js";import{h as s}from"./shared-7f33a83a.js";import{T as a,S as n,a as o}from"./shared-a88c5cf1.js";import"./shared-13cc4ed4.js";import"./shared-db06114b.js";import"./shared-4bd1efd7.js";import"./shared-2fa6a5a0.js";import"./shared-c97f7178.js";import"./shared-a96a2154.js";import{P as d}from"./shared-7d4e0011.js";import{c as l}from"./shared-4e709717.js";import{C as h}from"./shared-1fd59009.js";import{N as c}from"./shared-a6517170.js";import{i as _}from"./shared-d3bf9ac0.js";import{i as m}from"./shared-8528906b.js";import"./shared-6dffe67d.js";import"./shared-a7475f62.js";import"./shared-763a6797.js";import"./shared-343d1fd7.js";import"./shared-6b0498b2.js";import"./shared-f4822b9e.js";import"./shared-8134d8a7.js";import"./shared-11c2efc8.js";import"./shared-bbbb8894.js";import"./shared-3ab0306f.js";let p,u,y,g,v,f,$,b,x,S,T,E,j,k,O=e=>e;const C=["US","CA","AT","BE","BG","CY","CZ","DE","DK","EE","ES","FI","FR","GB","GR","HR","HU","IE","IM","IT","LT","LU","LV","MC","MT","NL","PL","PT","RO","SE","SI","SK"],w=[...C,"AU"],H=h(a(n(o(c,"tax-form"))));class A extends H{constructor(){var e;super(...arguments),e=this,this.templates={},this.__previousCountry=void 0,this.__countries="",this.__regions="",this.__countriesService=m(t.withConfig({services:{sendGet:async function(){const t=await new A.API(e).fetch(e.countries);if(!t.ok)throw new Error(await t.text());return await t.json()}}})),this.__regionsService=m(t.withConfig({services:{sendGet:async function(){var t;const i=new URL(e.regions);i.searchParams.set("country_code",null!==(t=e.form.country)&&void 0!==t?t:"US");const r=await new A.API(e).fetch(i.toString());if(!r.ok)throw new Error(await r.text());return await r.json()}}}))}static get scopedElements(){return{"vaadin-number-field":customElements.get("vaadin-number-field"),"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-combo-box":customElements.get("vaadin-combo-box"),"vaadin-button":customElements.get("vaadin-button"),"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"),"x-property-table":d,"x-checkbox":r,"x-dropdown":e}}static get properties(){return i(i({},super.properties),{},{countries:{type:String,noAccessor:!0},regions:{type:String,noAccessor:!0}})}static get v8n(){return[({name:e})=>!!e||"name_required",({name:e})=>!e||e.length<=30||"name_too_long",({country:e,type:t})=>"country"!==t||!!e||"country_required",({country:e,type:t})=>"region"!==t||!!e||"country_required",({country:e,use_origin_rates:t})=>!t||!!e||"country_required",({country:e})=>!e||!!e.match(/[A-Z]{2}/)||"country_invalid",({region:e,type:t})=>"region"!=t||!!e||"region_required",({region:e})=>!e||e.length<=20||"region_too_long",({city:e})=>!e||e.length<=50||"city_too_long",({city:e,type:t})=>"local"!=t||!!e||"city_required",({rate:e})=>!e||e<=100||"rate_invalid"]}get countries(){return this.__countries}set countries(e){this.__countries=e,e?this.__countriesService.send({type:"FETCH"}):this.__countriesService.send({type:"SET_DATA",data:null})}get regions(){return this.__regions}set regions(e){this.__regions=e,e?this.__regionsService.send({type:"FETCH"}):this.__regionsService.send({type:"SET_DATA",data:null})}connectedCallback(){super.connectedCallback(),this.__countriesService.onTransition((({changed:e})=>e&&this.requestUpdate())),this.__countriesService.onChange((()=>this.requestUpdate())),this.__countriesService.start(),this.__regionsService.onTransition((({changed:e})=>e&&this.requestUpdate())),this.__regionsService.onChange((()=>this.requestUpdate())),this.__regionsService.start()}render(){var e,t;return s(p||(p=O` <div class="relative space-y-m"> ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${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> `),this.__isNameHidden?null:this.__renderName(),this.__isTypeHidden?null:this.__renderType(),this.__isCountryHidden?null:this.__renderCountry(),this.__isRegionHidden?null:this.__renderRegion(),this.__isCityHidden?null:this.__renderCity(),this.__isProviderHidden?null:this.__renderProvider(),this.__isRateHidden?null:this.__renderRate(),this.__isApplyToShippingHidden?null:this.__renderApplyToShipping(),this.__isUseOriginRatesHidden?null:this.__renderUseOriginRates(),this.__isExemptAllCustomerTaxIdsHidden?null:this.__renderExemptAllCustomerTaxIds(),this.__isTimestampsHidden?null:this.__renderTimestamps(),this.__isCreateHidden?null:this.__renderCreate(),this.__isDeleteHidden?null:this.__renderDelete(),l({"transition duration-500 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":this.in("idle")}),this.in("fail")?"error":this.in("busy")?"busy":"empty",this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"")}updated(e){super.updated(e),this.form.country!==this.__previousCountry&&(this.__previousCountry=this.form.country,this.__regionsService.send({type:"FETCH"})),this.renderRoot.querySelectorAll("vaadin-combo-box").forEach((e=>e.validate()))}disconnectedCallback(){super.disconnectedCallback(),this.__countriesService.stop(),this.__regionsService.stop()}get __isNameHidden(){return this.hiddenSelector.matches("name",!0)}get __isTypeHidden(){return this.hiddenSelector.matches("type",!0)}get __isCountryHidden(){return!!this.hiddenSelector.matches("country",!0)||("union"===this.form.type?!this.form.use_origin_rates:!["country","region","local"].includes(this.form.type))}get __isRegionHidden(){return!!this.hiddenSelector.matches("region",!0)||"local"!==this.form.type&&"region"!==this.form.type}get __isCityHidden(){return!!this.hiddenSelector.matches("city",!0)||"local"!==this.form.type}get __isProviderHidden(){return!!this.hiddenSelector.matches("provider",!0)||(!this.form.type||"global"===this.form.type||"local"===this.form.type)}get __isRateHidden(){return!!this.hiddenSelector.matches("rate",!0)||(!this.form.type||!0===this.form.is_live)}get __isApplyToShippingHidden(){return!!this.hiddenSelector.matches("apply-to-shipping",!0)||(void 0===this.form.type||!!this.form.is_live&&C.includes(this.form.country))}get __isUseOriginRatesHidden(){return!!this.hiddenSelector.matches("use-origin-rates",!0)||("union"!==this.form.type||!this.form.is_live||!!this.form.service_provider)}get __isExemptAllCustomerTaxIdsHidden(){if(this.hiddenSelector.matches("exempt-all-customer-tax-ids",!0))return!0;const e=this.form.service_provider;return void 0===e||"onesource"===e||"avalara"===e}get __isTimestampsHidden(){return!!this.hiddenSelector.matches("timestamps",!0)||!this.data}get __isCreateHidden(){return!!this.hiddenSelector.matches("create",!0)||!!this.data}get __isDeleteHidden(){return!!this.hiddenSelector.matches("delete",!0)||!this.data}__getErrorMessage(e){const t=this.errors.find((t=>t.startsWith(e)));return t?this.t(t.replace(e,"v8n")).toString():""}__getValidator(e){return()=>!this.errors.some((t=>t.startsWith(e)))}__renderName(){return s(u||(u=O` <div> ${0} <vaadin-text-field data-testid="name" class="w-full" label="${0}" value="${0}" .checkValidity="${0}" .errorMessage="${0}" ?disabled="${0}" ?readonly="${0}" required @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot("name:before"),this.t("name"),_(this.form.name),this.__getValidator("name"),this.__getErrorMessage("name"),!this.in("idle")||this.disabledSelector.matches("name",!0),this.readonlySelector.matches("name",!0),this.__submitOnEnter,(e=>{const t=e.currentTarget.value;this.edit({name:t})}),this.renderTemplateOrSlot("name:after"))}__renderType(){return this.form.type||this.edit({type:"global"}),s(y||(y=O` <div> ${0} <x-dropdown data-testid="type" label="${0}" value="${0}" class="w-full" .items="${0}" .getText="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> </x-dropdown> ${0} </div> `),this.renderTemplateOrSlot("type:before"),this.t("type"),_(this.form.type),["global","union","country","region","local"],(e=>this.t(`tax_${e}`)),!this.in("idle")||this.disabledSelector.matches("type",!0),this.readonlySelector.matches("type",!0),(e=>{this.edit({type:e.detail,country:"",region:"",city:"",service_provider:"",apply_to_shipping:!1,use_origin_rates:!1,exempt_all_customer_tax_ids:!1,is_live:!1,rate:0})}),this.renderTemplateOrSlot("type:after"))}__renderCountry(){var e;const t=this.__countriesService.state.matches("busy"),i=this.in("busy"),r=t||i,a=this.in("fail"),n=this.__countriesService.state.context.data,o=Object.values(null!==(e=null==n?void 0:n.values)&&void 0!==e?e:{});return s(g||(g=O` <div> ${0} <vaadin-combo-box item-value-path="cc2" item-label-path="default" item-id-path="cc2" data-testid="country" label="${0}${0}" value="${0}" class="w-full" .checkValidity="${0}" .errorMessage="${0}" .items="${0}" ?allow-custom-value="${0}" ?disabled="${0}" ?readonly="${0}" required @change="${0}"> </vaadin-combo-box> ${0} </div> `),this.renderTemplateOrSlot("country:before"),this.t("country"),t?` • ${this.t("loading_busy")}`:"",_(t?void 0:this.form.country),this.__getValidator("country"),this.__getErrorMessage("country"),o,0===o.length,a||r||this.disabledSelector.matches("country",!0),this.readonlySelector.matches("country",!0),(e=>{this.edit({country:e.currentTarget.value,region:"",city:"",is_live:!1,service_provider:""}),this.__isApplyToShippingHidden&&this.edit({apply_to_shipping:!1}),this.__regionsService.send({type:"FETCH"})}),this.renderTemplateOrSlot("country:after"))}__renderRegion(){var e;const t=this.__regionsService.state.matches("busy"),i=this.in("busy"),r=t||i,a=this.in("fail"),n=this.__regionsService.state.context.data,o=Object.values(null!==(e=null==n?void 0:n.values)&&void 0!==e?e:{});return s(v||(v=O` <div> ${0} <vaadin-combo-box item-value-path="code" item-label-path="default" item-id-path="code" data-testid="region" label="${0}${0}" value="${0}" class="w-full" .checkValidity="${0}" .errorMessage="${0}" .items="${0}" ?allow-custom-value="${0}" ?disabled="${0}" ?readonly="${0}" required @change="${0}"> </vaadin-combo-box> ${0} </div> `),this.renderTemplateOrSlot("region:before"),this.t("region"),t?` • ${this.t("loading_busy")}`:"",_(t?void 0:this.form.region),this.__getValidator("region"),this.__getErrorMessage("region"),o,0===o.length,a||r||this.disabledSelector.matches("region",!0),this.readonlySelector.matches("region",!0),(e=>{const t=e.currentTarget.value;this.edit({region:t,city:""})}),this.renderTemplateOrSlot("region:after"))}__renderCity(){return s(f||(f=O` <div> ${0} <vaadin-text-field data-testid="city" class="w-full" label="${0}" value="${0}" .checkValidity="${0}" .errorMessage="${0}" ?disabled="${0}" ?readonly="${0}" required @keydown="${0}" @input="${0}"> </vaadin-text-field> ${0} </div> `),this.renderTemplateOrSlot("city:before"),this.t("city"),_(this.form.city),this.__getValidator("city"),this.__getErrorMessage("city"),!this.in("idle")||this.disabledSelector.matches("city",!0),this.readonlySelector.matches("city",!0),this.__submitOnEnter,(e=>{const t=e.currentTarget.value;this.edit({city:t})}),this.renderTemplateOrSlot("city:after"))}__renderProvider(){const e=[{label:this.t("tax_rate_provider_none"),value:"none"},{label:"Avalara AvaTax 15",value:"avalara"},{label:"Thomson Reuters ONESOURCE",value:"onesource"}];return("union"===this.form.type||C.includes(this.form.country))&&e.push({label:this.t("tax_rate_provider_default"),value:"default"}),w.includes(this.form.country)&&e.push({label:"TaxJar",value:"taxjar"}),s($||($=O` <div> ${0} <x-dropdown data-testid="provider" label="${0}" value="${0}" class="w-full" .items="${0}" .getText="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> </x-dropdown> ${0} </div> `),this.renderTemplateOrSlot("provider:before"),this.t("tax_rate_provider"),this.form.service_provider||(this.form.is_live?"default":"none"),e.map((e=>e.value)),(t=>{var i;return null===(i=e.find((e=>e.value===t)))||void 0===i?void 0:i.label}),!this.in("idle")||this.disabledSelector.matches("provider",!0),this.readonlySelector.matches("provider",!0),(e=>{const t=e.detail,i=["none","default"].includes(t)?"":t;this.edit({service_provider:i,is_live:"none"!==t}),this.__isExemptAllCustomerTaxIdsHidden&&this.edit({exempt_all_customer_tax_ids:!1}),this.__isApplyToShippingHidden&&this.edit({apply_to_shipping:!1}),this.__isUseOriginRatesHidden&&this.edit({use_origin_rates:!1})}),this.renderTemplateOrSlot("provider:after"))}__renderRate(){return s(b||(b=O` <div> ${0} <vaadin-number-field data-testid="rate" class="w-full" label="${0}" value="${0}" min="0" .checkValidity="${0}" .errorMessage="${0}" ?disabled="${0}" ?readonly="${0}" required @keydown="${0}" @change="${0}"> </vaadin-number-field> ${0} </div> `),this.renderTemplateOrSlot("rate:before"),this.t("tax_rate"),_(this.form.rate),this.__getValidator("rate"),this.__getErrorMessage("rate"),!this.in("idle")||this.disabledSelector.matches("rate",!0),this.readonlySelector.matches("rate",!0),this.__submitOnEnter,(e=>{const t=parseFloat(e.currentTarget.value);isNaN(t)||this.edit({rate:t})}),this.renderTemplateOrSlot("rate:after"))}__renderApplyToShipping(){return s(x||(x=O` <div> ${0} <x-checkbox data-testid="apply-to-shipping" class="leading-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="block text-m text-body" lang="${0}" key="tax_apply_to_shipping" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-s text-secondary" lang="${0}" key="tax_apply_to_shipping_explainer" ns="${0}"> </foxy-i18n> </x-checkbox> ${0} </div> `),this.renderTemplateOrSlot("apply-to-shipping:before"),!this.in("idle")||this.disabledSelector.matches("apply-to-shipping",!0),this.readonlySelector.matches("apply-to-shipping",!0),!!this.form.apply_to_shipping,(e=>this.edit({apply_to_shipping:e.detail})),this.lang,this.ns,this.lang,this.ns,this.renderTemplateOrSlot("apply-to-shipping:after"))}__renderUseOriginRates(){return s(S||(S=O` <div> ${0} <x-checkbox data-testid="use-origin-rates" class="leading-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="block text-m text-body" lang="${0}" key="tax_use_origin_rates" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-s text-secondary" lang="${0}" key="tax_use_origin_rates_explainer" ns="${0}"> </foxy-i18n> </x-checkbox> ${0} </div> `),this.renderTemplateOrSlot("use-origin-rates:before"),!this.in("idle")||this.disabledSelector.matches("use-origin-rates",!0),this.readonlySelector.matches("use-origin-rates",!0),!!this.form.use_origin_rates,(e=>this.edit({use_origin_rates:e.detail})),this.lang,this.ns,this.lang,this.ns,this.renderTemplateOrSlot("use-origin-rates:after"))}__renderExemptAllCustomerTaxIds(){const e="exempt-all-customer-tax-ids";return s(T||(T=O` <div> ${0} <x-checkbox data-testid="${0}" class="leading-s" ?disabled="${0}" ?readonly="${0}" ?checked="${0}" @change="${0}"> <foxy-i18n class="block text-m text-body" lang="${0}" key="tax_exempt_all_customer_tax_ids" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-s text-secondary" lang="${0}" key="tax_exempt_all_customer_tax_ids_explainer" ns="${0}"> </foxy-i18n> </x-checkbox> ${0} </div> `),this.renderTemplateOrSlot(`${e}:before`),e,!this.in("idle")||this.disabledSelector.matches(e,!0),this.readonlySelector.matches(e,!0),!!this.form.exempt_all_customer_tax_ids,(e=>{this.edit({exempt_all_customer_tax_ids:e.detail})}),this.lang,this.ns,this.lang,this.ns,this.renderTemplateOrSlot(`${e}:after`))}__renderTimestamps(){return s(E||(E=O` <div> ${0} <x-property-table data-testid="timestamps" .items="${0}"> </x-property-table> ${0} </div> `),this.renderTemplateOrSlot("timestamps: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("timestamps:after"))}__renderCreate(){const e=this.in({idle:{template:{clean:"invalid"}}}),t=this.in({idle:{template:{dirty:"invalid"}}}),i=this.in({idle:{snapshot:{clean:"invalid"}}}),r=this.in({idle:{snapshot:{dirty:"invalid"}}}),a=e||t||(i||r),n=this.in("idle");return s(j||(j=O` <div> ${0} <vaadin-button data-testid="create" class="w-full" theme="primary success" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="create" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("create:before"),!n||a||this.disabledSelector.matches("create",!0),this.submit,this.ns,this.lang,this.renderTemplateOrSlot("create:after"))}__renderDelete(){return s(k||(k=O` <div> <foxy-internal-confirm-dialog data-testid="confirm" message="delete_prompt" confirm="delete" cancel="cancel" header="delete" theme="primary error" lang="${0}" ns="${0}" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> ${0} <vaadin-button data-testid="delete" theme="error" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="delete" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.lang,this.ns,(e=>!e.detail.cancelled&&this.delete()),this.renderTemplateOrSlot("delete:before"),!this.in("idle")||this.disabledSelector.matches("delete",!0),(e=>{this.renderRoot.querySelector("#confirm").show(e.currentTarget)}),this.ns,this.lang,this.renderTemplateOrSlot("delete:after"))}__submitOnEnter(e){"Enter"===e.key&&this.submit()}}customElements.define("foxy-tax-form",A);export{A as TaxForm};
|