@foxy.io/elements 1.21.0-beta.2 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- 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-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 +1 -1
- package/dist/cdn/foxy-customer.js +6 -6
- 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-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-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-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 +1 -1
- package/dist/cdn/foxy-reports-table.js +5 -5
- package/dist/cdn/foxy-shipment-card.js +1 -1
- package/dist/cdn/foxy-shipping-method-card.js +1 -1
- package/dist/cdn/foxy-sign-in-form.js +1 -1
- package/dist/cdn/foxy-spinner.js +1 -1
- package/dist/cdn/foxy-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 +7 -7
- 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-11438c42.js +1 -0
- package/dist/cdn/{shared-868065de.js → shared-1433fc29.js} +1 -1
- package/dist/cdn/{shared-a37abe4c.js → shared-242b3ee9.js} +1 -1
- package/dist/cdn/{shared-988ec916.js → shared-274c49b0.js} +1 -1
- package/dist/cdn/{shared-ea67b3f3.js → shared-38b37888.js} +1 -1
- package/dist/cdn/{shared-8dd0af4d.js → shared-3d241b7f.js} +1 -1
- package/dist/cdn/{shared-d518bd55.js → shared-3dbe9aaa.js} +1 -1
- package/dist/cdn/{shared-de036570.js → shared-454f172e.js} +1 -1
- package/dist/cdn/shared-45926e43.js +1 -0
- package/dist/cdn/{shared-839dd3a8.js → shared-531bb690.js} +1 -1
- package/dist/cdn/{shared-d61b3e4f.js → shared-5c804971.js} +1 -1
- package/dist/cdn/{shared-4393ad93.js → shared-61e74612.js} +1 -1
- package/dist/cdn/{shared-486d7bb5.js → shared-62d636b5.js} +1 -1
- package/dist/cdn/{shared-43bcce74.js → shared-67546e10.js} +1 -1
- package/dist/cdn/{shared-bb0e33c3.js → shared-6f5c3101.js} +1 -1
- package/dist/cdn/{shared-0821cfdc.js → shared-7097364f.js} +1 -1
- package/dist/cdn/{shared-2add595d.js → shared-747b6d74.js} +1 -1
- package/dist/cdn/{shared-8b6addec.js → shared-758859b5.js} +1 -1
- package/dist/cdn/{shared-af226a9a.js → shared-81f9dc9a.js} +1 -1
- package/dist/cdn/{shared-6581241a.js → shared-8c11a711.js} +1 -1
- package/dist/cdn/{shared-80fc2b6a.js → shared-8f8abcd6.js} +1 -1
- package/dist/cdn/shared-94fc438b.js +1 -0
- package/dist/cdn/{shared-a85afa33.js → shared-955db6b4.js} +1 -1
- package/dist/cdn/{shared-62a54a6c.js → shared-9f905d9f.js} +1 -1
- package/dist/cdn/{shared-39c10b22.js → shared-a01b5597.js} +1 -1
- package/dist/cdn/shared-a29b600a.js +1 -0
- package/dist/cdn/{shared-b40cf0dd.js → shared-a2d619b4.js} +1 -1
- package/dist/cdn/{shared-63139d9e.js → shared-a5364194.js} +1 -1
- package/dist/cdn/{shared-1c94a156.js → shared-be99323d.js} +1 -1
- package/dist/cdn/{shared-c774d080.js → shared-c6a01446.js} +1 -1
- package/dist/cdn/{shared-c95c17e6.js → shared-c8f5c306.js} +1 -1
- package/dist/cdn/{shared-a41234b4.js → shared-ca87cf22.js} +1 -1
- package/dist/cdn/{shared-4979dca4.js → shared-cbdf08d8.js} +1 -1
- package/dist/cdn/{shared-f80f402a.js → shared-d3bf404a.js} +1 -1
- package/dist/cdn/{shared-744cf66b.js → shared-d807ae5c.js} +1 -1
- package/dist/cdn/shared-dc91f7ae.js +1 -0
- package/dist/cdn/{shared-76b3d76a.js → shared-dcdb6ea1.js} +1 -1
- package/dist/cdn/{shared-9bdacf65.js → shared-e262920d.js} +1 -1
- package/dist/cdn/{shared-2f7dcefa.js → shared-e3ab56d1.js} +1 -1
- package/dist/cdn/{shared-cba08e1c.js → shared-ee5a7812.js} +1 -1
- package/dist/cdn/shared-efa137cd.js +1 -0
- package/dist/cdn/{shared-71f2ef1f.js → shared-efc1aeae.js} +1 -1
- package/dist/cdn/{shared-101d1234.js → shared-f621ccee.js} +1 -1
- package/dist/cdn/translations/cart-form/en.json +4 -4
- package/dist/elements/internal/InternalAsyncDetailsControl/InternalAsyncDetailsControl.js +13 -7
- package/dist/elements/internal/InternalAsyncDetailsControl/InternalAsyncDetailsControl.js.map +1 -1
- package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.d.ts +2 -2
- package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.js +33 -33
- package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.js.map +1 -1
- package/dist/elements/internal/InternalAsyncListControl/index.d.ts +0 -2
- package/dist/elements/internal/InternalAsyncListControl/index.js +0 -2
- package/dist/elements/internal/InternalAsyncListControl/index.js.map +1 -1
- package/dist/elements/internal/InternalCalendar/InternalCalendar.js +2 -2
- package/dist/elements/internal/InternalCalendar/InternalCalendar.js.map +1 -1
- package/dist/elements/public/AdminSubscriptionCard/AdminSubscriptionCard.js +2 -7
- package/dist/elements/public/AdminSubscriptionCard/AdminSubscriptionCard.js.map +1 -1
- package/dist/elements/public/AppliedCouponCodeForm/types.d.ts +1 -3
- package/dist/elements/public/AppliedCouponCodeForm/types.js.map +1 -1
- package/dist/elements/public/CartCard/CartCard.js +2 -7
- package/dist/elements/public/CartCard/CartCard.js.map +1 -1
- package/dist/elements/public/CartForm/CartForm.js +1 -3
- package/dist/elements/public/CartForm/CartForm.js.map +1 -1
- package/dist/elements/public/CollectionPage/CollectionPage.d.ts +2 -2
- package/dist/elements/public/CollectionPage/CollectionPage.js +6 -5
- package/dist/elements/public/CollectionPage/CollectionPage.js.map +1 -1
- package/dist/elements/public/CouponForm/CouponForm.js +5 -1
- package/dist/elements/public/CouponForm/CouponForm.js.map +1 -1
- package/dist/elements/public/Customer/Customer.js +2 -2
- package/dist/elements/public/Customer/Customer.js.map +1 -1
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalSubscriptions.js +0 -1
- package/dist/elements/public/CustomerPortal/InternalCustomerPortalSubscriptions.js.map +1 -1
- package/dist/elements/public/ItemCard/ItemCard.js +2 -7
- package/dist/elements/public/ItemCard/ItemCard.js.map +1 -1
- package/dist/elements/public/ItemForm/ItemForm.js +6 -23
- package/dist/elements/public/ItemForm/ItemForm.js.map +1 -1
- package/dist/elements/public/ItemOptionCard/ItemOptionCard.d.ts +3 -0
- package/dist/elements/public/ItemOptionCard/ItemOptionCard.js +31 -27
- package/dist/elements/public/ItemOptionCard/ItemOptionCard.js.map +1 -1
- package/dist/elements/public/ItemOptionCard/index.d.ts +0 -2
- package/dist/elements/public/ItemOptionCard/index.js +0 -2
- package/dist/elements/public/ItemOptionCard/index.js.map +1 -1
- package/dist/elements/public/NucleonElement/NucleonElement.js +4 -4
- package/dist/elements/public/NucleonElement/NucleonElement.js.map +1 -1
- package/dist/elements/public/QueryBuilder/components/RangeValue.js +6 -6
- package/dist/elements/public/QueryBuilder/components/RangeValue.js.map +1 -1
- package/dist/elements/public/StoreShippingMethodForm/StoreShippingMethodForm.d.ts +2 -1
- package/dist/elements/public/StoreShippingMethodForm/StoreShippingMethodForm.js.map +1 -1
- package/dist/elements/public/SubscriptionForm/SubscriptionForm.js +2 -7
- package/dist/elements/public/SubscriptionForm/SubscriptionForm.js.map +1 -1
- package/dist/elements/public/SubscriptionForm/types.d.ts +1 -1
- package/dist/elements/public/SubscriptionForm/types.js.map +1 -1
- package/dist/elements/public/SubscriptionSettingsForm/internal/InternalSubscriptionSettingsFormReattemptBypass/globalStyles.js.map +1 -1
- package/dist/elements/public/SubscriptionsTable/SubscriptionsTable.d.ts +2 -2
- package/dist/elements/public/SubscriptionsTable/SubscriptionsTable.js +2 -2
- package/dist/elements/public/SubscriptionsTable/SubscriptionsTable.js.map +1 -1
- package/dist/elements/public/SubscriptionsTable/types.d.ts +2 -2
- package/dist/elements/public/SubscriptionsTable/types.js.map +1 -1
- package/dist/elements/public/TaxCard/TaxCard.js +6 -2
- package/dist/elements/public/TaxCard/TaxCard.js.map +1 -1
- package/package.json +6 -5
- package/dist/cdn/shared-09eb558f.js +0 -1
- package/dist/cdn/shared-1000b848.js +0 -1
- package/dist/cdn/shared-181f51bd.js +0 -1
- package/dist/cdn/shared-21679ebd.js +0 -1
- package/dist/cdn/shared-a0c8faf2.js +0 -1
- package/dist/cdn/shared-bcc6e13b.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{P as t,h as e}from"./shared-0ce006b9.js";import{E as i,T as s}from"./shared-be66c2e7.js";import"./shared-62c088b7.js";import"./shared-5a4829e3.js";import{y as a,S as n,R as o,a as r}from"./shared-2cc638ad.js";import{c as l,h as d}from"./shared-7f33a83a.js";import"./shared-6cb1015f.js";import"./shared-bc814810.js";import"./shared-2092d86f.js";import{I as c}from"./shared-
|
|
1
|
+
import{P as t,h as e}from"./shared-0ce006b9.js";import{E as i,T as s}from"./shared-be66c2e7.js";import"./shared-62c088b7.js";import"./shared-5a4829e3.js";import{y as a,S as n,R as o,a as r}from"./shared-2cc638ad.js";import{c as l,h as d}from"./shared-7f33a83a.js";import"./shared-6cb1015f.js";import"./shared-bc814810.js";import"./shared-2092d86f.js";import{I as c}from"./shared-8c11a711.js";import"./shared-a29b600a.js";import"./shared-3dbe9aaa.js";import"./foxy-cancellation-form.js";import"./shared-0479553e.js";import"./foxy-transaction-card.js";import"./foxy-nucleon-element.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-form-dialog.js";import"./foxy-item-card.js";import"./shared-7097364f.js";import{_ as u}from"./shared-a8ced8bf.js";import{C as h}from"./shared-be99323d.js";import"./shared-9f905d9f.js";import{S as m}from"./shared-f621ccee.js";import"./shared-bd252323.js";import"./shared-08156595.js";import"./shared-7d4fb1a2.js";import"./shared-4849ef5b.js";import{G as f}from"./shared-d8dc97f0.js";import"./shared-5ea18e60.js";import{B as p}from"./shared-dcdb6ea1.js";import{p as _}from"./shared-5c804971.js";import{s as y}from"./shared-bc7f58ef.js";import{i as v}from"./shared-d3bf9ac0.js";import{p as b}from"./shared-38b37888.js";import{j as g}from"./shared-75e78c70.js";import"./shared-08e27fe9.js";import"./shared-e262920d.js";import"./shared-67546e10.js";import"./shared-4f037e43.js";import"./shared-dc91f7ae.js";import"./shared-955db6b4.js";import"./shared-d6276c83.js";import"./shared-e3ab56d1.js";import"./shared-3d241b7f.js";import"./foxy-spinner.js";import"./shared-4e709717.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-a01b5597.js";import"./shared-f7e4cd67.js";import"./shared-ed0dee03.js";import"./shared-404aa9cc.js";import"./shared-5378bd8c.js";import"./shared-94fc438b.js";import"./shared-62d636b5.js";a("vcf-tooltip",l`
|
|
2
2
|
:host {
|
|
3
3
|
/* Sizing */
|
|
4
4
|
--lumo-tooltip-size: var(--lumo-size-m);
|
|
@@ -92,7 +92,7 @@ import{P as t,h as e}from"./shared-0ce006b9.js";import{E as i,T as s}from"./shar
|
|
|
92
92
|
<iron-icon icon="lumo:cross"></iron-icon>
|
|
93
93
|
</vaadin-button>
|
|
94
94
|
</div>
|
|
95
|
-
`}static get is(){return"vcf-tooltip"}static get version(){return"1.3.15"}static get properties(){return{for:{type:String},position:{type:String,value:"top"},align:{type:String,value:"center"},hidden:{type:Boolean,value:!0,notify:!0,reflectToAttribute:!0,observer:"_hiddenChanged"},manual:{type:Boolean,value:!1,reflectToAttribute:!0},targetElement:{type:Object,observer:"_attachToTarget"},closeButton:{type:Boolean,value:!1,reflectToAttribute:!0},theme:{type:String,reflectToAttribute:!0}}}static get observers(){return["_setPosition(targetElement, hidden, position, align)","_updateTarget(for)","_manualObserver(manual)"]}constructor(){super(),this._boundShow=this.show.bind(this),this._boundHide=this.hide.bind(this),this._boundOnKeyup=this._onKeyup.bind(this)}connectedCallback(){super.connectedCallback(),this._attachToTarget(),this._setDefaultId()}ready(){super.ready(),window.addEventListener("resize",(()=>{clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout((()=>{const{targetElement:t,hidden:e,position:i}=this;this.hidden||this._setPosition(t,e,i)}),100)})),this.getAttribute("theme")||this.setAttribute("theme","dark")}disconnectedCallback(){super.disconnectedCallback(),this._detachFromTarget()}_manualObserver(){this.manual?this._removeEvents():this._addEvents()}_attachToTarget(t,e){e&&(this._removeTargetEvents(e),e.describedby&&(e.removeAttribute("aria-describedby"),delete e.describedby)),t&&(this._addEvents(),t.getAttribute("aria-describedby")||(t.setAttribute("aria-describedby",this.id),t.describedby=!0))}_addEvents(){this.targetElement&&!this.manual&&(this.targetElement.addEventListener("mouseenter",this._boundShow),this.targetElement.addEventListener("focus",this._boundShow),this.targetElement.addEventListener("mouseleave",this._boundHide),this.targetElement.addEventListener("blur",this._boundHide),this.targetElement.addEventListener("tap",this._boundHide)),this.manual||(this.addEventListener("mouseenter",this._boundShow),this.addEventListener("mouseleave",this._boundHide))}_detachFromTarget(){this.manual||this._removeEvents(),this.targetElement&&this.targetElement.describedby&&(this.targetElement.removeAttribute("aria-describedby"),delete this.targetElement.describedby)}_removeEvents(){this.targetElement&&this._removeTargetEvents(this.targetElement),this.removeEventListener("mouseenter",this._boundShow),this.removeEventListener("mouseleave",this._boundHide)}_removeTargetEvents(t){t.removeEventListener("mouseenter",this._boundShow),t.removeEventListener("focus",this._boundShow),t.removeEventListener("mouseleave",this._boundHide),t.removeEventListener("blur",this._boundHide),t.removeEventListener("tap",this._boundHide)}_updateTarget(){this.targetElement=this.parentNode.querySelector(`#${this.for}`)}_setPosition(t,e,i){if(t&&!e){let t=window.innerHeight,e=window.innerWidth;this.offsetParent&&(t=this.offsetParent.scrollHeight,e=this.offsetParent.scrollWidth);const s=this.targetElement.getBoundingClientRect(),a=this.getBoundingClientRect(),n=(s.width-a.width)/2,o=(s.height-a.height)/2;let r,l,d=s.left,c=s.top,u=window.pageYOffset;switch(this._parentPostioned&&(c=this.targetElement.offsetTop,d=this.targetElement.offsetLeft,u=0),i){case"top":l=c-a.height+u,r=this._calculateLeft(d,s,a,n);break;case"bottom":l=c+s.height+u,r=this._calculateLeft(d,s,a,n);break;case"left":r=d-a.width,l=this._calculateTop(c,s,a,o,u);break;case"right":r=d+s.width,l=this._calculateTop(c,s,a,o,u)}this._setPositionInVisibleBounds(t,e,r,l,a)}}get _parentPostioned(){return"static"!==window.getComputedStyle(this.offsetParent).position}_setPositionInVisibleBounds(t,e,i,s,a){i+a.width>e?(this.style.right="0px",this.style.left="auto"):(this.style.left=Math.max(0,i)+"px",this.style.right="auto"),s+a.height>t?(this.style.bottom=t+"px",this.style.top="auto"):(this.style.top=Math.max(0,s)+"px",this.style.bottom="auto")}_calculateLeft(t,e,i,s){switch(this.align){case"left":return t;case"right":return e.left+e.width-i.width;default:return t+s}}_calculateTop(t,e,i,s,a){switch(this.align){case"top":return t+a;case"bottom":return t+e.height-i.height+a;default:return t+s+a}}show(){this.hidden=!1}hide(){this.hidden=!0}_hiddenChanged(t){t?(this.setAttribute("aria-hidden",!0),window.removeEventListener("keyup",this._boundOnKeyup)):(this.setAttribute("aria-hidden",!1),window.addEventListener("keyup",this._boundOnKeyup))}_onKeyup(t){27===t.keyCode&&this.hide()}_setDefaultId(){this.id||(Vaadin.tooltipIndex||(Vaadin.tooltipIndex=0),this.id="vcf-tooltip"+ ++Vaadin.tooltipIndex)}}function $(t){return function*(t){const e=[];for(const i of t.settings.subscriptions.allowFrequencyModification)if(g(i.jsonataQuery).evaluate(t.subscription))for(const t of i.values)!e.includes(t)&&(e.push(t),yield t)}({settings:{subscriptions:{allowFrequencyModification:t.settings.subscriptions.allow_frequency_modification.map((t=>({jsonataQuery:t.jsonata_query,values:t.values})))}},subscription:t.subscription})}customElements.define(x.is,x),window.Vaadin.VcfTooltip=x;class w extends Error{constructor(t){super(`Invalid frequency "${t}".`)}}function S(t){const e=864e5,i=31*e;if(".5m"===t)return i/2;const s=parseInt(t.substring(0,t.length-1));if(isNaN(s))throw new w(t);if(t.endsWith("y"))return 31536e6*s;if(t.endsWith("m"))return s*i;if(t.endsWith("w"))return 6048e5*s;if(t.endsWith("d"))return s*e;throw new w(t)}function T(t,e){if("boolean"==typeof e)return e;const i=e.filter((e=>Boolean(g(e.jsonataQuery).evaluate(t)))).reduce(((t,e)=>{var i,s,a,n,o;if(e.min){const i=t.min?S(t.min):1/0;S(e.min)<i&&(t.min=e.min)}if(e.max){const i=t.max?S(t.max):-1/0;S(e.max)>i&&(t.max=e.max)}if("day"===(null===(i=e.allowedDays)||void 0===i?void 0:i.type)){const i=[...null!==(s=t.allowedDaysOfWeek)&&void 0!==s?s:[],...e.allowedDays.days];t.allowedDaysOfWeek=Array.from(new Set(i))}if("month"===(null===(a=e.allowedDays)||void 0===a?void 0:a.type)){const i=[...null!==(n=t.allowedDaysOfMonth)&&void 0!==n?n:[],...e.allowedDays.days];t.allowedDaysOfMonth=Array.from(new Set(i))}if(e.disallowedDates){const i=[...null!==(o=t.disallowedDates)&&void 0!==o?o:[],...e.disallowedDates];t.disallowedDates=Array.from(new Set(i))}return t}),{});return 0!==Object.keys(i).length&&i}function j(t){const[e,i,s]=t.split("-").map((t=>parseInt(t)));return new Date(e,i-1,s)}function E(t){const e=t.settings.subscriptions.allow_next_date_modification;let i;return i="boolean"==typeof e?e:e.map((t=>({allowedDays:t.allowed_days,disallowedDates:t.disallowed_dates,jsonataQuery:t.jsonata_query,max:t.max,min:t.min}))),function(t){var e,i;const s=j(t.value),a=s.getTime(),n=T(t.subscription,t.settings.subscriptions.allowNextDateModification);if("boolean"==typeof n)return n;if(!1===(null===(e=n.allowedDaysOfMonth)||void 0===e?void 0:e.includes(s.getDate())))return!1;if(!1===(null===(i=n.allowedDaysOfWeek)||void 0===i?void 0:i.includes(s.getDay())))return!1;if(n.disallowedDates&&n.disallowedDates.find((t=>{const[e,i]=t.split("..").map((t=>j(t).getTime()));return a===e||void 0!==i&&a>=e&&a<=i})))return!1;if(n.min){const t=b(n.min);if(null!==t&&Date.now()+t>=a)return!1}if(n.max){const t=b(n.max);if(null!==t&&Date.now()+t<=a)return!1}return!0}({settings:{subscriptions:{allowNextDateModification:i}},subscription:t.subscription,value:t.value})}let D,q,k,L,H,I,A,O,C,z,P,N,F,R,V,B,M,U=t=>t;const W=n(o(r(c,"subscription-form")));class K extends W{constructor(){super(...arguments),this.getTransactionPageHref=(t,e)=>null==e?void 0:e._links["fx:receipt"].href,this.customerAddresses=null,this.itemCategories=null,this.localeCodes=null,this.templates={},this.settings=null,this.coupons=null,this.__transactionTemplateLoaderId="transactionTemplateLoader",this.__defaultTemplateSetLoaderId="defaultTemplateSetLoader",this.__localeCodesHelperLoaderId="localeCodesLoader",this.__templateSetLoaderId="templateSetLoader",this.__storeLoaderId="storeLoader",this.__renderHeaderSubtitle=()=>{var t;const{data:e,lang:i,ns:s}=this;if(e){let a,n,o="text-secondary";if(e.first_failed_transaction_date)o="text-error",a=e.first_failed_transaction_date,n="subscription_failed";else if(e.end_date){a=e.end_date;n=new Date(a).getTime()>Date.now()?"subscription_will_be_cancelled":"subscription_cancelled"}else a=null!==(t=e.next_transaction_date)&&void 0!==t?t:(new Date).toISOString(),n="subscription_"+(e.is_active?"active":"inactive");const r=d(D||(D=U` <foxy-i18n data-testid="header-subtitle" options="${0}" class="${0}" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> `),JSON.stringify({date:a}),o,i,n,s);return e.first_failed_transaction_date?d(q||(q=U` <span id="status" class="flex items-center space-x-xs ${0}"> ${0}<iron-icon icon="icons:info-outline" class="icon-inline"></iron-icon> </span> <vcf-tooltip for="status" position="bottom"> <span class="text-s">${0}</span> </vcf-tooltip> `),o,r,e.error_message):r}return d(k||(k=U`<x-skeleton class="w-full" variant="static"> </x-skeleton>`))},this.__renderHeaderTitle=(t,e)=>{const{data:i,lang:s,ns:a}=this;if(i){const n=_(i.frequency),o=this.__transactionTemplate,r=null==o?void 0:o.total_order;return"string"!=typeof t?d(L||(L=U`--`)):d(H||(H=U` <foxy-i18n data-testid="header-title" options="${0}" lang="${0}" key="price_${0}" ns="${0}"> </foxy-i18n> `),JSON.stringify(u(u({},n),{},{amount:`${r} ${t}`,currencyDisplay:e})),s,".5m"===i.frequency?"twice_a_month":"recurring",a)}return d(I||(I=U`<x-skeleton class="w-full" variant="static"> </x-skeleton>`))},this.__renderHeader=(t,e)=>d(A||(A=U` <div data-testid="header" class="sm-col-span-2"> ${0} <div class="leading-xs text-xxl font-bold truncate"> ${0} </div> <div class="leading-xs text-l">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("header:before"),this.__renderHeaderTitle(t,e),this.__renderHeaderSubtitle(),this.renderTemplateOrSlot("header:after")),this.__renderItemsActions=()=>d(O||(O=U` <div class="flex" data-testid="items:actions"> ${0} <foxy-i18n data-testid="items:actions-label" class="flex-1 text-s font-medium text-secondary" lang="${0}" key="item_plural" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("items:actions:before"),this.lang,this.ns,this.renderTemplateOrSlot("items:actions:after")),this.__renderItems=()=>{var t;let e;try{const i=this.__transactionTemplate,s=new URL(null!==(t=null==i?void 0:i._links["fx:items"].href)&&void 0!==t?t:"");s.searchParams.set("zoom","item_options"),e=s.toString()}catch(t){e=void 0}return d(C||(C=U` <div data-testid="items" class="space-y-xs sm-col-span-2"> ${0} <foxy-internal-async-list-control first="${0}" limit="5" infer="items" item="foxy-item-card"> </foxy-internal-async-list-control> </div> `),this.hiddenSelector.matches("items:actions",!0)?"":this.__renderItemsActions(),v(e))},this.__renderEndDate=()=>{const{disabledSelector:t,lang:e,ns:i}=this,s=this.hiddenSelector.zoom("end-date:form").toString();return d(z||(z=U` <div class="sm-col-span-2"> ${0} <foxy-form-dialog readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="save-button ${0}" data-testid="cancellation-form" parent="${0}" header="end_subscription" alert form="foxy-cancellation-form" href="${0}" lang="${0}" id="end-date-form" ns="${0}" .templates="${0}"> </foxy-form-dialog> <vaadin-button data-testid="end-date" theme="error" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n key="end_subscription" ns="${0}" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("end-date:before"),this.readonlySelector.zoom("end-date:form").toString(),t.zoom("end-date:form").toString(),s,this.parent,this.href,e,i,this.getNestedTemplates("end-date:form"),!this.data||t.matches("end-date",!0),(t=>{this.renderRoot.querySelector("#end-date-form").show(t.currentTarget)}),i,e,this.renderTemplateOrSlot("end-date:after"))},this.__checkNextTransactionDateAvailability=t=>{const{settings:e,data:i}=this;if(e&&i){return E({value:y(t),settings:e,subscription:i})}return t.getTime()>=Date.now()},this.__checkStartDateAvailability=t=>t.getTime()>=Date.now(),this.__renderStartDate=()=>{const{data:t,lang:e,ns:i}=this;return d(P||(P=U` <div data-testid="start-date"> ${0} <x-group frame> <foxy-i18n key="start_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("start-date:before"),i,e,v(null==t?void 0:t.start_date.substr(0,10)),v(null==t?void 0:t.start_date),e,!this.__isStartDateEditable,this.disabledSelector.matches("start-date",!0),this.__checkStartDateAvailability,(t=>{const e=t.target;this.edit({start_date:e.value})}),this.renderTemplateOrSlot("start-date:after"))},this.__renderNextTransactionDate=()=>{const{data:t,lang:e,ns:i}=this,s=!!(null==t?void 0:t.is_active);return d(N||(N=U` <div data-testid="next-transaction-date"> ${0} <x-group frame> <foxy-i18n key="next_transaction_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("next-transaction-date:before"),i,e,v(null==t?void 0:t.next_transaction_date.substr(0,10)),v(null==t?void 0:t.next_transaction_date),e,!s||this.readonlySelector.matches("next-transaction-date",!0),!t||this.disabledSelector.matches("next-transaction-date",!0),this.__checkNextTransactionDateAvailability,(t=>{const e=t.target;this.edit({next_transaction_date:e.value})}),this.renderTemplateOrSlot("next-transaction-date:after"))},this.__renderFrequencyAsDropdown=()=>{const{data:t}=this,e=!!(null==t?void 0:t.is_active),i=this.__frequencies.map((t=>({label:this.t(".5m"===t?"twice_a_month":"frequency",_(t)),value:t})));return d(F||(F=U` <vaadin-combo-box item-value-path="value" item-label-path="label" data-testid="frequency" ?disabled="${0}" ?readonly="${0}" class="w-full" label="${0}" value="${0}" .items="${0}" @change="${0}"> </vaadin-combo-box> `),!t||this.disabledSelector.matches("frequency",!0),t&&(!e||this.readonlySelector.matches("frequency",!0)),this.t("frequency_label").toString(),v(this.form.frequency),i,(t=>{this.edit({frequency:t.target.value})}))},this.__renderFrequencyAsRadioList=()=>{var t;const{data:e,lang:i,ns:s}=this;return d(R||(R=U` <x-group frame> <foxy-i18n key="frequency_label" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <x-choice default-custom-value="1d" data-testid="frequency" type="frequency" ns="${0}" ?custom="${0}" .items="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} </x-choice> </x-group> `),s,i,s,null===this.settings,this.__frequencies,null!==(t=this.form.frequency)&&void 0!==t?t:null,!e||this.disabledSelector.matches("frequency",!0),e&&(!e.is_active||this.readonlySelector.matches("frequency",!0)),(t=>{this.edit({frequency:t.target.value})}),this.__frequencies.map((t=>d(V||(V=U` <foxy-i18n options="${0}" slot="${0}-label" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> `),JSON.stringify(_(t)),t,i,".5m"===t?"twice_a_month":"frequency",s))))},this.__renderFrequency=()=>d(B||(B=U` <div class="sm-col-span-2"> ${0} ${0} ${0} </div> `),this.renderTemplateOrSlot("frequency:before"),this.settings&&this.__frequencies.length>4?this.__renderFrequencyAsDropdown():this.__renderFrequencyAsRadioList(),this.renderTemplateOrSlot("frequency:after"))}static get scopedElements(){return{"foxy-internal-timestamps-control":customElements.get("foxy-internal-timestamps-control"),"foxy-internal-async-list-control":customElements.get("foxy-internal-async-list-control"),"foxy-internal-number-control":customElements.get("foxy-internal-number-control"),"foxy-internal-calendar":customElements.get("foxy-internal-calendar"),"foxy-collection-pages":customElements.get("foxy-collection-pages"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"vaadin-combo-box":customElements.get("vaadin-combo-box"),"foxy-form-dialog":customElements.get("foxy-form-dialog"),"vaadin-button":customElements.get("vaadin-button"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-nucleon":customElements.get("foxy-nucleon"),"vcf-tooltip":customElements.get("vcf-tooltip"),"foxy-table":customElements.get("foxy-table"),"foxy-i18n":customElements.get("foxy-i18n"),"iron-icon":customElements.get("iron-icon"),"x-skeleton":m,"x-choice":h,"x-group":f}}static get properties(){return u(u({},super.properties),{},{getTransactionPageHref:{attribute:!1},customerAddresses:{attribute:"customer-addresses"},itemCategories:{attribute:"item-categories"},localeCodes:{attribute:"locale-codes"},settings:{type:Object},coupons:{}})}get hiddenSelector(){return new p(`items:pagination:card:autorenew-icon ${super.hiddenSelector}`)}renderBody(){var t,e,i,s,a,n,o,r;let l;try{const i=new URL(null!==(e=null===(t=this.data)||void 0===t?void 0:t._links["fx:transactions"].href)&&void 0!==e?e:"");i.searchParams.set("order","transaction_date desc"),i.searchParams.set("zoom","items"),l=i.toString()}catch(t){l=void 0}const c=(null===(i=this.__store)||void 0===i?void 0:i.use_international_currency_symbol)?"code":"symbol",u=this.__transactionTemplate;let h=null;if(u&&"currency_code"in u)h=u.currency_code;else{const t=this.__localeCodesHelper,e=null===(a=null!==(s=this.__templateSet)&&void 0!==s?s:this.__defaultTemplateSet)||void 0===a?void 0:a.locale_code,i=e?null==t?void 0:t.values[e]:void 0;i&&(h=null!==(o=null===(n=/Currency: ([A-Z]{3})/g.exec(i))||void 0===n?void 0:n[1])&&void 0!==o?o:null)}return d(M||(M=U` <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <div class="relative grid grid-cols-1 sm-grid-cols-2 gap-l"> ${0} ${0} ${0} ${0} ${0} <foxy-internal-number-control suffix="${0}" infer="past-due-amount" class="sm-col-span-2" min="0"> </foxy-internal-number-control> <foxy-internal-async-list-control first="${0}" class="sm-col-span-2" infer="attributes" limit="5" form="foxy-attribute-form" item="foxy-attribute-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control first="${0}" class="sm-col-span-2" infer="transactions" limit="5" item="foxy-transaction-card" hide-delete-button .getPageHref="${0}"> </foxy-internal-async-list-control> <foxy-internal-timestamps-control infer="timestamps" class="sm-col-span-2"> </foxy-internal-timestamps-control> ${0} </div> `),v(this.__transactionTemplateHref),this.__transactionTemplateLoaderId,(()=>this.requestUpdate()),v(this.__defaultTemplateSetHref),this.__defaultTemplateSetLoaderId,(()=>this.requestUpdate()),v(this.__localeCodesHelperHref),this.__localeCodesHelperLoaderId,(()=>this.requestUpdate()),v(this.__templateSetHref),this.__templateSetLoaderId,(()=>this.requestUpdate()),v(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.hiddenSelector.matches("header",!0)?"":this.__renderHeader(null!=h?h:void 0,c),this.hiddenSelector.matches("items",!0)?"":this.__renderItems(),this.__isFrequencyVisible?this.__renderFrequency():"",this.__isStartDateVisible?this.__renderStartDate():"",this.__isNextTransactionDateVisible?this.__renderNextTransactionDate():"",v(null!=h?h:void 0),v(null===(r=this.data)||void 0===r?void 0:r._links["fx:attributes"].href),v(l),this.getTransactionPageHref,this.hiddenSelector.matches("end-date",!0)?"":this.__renderEndDate())}get __transactionTemplateHref(){var t;return null===(t=this.data)||void 0===t?void 0:t._links["fx:transaction_template"].href}get __defaultTemplateSetHref(){var t,e,i;if(""===(null===(t=this.__transactionTemplate)||void 0===t?void 0:t.template_set_uri))try{const t=new URL(null!==(i=null===(e=this.__store)||void 0===e?void 0:e._links["fx:template_sets"].href)&&void 0!==i?i:"");return t.searchParams.set("code","DEFAULT"),t.toString()}catch(t){}}get __localeCodesHelperHref(){var t;if(this.__defaultTemplateSetHref||this.__templateSetHref)return null!==(t=this.localeCodes)&&void 0!==t?t:void 0}get __templateSetHref(){const t=this.__transactionTemplate;if(!(null==t?void 0:t.currency_code))return(null==t?void 0:t.template_set_uri)||void 0}get __storeHref(){var t,e;return null===(e=null===(t=this.data)||void 0===t?void 0:t._links["fx:store"])||void 0===e?void 0:e.href}get __transactionTemplate(){var t,e;const i=`#${this.__transactionTemplateLoaderId}`;return null!==(e=null===(t=this.renderRoot.querySelector(i))||void 0===t?void 0:t.data)&&void 0!==e?e:null}get __defaultTemplateSet(){var t,e;const i=`#${this.__defaultTemplateSetLoaderId}`,s=this.renderRoot.querySelector(i);return null!==(e=null===(t=null==s?void 0:s.data)||void 0===t?void 0:t._embedded["fx:template_sets"][0])&&void 0!==e?e:null}get __localeCodesHelper(){var t,e;const i=`#${this.__localeCodesHelperLoaderId}`;return null!==(e=null===(t=this.renderRoot.querySelector(i))||void 0===t?void 0:t.data)&&void 0!==e?e:null}get __templateSet(){var t,e;const i=`#${this.__templateSetLoaderId}`;return null!==(e=null===(t=this.renderRoot.querySelector(i))||void 0===t?void 0:t.data)&&void 0!==e?e:null}get __store(){var t,e;const i=`#${this.__storeLoaderId}`;return null!==(e=null===(t=this.renderRoot.querySelector(i))||void 0===t?void 0:t.data)&&void 0!==e?e:null}get __isNextTransactionDateVisible(){if(this.hiddenSelector.matches("next-transaction-date",!0))return!1;if(null===this.data)return!1;if(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())return!1;if(!1===this.data.is_active)return!1;if(null===this.settings)return!0;const t=this.settings.subscriptions.allow_next_date_modification;return!!function(t,e){let i;return i="boolean"==typeof e?e:e.map((t=>({allowedDays:t.allowed_days,disallowedDates:t.disallowed_dates,jsonataQuery:t.jsonata_query,max:t.max,min:t.min}))),T(t,i)}(this.data,t)}get __isStartDateVisible(){return!this.hiddenSelector.matches("start-date",!0)&&this.__isNextTransactionDateVisible}get __isStartDateEditable(){return!this.readonlySelector.matches("start-date",!0)&&(null!==this.data&&(!(this.data.end_date&&new Date(this.data.end_date)<=new Date)&&(!1!==this.data.is_active&&(!(this.data.start_date&&new Date(this.data.start_date)<=new Date)&&null===this.settings))))}get __isFrequencyVisible(){if(this.hiddenSelector.matches("frequency",!0))return!1;if(null===this.data)return!1;if(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())return!1;if(!1===this.data.is_active)return!1;if(null===this.settings)return!0;return!$({subscription:this.data,settings:this.settings}).next().done}get __frequencies(){if(!this.settings||!this.data)return[".5m","1m","1y"];const t=$({subscription:this.data,settings:this.settings});return Array.from(t)}}let Q;a("vcf-tooltip",l(Q||(Q=(t=>t)`
|
|
95
|
+
`}static get is(){return"vcf-tooltip"}static get version(){return"1.3.15"}static get properties(){return{for:{type:String},position:{type:String,value:"top"},align:{type:String,value:"center"},hidden:{type:Boolean,value:!0,notify:!0,reflectToAttribute:!0,observer:"_hiddenChanged"},manual:{type:Boolean,value:!1,reflectToAttribute:!0},targetElement:{type:Object,observer:"_attachToTarget"},closeButton:{type:Boolean,value:!1,reflectToAttribute:!0},theme:{type:String,reflectToAttribute:!0}}}static get observers(){return["_setPosition(targetElement, hidden, position, align)","_updateTarget(for)","_manualObserver(manual)"]}constructor(){super(),this._boundShow=this.show.bind(this),this._boundHide=this.hide.bind(this),this._boundOnKeyup=this._onKeyup.bind(this)}connectedCallback(){super.connectedCallback(),this._attachToTarget(),this._setDefaultId()}ready(){super.ready(),window.addEventListener("resize",(()=>{clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout((()=>{const{targetElement:t,hidden:e,position:i}=this;this.hidden||this._setPosition(t,e,i)}),100)})),this.getAttribute("theme")||this.setAttribute("theme","dark")}disconnectedCallback(){super.disconnectedCallback(),this._detachFromTarget()}_manualObserver(){this.manual?this._removeEvents():this._addEvents()}_attachToTarget(t,e){e&&(this._removeTargetEvents(e),e.describedby&&(e.removeAttribute("aria-describedby"),delete e.describedby)),t&&(this._addEvents(),t.getAttribute("aria-describedby")||(t.setAttribute("aria-describedby",this.id),t.describedby=!0))}_addEvents(){this.targetElement&&!this.manual&&(this.targetElement.addEventListener("mouseenter",this._boundShow),this.targetElement.addEventListener("focus",this._boundShow),this.targetElement.addEventListener("mouseleave",this._boundHide),this.targetElement.addEventListener("blur",this._boundHide),this.targetElement.addEventListener("tap",this._boundHide)),this.manual||(this.addEventListener("mouseenter",this._boundShow),this.addEventListener("mouseleave",this._boundHide))}_detachFromTarget(){this.manual||this._removeEvents(),this.targetElement&&this.targetElement.describedby&&(this.targetElement.removeAttribute("aria-describedby"),delete this.targetElement.describedby)}_removeEvents(){this.targetElement&&this._removeTargetEvents(this.targetElement),this.removeEventListener("mouseenter",this._boundShow),this.removeEventListener("mouseleave",this._boundHide)}_removeTargetEvents(t){t.removeEventListener("mouseenter",this._boundShow),t.removeEventListener("focus",this._boundShow),t.removeEventListener("mouseleave",this._boundHide),t.removeEventListener("blur",this._boundHide),t.removeEventListener("tap",this._boundHide)}_updateTarget(){this.targetElement=this.parentNode.querySelector(`#${this.for}`)}_setPosition(t,e,i){if(t&&!e){let t=window.innerHeight,e=window.innerWidth;this.offsetParent&&(t=this.offsetParent.scrollHeight,e=this.offsetParent.scrollWidth);const s=this.targetElement.getBoundingClientRect(),a=this.getBoundingClientRect(),n=(s.width-a.width)/2,o=(s.height-a.height)/2;let r,l,d=s.left,c=s.top,u=window.pageYOffset;switch(this._parentPostioned&&(c=this.targetElement.offsetTop,d=this.targetElement.offsetLeft,u=0),i){case"top":l=c-a.height+u,r=this._calculateLeft(d,s,a,n);break;case"bottom":l=c+s.height+u,r=this._calculateLeft(d,s,a,n);break;case"left":r=d-a.width,l=this._calculateTop(c,s,a,o,u);break;case"right":r=d+s.width,l=this._calculateTop(c,s,a,o,u)}this._setPositionInVisibleBounds(t,e,r,l,a)}}get _parentPostioned(){return"static"!==window.getComputedStyle(this.offsetParent).position}_setPositionInVisibleBounds(t,e,i,s,a){i+a.width>e?(this.style.right="0px",this.style.left="auto"):(this.style.left=Math.max(0,i)+"px",this.style.right="auto"),s+a.height>t?(this.style.bottom=t+"px",this.style.top="auto"):(this.style.top=Math.max(0,s)+"px",this.style.bottom="auto")}_calculateLeft(t,e,i,s){switch(this.align){case"left":return t;case"right":return e.left+e.width-i.width;default:return t+s}}_calculateTop(t,e,i,s,a){switch(this.align){case"top":return t+a;case"bottom":return t+e.height-i.height+a;default:return t+s+a}}show(){this.hidden=!1}hide(){this.hidden=!0}_hiddenChanged(t){t?(this.setAttribute("aria-hidden",!0),window.removeEventListener("keyup",this._boundOnKeyup)):(this.setAttribute("aria-hidden",!1),window.addEventListener("keyup",this._boundOnKeyup))}_onKeyup(t){27===t.keyCode&&this.hide()}_setDefaultId(){this.id||(Vaadin.tooltipIndex||(Vaadin.tooltipIndex=0),this.id="vcf-tooltip"+ ++Vaadin.tooltipIndex)}}function $(t){return function*(t){const e=[];for(const i of t.settings.subscriptions.allowFrequencyModification)if(g(i.jsonataQuery).evaluate(t.subscription))for(const t of i.values)!e.includes(t)&&(e.push(t),yield t)}({settings:{subscriptions:{allowFrequencyModification:t.settings.subscriptions.allow_frequency_modification.map((t=>({jsonataQuery:t.jsonata_query,values:t.values})))}},subscription:t.subscription})}customElements.define(x.is,x),window.Vaadin.VcfTooltip=x;class w extends Error{constructor(t){super(`Invalid frequency "${t}".`)}}function S(t){const e=864e5,i=31*e;if(".5m"===t)return i/2;const s=parseInt(t.substring(0,t.length-1));if(isNaN(s))throw new w(t);if(t.endsWith("y"))return 31536e6*s;if(t.endsWith("m"))return s*i;if(t.endsWith("w"))return 6048e5*s;if(t.endsWith("d"))return s*e;throw new w(t)}function T(t,e){if("boolean"==typeof e)return e;const i=e.filter((e=>Boolean(g(e.jsonataQuery).evaluate(t)))).reduce(((t,e)=>{var i,s,a,n,o;if(e.min){const i=t.min?S(t.min):1/0;S(e.min)<i&&(t.min=e.min)}if(e.max){const i=t.max?S(t.max):-1/0;S(e.max)>i&&(t.max=e.max)}if("day"===(null===(i=e.allowedDays)||void 0===i?void 0:i.type)){const i=[...null!==(s=t.allowedDaysOfWeek)&&void 0!==s?s:[],...e.allowedDays.days];t.allowedDaysOfWeek=Array.from(new Set(i))}if("month"===(null===(a=e.allowedDays)||void 0===a?void 0:a.type)){const i=[...null!==(n=t.allowedDaysOfMonth)&&void 0!==n?n:[],...e.allowedDays.days];t.allowedDaysOfMonth=Array.from(new Set(i))}if(e.disallowedDates){const i=[...null!==(o=t.disallowedDates)&&void 0!==o?o:[],...e.disallowedDates];t.disallowedDates=Array.from(new Set(i))}return t}),{});return 0!==Object.keys(i).length&&i}function j(t){const[e,i,s]=t.split("-").map((t=>parseInt(t)));return new Date(e,i-1,s)}function E(t){const e=t.settings.subscriptions.allow_next_date_modification;let i;return i="boolean"==typeof e?e:e.map((t=>({allowedDays:t.allowed_days,disallowedDates:t.disallowed_dates,jsonataQuery:t.jsonata_query,max:t.max,min:t.min}))),function(t){var e,i;const s=j(t.value),a=s.getTime(),n=T(t.subscription,t.settings.subscriptions.allowNextDateModification);if("boolean"==typeof n)return n;if(!1===(null===(e=n.allowedDaysOfMonth)||void 0===e?void 0:e.includes(s.getDate())))return!1;if(!1===(null===(i=n.allowedDaysOfWeek)||void 0===i?void 0:i.includes(s.getDay())))return!1;if(n.disallowedDates&&n.disallowedDates.find((t=>{const[e,i]=t.split("..").map((t=>j(t).getTime()));return a===e||void 0!==i&&a>=e&&a<=i})))return!1;if(n.min){const t=b(n.min);if(null!==t&&Date.now()+t>=a)return!1}if(n.max){const t=b(n.max);if(null!==t&&Date.now()+t<=a)return!1}return!0}({settings:{subscriptions:{allowNextDateModification:i}},subscription:t.subscription,value:t.value})}let D,q,k,L,H,I,A,O,C,z,P,N,F,R,V,B,M,U=t=>t;const W=n(o(r(c,"subscription-form")));class K extends W{constructor(){super(...arguments),this.getTransactionPageHref=(t,e)=>null==e?void 0:e._links["fx:receipt"].href,this.customerAddresses=null,this.itemCategories=null,this.localeCodes=null,this.templates={},this.settings=null,this.coupons=null,this.__transactionTemplateLoaderId="transactionTemplateLoader",this.__defaultTemplateSetLoaderId="defaultTemplateSetLoader",this.__localeCodesHelperLoaderId="localeCodesLoader",this.__templateSetLoaderId="templateSetLoader",this.__storeLoaderId="storeLoader",this.__renderHeaderSubtitle=()=>{var t;const{data:e,lang:i,ns:s}=this;if(e){let a,n,o="text-secondary";if(e.first_failed_transaction_date)o="text-error",a=e.first_failed_transaction_date,n="subscription_failed";else if(e.end_date){a=e.end_date;n=new Date(a).getTime()>Date.now()?"subscription_will_be_cancelled":"subscription_cancelled"}else a=null!==(t=e.next_transaction_date)&&void 0!==t?t:(new Date).toISOString(),n="subscription_"+(e.is_active?"active":"inactive");const r=d(D||(D=U` <foxy-i18n data-testid="header-subtitle" options="${0}" class="${0}" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> `),JSON.stringify({date:a}),o,i,n,s);return e.first_failed_transaction_date?d(q||(q=U` <span id="status" class="flex items-center space-x-xs ${0}"> ${0}<iron-icon icon="icons:info-outline" class="icon-inline"></iron-icon> </span> <vcf-tooltip for="status" position="bottom"> <span class="text-s">${0}</span> </vcf-tooltip> `),o,r,e.error_message):r}return d(k||(k=U`<x-skeleton class="w-full" variant="static"> </x-skeleton>`))},this.__renderHeaderTitle=(t,e)=>{const{data:i,lang:s,ns:a}=this;if(i){const n=_(i.frequency),o=this.__transactionTemplate,r=null==o?void 0:o.total_order;return"string"!=typeof t?d(L||(L=U`--`)):d(H||(H=U` <foxy-i18n data-testid="header-title" options="${0}" lang="${0}" key="price_${0}" ns="${0}"> </foxy-i18n> `),JSON.stringify(u(u({},n),{},{amount:`${r} ${t}`,currencyDisplay:e})),s,".5m"===i.frequency?"twice_a_month":"recurring",a)}return d(I||(I=U`<x-skeleton class="w-full" variant="static"> </x-skeleton>`))},this.__renderHeader=(t,e)=>d(A||(A=U` <div data-testid="header" class="sm-col-span-2"> ${0} <div class="leading-xs text-xxl font-bold truncate"> ${0} </div> <div class="leading-xs text-l">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("header:before"),this.__renderHeaderTitle(t,e),this.__renderHeaderSubtitle(),this.renderTemplateOrSlot("header:after")),this.__renderItemsActions=()=>d(O||(O=U` <div class="flex" data-testid="items:actions"> ${0} <foxy-i18n data-testid="items:actions-label" class="flex-1 text-s font-medium text-secondary" lang="${0}" key="item_plural" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("items:actions:before"),this.lang,this.ns,this.renderTemplateOrSlot("items:actions:after")),this.__renderItems=()=>{var t;let e;try{const i=this.__transactionTemplate,s=new URL(null!==(t=null==i?void 0:i._links["fx:items"].href)&&void 0!==t?t:"");s.searchParams.set("zoom","item_options"),e=s.toString()}catch(t){e=void 0}return d(C||(C=U` <div data-testid="items" class="space-y-xs sm-col-span-2"> ${0} <foxy-internal-async-list-control first="${0}" limit="5" infer="items" item="foxy-item-card"> </foxy-internal-async-list-control> </div> `),this.hiddenSelector.matches("items:actions",!0)?"":this.__renderItemsActions(),v(e))},this.__renderEndDate=()=>{const{disabledSelector:t,lang:e,ns:i}=this,s=this.hiddenSelector.zoom("end-date:form").toString();return d(z||(z=U` <div class="sm-col-span-2"> ${0} <foxy-form-dialog readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="save-button ${0}" data-testid="cancellation-form" parent="${0}" header="end_subscription" alert form="foxy-cancellation-form" href="${0}" lang="${0}" id="end-date-form" ns="${0}" .templates="${0}"> </foxy-form-dialog> <vaadin-button data-testid="end-date" theme="error" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n key="end_subscription" ns="${0}" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("end-date:before"),this.readonlySelector.zoom("end-date:form").toString(),t.zoom("end-date:form").toString(),s,this.parent,this.href,e,i,this.getNestedTemplates("end-date:form"),!this.data||t.matches("end-date",!0),(t=>{this.renderRoot.querySelector("#end-date-form").show(t.currentTarget)}),i,e,this.renderTemplateOrSlot("end-date:after"))},this.__checkNextTransactionDateAvailability=t=>{const{settings:e,data:i}=this;if(e&&i){return E({value:y(t),settings:e,subscription:i})}return t.getTime()>=Date.now()},this.__checkStartDateAvailability=t=>t.getTime()>=Date.now(),this.__renderStartDate=()=>{const{data:t,lang:e,ns:i}=this;return d(P||(P=U` <div data-testid="start-date"> ${0} <x-group frame> <foxy-i18n key="start_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("start-date:before"),i,e,v(null==t?void 0:t.start_date.substr(0,10)),v(null==t?void 0:t.start_date),e,!this.__isStartDateEditable,this.disabledSelector.matches("start-date",!0),this.__checkStartDateAvailability,(t=>{const e=t.target;this.edit({start_date:e.value})}),this.renderTemplateOrSlot("start-date:after"))},this.__renderNextTransactionDate=()=>{const{data:t,lang:e,ns:i}=this,s=!!(null==t?void 0:t.is_active);return d(N||(N=U` <div data-testid="next-transaction-date"> ${0} <x-group frame> <foxy-i18n key="next_transaction_date" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <foxy-internal-calendar start="${0}" value="${0}" lang="${0}" ?readonly="${0}" ?disabled="${0}" .checkAvailability="${0}" @change="${0}"> </foxy-internal-calendar> </x-group> ${0} </div> `),this.renderTemplateOrSlot("next-transaction-date:before"),i,e,v(null==t?void 0:t.next_transaction_date.substr(0,10)),v(null==t?void 0:t.next_transaction_date),e,!s||this.readonlySelector.matches("next-transaction-date",!0),!t||this.disabledSelector.matches("next-transaction-date",!0),this.__checkNextTransactionDateAvailability,(t=>{const e=t.target;this.edit({next_transaction_date:e.value})}),this.renderTemplateOrSlot("next-transaction-date:after"))},this.__renderFrequencyAsDropdown=()=>{const{data:t}=this,e=!!(null==t?void 0:t.is_active),i=this.__frequencies.map((t=>({label:this.t(".5m"===t?"twice_a_month":"frequency",_(t)),value:t})));return d(F||(F=U` <vaadin-combo-box item-value-path="value" item-label-path="label" data-testid="frequency" ?disabled="${0}" ?readonly="${0}" class="w-full" label="${0}" value="${0}" .items="${0}" @change="${0}"> </vaadin-combo-box> `),!t||this.disabledSelector.matches("frequency",!0),t&&(!e||this.readonlySelector.matches("frequency",!0)),this.t("frequency_label").toString(),v(this.form.frequency),i,(t=>{this.edit({frequency:t.target.value})}))},this.__renderFrequencyAsRadioList=()=>{var t;const{data:e,lang:i,ns:s}=this;return d(R||(R=U` <x-group frame> <foxy-i18n key="frequency_label" ns="${0}" lang="${0}" slot="header"></foxy-i18n> <x-choice default-custom-value="1d" data-testid="frequency" type="frequency" ns="${0}" ?custom="${0}" .items="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" @change="${0}"> ${0} </x-choice> </x-group> `),s,i,s,null===this.settings,this.__frequencies,null!==(t=this.form.frequency)&&void 0!==t?t:null,!e||this.disabledSelector.matches("frequency",!0),e&&(!e.is_active||this.readonlySelector.matches("frequency",!0)),(t=>{this.edit({frequency:t.target.value})}),this.__frequencies.map((t=>d(V||(V=U` <foxy-i18n options="${0}" slot="${0}-label" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> `),JSON.stringify(_(t)),t,i,".5m"===t?"twice_a_month":"frequency",s))))},this.__renderFrequency=()=>d(B||(B=U` <div class="sm-col-span-2"> ${0} ${0} ${0} </div> `),this.renderTemplateOrSlot("frequency:before"),this.settings&&this.__frequencies.length>4?this.__renderFrequencyAsDropdown():this.__renderFrequencyAsRadioList(),this.renderTemplateOrSlot("frequency:after"))}static get scopedElements(){return{"foxy-internal-timestamps-control":customElements.get("foxy-internal-timestamps-control"),"foxy-internal-async-list-control":customElements.get("foxy-internal-async-list-control"),"foxy-internal-number-control":customElements.get("foxy-internal-number-control"),"foxy-internal-calendar":customElements.get("foxy-internal-calendar"),"foxy-collection-pages":customElements.get("foxy-collection-pages"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"vaadin-combo-box":customElements.get("vaadin-combo-box"),"foxy-form-dialog":customElements.get("foxy-form-dialog"),"vaadin-button":customElements.get("vaadin-button"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-nucleon":customElements.get("foxy-nucleon"),"vcf-tooltip":customElements.get("vcf-tooltip"),"foxy-table":customElements.get("foxy-table"),"foxy-i18n":customElements.get("foxy-i18n"),"iron-icon":customElements.get("iron-icon"),"x-skeleton":m,"x-choice":h,"x-group":f}}static get properties(){return u(u({},super.properties),{},{getTransactionPageHref:{attribute:!1},customerAddresses:{attribute:"customer-addresses"},itemCategories:{attribute:"item-categories"},localeCodes:{attribute:"locale-codes"},settings:{type:Object},coupons:{}})}get hiddenSelector(){return new p(`items:pagination:card:autorenew-icon ${super.hiddenSelector}`)}renderBody(){var t,e,i,s,a,n,o,r;let l;try{const i=new URL(null!==(e=null===(t=this.data)||void 0===t?void 0:t._links["fx:transactions"].href)&&void 0!==e?e:"");i.searchParams.set("order","transaction_date desc"),i.searchParams.set("zoom","items"),l=i.toString()}catch(t){l=void 0}const c=(null===(i=this.__store)||void 0===i?void 0:i.use_international_currency_symbol)?"code":"symbol",u=this.__transactionTemplate;let h=null;if(null==u?void 0:u.currency_code)h=u.currency_code;else{const t=this.__localeCodesHelper,e=null===(a=null!==(s=this.__templateSet)&&void 0!==s?s:this.__defaultTemplateSet)||void 0===a?void 0:a.locale_code,i=e?null==t?void 0:t.values[e]:void 0;i&&(h=null!==(o=null===(n=/Currency: ([A-Z]{3})/g.exec(i))||void 0===n?void 0:n[1])&&void 0!==o?o:null)}return d(M||(M=U` <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <div class="relative grid grid-cols-1 sm-grid-cols-2 gap-l"> ${0} ${0} ${0} ${0} ${0} <foxy-internal-number-control suffix="${0}" infer="past-due-amount" class="sm-col-span-2" min="0"> </foxy-internal-number-control> <foxy-internal-async-list-control first="${0}" class="sm-col-span-2" infer="attributes" limit="5" form="foxy-attribute-form" item="foxy-attribute-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control first="${0}" class="sm-col-span-2" infer="transactions" limit="5" item="foxy-transaction-card" hide-delete-button .getPageHref="${0}"> </foxy-internal-async-list-control> <foxy-internal-timestamps-control infer="timestamps" class="sm-col-span-2"> </foxy-internal-timestamps-control> ${0} </div> `),v(this.__transactionTemplateHref),this.__transactionTemplateLoaderId,(()=>this.requestUpdate()),v(this.__defaultTemplateSetHref),this.__defaultTemplateSetLoaderId,(()=>this.requestUpdate()),v(this.__localeCodesHelperHref),this.__localeCodesHelperLoaderId,(()=>this.requestUpdate()),v(this.__templateSetHref),this.__templateSetLoaderId,(()=>this.requestUpdate()),v(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.hiddenSelector.matches("header",!0)?"":this.__renderHeader(null!=h?h:void 0,c),this.hiddenSelector.matches("items",!0)?"":this.__renderItems(),this.__isFrequencyVisible?this.__renderFrequency():"",this.__isStartDateVisible?this.__renderStartDate():"",this.__isNextTransactionDateVisible?this.__renderNextTransactionDate():"",v(null!=h?h:void 0),v(null===(r=this.data)||void 0===r?void 0:r._links["fx:attributes"].href),v(l),this.getTransactionPageHref,this.hiddenSelector.matches("end-date",!0)?"":this.__renderEndDate())}get __transactionTemplateHref(){var t;return null===(t=this.data)||void 0===t?void 0:t._links["fx:transaction_template"].href}get __defaultTemplateSetHref(){var t,e,i;if(""===(null===(t=this.__transactionTemplate)||void 0===t?void 0:t.template_set_uri))try{const t=new URL(null!==(i=null===(e=this.__store)||void 0===e?void 0:e._links["fx:template_sets"].href)&&void 0!==i?i:"");return t.searchParams.set("code","DEFAULT"),t.toString()}catch(t){}}get __localeCodesHelperHref(){var t;if(this.__defaultTemplateSetHref||this.__templateSetHref)return null!==(t=this.localeCodes)&&void 0!==t?t:void 0}get __templateSetHref(){const t=this.__transactionTemplate;if(!(null==t?void 0:t.currency_code))return(null==t?void 0:t.template_set_uri)||void 0}get __storeHref(){var t,e;return null===(e=null===(t=this.data)||void 0===t?void 0:t._links["fx:store"])||void 0===e?void 0:e.href}get __transactionTemplate(){var t,e;const i=`#${this.__transactionTemplateLoaderId}`;return null!==(e=null===(t=this.renderRoot.querySelector(i))||void 0===t?void 0:t.data)&&void 0!==e?e:null}get __defaultTemplateSet(){var t,e;const i=`#${this.__defaultTemplateSetLoaderId}`,s=this.renderRoot.querySelector(i);return null!==(e=null===(t=null==s?void 0:s.data)||void 0===t?void 0:t._embedded["fx:template_sets"][0])&&void 0!==e?e:null}get __localeCodesHelper(){var t,e;const i=`#${this.__localeCodesHelperLoaderId}`;return null!==(e=null===(t=this.renderRoot.querySelector(i))||void 0===t?void 0:t.data)&&void 0!==e?e:null}get __templateSet(){var t,e;const i=`#${this.__templateSetLoaderId}`;return null!==(e=null===(t=this.renderRoot.querySelector(i))||void 0===t?void 0:t.data)&&void 0!==e?e:null}get __store(){var t,e;const i=`#${this.__storeLoaderId}`;return null!==(e=null===(t=this.renderRoot.querySelector(i))||void 0===t?void 0:t.data)&&void 0!==e?e:null}get __isNextTransactionDateVisible(){if(this.hiddenSelector.matches("next-transaction-date",!0))return!1;if(null===this.data)return!1;if(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())return!1;if(!1===this.data.is_active)return!1;if(null===this.settings)return!0;const t=this.settings.subscriptions.allow_next_date_modification;return!!function(t,e){let i;return i="boolean"==typeof e?e:e.map((t=>({allowedDays:t.allowed_days,disallowedDates:t.disallowed_dates,jsonataQuery:t.jsonata_query,max:t.max,min:t.min}))),T(t,i)}(this.data,t)}get __isStartDateVisible(){return!this.hiddenSelector.matches("start-date",!0)&&this.__isNextTransactionDateVisible}get __isStartDateEditable(){return!this.readonlySelector.matches("start-date",!0)&&(null!==this.data&&(!(this.data.end_date&&new Date(this.data.end_date)<=new Date)&&(!1!==this.data.is_active&&(!(this.data.start_date&&new Date(this.data.start_date)<=new Date)&&null===this.settings))))}get __isFrequencyVisible(){if(this.hiddenSelector.matches("frequency",!0))return!1;if(null===this.data)return!1;if(this.data.end_date&&new Date(this.data.end_date).getTime()<=Date.now())return!1;if(!1===this.data.is_active)return!1;if(null===this.settings)return!0;return!$({subscription:this.data,settings:this.settings}).next().done}get __frequencies(){if(!this.settings||!this.data)return[".5m","1m","1y"];const t=$({subscription:this.data,settings:this.settings});return Array.from(t)}}let Q;a("vcf-tooltip",l(Q||(Q=(t=>t)`
|
|
96
96
|
:host([hidden]) [part='container']{
|
|
97
97
|
display:none !important;
|
|
98
98
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-2add595d.js";import"./shared-71f2ef1f.js";import"./shared-a37abe4c.js";import"./shared-988ec916.js";import"./shared-80fc2b6a.js";import{I as e}from"./shared-6581241a.js";import{I as t}from"./shared-39c10b22.js";import"./shared-0821cfdc.js";import{c as s,h as a}from"./shared-7f33a83a.js";import{y as i,a as r}from"./shared-2cc638ad.js";import"./shared-88c4cfec.js";import"./shared-be66c2e7.js";import"./shared-0ce006b9.js";import"./shared-08156595.js";import"./shared-5ea18e60.js";import"./shared-62c088b7.js";import"./shared-a8ced8bf.js";import"./shared-d3bf9ac0.js";import"./shared-4e709717.js";import"./shared-d519a301.js";import"./shared-f3b35364.js";import"./shared-11c2efc8.js";import"./shared-bd252323.js";import"./shared-7d4fb1a2.js";import"./shared-9bdacf65.js";import"./shared-0479553e.js";import"./shared-43bcce74.js";import"./shared-76b3d76a.js";import"./shared-4f037e43.js";import"./shared-181f51bd.js";import"./shared-a85afa33.js";import"./shared-d6276c83.js";import"./shared-2f7dcefa.js";import"./shared-bc814810.js";import"./shared-8dd0af4d.js";import"./shared-62a54a6c.js";import"./foxy-spinner.js";import"./shared-2092d86f.js";let o,n,l,p=e=>e;let u,d,c=e=>e;const m=s(u||(u=c`: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=c`: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",m),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-747b6d74.js";import"./shared-efc1aeae.js";import"./shared-242b3ee9.js";import"./shared-274c49b0.js";import"./shared-8f8abcd6.js";import{I as e}from"./shared-8c11a711.js";import{I as t}from"./shared-a01b5597.js";import"./shared-7097364f.js";import{c as s,h as a}from"./shared-7f33a83a.js";import{y as i,a as r}from"./shared-2cc638ad.js";import"./shared-88c4cfec.js";import"./shared-be66c2e7.js";import"./shared-0ce006b9.js";import"./shared-08156595.js";import"./shared-5ea18e60.js";import"./shared-62c088b7.js";import"./shared-a8ced8bf.js";import"./shared-d3bf9ac0.js";import"./shared-4e709717.js";import"./shared-d519a301.js";import"./shared-f3b35364.js";import"./shared-11c2efc8.js";import"./shared-bd252323.js";import"./shared-7d4fb1a2.js";import"./shared-e262920d.js";import"./shared-0479553e.js";import"./shared-67546e10.js";import"./shared-dcdb6ea1.js";import"./shared-4f037e43.js";import"./shared-dc91f7ae.js";import"./shared-955db6b4.js";import"./shared-d6276c83.js";import"./shared-e3ab56d1.js";import"./shared-bc814810.js";import"./shared-3d241b7f.js";import"./shared-9f905d9f.js";import"./foxy-spinner.js";import"./shared-2092d86f.js";let o,n,l,p=e=>e;let u,d,c=e=>e;const m=s(u||(u=c`: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=c`: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",m),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-7097364f.js";import{S as s}from"./shared-61e74612.js";export{S as SubscriptionsTable}from"./shared-61e74612.js";import"./shared-62c088b7.js";import"./shared-0ce006b9.js";import"./shared-2cc638ad.js";import"./shared-a8ced8bf.js";import"./shared-7f33a83a.js";import"./shared-2092d86f.js";import"./shared-4f037e43.js";import"./shared-dcdb6ea1.js";import"./shared-d3bf404a.js";import"./shared-67546e10.js";import"./shared-d3bf9ac0.js";import"./foxy-nucleon-element.js";import"./shared-dc91f7ae.js";import"./shared-955db6b4.js";import"./shared-d6276c83.js";import"./shared-e3ab56d1.js";import"./shared-4e709717.js";import"./shared-5c804971.js";customElements.define("foxy-subscriptions-table",s);
|
package/dist/cdn/foxy-table.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-0479553e.js";import"./foxy-spinner.js";import{T as s}from"./shared-
|
|
1
|
+
import"./shared-0479553e.js";import"./foxy-spinner.js";import{T as s}from"./shared-d3bf404a.js";export{T as Table}from"./shared-d3bf404a.js";import"./shared-7f33a83a.js";import"./shared-62c088b7.js";import"./shared-0ce006b9.js";import"./shared-2cc638ad.js";import"./shared-a8ced8bf.js";import"./shared-2092d86f.js";import"./shared-7097364f.js";import"./shared-dcdb6ea1.js";import"./shared-4f037e43.js";import"./shared-67546e10.js";import"./shared-d3bf9ac0.js";import"./foxy-nucleon-element.js";import"./shared-dc91f7ae.js";import"./shared-955db6b4.js";import"./shared-d6276c83.js";import"./shared-e3ab56d1.js";import"./shared-4e709717.js";customElements.define("foxy-table",s);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-94fc438b.js";import{h as t}from"./shared-7f33a83a.js";import{a}from"./shared-2cc638ad.js";import{C as e}from"./shared-67546e10.js";import{I as r}from"./shared-62d636b5.js";import"./foxy-spinner.js";import"./shared-62c088b7.js";import"./shared-0ce006b9.js";import"./shared-2092d86f.js";import"./shared-7097364f.js";import"./shared-a8ced8bf.js";import"./shared-dcdb6ea1.js";import"./shared-4f037e43.js";import"./shared-d3bf9ac0.js";import"./shared-dc91f7ae.js";import"./shared-955db6b4.js";import"./shared-d6276c83.js";import"./shared-e3ab56d1.js";import"./shared-4e709717.js";let s,i=t=>t;class d extends(a(e(r),"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-semibold 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:e,region:r,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?e:"region"===a?`${e}, ${r}`:"local"===a?`${e}, ${r}, ${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 e=null===(a=this.data)||void 0===a?void 0:a.service_provider;return"onesource"===e?"Thomson Reuters ONESOURCE":"avalara"===e?"Avalara AvaTax 15":"taxjar"===e?"TaxJar":this.t("tax_rate_provider_default")}}customElements.define("foxy-tax-card",d);export{d as TaxCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-8dd0af4d.js";import"./shared-0479553e.js";import"./foxy-spinner.js";import"./shared-0821cfdc.js";import"./shared-bd252323.js";import"./shared-08156595.js";import"./shared-7d4fb1a2.js";import"./shared-6cb1015f.js";import"./shared-bc814810.js";import{D as e}from"./shared-101d1234.js";import{_ as t}from"./shared-a8ced8bf.js";import{C as i}from"./shared-9f436277.js";import"./shared-1c94a156.js";import"./shared-62a54a6c.js";import{h as r}from"./shared-7f33a83a.js";import{T as s,S as a,a as n}from"./shared-2cc638ad.js";import"./shared-4849ef5b.js";import"./shared-be66c2e7.js";import"./shared-5ea18e60.js";import"./shared-62c088b7.js";import"./shared-5a4829e3.js";import{P as o}from"./shared-5378bd8c.js";import{c as d}from"./shared-4e709717.js";import{a as l}from"./shared-76b3d76a.js";import{C as h}from"./shared-43bcce74.js";import{N as c}from"./shared-181f51bd.js";import{i as _}from"./shared-d3bf9ac0.js";import{i as m}from"./shared-2f7dcefa.js";import"./shared-2092d86f.js";import"./shared-0ce006b9.js";import"./shared-4f037e43.js";import"./shared-08e27fe9.js";import"./shared-404aa9cc.js";import"./shared-ed0dee03.js";import"./shared-11c2efc8.js";import"./shared-a85afa33.js";import"./shared-d6276c83.js";let p,u,y,g,v,f,$,x,b,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(s(a(n(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(l.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(l.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-integer-field":customElements.get("vaadin-integer-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":o,"x-checkbox":i,"x-dropdown":e}}static get properties(){return t(t({},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 r(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(),d({"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 r(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"}),r(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"),s=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 r(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||s||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"),s=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 r(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||s||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 r(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"}),r($||($=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 r(x||(x=O` <div> ${0} <vaadin-integer-field data-testid="rate" class="w-full" label="${0}" value="${0}" min="0" prevent-invalid-input has-controls .checkValidity="${0}" .errorMessage="${0}" ?disabled="${0}" ?readonly="${0}" required @keydown="${0}" @change="${0}"> </vaadin-integer-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=parseInt(e.currentTarget.value);this.edit({rate:t})}),this.renderTemplateOrSlot("rate:after"))}__renderApplyToShipping(){return r(b||(b=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 r(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 r(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 r(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"}}}),s=this.in({idle:{snapshot:{dirty:"invalid"}}}),a=e||t||(i||s),n=this.in("idle");return r(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 r(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-3d241b7f.js";import"./shared-0479553e.js";import"./foxy-spinner.js";import"./shared-7097364f.js";import"./shared-bd252323.js";import"./shared-08156595.js";import"./shared-7d4fb1a2.js";import"./shared-6cb1015f.js";import"./shared-bc814810.js";import{D as e}from"./shared-f621ccee.js";import{_ as t}from"./shared-a8ced8bf.js";import{C as i}from"./shared-9f436277.js";import"./shared-be99323d.js";import"./shared-9f905d9f.js";import{h as r}from"./shared-7f33a83a.js";import{T as s,S as a,a as n}from"./shared-2cc638ad.js";import"./shared-4849ef5b.js";import"./shared-be66c2e7.js";import"./shared-5ea18e60.js";import"./shared-62c088b7.js";import"./shared-5a4829e3.js";import{P as o}from"./shared-5378bd8c.js";import{c as d}from"./shared-4e709717.js";import{a as l}from"./shared-dcdb6ea1.js";import{C as h}from"./shared-67546e10.js";import{N as c}from"./shared-dc91f7ae.js";import{i as _}from"./shared-d3bf9ac0.js";import{i as m}from"./shared-e3ab56d1.js";import"./shared-2092d86f.js";import"./shared-0ce006b9.js";import"./shared-4f037e43.js";import"./shared-08e27fe9.js";import"./shared-404aa9cc.js";import"./shared-ed0dee03.js";import"./shared-11c2efc8.js";import"./shared-955db6b4.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(s(a(n(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(l.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(l.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-integer-field":customElements.get("vaadin-integer-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":o,"x-checkbox":i,"x-dropdown":e}}static get properties(){return t(t({},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 r(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(),d({"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 r(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"}),r(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"),s=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 r(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||s||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"),s=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 r(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||s||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 r(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"}),r($||($=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 r(b||(b=O` <div> ${0} <vaadin-integer-field data-testid="rate" class="w-full" label="${0}" value="${0}" min="0" prevent-invalid-input has-controls .checkValidity="${0}" .errorMessage="${0}" ?disabled="${0}" ?readonly="${0}" required @keydown="${0}" @change="${0}"> </vaadin-integer-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=parseInt(e.currentTarget.value);this.edit({rate:t})}),this.renderTemplateOrSlot("rate:after"))}__renderApplyToShipping(){return r(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 r(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 r(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 r(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"}}}),s=this.in({idle:{snapshot:{dirty:"invalid"}}}),a=e||t||(i||s),n=this.in("idle");return r(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 r(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};
|