@foxy.io/elements 1.27.0-beta.1 → 1.27.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/foxy-access-recovery-form.js +1 -1
- package/dist/cdn/foxy-address-card.js +1 -1
- package/dist/cdn/foxy-address-form.js +1 -1
- package/dist/cdn/foxy-admin-subscription-card.js +1 -1
- package/dist/cdn/foxy-api-browser.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-card.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-applied-tax-card.js +1 -1
- package/dist/cdn/foxy-attribute-card.js +1 -1
- package/dist/cdn/foxy-attribute-form.js +1 -1
- package/dist/cdn/foxy-billing-address-card.js +1 -1
- package/dist/cdn/foxy-cancellation-form.js +1 -1
- package/dist/cdn/foxy-cart-card.js +1 -1
- package/dist/cdn/foxy-cart-form.js +1 -1
- package/dist/cdn/foxy-client-card.js +1 -1
- package/dist/cdn/foxy-client-form.js +1 -1
- package/dist/cdn/foxy-collection-page.js +1 -1
- package/dist/cdn/foxy-collection-pages.js +1 -1
- package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
- package/dist/cdn/foxy-coupon-card.js +1 -1
- package/dist/cdn/foxy-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-coupon-codes-form.js +1 -1
- package/dist/cdn/foxy-coupon-detail-card.js +1 -1
- package/dist/cdn/foxy-coupon-form.js +1 -1
- package/dist/cdn/foxy-custom-field-card.js +1 -1
- package/dist/cdn/foxy-custom-field-form.js +1 -1
- package/dist/cdn/foxy-customer-card.js +1 -1
- package/dist/cdn/foxy-customer-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings.js +1 -1
- package/dist/cdn/foxy-customer-portal.js +2 -2
- package/dist/cdn/foxy-customer.js +1 -1
- package/dist/cdn/foxy-customers-table.js +1 -1
- package/dist/cdn/foxy-discount-builder.js +1 -1
- package/dist/cdn/foxy-discount-card.js +1 -1
- package/dist/cdn/foxy-discount-detail-card.js +1 -1
- package/dist/cdn/foxy-donation.js +1 -1
- package/dist/cdn/foxy-downloadable-card.js +1 -1
- package/dist/cdn/foxy-downloadable-form.js +1 -1
- package/dist/cdn/foxy-email-template-card.js +1 -1
- package/dist/cdn/foxy-email-template-form.js +1 -1
- package/dist/cdn/foxy-error-entry-card.js +1 -1
- package/dist/cdn/foxy-filter-attribute-card.js +1 -1
- package/dist/cdn/foxy-filter-attribute-form.js +1 -1
- package/dist/cdn/foxy-form-dialog.js +1 -1
- package/dist/cdn/foxy-generate-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-card.js +1 -1
- package/dist/cdn/foxy-gift-card-code-form.js +1 -1
- package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
- package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-form.js +1 -1
- package/dist/cdn/foxy-i18n-editor.js +2 -2
- package/dist/cdn/foxy-i18n.js +1 -1
- package/dist/cdn/foxy-integration-card.js +1 -1
- package/dist/cdn/foxy-integration-form.js +1 -1
- package/dist/cdn/foxy-item-card.js +1 -1
- package/dist/cdn/foxy-item-category-card.js +1 -1
- package/dist/cdn/foxy-item-category-form.js +1 -1
- package/dist/cdn/foxy-item-form.js +4 -4
- package/dist/cdn/foxy-item-option-card.js +1 -1
- package/dist/cdn/foxy-item-option-form.js +1 -1
- package/dist/cdn/foxy-items-form.js +1 -1
- package/dist/cdn/foxy-native-integration-card.js +1 -1
- package/dist/cdn/foxy-native-integration-form.js +1 -1
- package/dist/cdn/foxy-pagination.js +1 -1
- package/dist/cdn/foxy-passkey-card.js +1 -1
- package/dist/cdn/foxy-passkey-form.js +1 -1
- package/dist/cdn/foxy-payment-card.js +1 -1
- package/dist/cdn/foxy-payment-method-card.js +1 -1
- package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
- package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
- package/dist/cdn/foxy-query-builder.js +1 -1
- package/dist/cdn/foxy-report-form.js +10 -10
- package/dist/cdn/foxy-reports-table.js +1 -1
- package/dist/cdn/foxy-shipment-card.js +1 -1
- package/dist/cdn/foxy-shipping-method-card.js +1 -1
- package/dist/cdn/foxy-sign-in-form.js +1 -1
- package/dist/cdn/foxy-spinner.js +2 -2
- package/dist/cdn/foxy-store-card.js +1 -1
- package/dist/cdn/foxy-store-form.js +1 -1
- package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
- package/dist/cdn/foxy-subscription-card.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +1 -5
- 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-card.js +1 -1
- package/dist/cdn/foxy-user-form.js +1 -1
- package/dist/cdn/foxy-users-table.js +1 -1
- package/dist/cdn/foxy-webhook-card.js +1 -1
- package/dist/cdn/foxy-webhook-form.js +1 -1
- package/dist/cdn/foxy-webhook-log-card.js +1 -1
- package/dist/cdn/foxy-webhook-status-card.js +1 -1
- package/dist/cdn/{shared-d9f44257.js → shared-030f561a.js} +1 -1
- package/dist/cdn/{shared-dbfccb3e.js → shared-0cbb19f4.js} +1 -1
- package/dist/cdn/{shared-09ac8087.js → shared-0cf90158.js} +1 -1
- package/dist/cdn/{shared-8a92f939.js → shared-1024766f.js} +1 -1
- package/dist/cdn/{shared-8f706991.js → shared-12390d6f.js} +1 -1
- package/dist/cdn/{shared-380c0453.js → shared-12ad8924.js} +2 -2
- package/dist/cdn/shared-150f5214.js +1 -0
- package/dist/cdn/shared-2062c274.js +1 -0
- package/dist/cdn/{shared-e460ee3d.js → shared-2376abfc.js} +7 -7
- package/dist/cdn/{shared-648f62a1.js → shared-26f4b6bf.js} +1 -1
- package/dist/cdn/{shared-1bb9c21a.js → shared-2920b595.js} +1 -1
- package/dist/cdn/{shared-13afcc16.js → shared-331a223c.js} +1 -1
- package/dist/cdn/{shared-c0cbb20a.js → shared-33d8cbfb.js} +1 -1
- package/dist/cdn/{shared-062f3122.js → shared-352c79a6.js} +1 -1
- package/dist/cdn/{shared-adecdd5f.js → shared-37e1a834.js} +1 -1
- package/dist/cdn/shared-3f19b914.js +20 -0
- package/dist/cdn/{shared-30f373f2.js → shared-405a290e.js} +1 -1
- package/dist/cdn/shared-40bece2b.js +1 -0
- package/dist/cdn/{shared-24ceebec.js → shared-4482e7b9.js} +1 -1
- package/dist/cdn/{shared-02883252.js → shared-44bb85d8.js} +1 -1
- package/dist/cdn/{shared-d3e8c449.js → shared-497ebb8c.js} +1 -1
- package/dist/cdn/{shared-a5ec3472.js → shared-4cec4de0.js} +1 -1
- package/dist/cdn/{shared-6424d196.js → shared-510a9e1b.js} +1 -1
- package/dist/cdn/{shared-6310fdde.js → shared-5ba87b6d.js} +1 -1
- package/dist/cdn/{shared-8c937a7c.js → shared-5df32007.js} +1 -1
- package/dist/cdn/{shared-0fdfc2c2.js → shared-5dfec3b7.js} +1 -1
- package/dist/cdn/shared-651c44fa.js +6 -0
- package/dist/cdn/{shared-5ba412f7.js → shared-655e7c5f.js} +1 -1
- package/dist/cdn/shared-6d41c9a9.js +1 -0
- package/dist/cdn/{shared-e1cade57.js → shared-6e508e5b.js} +5 -5
- package/dist/cdn/{shared-ff35e803.js → shared-6ed07856.js} +1 -1
- package/dist/cdn/{shared-b17fcc8f.js → shared-7039733e.js} +1 -1
- package/dist/cdn/{shared-c692070c.js → shared-74adbf9e.js} +1 -1
- package/dist/cdn/{shared-0dcc1ea4.js → shared-7ea4cb27.js} +1 -1
- package/dist/cdn/{shared-2d7cab3c.js → shared-83fc5dca.js} +1 -1
- package/dist/cdn/{shared-4345e9fd.js → shared-882e7191.js} +1 -1
- package/dist/cdn/shared-8ab2ba91.js +425 -0
- package/dist/cdn/{shared-36a09fe6.js → shared-8b80db13.js} +1 -1
- package/dist/cdn/{shared-b114fee0.js → shared-966feb65.js} +1 -1
- package/dist/cdn/{shared-1af365fe.js → shared-97d63da6.js} +1 -1
- package/dist/cdn/shared-99f0fee6.js +1 -0
- package/dist/cdn/shared-9adc47da.js +113 -0
- package/dist/cdn/{shared-708f960f.js → shared-9fd64015.js} +1 -1
- package/dist/cdn/{shared-5ecc7f74.js → shared-a19e1dff.js} +1 -1
- package/dist/cdn/{shared-921d4691.js → shared-a5ecd56e.js} +1 -1
- package/dist/cdn/{shared-b56daa27.js → shared-a9f76cae.js} +1 -1
- package/dist/cdn/{shared-e260fc5a.js → shared-ae459232.js} +4 -4
- package/dist/cdn/{shared-3895091e.js → shared-bbc0cdd6.js} +1 -1
- package/dist/cdn/{shared-fe165f2e.js → shared-bf695fe7.js} +1 -1
- package/dist/cdn/{shared-fba9b7b3.js → shared-cd8c3429.js} +1 -1
- package/dist/cdn/{shared-67696f2f.js → shared-cfed658c.js} +1 -1
- package/dist/cdn/shared-d0374d0c.js +1 -0
- package/dist/cdn/{shared-5f6d7cc6.js → shared-d244dd07.js} +1 -1
- package/dist/cdn/{shared-fcddc6cc.js → shared-d9f65ee0.js} +4 -4
- package/dist/cdn/{shared-d61d1d8d.js → shared-db98729a.js} +1 -1
- package/dist/cdn/{shared-019ad470.js → shared-e40937c5.js} +1 -1
- package/dist/cdn/shared-f1afbd7b.js +1 -0
- package/dist/cdn/{shared-d96312ed.js → shared-f53d078e.js} +1 -1
- package/dist/cdn/{shared-a3ec1362.js → shared-f588b5c2.js} +1 -1
- package/dist/cdn/{shared-8addaf74.js → shared-f5d4dda0.js} +1 -1
- package/dist/cdn/{shared-d070d509.js → shared-f94fa366.js} +1 -1
- package/dist/cdn/{shared-8cc1f513.js → shared-fd0a4026.js} +1 -1
- package/dist/cdn/translations/coupon-code-form/en.json +68 -12
- package/dist/cdn/translations/coupon-form/en.json +68 -11
- package/dist/cdn/translations/custom-field-form/en.json +32 -13
- package/dist/cdn/translations/customer/en.json +1 -12
- package/dist/cdn/translations/gift-card-code-form/en.json +51 -21
- package/dist/cdn/translations/gift-card-form/en.json +56 -22
- package/dist/cdn/translations/subscription-form/en.json +1 -12
- package/dist/cdn/translations/transaction/en.json +32 -13
- package/dist/cdn/translations/user-form/en.json +54 -20
- package/dist/cdn/translations/users-table/en.json +54 -20
- package/dist/elements/public/CouponCodeForm/CouponCodeForm.d.ts +19 -21
- package/dist/elements/public/CouponCodeForm/CouponCodeForm.js +47 -178
- package/dist/elements/public/CouponCodeForm/CouponCodeForm.js.map +1 -1
- package/dist/elements/public/CouponCodeForm/index.d.ts +5 -6
- package/dist/elements/public/CouponCodeForm/index.js +5 -6
- package/dist/elements/public/CouponCodeForm/index.js.map +1 -1
- package/dist/elements/public/CouponCodeForm/types.d.ts +11 -4
- package/dist/elements/public/CouponCodeForm/types.js.map +1 -1
- package/dist/elements/public/CouponForm/CouponForm.d.ts +2 -1
- package/dist/elements/public/CouponForm/CouponForm.js +4 -0
- package/dist/elements/public/CouponForm/CouponForm.js.map +1 -1
- package/dist/elements/public/CouponForm/types.d.ts +3 -0
- package/dist/elements/public/CouponForm/types.js.map +1 -1
- package/dist/elements/public/CustomFieldForm/CustomFieldForm.d.ts +27 -36
- package/dist/elements/public/CustomFieldForm/CustomFieldForm.js +40 -221
- package/dist/elements/public/CustomFieldForm/CustomFieldForm.js.map +1 -1
- package/dist/elements/public/CustomFieldForm/index.d.ts +3 -7
- package/dist/elements/public/CustomFieldForm/index.js +3 -7
- package/dist/elements/public/CustomFieldForm/index.js.map +1 -1
- package/dist/elements/public/CustomFieldForm/types.d.ts +4 -7
- package/dist/elements/public/CustomFieldForm/types.js.map +1 -1
- package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.d.ts +12 -29
- package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.js +27 -276
- package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.js.map +1 -1
- package/dist/elements/public/GiftCardCodeForm/index.d.ts +5 -9
- package/dist/elements/public/GiftCardCodeForm/index.js +5 -9
- package/dist/elements/public/GiftCardCodeForm/index.js.map +1 -1
- package/dist/elements/public/GiftCardCodeForm/internal/InternalGiftCardCodeFormItemControl/InternalGiftCardCodeFormItemControl.js +17 -6
- package/dist/elements/public/GiftCardCodeForm/internal/InternalGiftCardCodeFormItemControl/InternalGiftCardCodeFormItemControl.js.map +1 -1
- package/dist/elements/public/GiftCardCodeForm/internal/InternalGiftCardCodeFormItemControl/index.d.ts +0 -1
- package/dist/elements/public/GiftCardCodeForm/internal/InternalGiftCardCodeFormItemControl/index.js +0 -1
- package/dist/elements/public/GiftCardCodeForm/internal/InternalGiftCardCodeFormItemControl/index.js.map +1 -1
- package/dist/elements/public/GiftCardCodeForm/types.d.ts +6 -4
- package/dist/elements/public/GiftCardCodeForm/types.js.map +1 -1
- package/dist/elements/public/SubscriptionForm/SubscriptionForm.d.ts +3 -0
- package/dist/elements/public/SubscriptionForm/SubscriptionForm.js +88 -78
- package/dist/elements/public/SubscriptionForm/SubscriptionForm.js.map +1 -1
- package/dist/elements/public/SubscriptionForm/index.d.ts +0 -2
- package/dist/elements/public/SubscriptionForm/index.js +0 -8
- package/dist/elements/public/SubscriptionForm/index.js.map +1 -1
- package/dist/elements/public/UserForm/UserForm.d.ts +15 -12
- package/dist/elements/public/UserForm/UserForm.js +64 -172
- package/dist/elements/public/UserForm/UserForm.js.map +1 -1
- package/dist/elements/public/UserForm/index.d.ts +3 -5
- package/dist/elements/public/UserForm/index.js +3 -5
- package/dist/elements/public/UserForm/index.js.map +1 -1
- package/dist/elements/public/UserForm/types.d.ts +3 -1
- package/dist/elements/public/UserForm/types.js.map +1 -1
- package/dist/elements/public/UsersTable/UsersTable.js +1 -1
- package/dist/elements/public/UsersTable/UsersTable.js.map +1 -1
- package/dist/elements/public/UsersTable/roles.js.map +1 -0
- package/dist/mixins/themeable.js +38 -8
- package/dist/mixins/themeable.js.map +1 -1
- package/package.json +1 -1
- package/dist/cdn/shared-20142d51.js +0 -1
- package/dist/cdn/shared-74086729.js +0 -1
- package/dist/cdn/shared-8b7ef8ec.js +0 -1
- package/dist/cdn/shared-9f41236b.js +0 -1
- package/dist/cdn/shared-c0242421.js +0 -531
- package/dist/cdn/shared-ce9795cd.js +0 -25
- package/dist/cdn/shared-d1ee06bb.js +0 -1
- package/dist/cdn/shared-ded1248f.js +0 -1
- package/dist/cdn/shared-f655b20d.js +0 -1
- package/dist/elements/public/UserForm/roles.js.map +0 -1
- /package/dist/elements/public/{UserForm → UsersTable}/roles.d.ts +0 -0
- /package/dist/elements/public/{UserForm → UsersTable}/roles.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-26f4b6bf.js";import"./shared-51c4a6dd.js";import"./shared-d0374d0c.js";import"./shared-f5d4dda0.js";import"./shared-1522d76f.js";import{g as e}from"./shared-bab2ea2c.js";import{C as t}from"./shared-9f570db0.js";import{a as s}from"./shared-331a223c.js";import{I as i}from"./shared-d244dd07.js";import{c as r}from"./shared-4e709717.js";import{h as o}from"./shared-dc73b9a5.js";import"./shared-bf695fe7.js";import"./shared-cfed658c.js";import"./shared-e40937c5.js";import"./shared-7039733e.js";import"./foxy-spinner.js";import"./shared-8b80db13.js";import"./shared-30cbf0a6.js";import"./shared-343d1fd7.js";import"./shared-9803aa7c.js";import"./shared-a0435ec6.js";import"./shared-07e9d1fb.js";import"./shared-3ab0306f.js";import"./shared-eb116b3e.js";let a,n,d,c,l,p,u,m,f,h,v,y,_,x,$=e=>e;const b=t(s(i,"transaction-card"));class g extends b{constructor(){super(...arguments),this.templates={},this.__currencyDisplay=""}renderBody(){var e,t;const s=this.hiddenSelector,i=!s.matches("total",!0),d=!s.matches("status",!0);return o(a||(a=$` <div aria-busy="${0}" aria-live="polite" class="relative leading-s font-lumo text-m"> <div class="${0}"> ${0} ${0} ${0} </div> <div class="${0}"> <foxy-spinner data-testid="spinner" state="${0}" class="m-auto" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.in("busy"),r({"transition-opacity":!0,"opacity-0":!this.data}),i||d?o(n||(n=$` <div class="flex items-center justify-between gap-s"> ${0} ${0} </div> `),i?this.__renderIdAndTotal():"",d?this.__renderStatus():""):"",s.matches("description",!0)?"":this.__renderSummary(),s.matches("customer",!0)?"":this.__renderCustomer(),r({"pointer-events-none absolute inset-0 flex transition-opacity":!0,"opacity-0":!!this.data}),this.in("fail")?"error":this.in({idle:"template"})?"empty":"busy",this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"")}async _sendGet(){var e;const t=await super._sendGet(),s=null===(e=t._links["fx:store"])||void 0===e?void 0:e.href;if("string"==typeof s){const e=await super._fetch(s);this.__currencyDisplay=e.use_international_currency_symbol?"code":"symbol"}else this.__currencyDisplay="symbol";return t}__renderIdAndTotal(){const t=this.data;let s;if(t){const i={amount:`${t.total_order} ${t.currency_code}`,currencyDisplay:this.__currencyDisplay};s=o(d||(d=$` <span class="truncate">ID ${0}</span> ${0} `),t.display_id||e(t._links.self.href),"updateinfo"!==t.type&&"subscription_cancellation"!==t.type?o(c||(c=$` <span>•</span> <foxy-i18n .options="${0}" infer="" key="price"></foxy-i18n> `),i):"")}else s=o(l||(l=$`​`));return o(p||(p=$` <div class="min-w-0" data-testid="total"> ${0} <div class="font-medium flex items-center gap-xs">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("total:before"),s,this.renderTemplateOrSlot("total:after"))}__renderStatus(){var e,t,s,i,r,a;const n=(null===(e=this.data)||void 0===e?void 0:e.status)||"completed",d=null===(s=null===(t=this.data)||void 0===t?void 0:t.source)||void 0===s?void 0:s.substring(0,3).toUpperCase();return o(u||(u=$` <div class="flex-shrink-0" data-testid="status"> ${0} <div class="text-tertiary text-s flex items-center space-x-xs"> ${0} <foxy-i18n options="${0}" lang="${0}" key="time" ns="${0}"> </foxy-i18n> <iron-icon data-testid="status-icon" class="icon-inline cursor-default text-l ${0}" id="status" icon="${0}"> </iron-icon> <vcf-tooltip for="status" theme="light" position="top"> <foxy-i18n infer="" key="status_${0}"></foxy-i18n> </vcf-tooltip> </div> ${0} </div> `),this.renderTemplateOrSlot("status:before"),d?o(m||(m=$` <vcf-tooltip for="source" theme="light" position="top"> <foxy-i18n infer="" key="source_${0}"></foxy-i18n> </vcf-tooltip> <span class="cursor-default" id="source">${0}</span> `),d,d):"",JSON.stringify({value:null===(i=this.data)||void 0===i?void 0:i.transaction_date}),this.lang,this.ns,null!==(r={authorized:"text-success",completed:"text-success",capturing:"text-success",captured:"text-success",approved:"text-success",pending:"text-success",pending_fraud_review:"text-error",declined:"text-error",rejected:"text-error",problem:"text-error"}[n])&&void 0!==r?r:"text-tertiary",null!==(a={authorized:"icons:done",capturing:"icons:done",captured:"icons:done",approved:"icons:done",pending:"icons:done",completed:"icons:done-all",pending_fraud_review:"icons:info-outline",declined:"icons:highlight-off",rejected:"icons:highlight-off",problem:"icons:info-outline",refunded:"icons:restore",voided:"icons:remove-circle-outline"}[n])&&void 0!==a?a:"icons:schedule",n,this.renderTemplateOrSlot("status:after"))}__renderSummary(){var e,t,s;const i=null===(t=null===(e=this.data)||void 0===e?void 0:e._embedded)||void 0===t?void 0:t["fx:items"],r=null===(s=this.data)||void 0===s?void 0:s.type;let a,n;if(n="updateinfo"===r?"summary_payment_method_change":"subscription_modification"===r?"summary_subscription_modification":"subscription_cancellation"===r?"summary_subscription_cancellation":"summary",i){const e={most_expensive_item:[...i].sort(((e,t)=>e.price-t.price))[0],count_minus_one:i.length-1,count:i.length};a=o(f||(f=$`<foxy-i18n .options="${0}" infer="" key="${0}"></foxy-i18n>`),e,n)}else a=o(h||(h=$`​`));return o(v||(v=$` <div data-testid="description"> ${0} <div class="text-s text-secondary truncate">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("description:before"),a,this.renderTemplateOrSlot("description:after"))}__renderCustomer(){const e=this.data,t=e?o(y||(y=$`${0} ${0} (${0})`),e.customer_first_name,e.customer_last_name,e.customer_email):o(_||(_=$`​`));return o(x||(x=$` <div data-testid="customer"> ${0} <div class="text-tertiary truncate text-s">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("customer:before"),t,this.renderTemplateOrSlot("customer:after"))}}customElements.define("foxy-transaction-card",g);export{g as TransactionCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./foxy-billing-address-card.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-custom-field-form.js";import"./foxy-custom-field-card.js";import"./foxy-copy-to-clipboard.js";import"./foxy-shipment-card.js";import"./foxy-payment-card.js";import"./foxy-item-card.js";import"./foxy-item-form.js";import"./shared-8addaf74.js";import"./shared-8a92f939.js";import{I as t}from"./shared-b114fee0.js";import{I as e}from"./shared-d1ee06bb.js";import"./foxy-customer-card.js";import"./foxy-swipe-actions.js";import"./foxy-spinner.js";import{_ as i,B as o}from"./shared-1522d76f.js";import{g as s}from"./shared-bab2ea2c.js";import{i as r}from"./shared-9803aa7c.js";import{h as n,s as a}from"./shared-dc73b9a5.js";import{c as d}from"./shared-4e709717.js";import"./shared-adecdd5f.js";import"./shared-d9f44257.js";import{N as l}from"./shared-a0435ec6.js";import"./foxy-nucleon-element.js";import{R as c,a as u}from"./shared-13afcc16.js";import"./shared-20142d51.js";import"./shared-5f6d7cc6.js";import"./shared-019ad470.js";import"./shared-fe165f2e.js";import"./shared-36a09fe6.js";import"./shared-30cbf0a6.js";import"./shared-343d1fd7.js";import"./shared-07e9d1fb.js";import"./shared-3ab0306f.js";import"./shared-eb116b3e.js";import"./shared-51c4a6dd.js";import"./shared-9f570db0.js";import"./shared-0dcc1ea4.js";import"./shared-67696f2f.js";import"./shared-61ade33e.js";import"./shared-8cc1f513.js";import"./shared-f655b20d.js";import"./shared-dbfccb3e.js";import"./shared-a0c6a159.js";import"./shared-8c937a7c.js";import"./shared-24ceebec.js";import"./shared-5ba412f7.js";import"./shared-fba9b7b3.js";import"./shared-b17fcc8f.js";import"./shared-ded1248f.js";import"./shared-d61d1d8d.js";import"./shared-02883252.js";import"./shared-a3ec1362.js";import"./shared-d070d509.js";import"./shared-c0242421.js";import"./shared-ce9795cd.js";import"./shared-99940888.js";import"./shared-e1cade57.js";import"./shared-ff35e803.js";import"./shared-6310fdde.js";import"./shared-a5ec3472.js";import"./shared-b56daa27.js";import"./shared-293771ba.js";import"./shared-2bf89a21.js";import"./shared-9f41236b.js";import"./shared-4345e9fd.js";import"./shared-c0cbb20a.js";import"./shared-1af365fe.js";import"./shared-09ac8087.js";import"./shared-d96312ed.js";import"./shared-1bb9c21a.js";import"./shared-e460ee3d.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-discount-builder.js";import"./shared-8438d4ca.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-collection-page.js";import"./foxy-form-dialog.js";import"./foxy-pagination.js";let p,m,f,h,_=t=>t;customElements.define("foxy-internal-transaction-customer-control",class extends e{constructor(){super(...arguments),this.__copyEmailState="idle",this.__copyIdState="idle"}static get properties(){return i(i({},super.properties),{},{__copyEmailState:{attribute:!1},__copyIdState:{attribute:!1}})}renderControl(){var t,e,i,o;const l=this.nucleon,c=null===(t=null==l?void 0:l.data)||void 0===t?void 0:t._links["fx:customer"].href,u=c?null===(e=null==l?void 0:l.getCustomerPageHref)||void 0===e?void 0:e.call(l,c):void 0;return n(p||(p=_` <foxy-i18n infer="" class="block text-s font-medium leading-xs mb-xs" key="label"> </foxy-i18n> <foxy-swipe-actions> <a class="${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" href="${0}"> <foxy-customer-card infer="" href="${0}"></foxy-customer-card> </a> <div class="h-full grid grid-cols-2 gap-s ml-s" slot="action"> ${0} ${0} </div> </foxy-swipe-actions> `),d({"block ring-inset rounded transition-colors":!0,"ring-1 ring-contrast-10":!u,"cursor-pointer bg-contrast-5 hover-bg-contrast-10":!!u,"focus-outline-none focus-ring-2 focus-ring-primary-50":!!u}),r(u),r(c),this.__renderCopyAction(a(m||(m=_`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.2rem; height: 1.2rem"><path fill-rule="evenodd" d="M9.493 2.852a.75.75 0 0 0-1.486-.204L7.545 6H4.198a.75.75 0 0 0 0 1.5h3.14l-.69 5H3.302a.75.75 0 0 0 0 1.5h3.14l-.435 3.148a.75.75 0 0 0 1.486.204L7.955 14h2.986l-.434 3.148a.75.75 0 0 0 1.486.204L12.456 14h3.346a.75.75 0 0 0 0-1.5h-3.14l.69-5h3.346a.75.75 0 0 0 0-1.5h-3.14l.435-3.148a.75.75 0 0 0-1.486-.204L12.045 6H9.059l.434-3.148ZM8.852 7.5l-.69 5h2.986l.69-5H8.852Z" clip-rule="evenodd" /></svg>`)),"copy_id_caption","__copyIdState",c?String(s(c)):""),this.__renderCopyAction(a(f||(f=_`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.2rem; height: 1.2rem"><path fill-rule="evenodd" d="M5.404 14.596A6.5 6.5 0 1 1 16.5 10a1.25 1.25 0 0 1-2.5 0 4 4 0 1 0-.571 2.06A2.75 2.75 0 0 0 18 10a8 8 0 1 0-2.343 5.657.75.75 0 0 0-1.06-1.06 6.5 6.5 0 0 1-9.193 0ZM10 7.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5Z" clip-rule="evenodd" /></svg>`)),"copy_email_caption","__copyEmailState",null!==(o=null===(i=null==l?void 0:l.data)||void 0===i?void 0:i.customer_email)&&void 0!==o?o:""))}__renderCopyAction(t,e,i,o){const s=this[i],r="fail"===s?"error":"done"===s?"end":"busy";return n(h||(h=_` <button class="relative transition-colors bg-contrast-5 text-body hover-bg-contrast-10 rounded h-full py-0 px-m focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50" ?disabled="${0}" @click="${0}" @focusout="${0}" @mouseout="${0}"> <div class="${0}"> ${0} <foxy-i18n class="mt-xs text-s font-medium leading-none" infer="" key="${0}"> </foxy-i18n> </div> <div class="${0}"> <foxy-spinner layout="no-label" state="${0}" infer="spinner"> </foxy-spinner> </div> </button> `),"idle"!==s,(()=>"idle"===s&&this.__copy(o,i)),(t=>"idle"!==s&&t.stopPropagation()),(t=>"idle"!==s&&t.stopPropagation()),d({"relative flex flex-col items-center justify-center transition-opacity":!0,"opacity-0":"idle"!==s}),t,e,d({"absolute inset-0 flex items-center justify-center transition-opacity":!0,"opacity-0":"idle"===s}),r)}async __copy(t,e){this[e]="busy";try{await navigator.clipboard.writeText(t),this[e]="done"}catch(t){this[e]="fail"}setTimeout((()=>this[e]="idle"),3e3)}});let y,v=t=>t;customElements.define("foxy-internal-transaction-post-action-control",class extends e{constructor(){super(...arguments),this.theme=null,this.href=null,this.__state="idle"}static get properties(){return i(i({},super.properties),{},{__state:{type:String},theme:{type:String},href:{type:String}})}renderControl(){const t=this.__state,e="fail"===t?"error":"idle"===t?this.theme:"";return n(y||(y=v` <foxy-internal-confirm-dialog header="header" infer="confirm" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <vaadin-button class="w-full" theme="${0} tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n key="${0}" infer=""></foxy-i18n> </vaadin-button> `),(t=>!t.detail.cancelled&&this.__submit()),e,"busy"===t||this.disabled,(t=>{this.renderRoot.querySelector("#confirm").show(t.currentTarget)}),t)}async __submit(){var t;if("busy"!==this.__state)try{this.__state="busy";const e=new l.API(this),i=await e.fetch(null!==(t=this.href)&&void 0!==t?t:"",{method:"POST"});this.__state=i.ok?"idle":"fail",i.ok&&this.dispatchEvent(new CustomEvent("done"))}catch(t){this.__state="fail"}}});let x,b,g,j,$,w,k=t=>t;customElements.define("foxy-internal-transaction-actions-control",class extends e{renderControl(){var t,e,i,o,s,r,a,d,l,c;return n(x||(x=k` <div class="flex flex-wrap gap-x-m gap-y-xs"> ${0} ${0} ${0} ${0} ${0} </div> `),(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:capture"])?this.__renderCaptureAction():"",(null===(o=null===(i=this.nucleon)||void 0===i?void 0:i.data)||void 0===o?void 0:o._links["fx:void"])?this.__renderVoidAction():"",(null===(r=null===(s=this.nucleon)||void 0===s?void 0:s.data)||void 0===r?void 0:r._links["fx:refund"])?this.__renderRefundAction():"",(null===(d=null===(a=this.nucleon)||void 0===a?void 0:a.data)||void 0===d?void 0:d._links["fx:send_emails"])?this.__renderSendEmailsAction():"",(null===(c=null===(l=this.nucleon)||void 0===l?void 0:l.data)||void 0===c?void 0:c._links["fx:subscription"])?this.__renderSubscriptionAction():"")}__renderSendEmailsAction(){var t,e;return n(b||(b=k` <foxy-internal-transaction-post-action-control infer="send-emails" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),r(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:send_emails"].href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderCaptureAction(){var t,e;return n(g||(g=k` <foxy-internal-transaction-post-action-control theme="success" infer="capture" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),r(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:capture"].href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderVoidAction(){var t,e,i;return n(j||(j=k` <foxy-internal-transaction-post-action-control theme="error" infer="void" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),r(null===(i=null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:void"])||void 0===i?void 0:i.href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderRefundAction(){var t,e,i;return n($||($=k` <foxy-internal-transaction-post-action-control infer="refund" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),r(null===(i=null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:refund"])||void 0===i?void 0:i.href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderSubscriptionAction(){var t,e,i;const o=this.nucleon,s=null===(e=null===(t=null==o?void 0:o.data)||void 0===t?void 0:t._links["fx:subscription"])||void 0===e?void 0:e.href,a=s?null===(i=null==o?void 0:o.getSubscriptionPageHref)||void 0===i?void 0:i.call(o,s):void 0;return n(w||(w=k` <a class="rounded text-m font-medium text-primary cursor-pointer transition-opacity hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="subscription" key="caption"></foxy-i18n> </a> `),r(a))}});let S,P,H,A,C,E,L,I,R,G,B=t=>t;customElements.define("foxy-internal-transaction-summary-control",class extends e{constructor(){super(...arguments),this.__storeLoaderId="storeLoader"}renderControl(){var t,e,i,o,s,a,d,l,c;const u=null===(t=this.nucleon)||void 0===t?void 0:t.data;if(!u)return n(S||(S=B``));const p=null!==(i=null===(e=null==u?void 0:u._embedded)||void 0===e?void 0:e["fx:applied_taxes"])&&void 0!==i?i:[],m=null!==(s=null===(o=u._embedded)||void 0===o?void 0:o["fx:shipments"])&&void 0!==s?s:[];return n(P||(P=B` <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <p class="grid gap-x-s text-right text-s leading-m border-dashed border rounded border-contrast-20 whitespace-nowrap overflow-auto" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 2px);grid-template-columns:1fr min-content"> <span><foxy-i18n key="subtotal" infer=""></foxy-i18n>:</span> <span>${0}</span> ${0} ${0} ${0} ${0} <span class="col-span-2 border-t border-dashed border-contrast-20 my-s"></span> <span class="col-span-2 flex gap-s justify-between items-center"> ${0} <span class="text-xl font-medium leading-xs"> <foxy-i18n infer="" key="total"></foxy-i18n>: ${0} </span> </span> </p> `),r(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.__renderPrice(u.total_item_price),0===m.length||0===u.total_shipping?n(H||(H=B` <span><foxy-i18n infer="" key="total_shipping"></foxy-i18n>:</span> <span>${0} </span> `),this.__renderPrice(u.total_shipping,!0)):m.map((t=>n(A||(A=B` <span>${0}:</span> <span>${0}</span> `),t.shipping_service_description,this.__renderPrice(t.total_shipping,!0)))),0===p.length||0===u.total_tax?n(C||(C=B` <span><foxy-i18n infer="" key="total_tax"></foxy-i18n>:</span> <span>${0}</span> `),this.__renderPrice(u.total_tax,!0)):p.map((t=>n(E||(E=B` <span>${0}:</span> <span>${0}</span> `),t.name,this.__renderPrice(t.amount,!0)))),null===(d=null===(a=null==u?void 0:u._embedded)||void 0===a?void 0:a["fx:applied_gift_card_codes"])||void 0===d?void 0:d.map((t=>{var e;return n(L||(L=B` <span>${0}:</span> <span>${0}</span> `),t._embedded["fx:gift_card"].name,this.__renderPrice(null!==(e=t.balance_adjustment)&&void 0!==e?e:0,!0))})),null===(c=null===(l=null==u?void 0:u._embedded)||void 0===l?void 0:l["fx:discounts"])||void 0===c?void 0:c.map((t=>n(I||(I=B` <span data-testclass="discount">${0}:</span> <span>${0}</span> `),t.name,this.__renderPrice(t.amount,!0)))),this.__renderStatus(),this.__renderPrice(u.total_order))}get __storeHref(){var t,e,i;return null===(i=null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:store"])||void 0===i?void 0:i.href}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}__renderPrice(t,e=!1){var i,o,s;const r=(null===(i=this.__store)||void 0===i?void 0:i.use_international_currency_symbol)?"code":"symbol",a=null===(s=null===(o=this.nucleon)||void 0===o?void 0:o.data)||void 0===s?void 0:s.currency_code;return n(R||(R=B` <foxy-i18n class="${0}" infer="" key="price" .options="${0}"> </foxy-i18n> `),e&&0!==t?t>0?"text-success":"text-error":"",{currencyDisplay:r,signDisplay:e?"exceptZero":"auto",amount:`${t} ${a}`})}__renderStatus(){var t,e;const i=(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e.status)||"completed";let o="";return o=["capturing","captured","approved","authorized","pending"].includes(i)?"text-success bg-success-10":i&&"completed"!==i?["problem","pending_fraud_review","rejected","declined"].includes(i)?"text-error-contrast bg-error":"bg-contrast-5 text-body":"text-success-contrast bg-success",n(G||(G=B` <foxy-i18n infer="" class="${0} rounded-s py-xs px-s font-medium text-s leading-xs" key="status_${0}"></foxy-i18n> `),o,i)}});let Z,M,T=t=>t;const W=c(u(t,"transaction"));class q extends W{constructor(){super(...arguments),this.hostedPaymentGatewaysHelper=null,this.paymentGatewaysHelper=null,this.getSubscriptionPageHref=null,this.getCustomerPageHref=null}static get properties(){return i(i({},super.properties),{},{hostedPaymentGatewaysHelper:{attribute:"hosted-payment-gateways-helper"},paymentGatewaysHelper:{attribute:"payment-gateways-helper"},getSubscriptionPageHref:{attribute:!1},getCustomerPageHref:{attribute:!1}})}get readonlySelector(){var t,e,i;const s=Boolean(null!==(e=null===(t=this.data)||void 0===t?void 0:t._links["fx:void"])&&void 0!==e?e:null===(i=this.data)||void 0===i?void 0:i._links["fx:refund"]);return new o(s?`${super.readonlySelector} billing-addresses`:`${super.readonlySelector} billing-addresses items attributes custom-fields`)}get hiddenSelector(){var t,e;const i=["billing-addresses:dialog:delete billing-addresses:dialog:timestamps"],s=null===(t=this.data)||void 0===t?void 0:t.type;return(null===(e=this.data)||void 0===e?void 0:e._links["fx:subscription"])||i.push("subscription"),"subscription_modification"===s&&i.push("actions"),"updateinfo"===s&&i.push("not=customer,subscription,payments,custom-fields,attributes"),"subscription_cancellation"===s&&i.push("not=customer,subscription,custom-fields,attributes"),new o(`${super.hiddenSelector} ${i.join(" ")}`.trim())}renderBody(){var t,e,i,o,s,a,d,l,c,u,p,m,f;let h,_,y="subtitle";const v=this.hiddenSelector,x=null===(t=this.data)||void 0===t?void 0:t.source,b=null===(e=this.data)||void 0===e?void 0:e.type;if("updateinfo"===b?y=!x||(null==x?void 0:x.startsWith("cit_"))?"subtitle_customer_changed_payment_method":"mit_uoe"===x?"subtitle_admin_changed_payment_method_with_uoe":"mit_api"===x?"subtitle_integration_changed_payment_method":"subtitle_admin_changed_payment_method":"subscription_modification"===b?y=!x||(null==x?void 0:x.startsWith("cit_"))?"subtitle_customer_changed_subscription":"mit_uoe"===x?"subtitle_admin_changed_subscription_with_uoe":"mit_api"===x?"subtitle_integration_changed_subscription":"subtitle_admin_changed_subscription":"subscription_renewal"===b?"mit_recurring"===x?y="subtitle_subscription_renewal_attempt":"mit_recurring_reattempt_automated"===x?y="subtitle_subscription_renewal_automated_reattempt":"mit_recurring_reattempt_manual"===x&&(y="subtitle_subscription_renewal_manual_reattempt"):"subscription_cancellation"===b?"cit_recurring_cancellation"===x?y="subtitle_customer_canceled_subscription":"mit_recurring_cancellation"===x&&(y="subtitle_admin_canceled_subscription"):(null===(i=this.data)||void 0===i?void 0:i._links["fx:subscription"])?(null==x?void 0:x.startsWith("cit_"))?y="subtitle_customer_subscribed":"mit_uoe"===x?y="subtitle_admin_subscribed_with_uoe":"mit_api"===x&&(y="subtitle_integration_subscribed"):(null==x?void 0:x.startsWith("cit_"))?y="subtitle_customer_placed_order":"mit_uoe"===x?y="subtitle_admin_placed_order_with_uoe":"mit_api"===x&&(y="subtitle_integration_placed_order"),this.data)try{const t=new URL(this.data._links["fx:shipments"].href),e=new URL(this.data._links["fx:items"].href);t.searchParams.set("zoom","items:item_category"),e.searchParams.set("zoom","item_options"),h=t.toString(),_=e.toString()}catch(t){}return n(Z||(Z=T` <h2> <div class="flex items-center gap-s leading-xs text-xxl font-medium break-all"> <foxy-i18n infer="header" key="title" .options="${0}"></foxy-i18n> <foxy-copy-to-clipboard infer="header" class="inline-block text-m" text="${0}"> </foxy-copy-to-clipboard> </div> <foxy-i18n class="block leading-xs text-l text-secondary" infer="header" key="${0}" .options="${0}"> </foxy-i18n> <foxy-internal-transaction-actions-control class="mt-xs" infer="actions"> </foxy-internal-transaction-actions-control> </h2> ${0} <foxy-internal-transaction-customer-control infer="customer"> </foxy-internal-transaction-customer-control> <div class="grid gap-s" ?hidden="${0}"> <foxy-internal-async-list-control infer="items" class="min-w-0" first="${0}" limit="10" item="foxy-item-card" form="foxy-item-form" alert .related="${0}"> </foxy-internal-async-list-control> <foxy-internal-transaction-summary-control infer="summary" class="min-w-0"> </foxy-internal-transaction-summary-control> </div> <foxy-internal-async-list-control infer="billing-addresses" first="${0}" item="foxy-billing-address-card" form="foxy-address-form" hide-create-button hide-delete-button alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="payments" first="${0}" item="foxy-payment-card" .itemProps="${0}"> </foxy-internal-async-list-control> <div class="grid gap-m sm-grid-cols-2" ?hidden="${0}"> <foxy-internal-async-list-control infer="custom-fields" class="min-w-0" first="${0}" limit="5" form="foxy-custom-field-form" item="foxy-custom-field-card" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" limit="5" form="foxy-attribute-form" item="foxy-attribute-card" alert> </foxy-internal-async-list-control> </div> <foxy-internal-async-list-control infer="shipments" first="${0}" item="foxy-shipment-card"> </foxy-internal-async-list-control> `),this.data,null===(o=this.data)||void 0===o?void 0:o.display_id,y,{transaction_date:null===(s=this.data)||void 0===s?void 0:s.transaction_date,ip_country:null===(a=this.data)||void 0===a?void 0:a.ip_country},["problem","pending_fraud_review","rejected","declined"].includes(null!==(l=null===(d=this.data)||void 0===d?void 0:d.status)&&void 0!==l?l:"")?n(M||(M=T` <p class="leading-xs text-body rounded bg-error-10 block" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <foxy-i18n infer="header" key="alert_status_${0}"></foxy-i18n> </p> `),null===(c=this.data)||void 0===c?void 0:c.status):"",v.matches("items",!0)&&v.matches("summary",!0),r(_),[this.href],r(null===(u=this.data)||void 0===u?void 0:u._links["fx:billing_addresses"].href),r(null===(p=this.data)||void 0===p?void 0:p._links["fx:payments"].href),{"hosted-payment-gateways-helper":this.hostedPaymentGatewaysHelper,"payment-gateways-helper":this.paymentGatewaysHelper},v.matches("custom-fields",!0)&&v.matches("attributes",!0),r(null===(m=this.data)||void 0===m?void 0:m._links["fx:custom_fields"].href),r(null===(f=this.data)||void 0===f?void 0:f._links["fx:attributes"].href),r(h))}}customElements.define("foxy-transaction",q);export{q as Transaction};
|
|
1
|
+
import"./foxy-billing-address-card.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-custom-field-form.js";import"./foxy-custom-field-card.js";import"./foxy-copy-to-clipboard.js";import"./foxy-shipment-card.js";import"./foxy-payment-card.js";import"./foxy-item-card.js";import"./foxy-item-form.js";import"./shared-f5d4dda0.js";import"./shared-1024766f.js";import{I as t}from"./shared-966feb65.js";import{a as e}from"./shared-2062c274.js";import"./foxy-customer-card.js";import"./foxy-swipe-actions.js";import"./foxy-spinner.js";import{_ as i,B as o}from"./shared-1522d76f.js";import{g as s}from"./shared-bab2ea2c.js";import{i as r}from"./shared-9803aa7c.js";import{h as n,s as a}from"./shared-dc73b9a5.js";import{c as d}from"./shared-4e709717.js";import"./shared-37e1a834.js";import"./shared-030f561a.js";import{N as l}from"./shared-a0435ec6.js";import"./foxy-nucleon-element.js";import{R as c,a as u}from"./shared-331a223c.js";import"./shared-d0374d0c.js";import"./shared-d244dd07.js";import"./shared-e40937c5.js";import"./shared-bf695fe7.js";import"./shared-8b80db13.js";import"./shared-30cbf0a6.js";import"./shared-343d1fd7.js";import"./shared-07e9d1fb.js";import"./shared-3ab0306f.js";import"./shared-eb116b3e.js";import"./shared-51c4a6dd.js";import"./shared-9f570db0.js";import"./shared-7ea4cb27.js";import"./shared-cfed658c.js";import"./shared-61ade33e.js";import"./shared-fd0a4026.js";import"./shared-0cbb19f4.js";import"./shared-a0c6a159.js";import"./shared-5df32007.js";import"./shared-405a290e.js";import"./shared-cd8c3429.js";import"./shared-a9f76cae.js";import"./shared-293771ba.js";import"./shared-2bf89a21.js";import"./shared-6d41c9a9.js";import"./shared-655e7c5f.js";import"./shared-882e7191.js";import"./shared-8ab2ba91.js";import"./shared-9adc47da.js";import"./shared-3f19b914.js";import"./shared-651c44fa.js";import"./shared-4482e7b9.js";import"./shared-33d8cbfb.js";import"./shared-db98729a.js";import"./shared-44bb85d8.js";import"./shared-f94fa366.js";import"./shared-97d63da6.js";import"./shared-f588b5c2.js";import"./shared-0cf90158.js";import"./shared-f53d078e.js";import"./shared-2920b595.js";import"./shared-150f5214.js";import"./shared-2376abfc.js";import"./shared-5ba87b6d.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-discount-builder.js";import"./shared-8438d4ca.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-collection-page.js";import"./shared-99940888.js";import"./foxy-form-dialog.js";import"./foxy-pagination.js";let p,m,f,h,_=t=>t;customElements.define("foxy-internal-transaction-customer-control",class extends e{constructor(){super(...arguments),this.__copyEmailState="idle",this.__copyIdState="idle"}static get properties(){return i(i({},super.properties),{},{__copyEmailState:{attribute:!1},__copyIdState:{attribute:!1}})}renderControl(){var t,e,i,o;const l=this.nucleon,c=null===(t=null==l?void 0:l.data)||void 0===t?void 0:t._links["fx:customer"].href,u=c?null===(e=null==l?void 0:l.getCustomerPageHref)||void 0===e?void 0:e.call(l,c):void 0;return n(p||(p=_` <foxy-i18n infer="" class="block text-s font-medium leading-xs mb-xs" key="label"> </foxy-i18n> <foxy-swipe-actions> <a class="${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" href="${0}"> <foxy-customer-card infer="" href="${0}"></foxy-customer-card> </a> <div class="h-full grid grid-cols-2 gap-s ml-s" slot="action"> ${0} ${0} </div> </foxy-swipe-actions> `),d({"block ring-inset rounded transition-colors":!0,"ring-1 ring-contrast-10":!u,"cursor-pointer bg-contrast-5 hover-bg-contrast-10":!!u,"focus-outline-none focus-ring-2 focus-ring-primary-50":!!u}),r(u),r(c),this.__renderCopyAction(a(m||(m=_`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.2rem; height: 1.2rem"><path fill-rule="evenodd" d="M9.493 2.852a.75.75 0 0 0-1.486-.204L7.545 6H4.198a.75.75 0 0 0 0 1.5h3.14l-.69 5H3.302a.75.75 0 0 0 0 1.5h3.14l-.435 3.148a.75.75 0 0 0 1.486.204L7.955 14h2.986l-.434 3.148a.75.75 0 0 0 1.486.204L12.456 14h3.346a.75.75 0 0 0 0-1.5h-3.14l.69-5h3.346a.75.75 0 0 0 0-1.5h-3.14l.435-3.148a.75.75 0 0 0-1.486-.204L12.045 6H9.059l.434-3.148ZM8.852 7.5l-.69 5h2.986l.69-5H8.852Z" clip-rule="evenodd" /></svg>`)),"copy_id_caption","__copyIdState",c?String(s(c)):""),this.__renderCopyAction(a(f||(f=_`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.2rem; height: 1.2rem"><path fill-rule="evenodd" d="M5.404 14.596A6.5 6.5 0 1 1 16.5 10a1.25 1.25 0 0 1-2.5 0 4 4 0 1 0-.571 2.06A2.75 2.75 0 0 0 18 10a8 8 0 1 0-2.343 5.657.75.75 0 0 0-1.06-1.06 6.5 6.5 0 0 1-9.193 0ZM10 7.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5Z" clip-rule="evenodd" /></svg>`)),"copy_email_caption","__copyEmailState",null!==(o=null===(i=null==l?void 0:l.data)||void 0===i?void 0:i.customer_email)&&void 0!==o?o:""))}__renderCopyAction(t,e,i,o){const s=this[i],r="fail"===s?"error":"done"===s?"end":"busy";return n(h||(h=_` <button class="relative transition-colors bg-contrast-5 text-body hover-bg-contrast-10 rounded h-full py-0 px-m focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50" ?disabled="${0}" @click="${0}" @focusout="${0}" @mouseout="${0}"> <div class="${0}"> ${0} <foxy-i18n class="mt-xs text-s font-medium leading-none" infer="" key="${0}"> </foxy-i18n> </div> <div class="${0}"> <foxy-spinner layout="no-label" state="${0}" infer="spinner"> </foxy-spinner> </div> </button> `),"idle"!==s,(()=>"idle"===s&&this.__copy(o,i)),(t=>"idle"!==s&&t.stopPropagation()),(t=>"idle"!==s&&t.stopPropagation()),d({"relative flex flex-col items-center justify-center transition-opacity":!0,"opacity-0":"idle"!==s}),t,e,d({"absolute inset-0 flex items-center justify-center transition-opacity":!0,"opacity-0":"idle"===s}),r)}async __copy(t,e){this[e]="busy";try{await navigator.clipboard.writeText(t),this[e]="done"}catch(t){this[e]="fail"}setTimeout((()=>this[e]="idle"),3e3)}});let y,v=t=>t;customElements.define("foxy-internal-transaction-post-action-control",class extends e{constructor(){super(...arguments),this.theme=null,this.href=null,this.__state="idle"}static get properties(){return i(i({},super.properties),{},{__state:{type:String},theme:{type:String},href:{type:String}})}renderControl(){const t=this.__state,e="fail"===t?"error":"idle"===t?this.theme:"";return n(y||(y=v` <foxy-internal-confirm-dialog header="header" infer="confirm" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> <vaadin-button class="w-full" theme="${0} tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n key="${0}" infer=""></foxy-i18n> </vaadin-button> `),(t=>!t.detail.cancelled&&this.__submit()),e,"busy"===t||this.disabled,(t=>{this.renderRoot.querySelector("#confirm").show(t.currentTarget)}),t)}async __submit(){var t;if("busy"!==this.__state)try{this.__state="busy";const e=new l.API(this),i=await e.fetch(null!==(t=this.href)&&void 0!==t?t:"",{method:"POST"});this.__state=i.ok?"idle":"fail",i.ok&&this.dispatchEvent(new CustomEvent("done"))}catch(t){this.__state="fail"}}});let x,b,g,j,$,w,k=t=>t;customElements.define("foxy-internal-transaction-actions-control",class extends e{renderControl(){var t,e,i,o,s,r,a,d,l,c;return n(x||(x=k` <div class="flex flex-wrap gap-x-m gap-y-xs"> ${0} ${0} ${0} ${0} ${0} </div> `),(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:capture"])?this.__renderCaptureAction():"",(null===(o=null===(i=this.nucleon)||void 0===i?void 0:i.data)||void 0===o?void 0:o._links["fx:void"])?this.__renderVoidAction():"",(null===(r=null===(s=this.nucleon)||void 0===s?void 0:s.data)||void 0===r?void 0:r._links["fx:refund"])?this.__renderRefundAction():"",(null===(d=null===(a=this.nucleon)||void 0===a?void 0:a.data)||void 0===d?void 0:d._links["fx:send_emails"])?this.__renderSendEmailsAction():"",(null===(c=null===(l=this.nucleon)||void 0===l?void 0:l.data)||void 0===c?void 0:c._links["fx:subscription"])?this.__renderSubscriptionAction():"")}__renderSendEmailsAction(){var t,e;return n(b||(b=k` <foxy-internal-transaction-post-action-control infer="send-emails" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),r(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:send_emails"].href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderCaptureAction(){var t,e;return n(g||(g=k` <foxy-internal-transaction-post-action-control theme="success" infer="capture" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),r(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:capture"].href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderVoidAction(){var t,e,i;return n(j||(j=k` <foxy-internal-transaction-post-action-control theme="error" infer="void" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),r(null===(i=null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:void"])||void 0===i?void 0:i.href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderRefundAction(){var t,e,i;return n($||($=k` <foxy-internal-transaction-post-action-control infer="refund" href="${0}" @done="${0}"> </foxy-internal-transaction-post-action-control> `),r(null===(i=null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:refund"])||void 0===i?void 0:i.href),(()=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.refresh()}))}__renderSubscriptionAction(){var t,e,i;const o=this.nucleon,s=null===(e=null===(t=null==o?void 0:o.data)||void 0===t?void 0:t._links["fx:subscription"])||void 0===e?void 0:e.href,a=s?null===(i=null==o?void 0:o.getSubscriptionPageHref)||void 0===i?void 0:i.call(o,s):void 0;return n(w||(w=k` <a class="rounded text-m font-medium text-primary cursor-pointer transition-opacity hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="subscription" key="caption"></foxy-i18n> </a> `),r(a))}});let S,P,H,A,C,E,L,I,R,G,B=t=>t;customElements.define("foxy-internal-transaction-summary-control",class extends e{constructor(){super(...arguments),this.__storeLoaderId="storeLoader"}renderControl(){var t,e,i,o,s,a,d,l,c;const u=null===(t=this.nucleon)||void 0===t?void 0:t.data;if(!u)return n(S||(S=B``));const p=null!==(i=null===(e=null==u?void 0:u._embedded)||void 0===e?void 0:e["fx:applied_taxes"])&&void 0!==i?i:[],m=null!==(s=null===(o=u._embedded)||void 0===o?void 0:o["fx:shipments"])&&void 0!==s?s:[];return n(P||(P=B` <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <p class="grid gap-x-s text-right text-s leading-m border-dashed border rounded border-contrast-20 whitespace-nowrap overflow-auto" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 2px);grid-template-columns:1fr min-content"> <span><foxy-i18n key="subtotal" infer=""></foxy-i18n>:</span> <span>${0}</span> ${0} ${0} ${0} ${0} <span class="col-span-2 border-t border-dashed border-contrast-20 my-s"></span> <span class="col-span-2 flex gap-s justify-between items-center"> ${0} <span class="text-xl font-medium leading-xs"> <foxy-i18n infer="" key="total"></foxy-i18n>: ${0} </span> </span> </p> `),r(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.__renderPrice(u.total_item_price),0===m.length||0===u.total_shipping?n(H||(H=B` <span><foxy-i18n infer="" key="total_shipping"></foxy-i18n>:</span> <span>${0} </span> `),this.__renderPrice(u.total_shipping,!0)):m.map((t=>n(A||(A=B` <span>${0}:</span> <span>${0}</span> `),t.shipping_service_description,this.__renderPrice(t.total_shipping,!0)))),0===p.length||0===u.total_tax?n(C||(C=B` <span><foxy-i18n infer="" key="total_tax"></foxy-i18n>:</span> <span>${0}</span> `),this.__renderPrice(u.total_tax,!0)):p.map((t=>n(E||(E=B` <span>${0}:</span> <span>${0}</span> `),t.name,this.__renderPrice(t.amount,!0)))),null===(d=null===(a=null==u?void 0:u._embedded)||void 0===a?void 0:a["fx:applied_gift_card_codes"])||void 0===d?void 0:d.map((t=>{var e;return n(L||(L=B` <span>${0}:</span> <span>${0}</span> `),t._embedded["fx:gift_card"].name,this.__renderPrice(null!==(e=t.balance_adjustment)&&void 0!==e?e:0,!0))})),null===(c=null===(l=null==u?void 0:u._embedded)||void 0===l?void 0:l["fx:discounts"])||void 0===c?void 0:c.map((t=>n(I||(I=B` <span data-testclass="discount">${0}:</span> <span>${0}</span> `),t.name,this.__renderPrice(t.amount,!0)))),this.__renderStatus(),this.__renderPrice(u.total_order))}get __storeHref(){var t,e,i;return null===(i=null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e._links["fx:store"])||void 0===i?void 0:i.href}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}__renderPrice(t,e=!1){var i,o,s;const r=(null===(i=this.__store)||void 0===i?void 0:i.use_international_currency_symbol)?"code":"symbol",a=null===(s=null===(o=this.nucleon)||void 0===o?void 0:o.data)||void 0===s?void 0:s.currency_code;return n(R||(R=B` <foxy-i18n class="${0}" infer="" key="price" .options="${0}"> </foxy-i18n> `),e&&0!==t?t>0?"text-success":"text-error":"",{currencyDisplay:r,signDisplay:e?"exceptZero":"auto",amount:`${t} ${a}`})}__renderStatus(){var t,e;const i=(null===(e=null===(t=this.nucleon)||void 0===t?void 0:t.data)||void 0===e?void 0:e.status)||"completed";let o="";return o=["capturing","captured","approved","authorized","pending"].includes(i)?"text-success bg-success-10":i&&"completed"!==i?["problem","pending_fraud_review","rejected","declined"].includes(i)?"text-error-contrast bg-error":"bg-contrast-5 text-body":"text-success-contrast bg-success",n(G||(G=B` <foxy-i18n infer="" class="${0} rounded-s py-xs px-s font-medium text-s leading-xs" key="status_${0}"></foxy-i18n> `),o,i)}});let Z,M,T=t=>t;const W=c(u(t,"transaction"));class q extends W{constructor(){super(...arguments),this.hostedPaymentGatewaysHelper=null,this.paymentGatewaysHelper=null,this.getSubscriptionPageHref=null,this.getCustomerPageHref=null}static get properties(){return i(i({},super.properties),{},{hostedPaymentGatewaysHelper:{attribute:"hosted-payment-gateways-helper"},paymentGatewaysHelper:{attribute:"payment-gateways-helper"},getSubscriptionPageHref:{attribute:!1},getCustomerPageHref:{attribute:!1}})}get readonlySelector(){var t,e,i;const s=Boolean(null!==(e=null===(t=this.data)||void 0===t?void 0:t._links["fx:void"])&&void 0!==e?e:null===(i=this.data)||void 0===i?void 0:i._links["fx:refund"]);return new o(s?`${super.readonlySelector} billing-addresses`:`${super.readonlySelector} billing-addresses items attributes custom-fields`)}get hiddenSelector(){var t,e;const i=["billing-addresses:dialog:delete billing-addresses:dialog:timestamps"],s=null===(t=this.data)||void 0===t?void 0:t.type;return(null===(e=this.data)||void 0===e?void 0:e._links["fx:subscription"])||i.push("subscription"),"subscription_modification"===s&&i.push("actions"),"updateinfo"===s&&i.push("not=customer,subscription,payments,custom-fields,attributes"),"subscription_cancellation"===s&&i.push("not=customer,subscription,custom-fields,attributes"),new o(`${super.hiddenSelector} ${i.join(" ")}`.trim())}renderBody(){var t,e,i,o,s,a,d,l,c,u,p,m,f;let h,_,y="subtitle";const v=this.hiddenSelector,x=null===(t=this.data)||void 0===t?void 0:t.source,b=null===(e=this.data)||void 0===e?void 0:e.type;if("updateinfo"===b?y=!x||(null==x?void 0:x.startsWith("cit_"))?"subtitle_customer_changed_payment_method":"mit_uoe"===x?"subtitle_admin_changed_payment_method_with_uoe":"mit_api"===x?"subtitle_integration_changed_payment_method":"subtitle_admin_changed_payment_method":"subscription_modification"===b?y=!x||(null==x?void 0:x.startsWith("cit_"))?"subtitle_customer_changed_subscription":"mit_uoe"===x?"subtitle_admin_changed_subscription_with_uoe":"mit_api"===x?"subtitle_integration_changed_subscription":"subtitle_admin_changed_subscription":"subscription_renewal"===b?"mit_recurring"===x?y="subtitle_subscription_renewal_attempt":"mit_recurring_reattempt_automated"===x?y="subtitle_subscription_renewal_automated_reattempt":"mit_recurring_reattempt_manual"===x&&(y="subtitle_subscription_renewal_manual_reattempt"):"subscription_cancellation"===b?"cit_recurring_cancellation"===x?y="subtitle_customer_canceled_subscription":"mit_recurring_cancellation"===x&&(y="subtitle_admin_canceled_subscription"):(null===(i=this.data)||void 0===i?void 0:i._links["fx:subscription"])?(null==x?void 0:x.startsWith("cit_"))?y="subtitle_customer_subscribed":"mit_uoe"===x?y="subtitle_admin_subscribed_with_uoe":"mit_api"===x&&(y="subtitle_integration_subscribed"):(null==x?void 0:x.startsWith("cit_"))?y="subtitle_customer_placed_order":"mit_uoe"===x?y="subtitle_admin_placed_order_with_uoe":"mit_api"===x&&(y="subtitle_integration_placed_order"),this.data)try{const t=new URL(this.data._links["fx:shipments"].href),e=new URL(this.data._links["fx:items"].href);t.searchParams.set("zoom","items:item_category"),e.searchParams.set("zoom","item_options"),h=t.toString(),_=e.toString()}catch(t){}return n(Z||(Z=T` <h2> <div class="flex items-center gap-s leading-xs text-xxl font-medium break-all"> <foxy-i18n infer="header" key="title" .options="${0}"></foxy-i18n> <foxy-copy-to-clipboard infer="header" class="inline-block text-m" text="${0}"> </foxy-copy-to-clipboard> </div> <foxy-i18n class="block leading-xs text-l text-secondary" infer="header" key="${0}" .options="${0}"> </foxy-i18n> <foxy-internal-transaction-actions-control class="mt-xs" infer="actions"> </foxy-internal-transaction-actions-control> </h2> ${0} <foxy-internal-transaction-customer-control infer="customer"> </foxy-internal-transaction-customer-control> <div class="grid gap-s" ?hidden="${0}"> <foxy-internal-async-list-control infer="items" class="min-w-0" first="${0}" limit="10" item="foxy-item-card" form="foxy-item-form" alert .related="${0}"> </foxy-internal-async-list-control> <foxy-internal-transaction-summary-control infer="summary" class="min-w-0"> </foxy-internal-transaction-summary-control> </div> <foxy-internal-async-list-control infer="billing-addresses" first="${0}" item="foxy-billing-address-card" form="foxy-address-form" hide-create-button hide-delete-button alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="payments" first="${0}" item="foxy-payment-card" .itemProps="${0}"> </foxy-internal-async-list-control> <div class="grid gap-m sm-grid-cols-2" ?hidden="${0}"> <foxy-internal-async-list-control infer="custom-fields" class="min-w-0" first="${0}" limit="5" form="foxy-custom-field-form" item="foxy-custom-field-card" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" limit="5" form="foxy-attribute-form" item="foxy-attribute-card" alert> </foxy-internal-async-list-control> </div> <foxy-internal-async-list-control infer="shipments" first="${0}" item="foxy-shipment-card"> </foxy-internal-async-list-control> `),this.data,null===(o=this.data)||void 0===o?void 0:o.display_id,y,{transaction_date:null===(s=this.data)||void 0===s?void 0:s.transaction_date,ip_country:null===(a=this.data)||void 0===a?void 0:a.ip_country},["problem","pending_fraud_review","rejected","declined"].includes(null!==(l=null===(d=this.data)||void 0===d?void 0:d.status)&&void 0!==l?l:"")?n(M||(M=T` <p class="leading-xs text-body rounded bg-error-10 block" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <foxy-i18n infer="header" key="alert_status_${0}"></foxy-i18n> </p> `),null===(c=this.data)||void 0===c?void 0:c.status):"",v.matches("items",!0)&&v.matches("summary",!0),r(_),[this.href],r(null===(u=this.data)||void 0===u?void 0:u._links["fx:billing_addresses"].href),r(null===(p=this.data)||void 0===p?void 0:p._links["fx:payments"].href),{"hosted-payment-gateways-helper":this.hostedPaymentGatewaysHelper,"payment-gateways-helper":this.paymentGatewaysHelper},v.matches("custom-fields",!0)&&v.matches("attributes",!0),r(null===(m=this.data)||void 0===m?void 0:m._links["fx:custom_fields"].href),r(null===(f=this.data)||void 0===f?void 0:f._links["fx:attributes"].href),r(h))}}customElements.define("foxy-transaction",q);export{q as Transaction};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-8b80db13.js";import"./shared-e40937c5.js";import"./foxy-spinner.js";import"./shared-f5d4dda0.js";import{T as t}from"./shared-a19e1dff.js";import{a as s}from"./shared-331a223c.js";import"./shared-bf695fe7.js";import"./shared-1522d76f.js";import"./shared-dc73b9a5.js";import"./shared-30cbf0a6.js";import"./shared-343d1fd7.js";import"./shared-9f570db0.js";import"./shared-9803aa7c.js";import"./foxy-nucleon-element.js";import"./shared-a0435ec6.js";import"./shared-07e9d1fb.js";import"./shared-3ab0306f.js";import"./shared-eb116b3e.js";import"./shared-4e709717.js";let e,a,n,o,r,i,l=t=>t;class d extends(s(t,"transactions-table")){constructor(){super(...arguments),this.columns=[d.priceColumn,d.summaryColumn,d.statusColumn,d.idColumn,d.dateColumn,d.receiptColumn]}}d.priceColumn={cell:t=>t.html(e||(e=l`
|
|
2
2
|
<foxy-i18n
|
|
3
3
|
data-testclass="i18n totals"
|
|
4
4
|
class="text-m font-medium font-tnum"
|
|
@@ -8,7 +8,7 @@ import"./shared-36a09fe6.js";import"./shared-019ad470.js";import"./foxy-spinner.
|
|
|
8
8
|
.options=${0}
|
|
9
9
|
>
|
|
10
10
|
</foxy-i18n>
|
|
11
|
-
`),t.lang,t.ns,{amount:`${t.data.total_order} ${t.data.currency_code}`})},
|
|
11
|
+
`),t.lang,t.ns,{amount:`${t.data.total_order} ${t.data.currency_code}`})},d.summaryColumn={cell:t=>{var s;const e=null===(s=t.data._embedded)||void 0===s?void 0:s["fx:items"];if(!e)return"";const n={most_expensive_item:[...e].sort(((t,s)=>t.price-s.price))[0],count_minus_one:e.length-1,count:e.length};return t.html(a||(a=l`
|
|
12
12
|
<foxy-i18n
|
|
13
13
|
data-testclass="i18n summaries"
|
|
14
14
|
class="text-m"
|
|
@@ -18,7 +18,7 @@ import"./shared-36a09fe6.js";import"./shared-019ad470.js";import"./foxy-spinner.
|
|
|
18
18
|
.options=${0}
|
|
19
19
|
>
|
|
20
20
|
</foxy-i18n>
|
|
21
|
-
`),t.lang,t.ns,n)}},
|
|
21
|
+
`),t.lang,t.ns,n)}},d.statusColumn={hideBelow:"sm",cell:t=>{const s={completed:"bg-success-10 text-success",declined:"bg-error-10 text-error",rejected:"bg-error-10 text-error"},e=t.data.status||"completed",a=e in s?s[e]:"bg-contrast-5 text-contrast";return t.html(n||(n=l`
|
|
22
22
|
<foxy-i18n
|
|
23
23
|
data-testclass="i18n statuses"
|
|
24
24
|
class="px-s py-xs text-m font-medium rounded ${0}"
|
|
@@ -27,11 +27,11 @@ import"./shared-36a09fe6.js";import"./shared-019ad470.js";import"./foxy-spinner.
|
|
|
27
27
|
ns=${0}
|
|
28
28
|
>
|
|
29
29
|
</foxy-i18n>
|
|
30
|
-
`),a,t.lang,`transaction_${e}`,t.ns)}},
|
|
30
|
+
`),a,t.lang,`transaction_${e}`,t.ns)}},d.idColumn={hideBelow:"sm",cell:t=>t.html(o||(o=l`
|
|
31
31
|
<span class="text-m text-secondary font-tnum" data-testclass="ids">
|
|
32
32
|
<span class="text-tertiary">ID</span> ${0}
|
|
33
33
|
</span>
|
|
34
|
-
`),t.data.id)},
|
|
34
|
+
`),t.data.id)},d.dateColumn={hideBelow:"sm",cell:t=>t.html(r||(r=l`
|
|
35
35
|
<foxy-i18n
|
|
36
36
|
data-testclass="i18n dates"
|
|
37
37
|
class="text-m text-secondary font-tnum"
|
|
@@ -41,7 +41,7 @@ import"./shared-36a09fe6.js";import"./shared-019ad470.js";import"./foxy-spinner.
|
|
|
41
41
|
.options=${0}
|
|
42
42
|
>
|
|
43
43
|
</foxy-i18n>
|
|
44
|
-
`),t.lang,t.ns,{value:t.data.transaction_date})},
|
|
44
|
+
`),t.lang,t.ns,{value:t.data.transaction_date})},d.receiptColumn={cell:t=>t.html(i||(i=l`
|
|
45
45
|
<a
|
|
46
46
|
data-testclass="links"
|
|
47
47
|
target="_blank"
|
|
@@ -57,4 +57,4 @@ import"./shared-36a09fe6.js";import"./shared-019ad470.js";import"./foxy-spinner.
|
|
|
57
57
|
</foxy-i18n>
|
|
58
58
|
<iron-icon icon="icons:open-in-new" class="icon-inline"></iron-icon>
|
|
59
59
|
</a>
|
|
60
|
-
`),t.data._links["fx:receipt"].href,t.ns,t.lang)},
|
|
60
|
+
`),t.data._links["fx:receipt"].href,t.ns,t.lang)},d.__ns="transactions-table",customElements.define("foxy-transactions-table",d);export{d as TransactionsTable};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-
|
|
1
|
+
import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-f5d4dda0.js";import{a as r}from"./shared-331a223c.js";import{T as s}from"./shared-a9f76cae.js";import{h as e}from"./shared-dc73b9a5.js";import"./shared-e40937c5.js";import"./shared-bf695fe7.js";import"./shared-8b80db13.js";import"./shared-1522d76f.js";import"./shared-30cbf0a6.js";import"./shared-343d1fd7.js";import"./shared-9f570db0.js";import"./shared-9803aa7c.js";import"./shared-d244dd07.js";import"./shared-a0435ec6.js";import"./shared-07e9d1fb.js";import"./shared-3ab0306f.js";import"./shared-eb116b3e.js";import"./shared-4e709717.js";let a,d,t=r=>r;const o=r(s,"user-card");class i extends o{renderBody(){return super.renderBody({title:r=>{const s=[r.first_name.trim(),r.last_name.trim()];return e(a||(a=t`${0}`),s.filter((r=>!!r)).join(" ")||this.t("no_name"))},subtitle:r=>e(d||(d=t`${0}`),r.email)})}}customElements.define("foxy-user-card",i);export{i as UserCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-405a290e.js";import"./shared-0cf90158.js";import"./shared-2920b595.js";import{I as e}from"./shared-966feb65.js";import{v as r}from"./shared-b738ee96.js";import{a as t}from"./shared-331a223c.js";import{B as o}from"./shared-1522d76f.js";import{h as s}from"./shared-dc73b9a5.js";import"./shared-cd8c3429.js";import"./shared-cfed658c.js";import"./shared-bf695fe7.js";import"./shared-61ade33e.js";import"./shared-fd0a4026.js";import"./shared-e40937c5.js";import"./shared-2062c274.js";import"./shared-51c4a6dd.js";import"./shared-f5d4dda0.js";import"./shared-343d1fd7.js";import"./shared-30cbf0a6.js";import"./shared-9f570db0.js";import"./shared-9803aa7c.js";import"./shared-a0435ec6.js";import"./shared-07e9d1fb.js";import"./shared-3ab0306f.js";import"./shared-eb116b3e.js";import"./shared-db98729a.js";import"./shared-655e7c5f.js";import"./shared-4482e7b9.js";import"./shared-44bb85d8.js";import"./shared-37e1a834.js";import"./shared-030f561a.js";import"./shared-5df32007.js";import"./shared-4e709717.js";import"./foxy-spinner.js";import"./shared-8b80db13.js";let n,a=e=>e;const i=t(e,"user-form");class d extends i{constructor(){super(...arguments),this.templates={},this.__roleGetValue=()=>{const e=[];return this.form.is_merchant&&e.push("merchant"),this.form.is_programmer&&e.push("backend_developer"),this.form.is_front_end_developer&&e.push("frontend_developer"),this.form.is_designer&&e.push("designer"),e},this.__roleSetValue=e=>{this.edit({is_merchant:e.includes("merchant"),is_programmer:e.includes("backend_developer"),is_front_end_developer:e.includes("frontend_developer"),is_designer:e.includes("designer")})},this.__roleOptions=[{label:"option_merchant",value:"merchant"},{label:"option_backend_developer",value:"backend_developer"},{label:"option_frontend_developer",value:"frontend_developer"},{label:"option_designer",value:"designer"}]}static get v8n(){return[({first_name:e})=>e&&e.length>0||"first-name:v8n_required",({first_name:e})=>!e||e.length<=50||"first-name:v8n_too_long",({last_name:e})=>e&&e.length>0||"last-name:v8n_required",({last_name:e})=>!e||e.length<=50||"last-name:v8n_too_long",({email:e})=>e&&e.length>0||"email:v8n_required",({email:e})=>!e||e.length<=100||"email:v8n_too_long",({email:e})=>!e||r(e)||"email:v8n_invalid_email",({phone:e})=>!e||e.length<=50||"phone:v8n_too_long"]}get readonlySelector(){const e=[super.readonlySelector.toString()];return this.href&&e.unshift("affiliate-id"),new o(e.join(" ").trim())}renderBody(){return s(n||(n=a` <foxy-internal-text-control infer="first-name"></foxy-internal-text-control> <foxy-internal-text-control infer="last-name"></foxy-internal-text-control> <foxy-internal-text-control infer="email"></foxy-internal-text-control> <foxy-internal-text-control infer="phone"></foxy-internal-text-control> <foxy-internal-integer-control infer="affiliate-id"></foxy-internal-integer-control> <foxy-internal-checkbox-group-control infer="role" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} `),this.__roleGetValue,this.__roleSetValue,this.__roleOptions,super.renderBody())}}customElements.define("foxy-user-form",d);export{d as UserForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-37e1a834.js";import"./foxy-form-dialog.js";import"./foxy-user-form.js";import"./foxy-spinner.js";import"./shared-f5d4dda0.js";import{s as e,h as s}from"./shared-dc73b9a5.js";import{T as a}from"./shared-a19e1dff.js";import{a as r}from"./shared-331a223c.js";import"./shared-cfed658c.js";import"./shared-bf695fe7.js";import"./shared-61ade33e.js";import"./shared-030f561a.js";import"./shared-1522d76f.js";import"./shared-5df32007.js";import"./shared-07e9d1fb.js";import"./shared-343d1fd7.js";import"./shared-9f570db0.js";import"./shared-9803aa7c.js";import"./shared-30cbf0a6.js";import"./shared-4e709717.js";import"./shared-3ab0306f.js";import"./shared-99940888.js";import"./shared-405a290e.js";import"./shared-cd8c3429.js";import"./shared-fd0a4026.js";import"./shared-e40937c5.js";import"./shared-2062c274.js";import"./shared-51c4a6dd.js";import"./shared-a0435ec6.js";import"./shared-eb116b3e.js";import"./shared-0cf90158.js";import"./shared-db98729a.js";import"./shared-655e7c5f.js";import"./shared-4482e7b9.js";import"./shared-44bb85d8.js";import"./shared-2920b595.js";import"./shared-966feb65.js";import"./shared-b738ee96.js";import"./shared-8b80db13.js";import"./foxy-nucleon-element.js";let t,o,d,l,i=e=>e;const n=[{property:"is_merchant",icon:e(t||(t=i`<svg class="fill-current h-full w-full" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M22.8961 8.89L21.7932 4.52C21.5622 3.62 20.7429 3 19.7871 3H5.1979C4.25259 3 3.42283 3.63 3.20225 4.52L2.0994 8.89C1.84732 9.91 2.07839 10.95 2.75061 11.77C2.83464 11.88 2.95017 11.96 3.0447 12.06V19C3.0447 20.1 3.99001 21 5.14538 21H19.8501C21.0055 21 21.9508 20.1 21.9508 19V12.06C22.0453 11.97 22.1609 11.88 22.2449 11.78C22.9171 10.96 23.1587 9.91 22.8961 8.89ZM19.7556 4.99L20.8584 9.36C20.9635 9.78 20.8689 10.2 20.5958 10.53C20.4488 10.71 20.1337 11 19.6085 11C18.9678 11 18.4111 10.51 18.3376 9.86L17.7284 5L19.7556 4.99ZM13.5481 5H15.6067L16.1739 9.52C16.2264 9.91 16.1004 10.3 15.8273 10.59C15.5962 10.85 15.2601 11 14.8295 11C14.1258 11 13.5481 10.41 13.5481 9.69V5ZM8.81106 9.52L9.38874 5H11.4474V9.69C11.4474 10.41 10.8697 11 10.0925 11C9.73536 11 9.40975 10.85 9.15767 10.59C8.89509 10.3 8.76905 9.91 8.81106 9.52ZM4.13705 9.36L5.1979 5H7.26706L6.65787 9.86C6.57384 10.51 6.02766 11 5.38696 11C4.87229 11 4.54669 10.71 4.41014 10.53C4.12655 10.21 4.03202 9.78 4.13705 9.36ZM5.14538 19V12.97C5.22941 12.98 5.30293 13 5.38696 13C6.30075 13 7.13052 12.64 7.73971 12.05C8.36992 12.65 9.21019 13 10.166 13C11.0798 13 11.8991 12.64 12.5082 12.07C13.1279 12.64 13.9682 13 14.9135 13C15.7958 13 16.6361 12.65 17.2663 12.05C17.8755 12.64 18.7052 13 19.619 13C19.7031 13 19.7766 12.98 19.8606 12.97V19H5.14538Z" /></svg>`)),key:"merchant"},{property:"is_programmer",icon:e(o||(o=i`<svg class="fill-current h-full w-full" viewBox="0 0 20 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M0 3C0 1.34315 1.34315 0 3 0H17C18.6569 0 20 1.34315 20 3V15C20 16.6569 18.6569 18 17 18H3C1.34315 18 0 16.6569 0 15V3ZM3 2C2.44772 2 2 2.44772 2 3V15C2 15.5523 2.44772 16 3 16H17C17.5523 16 18 15.5523 18 15V3C18 2.44772 17.5523 2 17 2H3ZM4.29289 4.29289C4.68342 3.90237 5.31658 3.90237 5.70711 4.29289L9.70711 8.29289C9.89464 8.48043 10 8.73478 10 9C10 9.26522 9.89464 9.51957 9.70711 9.70711L5.70711 13.7071C5.31658 14.0976 4.68342 14.0976 4.29289 13.7071C3.90237 13.3166 3.90237 12.6834 4.29289 12.2929L7.58579 9L4.29289 5.70711C3.90237 5.31658 3.90237 4.68342 4.29289 4.29289ZM9 13C9 12.4477 9.44771 12 10 12H15C15.5523 12 16 12.4477 16 13C16 13.5523 15.5523 14 15 14H10C9.44771 14 9 13.5523 9 13Z"/></svg>`)),key:"backend_developer"},{property:"is_front_end_developer",icon:e(d||(d=i`<svg class="fill-current h-full w-full" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M14.2747 4.03847C14.8058 4.1902 15.1132 4.74368 14.9615 5.27472L10.9615 19.2747C10.8098 19.8058 10.2563 20.1132 9.72528 19.9615C9.19424 19.8098 8.88675 19.2563 9.03848 18.7253L13.0385 4.72528C13.1902 4.19424 13.7437 3.88675 14.2747 4.03847ZM6.70711 7.29289C7.09763 7.68342 7.09763 8.31658 6.70711 8.7071L3.41421 12L6.70711 15.2929C7.09763 15.6834 7.09763 16.3166 6.70711 16.7071C6.31658 17.0976 5.68342 17.0976 5.29289 16.7071L1.29289 12.7071C0.902369 12.3166 0.902369 11.6834 1.29289 11.2929L5.29289 7.29289C5.68342 6.90237 6.31658 6.90237 6.70711 7.29289ZM17.2929 7.29289C17.6834 6.90237 18.3166 6.90237 18.7071 7.29289L22.7071 11.2929C22.8946 11.4804 23 11.7348 23 12C23 12.2652 22.8946 12.5196 22.7071 12.7071L18.7071 16.7071C18.3166 17.0976 17.6834 17.0976 17.2929 16.7071C16.9024 16.3166 16.9024 15.6834 17.2929 15.2929L20.5858 12L17.2929 8.70711C16.9024 8.31658 16.9024 7.68342 17.2929 7.29289Z" /></svg>`)),key:"frontend_developer"},{property:"is_designer",icon:e(l||(l=i`<svg class="fill-current h-full w-full" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10 20C4.49 20 0 15.51 0 10C0 4.49 4.49 0 10 0C15.51 0 20 4.04 20 9C20 12.31 17.31 15 14 15H12.23C11.95 15 11.73 15.22 11.73 15.5C11.73 15.62 11.78 15.73 11.86 15.83C12.27 16.3 12.5 16.89 12.5 17.5C12.5 18.88 11.38 20 10 20ZM10 2C5.59 2 2 5.59 2 10C2 14.41 5.59 18 10 18C10.28 18 10.5 17.78 10.5 17.5C10.5 17.34 10.42 17.22 10.36 17.15C9.95 16.69 9.73 16.1 9.73 15.5C9.73 14.12 10.85 13 12.23 13H14C16.21 13 18 11.21 18 9C18 5.14 14.41 2 10 2Z" /><path d="M4.5 11C5.32843 11 6 10.3284 6 9.5C6 8.67157 5.32843 8 4.5 8C3.67157 8 3 8.67157 3 9.5C3 10.3284 3.67157 11 4.5 11Z" /><path d="M7.5 7C8.32843 7 9 6.32843 9 5.5C9 4.67157 8.32843 4 7.5 4C6.67157 4 6 4.67157 6 5.5C6 6.32843 6.67157 7 7.5 7Z" /><path d="M12.5 7C13.3284 7 14 6.32843 14 5.5C14 4.67157 13.3284 4 12.5 4C11.6716 4 11 4.67157 11 5.5C11 6.32843 11.6716 7 12.5 7Z" /><path d="M15.5 11C16.3284 11 17 10.3284 17 9.5C17 8.67157 16.3284 8 15.5 8C14.6716 8 14 8.67157 14 9.5C14 10.3284 14.6716 11 15.5 11Z" /></svg>`)),key:"designer"}];let C,m,p,f,h,c,u,j=e=>e;class g extends(r(a,"users-table")){constructor(){super(...arguments),this.columns=[g.nameColumn,g.emailColumn,g.rolesColumn,g.lastUpdatedColumn,g.actionsColumn]}render(){return s(C||(C=j` <foxy-form-dialog parent="${0}" form="foxy-user-form" lang="${0}" ns="${0}" id="form"> </foxy-form-dialog> ${0} `),this.href,this.lang,this.ns,super.render())}}g.nameColumn={cell:e=>s(m||(m=j` <span data-testclass="name" class="text-m font-medium"> ${0} ${0} </span> `),e.data.first_name,e.data.last_name)},g.emailColumn={hideBelow:"md",cell:e=>s(p||(p=j` <span data-testclass="email" class="text-m text-secondary">${0}</span> `),e.data.email)},g.rolesColumn={cell:e=>s(f||(f=j` <div data-testclass="roles" class="flex space-x-s"> ${0} </div> `),["is_merchant","is_programmer","is_front_end_developer","is_designer"].map((a=>s(h||(h=j` <div class="${0}" style="width:1rem;height:1rem"> ${0} </div> `),e.data[a]?"":"text-disabled",n.find((e=>e.property===a)).icon))))},g.lastUpdatedColumn={hideBelow:"lg",cell:e=>s(c||(c=j` <span data-testclass="lastUpdated" class="text-m text-secondary font-tnum"> <foxy-i18n options="${0}" lang="${0}" key="date" ns="${0}"> </foxy-i18n> <foxy-i18n options="${0}" lang="${0}" key="time" ns="${0}"> </foxy-i18n> </span> `),JSON.stringify({value:e.data.date_modified}),e.lang,e.ns,JSON.stringify({value:e.data.date_modified}),e.lang,e.ns)},g.actionsColumn={cell:e=>s(u||(u=j` <vaadin-button data-testclass="actions" theme="tertiary small" @click="${0}"> <foxy-i18n lang="${0}" key="update" ns="${0}"></foxy-i18n> </vaadin-button> `),(s=>{const a=s.target,r=a.getRootNode().querySelector("#form");r.href=e.data._links.self.href,r.show(a)}),e.lang,e.ns)},customElements.define("foxy-users-table",g);export{g as UsersTable};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-d0374d0c.js";import{I as e}from"./shared-d244dd07.js";import{h as s}from"./shared-dc73b9a5.js";import{a as r}from"./shared-331a223c.js";import"./foxy-spinner.js";import"./shared-e40937c5.js";import"./shared-bf695fe7.js";import"./shared-8b80db13.js";import"./shared-f5d4dda0.js";import"./shared-1522d76f.js";import"./shared-343d1fd7.js";import"./shared-30cbf0a6.js";import"./shared-a0435ec6.js";import"./shared-07e9d1fb.js";import"./shared-3ab0306f.js";import"./shared-eb116b3e.js";import"./shared-4e709717.js";let d,t=e=>e;class a extends(r(e,"webhook-card")){renderBody(){var e,r,a,o;return s(d||(d=t` <div class="grid grid-cols-1 leading-s -my-xs"> <p class="text-m truncate text-body font-medium">${0}​</p> <p class="text-s truncate text-secondary">${0}​</p> <p class="text-s truncate text-tertiary"> ${0} • ${0}​ </p> </div> `),null===(e=this.data)||void 0===e?void 0:e.name,null===(r=this.data)||void 0===r?void 0:r.url,null===(a=this.data)||void 0===a?void 0:a.format,null===(o=this.data)||void 0===o?void 0:o.event_resource)}}customElements.define("foxy-webhook-card",a);export{a as WebhookCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./
|
|
1
|
+
import"./foxy-collection-page.js";import"./foxy-form-dialog.js";import"./foxy-pagination.js";import"./shared-f5d4dda0.js";import{a as e}from"./shared-2062c274.js";import"./shared-8b80db13.js";import"./shared-e40937c5.js";import{_ as r,B as t}from"./shared-1522d76f.js";import{h as o,L as s}from"./shared-dc73b9a5.js";import{I as n}from"./shared-30cbf0a6.js";import{T as i,a}from"./shared-331a223c.js";import{c as l}from"./shared-4e709717.js";import"./shared-7ea4cb27.js";import"./shared-2920b595.js";import{I as d}from"./shared-966feb65.js";import"./foxy-webhook-status-card.js";import"./foxy-webhook-log-card.js";import"./foxy-spinner.js";import"./shared-bf695fe7.js";import"./shared-343d1fd7.js";import"./shared-9f570db0.js";import"./shared-9803aa7c.js";import"./shared-a0435ec6.js";import"./shared-07e9d1fb.js";import"./shared-3ab0306f.js";import"./shared-eb116b3e.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./shared-030f561a.js";import"./shared-37e1a834.js";import"./shared-cfed658c.js";import"./shared-61ade33e.js";import"./shared-5df32007.js";import"./shared-51c4a6dd.js";import"./shared-fd0a4026.js";import"./shared-4482e7b9.js";import"./shared-655e7c5f.js";import"./shared-d0374d0c.js";import"./shared-d244dd07.js";let c,f=e=>e;class m extends(i(n(s))){constructor(){super(...arguments),this.summary=null,this.open=!1}static get properties(){return r(r({},super.properties),{},{summary:{type:String},open:{type:Boolean}})}render(){var e;return o(c||(c=f` <details class="w-full border border-contrast-10 rounded" ?open="${0}" @toggle="${0}"> <summary class="${0}"> <div class="flex items-center h-m pl-m pr-s"> <div class="flex items-center flex-1"> <foxy-i18n class="flex items-center text-xs tracking-wide uppercase font-medium text-body" infer="" key="${0}"> </foxy-i18n> <slot name="actions"></slot> </div> <iron-icon class="icon-inline text-xl text-body" icon="icons:expand-${0}"> </iron-icon> </div> </summary> <div class="border-t border-contrast-10"> <slot></slot> </div> </details> `),this.open,(e=>{this.open=e.currentTarget.open}),l({"focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50":!0,"transition-colors cursor-pointer hover-bg-contrast-5":!0,"rounded-t":!0,"rounded-b":!this.open}),null!==(e=this.summary)&&void 0!==e?e:"",this.open?"less":"more")}}customElements.define("foxy-internal-details",m);let p,h,u,y,x,g=e=>e;customElements.define("foxy-internal-async-details-control",class extends e{constructor(){super(...arguments),this.related=[],this.limit=20,this.first="",this.form="",this.item="",this.open=!1,this.__cachedCardRenderer=null,this.__itemRenderer=e=>{if(!this.form||!e.data)return this.__cardRenderer(e);const r=this.disabledSelector.matches("card",!0);return o(p||(p=g` <button ?disabled="${0}" class="${0}" @click="${0}"> ${0} </button> `),r,l({"focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50":!0,"text-left w-full block transition-colors":!0,"hover-bg-contrast-5":!r}),(r=>{const t=r.currentTarget,o=this.__dialog;o.header="header_update",o.href=e.href,o.show(t)}),this.__cardRenderer(e))}}static get properties(){return r(r({},super.properties),{},{related:{type:Array},first:{type:String},limit:{type:Number},form:{type:String},item:{type:String},open:{type:Boolean}})}renderControl(){let e;try{const r=new URL(this.first);r.searchParams.set("limit",String(this.limit)),e=r.toString()}catch(r){e=this.first}return o(h||(h=g` <foxy-internal-details summary="title" infer="" ?open="${0}" @toggle="${0}"> ${0} <foxy-pagination class="px-m pb-s" first="${0}" infer="pagination"> <foxy-collection-page class="-mx-m block divide-y divide-contrast-10 mb-s" infer="card" .related="${0}" .item="${0}"> </foxy-collection-page> </foxy-pagination> </foxy-internal-details> `),this.open,(e=>this.open=e.currentTarget.open),this.form?o(u||(u=g` <foxy-form-dialog parent="${0}" infer="dialog" id="form" .related="${0}" .form="${0}"> </foxy-form-dialog> ${0} `),e,this.related,this.form,this.readonly?"":o(y||(y=g` <button class="h-xs w-xs rounded-full text-success flex items-center justify-center text-l focus-outline-none focus-ring-2 focus-ring-primary-50" slot="actions" ?disabled="${0}" @click="${0}"> <iron-icon class="icon-inline" icon="icons:add"></iron-icon> </button> `),this.disabled,(e=>{e.preventDefault(),e.stopPropagation();const r=this.__dialog,t=e.currentTarget;r.header="header_create",r.href="",r.show(t)}))):"",e,this.related,this.__itemRenderer)}get __dialog(){return this.renderRoot.querySelector("#form")}get __cardRenderer(){var e;const r=this.item;if((null===(e=this.__cachedCardRenderer)||void 0===e?void 0:e.item)!==r){let e;e=null===r?()=>o(x||(x=g``)):"string"==typeof r?new Function("ctx",`return ctx.html\`<${r} related=\${JSON.stringify(ctx.related)} parent=\${ctx.parent} class="p-m" infer href=\${ctx.href}></${r}>\``):r,this.__cachedCardRenderer={item:r,render:e}}return this.__cachedCardRenderer.render}});let _,b,j=e=>e;class v extends(a(d,"webhook-form")){constructor(){super(...arguments),this.__formats=[{value:"json",label:"JSON"},{value:"webflow",label:"Webflow"},{value:"zapier",label:"Zapier"}],this.__eventResources=[{value:"subscription",label:"event_resource_subscription"},{value:"transaction",label:"event_resource_transaction"},{value:"customer",label:"event_resource_customer"}]}static get v8n(){return[({name:e})=>!!e||"name:v8n_required",({name:e})=>!!e&&e.length<=255||"name:v8n_too_long",({version:e})=>!!e||"version:v8n_required",({format:e})=>!!e||"format:v8n_required",({url:e})=>!e||e.length<=1e3||"url:v8n_too_long",({query:e})=>!e||e.length<=1e3||"query:v8n_too_long",({encryption_key:e})=>!e||e.length<=1e3||"encryption-key:v8n_too_long"]}get readonlySelector(){const e=[];return this.data&&e.push("event-resource"),new t(`${super.readonlySelector} ${e.join(" ")}`.trim())}renderBody(){return o(_||(_=j` <foxy-internal-text-control infer="name"></foxy-internal-text-control> <foxy-internal-radio-group-control infer="event-resource" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-text-control infer="query"></foxy-internal-text-control> <foxy-internal-text-control infer="url"></foxy-internal-text-control> <foxy-internal-radio-group-control infer="format" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-text-control infer="encryption-key"></foxy-internal-text-control> <foxy-internal-text-control infer="version"></foxy-internal-text-control> ${0} ${0} `),this.__eventResources,this.__formats,this.data?o(b||(b=j` <foxy-internal-async-details-control first="${0}" infer="statuses" limit="10" item="foxy-webhook-status-card"> </foxy-internal-async-details-control> <foxy-internal-async-details-control first="${0}" infer="logs" limit="5" item="foxy-webhook-log-card"> </foxy-internal-async-details-control> `),this.data._links["fx:statuses"].href,this.data._links["fx:logs"].href):"",super.renderBody())}}customElements.define("foxy-webhook-form",v);export{v as WebhookForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-f5d4dda0.js";import"./shared-d0374d0c.js";import{a as e}from"./shared-331a223c.js";import{I as s}from"./shared-d244dd07.js";import{h as r}from"./shared-dc73b9a5.js";import"./shared-1522d76f.js";import"./shared-343d1fd7.js";import"./shared-30cbf0a6.js";import"./foxy-spinner.js";import"./shared-e40937c5.js";import"./shared-bf695fe7.js";import"./shared-8b80db13.js";import"./shared-a0435ec6.js";import"./shared-07e9d1fb.js";import"./shared-3ab0306f.js";import"./shared-eb116b3e.js";import"./shared-4e709717.js";let d,a=e=>e;class o extends(e(s,"webhook-log-card")){renderBody(){var e;const{date_created:s,response_code:o,response_body:t}=null!==(e=this.data)&&void 0!==e?e:{};return r(d||(d=a` <div class="leading-none space-y-xs"> <p class="flex justify-between items-center font-medium"> <foxy-i18n .options="${0}" infer="" key="date"></foxy-i18n> <span class="inline-block text-xs bg-contrast-5 text-secondary rounded p-xs"> ${0}​ </span> </p> <p class="text-tertiary">${0}​</p> </div> `),{value:s},o,t)}}customElements.define("foxy-webhook-log-card",o);export{o as WebhookLogCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-f5d4dda0.js";import"./shared-d0374d0c.js";import{a as s}from"./shared-331a223c.js";import{I as e}from"./shared-d244dd07.js";import{h as r}from"./shared-dc73b9a5.js";import{c as t}from"./shared-4e709717.js";import"./shared-1522d76f.js";import"./shared-343d1fd7.js";import"./shared-30cbf0a6.js";import"./foxy-spinner.js";import"./shared-e40937c5.js";import"./shared-bf695fe7.js";import"./shared-8b80db13.js";import"./shared-a0435ec6.js";import"./shared-07e9d1fb.js";import"./shared-3ab0306f.js";import"./shared-eb116b3e.js";let a,d=s=>s;const o=s(e,"webhook-status-card");class i extends o{renderBody(){var s,e;const o=null===(s=this.data)||void 0===s?void 0:s.status;return r(a||(a=d` <p class="flex justify-between items-center leading-none"> <foxy-i18n .options="${0}" class="font-medium" infer="" key="date"> </foxy-i18n> <foxy-i18n class="${0}" infer="" key="status_${0}"> </foxy-i18n> </p> `),{value:null===(e=this.data)||void 0===e?void 0:e.date_created},t({"text-error":"failed"===o,"text-tertiary":"pending"===o,"text-success":"successful"===o}),o)}}customElements.define("foxy-webhook-status-card",i);export{i as WebhookStatusCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-37e1a834.js";import"./shared-f5d4dda0.js";import{_ as t}from"./shared-1522d76f.js";import{h as e}from"./shared-dc73b9a5.js";import{D as s}from"./shared-5df32007.js";let i,n=t=>t;customElements.define("foxy-internal-confirm-dialog",class extends s{constructor(){super(...arguments),this.closable=!1,this.editable=!1,this.alert=!0,this.confirm="confirm",this.message="message",this.cancel="cancel",this.theme="primary"}static get properties(){return t(t({},super.properties),{},{confirm:{type:String},message:{type:String},cancel:{type:String},theme:{type:String}})}render(){return super.render((()=>e(i||(i=n` <foxy-i18n class="block font-lumo text-m text-body text-center mb-m" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> <div class="grid grid-cols-2 gap-m"> <vaadin-button data-testid="cancelButton" @click="${0}"> <foxy-i18n ns="${0}" lang="${0}" key="${0}"></foxy-i18n> </vaadin-button> <vaadin-button theme="${0}" data-testid="confirmButton" @click="${0}"> <foxy-i18n ns="${0}" lang="${0}" key="${0}"></foxy-i18n> </vaadin-button> </div> `),this.lang,this.message,this.ns,this.__handleCancel,this.ns,this.lang,this.cancel,this.theme,this.__handleConfirm,this.ns,this.lang,this.confirm)))}async __handleCancel(){await this.hide(!0)}async __handleConfirm(){await this.hide()}});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{I as e}from"./shared-
|
|
1
|
+
import{I as e}from"./shared-2062c274.js";import{_ as t}from"./shared-1522d76f.js";import{c as r,h as s}from"./shared-dc73b9a5.js";import{r as a}from"./shared-a0c6a159.js";let o,i,d,l,n,c=e=>e;customElements.define("foxy-internal-source-control",class extends e{constructor(){super(...arguments),this.__isErrorVisible=!1,this.__hovered=!1,this.__focused=!1}static get properties(){return t(t({},super.properties),{},{__isErrorVisible:{attribute:!1},__hovered:{attribute:!1},__focused:{attribute:!1}})}static get styles(){return[...super.styles,r(o||(o=c`.monospace{font-family:monospace}.resize-none{resize:none}.max-h-16em{max-height:16em}textarea::selection{background:var(--lumo-contrast-10pct)}`))]}renderControl(){var e;let t,r,o,h,b;return this.disabled?(t="bg-contrast-5 text-disabled",r="text-disabled",h="text-disabled",b="text-disabled",this.readonly?(t+=" border-dashed border-contrast-20",o="border-dashed border-contrast-30"):(t+=" border-transparent",o="border-contrast-10")):this.readonly?(t="border-dashed border-contrast-30 bg-transparent text-secondary",r="text-secondary",o="border-dashed border-contrast-30",h="text-secondary",b="text-secondary",this.__focused&&(o+=" ring-2 ring-primary-50")):this.__focused?(t="border-transparent bg-contrast-10 text-tertiary",r="text-secondary",o="border-primary-50 ring-1 ring-primary-50",h="text-body",b="text-primary"):this.__hovered?(t="border-transparent bg-contrast-20 text-tertiary",r="text-body",o="border-contrast-20",h="text-body",b="text-body"):(t="border-transparent bg-contrast-10 text-tertiary",r="text-secondary",o="border-contrast-10",h="text-body",b="text-secondary"),s(i||(i=c` <label class="block h-full" @mouseenter="${0}" @mouseleave="${0}"> <div class="mb-xs transition-colors leading-none text-s font-medium ${0}" part="label"> ${0} </div> <div class="max-h-16em h-full transition-colors flex-1 flex bg-base rounded overflow-auto border ${0}" part="editor"> <div class="h-full transition-colors monospace leading-s text-s text-right border-r ${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} </div> <textarea placeholder="${0}" class="bg-base whitespace-pre leading-s text-s focus-outline-none monospace resize-none block w-full select-text transition-colors ${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" rows="1" .value="${0}" ?disabled="${0}" ?readonly="${0}" @focus="${0}" @blur="${0}" @input="${0}">
|
|
2
2
|
</textarea> </div> <div class="mt-xs transition-colors leading-xs text-xs ${0}" part="helper-text" ?hidden="${0}"> ${0} </div> <div class="mt-xs text-xs leading-xs text-error" ?hidden="${0}"> ${0} </div> </label> `),(()=>this.__hovered=!0),(()=>this.__hovered=!1),b,this.label,o,t,a(null!==(e=this._value.split("\n"))&&void 0!==e?e:[],((e,t)=>String(t)),((e,t)=>s(d||(d=c`<div>${0}${0}<span>${0}<span></span></span></div>`),t<9?s(l||(l=c`<span class="opacity-0">0</span>`)):"",t<99?s(n||(n=c`<span class="opacity-0">0</span>`)):"",t+1))),this.placeholder,h,this._value,this.disabled,this.readonly,(()=>this.__focused=!0),(()=>{this.__focused=!1,this.__isErrorVisible=!0}),(e=>{const t=e.currentTarget;this._value=t.value}),r,!this.helperText,this.helperText,!this.__isErrorVisible||!this._errorMessage||this.disabled||this.readonly,this._errorMessage)}updated(e){super.updated(e),this.renderRoot.querySelectorAll("textarea").forEach((e=>{e.style.height="auto",e.style.height=`${e.scrollHeight}px`,e.style.overflowY="hidden"}))}get _value(){var e;return null!==(e=super._value)&&void 0!==e?e:""}set _value(e){super._value=e}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-db98729a.js";import"./shared-4482e7b9.js";import"./shared-44bb85d8.js";import{I as e}from"./shared-2062c274.js";import{_ as i}from"./shared-1522d76f.js";import{i as r}from"./shared-9803aa7c.js";import{h as s}from"./shared-dc73b9a5.js";let t,l,a,n=e=>e;customElements.define("foxy-internal-integer-control",class extends e{constructor(){super(...arguments),this.prefix=null,this.suffix=null,this.min=null,this.max=null}static get properties(){return i(i({},super.properties),{},{prefix:{},suffix:{},min:{type:Number},max:{type:Number}})}renderControl(){var e,i;return s(t||(t=n` <vaadin-integer-field error-message="${0}" placeholder="${0}" helper-text="${0}" label="${0}" class="w-full" min="${0}" max="${0}" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" .value="${0}" clear-button-visible @keydown="${0}" @change="${0}"> ${0} ${0} </vaadin-integer-field> `),r(this._errorMessage),this.placeholder,this.helperText,this.label,r(null!==(e=this.min)&&void 0!==e?e:void 0),r(null!==(i=this.max)&&void 0!==i?i:void 0),this.disabled,this.readonly,this._checkValidity,String(this._value),(e=>{var i;return"Enter"===e.key&&(null===(i=this.nucleon)||void 0===i?void 0:i.submit())}),(e=>{const i=e.currentTarget;this._value=parseInt(i.value)}),this.prefix?s(l||(l=n`<div slot="prefix">${0}</div>`),this.prefix):"",this.suffix?s(a||(a=n`<div class="pr-s font-medium" slot="suffix">${0}</div>`),this.suffix):"")}get _value(){var e;return null!==(e=super._value)&&void 0!==e?e:0}set _value(e){super._value=e}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-37e1a834.js";import"./foxy-collection-page.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./foxy-pagination.js";import"./shared-f5d4dda0.js";import{I as e}from"./shared-2062c274.js";import"./shared-030f561a.js";import{_ as t}from"./shared-1522d76f.js";import{i}from"./shared-9803aa7c.js";import{c as r}from"./shared-4e709717.js";import{h as o}from"./shared-dc73b9a5.js";let a,n,s,l,d,c,h,f,p,u,m=e=>e;customElements.define("foxy-internal-async-list-control",class extends e{constructor(){super(...arguments),this.keepDialogOpenOnDelete=!1,this.keepDialogOpenOnPost=!1,this.createPageHref=null,this.related=[],this.limit=20,this.first=null,this.form=null,this.item=null,this.itemProps={},this.wide=!1,this.alert=!1,this.hideDeleteButton=!1,this.hideCreateButton=!1,this.getPageHref=null,this.__deletionConfimationCallback=null,this.__cachedCardRenderer=null,this.__itemRenderer=e=>{var t;if(!e.data)return this.__cardRenderer(e);if("string"!=typeof(null===(t=this.getPageHref)||void 0===t?void 0:t.call(this,e.href,e.data))&&!this.form)return this.__cardRenderer(e);const i=this.disabledSelector.matches("card",!0),d=this.__cardRenderer(e);let c;const h=r({"rounded-t":!e.previous,"rounded-b":!e.next,"focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50":!0,"text-left w-full block transition-colors":!0,"hover-bg-contrast-5":!i});if(this.getPageHref)if(i)c=o(a||(a=m`<div class="${0}">${0}</div>`),h,d);else{const t=this.getPageHref(e.href,e.data);c=o(n||(n=m`<a class="${0}" href="${0}">${0}</a>`),h,t,d)}else{c=o(s||(s=m` <button ?disabled="${0}" class="${0}" @click="${0}">${0}</button> `),i,h,(t=>{const i=t.currentTarget,r=this.__dialog;r.header="header_update",r.href=e.href,r.show(i)}),d)}return this.hideDeleteButton||this.readonly?c:o(l||(l=m` <foxy-swipe-actions class="block"> ${0} <vaadin-button theme="primary error" class="h-full" slot="action" @click="${0}"> <foxy-i18n infer="" key="delete_button_text"></foxy-i18n> </vaadin-button> </foxy-swipe-actions> `),c,(e=>{const t=e.currentTarget;this.renderRoot.querySelector("#confirm").show(t),this.__deletionConfimationCallback=()=>{const e=t.previousElementSibling.querySelector("[href]");null==e||e.delete(),this.__deletionConfimationCallback=null}}))}}static get properties(){return t(t({},super.properties),{},{keepDialogOpenOnDelete:{type:Boolean,attribute:"keep-dialog-open-on-delete"},keepDialogOpenOnPost:{type:Boolean,attribute:"keep-dialog-open-on-post"},hideDeleteButton:{type:Boolean,attribute:"hide-delete-button"},hideCreateButton:{type:Boolean,attribute:"hide-create-button"},createPageHref:{attribute:"create-page-href"},getPageHref:{attribute:!1},related:{type:Array},first:{},limit:{type:Number},form:{},item:{},itemProps:{type:Object,attribute:"item-props"},wide:{type:Boolean},alert:{type:Boolean}})}renderControl(){var e,t;let a;try{const t=new URL(null!==(e=this.first)&&void 0!==e?e:"");t.searchParams.set("limit",String(this.limit)),a=t.toString()}catch(e){a=void 0}return o(d||(d=m` ${0} ${0} <div class="flex items-center justify-between mb-xs text-s font-medium"> <span class="text-secondary"> ${0} </span> ${0} </div> <foxy-pagination first="${0}" infer="pagination"> <foxy-collection-page class="${0}" infer="card" .related="${0}" .props="${0}" .item="${0}"> </foxy-collection-page> </foxy-pagination> `),this.form?o(c||(c=m` <foxy-form-dialog parent="${0}" infer="dialog" id="form" ?wide="${0}" ?alert="${0}" ?keep-open-on-post="${0}" ?keep-open-on-delete="${0}" .related="${0}" .form="${0}"> </foxy-form-dialog> `),i(null!==(t=this.first)&&void 0!==t?t:void 0),this.wide,this.alert,this.keepDialogOpenOnPost,this.keepDialogOpenOnDelete,this.related,this.form):"",this.hideDeleteButton||this.readonly?"":o(h||(h=m` <foxy-internal-confirm-dialog message="delete_message" confirm="delete_confirm" cancel="delete_cancel" header="delete_header" theme="error" infer="" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> `),(e=>{var t;e.detail.cancelled||null===(t=this.__deletionConfimationCallback)||void 0===t||t.call(this)})),this.label&&"label"!==this.label?this.label:"",!this.form&&!this.createPageHref||this.readonly||this.hideCreateButton?"":this.createPageHref&&!this.disabled?o(f||(f=m` <a class="rounded-s text-primary group focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n class="transition-opacity group-hover-opacity-80" infer="" key="create_button_text"> </foxy-i18n> </a> `),this.createPageHref):o(p||(p=m` <vaadin-button theme="tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="pagination" key="create_button_text"></foxy-i18n> </vaadin-button> `),this.disabled,(e=>{e.preventDefault(),e.stopPropagation();const t=this.__dialog,i=e.currentTarget;t.header="header_create",t.href="",t.show(i)})),i(a),r({"block divide-y divide-contrast-5 rounded overflow-hidden":!0,"ring-1 ring-inset ring-contrast-10":!this.form&&!this.getPageHref,"bg-contrast-5":!!this.form||!!this.getPageHref}),this.related,this.itemProps,this.__itemRenderer)}get __dialog(){return this.renderRoot.querySelector("#form")}get __cardRenderer(){var e;const t=this.item;return(null===(e=this.__cachedCardRenderer)||void 0===e?void 0:e.item)!==t&&(this.__cachedCardRenderer={item:t,render:"string"==typeof t?new Function("ctx",`return ctx.html\`\n <${t}\n related=\${JSON.stringify(ctx.related)}\n parent=\${ctx.parent}\n style="padding: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)"\n infer=""\n href=\${ctx.href}\n ...=\${ctx.spread(ctx.props)}\n >\n </${t}>\``):e=>o(u||(u=m` <div style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} </div> `),null==t?void 0:t(e))}),this.__cachedCardRenderer.render}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as t}from"./shared-
|
|
1
|
+
import{h as t}from"./shared-bf695fe7.js";import{T as e}from"./shared-4482e7b9.js";import{D as l}from"./shared-331a223c.js";const r=t`<dom-module id="lumo-email-field" theme-for="vaadin-email-field">
|
|
2
2
|
<template>
|
|
3
3
|
<style>
|
|
4
4
|
:not(*):placeholder-shown, /* to prevent broken styles on IE */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-8b80db13.js";import"./shared-e40937c5.js";import{_ as e}from"./shared-1522d76f.js";import{s as l,h as t,c as a,L as s}from"./shared-dc73b9a5.js";import{o as n}from"./shared-8438d4ca.js";import{c as o}from"./shared-4e709717.js";import{i}from"./shared-9803aa7c.js";import{a as r}from"./shared-79d0699c.js";import{r as d}from"./shared-a0c6a159.js";import{R as u,T as c,a as v}from"./shared-331a223c.js";import{I as p}from"./shared-30cbf0a6.js";import{C as h}from"./shared-9f570db0.js";var b,f;!function(e){e.Attribute="attribute",e.Boolean="boolean",e.String="string",e.Number="number",e.Date="date",e.Any="any"}(b||(b={})),function(e){e.LessThanOrEqual="lessthanorequal",e.LessThan="lessthan",e.GreaterThanOrEqual="greaterthanorequal",e.GreaterThan="greaterthan",e.IsDefined="isdefined",e.Not="not",e.In="in"}(f||(f={}));let g;const m=l(g||(g=(e=>e)`
|
|
2
2
|
<svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3
3
|
<path d="M26.4 14.7399C26.4 15.2922 25.9523 15.7399 25.4 15.7399H10.6C10.0477 15.7399 9.60001 15.2922 9.60001 14.7399V14.2C9.60001 13.6477 10.0477 13.2 10.6 13.2H25.4C25.9523 13.2 26.4 13.6477 26.4 14.2V14.7399ZM26.4 21.8C26.4 22.3523 25.9523 22.8 25.4 22.8H10.6C10.0477 22.8 9.60001 22.3523 9.60001 21.8V21.2601C9.60001 20.7078 10.0477 20.2601 10.6 20.2601H25.4C25.9523 20.2601 26.4 20.7078 26.4 21.2601V21.8Z" class="fill-current"/>
|
|
4
4
|
</svg>
|
|
@@ -61,4 +61,4 @@ import"./shared-36a09fe6.js";import"./shared-019ad470.js";import{_ as e}from"./s
|
|
|
61
61
|
<svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
62
62
|
<path d="M11 11V14H16.5V26H19.5V14H25V11H11Z" class="fill-current"/>
|
|
63
63
|
</svg>
|
|
64
|
-
`));let R,U,G,W,F,Q=e=>e;function J(e){var l,a,s;const n=null===(a=null===(l=e.list)||void 0===l?void 0:l.every((l=>l.value!==e.value)))||void 0===a||a;return t(R||(R=Q` <label class="${0}"> <div class="relative flex-1 min-w-0 overflow-hidden"> <select class="${0}" ?disabled="${0}" @change="${0}"> ${0} ${0} </select> </div> ${0} </label> `),o({"flex items-center transition-colors group text-tertiary":!0,"cursor-pointer hover-bg-contrast-5":!e.disabled&&!e.readonly,"cursor-default":e.disabled||e.readonly}),o({"bg-transparent relative appearance-none flex h-m px-s":!0,"font-medium w-full max-w-full whitespace-nowrap focus-outline-none":!0,"text-tertiary":n&&!e.disabled,"text-body":!n&&!e.disabled&&!e.readonly,"text-disabled":e.disabled,"text-secondary":!n&&e.readonly,"cursor-pointer":!e.disabled&&!e.readonly,"cursor-default":e.disabled||e.readonly}),e.disabled||e.readonly,(l=>{const t=l.currentTarget,a=t.options[t.options.selectedIndex].value;e.onChange(a)}),n?t(U||(U=Q` <option value="" disabled="disabled" ?selected="${0}">${0}</option> `),n,e.t(e.label)):"",null===(s=e.list)||void 0===s?void 0:s.map((({label:l,value:a})=>t(G||(G=Q` <option value="${0}" ?selected="${0}"> ${0} </option> `),a,a===e.value,e.t(l)))),n?"":t(W||(W=Q` <span class="${0}"> ${0} </span> ${0} `),o({"font-tnum text-xs font-medium border mr-s px-xs rounded-s border-current inline-block":!0,"text-body":!e.disabled&&!e.readonly,"text-disabled":e.disabled,"text-secondary":e.readonly}),e.t(e.label),e.clearable&&!e.readonly?t(F||(F=Q` <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon aria-hidden="true" class="icon-inline text-l" icon="icons:remove-circle-outline"> </iron-icon> </button> `),e.t("delete"),o({"w-s h-s mr-xs flex items-center justify-center transition-colors rounded-full":!0,"focus-outline-none focus-ring-2 focus-ring-primary-50":!0,"hover-bg-contrast-5 hover-text-error text-body":!e.disabled,"text-disabled":e.disabled}),e.disabled,(()=>e.onChange(""))):""))}let K,P,X,Y,ee,le=e=>e;function te(e){var l;const a=`${null!==(l=e.id)&&void 0!==l?l:String(Math.floor(Math.random()*Math.pow(10,8)))}-list`,s=!!e.displayValue;let n=e.value;if("date"===e.type){const l=new Date(e.value);n=isNaN(l.getTime())?"":r(l)}return t(K||(K=le` <label class="relative flex items-center cursor-text group text-tertiary"> <div class="relative flex-1 min-w-0 overflow-hidden"> ${0} <input placeholder="${0}" class="${0}" list="${0}" type="${0}" max="${0}" .value="${0}" ?disabled="${0}" @input="${0}"> </div> <span class="${0}"> ${0} </span> ${0} ${0} </label> `),s?t(P||(P=le` <div aria-hidden="true" class="${0}"> <div class="truncate">${0}</div> </div> `),o({"absolute inset-0 h-m px-s font-medium flex items-center":!0,"text-body":!e.disabled&&!e.readonly,"text-disabled":e.disabled,"text-secondary":e.readonly}),e.t(e.displayValue)):"",n||"date"===e.type?"":e.t(e.label),o({"bg-base relative flex h-m px-s font-medium w-full":!0,"text-body":!e.disabled&&!e.readonly,"text-disabled":e.disabled,"text-secondary":e.readonly,"flex max-w-full whitespace-nowrap":!0,"focus-outline-none":!0,"opacity-0 focus-opacity-100":s}),i(e.list?a:void 0),"date"===e.type?"datetime-local":e.type,i("date"===e.type?"9999-12-31T23:59":""),n,e.disabled||e.readonly,(l=>{const t=l.currentTarget;let a=t.value;try{if("date"===e.type){const e=new Date(t.value);isNaN(e.getTime())||(a=e.toISOString())}}catch(e){}e.onChange(a)}),o({"font-tnum text-xs font-medium border border-current mr-s px-xs rounded-s":!0,"inline-block":!!n||"date"===e.type,"sr-only":!n&&"date"!==e.type,"text-body":!e.disabled&&!e.readonly,"text-disabled":e.disabled,"text-secondary":e.readonly}),e.t(e.label),e.list?t(X||(X=le` <datalist id="${0}"> ${0} </datalist> `),a,e.list.map((({label:l,value:a})=>t(Y||(Y=le`<option value="${0}">${0}</option>`),a,e.t(l))))):"",e.disabled||e.readonly?"":t(ee||(ee=le` <div class="absolute inset-0 transition-colors bg-transparent group-hover-bg-contrast-5 pointer-events-none"></div> `)))}let ae,se,ne=e=>e;let oe,ie=e=>e;function re({parsedValue:l,disabled:t,readonly:a,options:s,option:n,t:o,onChange:i}){return te({displayValue:null==n?void 0:n.label,disabled:t,readonly:a,value:l.path,label:"field",list:s.map((l=>e(e({},l),{},{value:l.path}))),type:"text",id:"path",t:o,onChange:e=>i({operator:null,value:"",path:e})})}let de,ue=e=>e;let ce,ve,pe=e=>e;function fe(l){var a,s;const{parsedValue:i,isFullSize:r,isNested:u,readonly:c,disabled:v,options:p,t:f,onConvert:g,onDelete:C,onChange:x}=l,V=null!==(a=p.find((e=>e.path===i.path)))&&void 0!==a?a:null,H=null!==(s=null==V?void 0:V.type)&&void 0!==s?s:h.Any,M=i.operator,N={parsedValue:i,disabled:v,readonly:c,options:p,option:V,t:f,onChange:x},j={[h.Attribute]:B,[h.Boolean]:_,[h.Number]:S,[h.String]:z,[h.Date]:q,[h.Any]:A};return t(ce||(ce=pe` <div class="flex items-center space-x-s" aria-label="${0}"> <div class="${0}"> <div class="bg-contrast-10"> <div class="grid gap-1px grid-vertical sm-grid-horizontal"> <div class="bg-base" title="${0}"> <div class="${0}" aria-hidden="true"> ${0} </div> </div> <div class="bg-base"> ${0} </div> <div class="bg-base">${0}</div> <div class="bg-base"> ${0} </div> </div> </div> </div> <div class="${0}"> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon aria-hidden="true" class="m-auto icon-inline text-xl" icon="icons:remove-circle-outline"> </iron-icon> </button> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon aria-hidden="true" class="m-auto icon-inline text-xl" icon="icons:add-circle-outline"> </iron-icon> </button> </div> </div> `),f("query_builder_rule"),o({"flex-1 bg-base rounded overflow-hidden border":!0,"border-contrast-10":!u&&!c,"border-contrast-50":!!u||c,"border-dashed":c,"border-solid":!c}),f(`type_${H}`),o({"w-m h-m":!0,"text-tertiary":!c&&!v,"text-disabled":c||v}),V?j[H]:A,i.path&&(H===h.Attribute||i.name)?t(ve||(ve=pe` <div class="bg-contrast-10 grid gap-1px grid-cols-1 sm-grid-cols-2"> <div class="bg-base">${0}</div> <div class="bg-base">${0}</div> </div> `),re(N),function(l){var t;return te({disabled:l.disabled,readonly:l.readonly,value:null!==(t=l.parsedValue.name)&&void 0!==t?t:"",label:"name",type:"text",t:l.t,onChange:t=>l.onChange(e(e({},l.parsedValue),{},{name:t}))})}(N)):re(N),function(l){const a=l.parsedValue.operator,s={[b.GreaterThan]:y,[b.GreaterThanOrEqual]:n,[b.In]:w,[b.IsDefined]:$,[b.LessThan]:L,[b.LessThanOrEqual]:Z,[b.Not]:I},i={[h.Attribute]:[b.In,b.Not,b.IsDefined],[h.Boolean]:[],[h.String]:[b.In,b.Not],[h.Number]:[b.In,b.Not,b.GreaterThan,b.LessThan,b.GreaterThanOrEqual,b.LessThanOrEqual],[h.Date]:[b.In,b.Not],[h.Any]:Object.values(b)},r=l.option?i[l.option.type]:l.parsedValue.name?Object.values(b):Object.values(b).filter((e=>e!==b.IsDefined)),d=l.disabled||l.readonly||0===r.length||!l.parsedValue.path;return t(oe||(oe=ie` <button title="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <div aria-hidden="true">${0}</div> </button> `),l.t(`operator_${null!=a?a:"equal"}`),o({"flex items-center justify-center w-m h-m transition-colors":!0,"focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50":!0,"text-disabled cursor-default":d,"hover-bg-contrast-5":!d}),d,(()=>{var t;const s=a?r.indexOf(a):-1,n=null!==(t=r[s+1])&&void 0!==t?t:null;l.onChange(e(e({},l.parsedValue),{},{operator:n,value:l.parsedValue.value}))}),a?s[a]:m)}(N),M===b.In?function(l){var a,s,n,o;const i=(null===(a=l.option)||void 0===a?void 0:a.list)?J:te,r=l.parsedValue.value.split(","),u=null!==(n=null===(s=l.option)||void 0===s?void 0:s.type)&&void 0!==n?n:h.Any,c=u===h.Number?"number":u===h.Date?"date":"text",v=null===(o=l.option)||void 0===o?void 0:o.list,p=[...r.filter((e=>!!e))];return l.readonly||p.push(null),t(ae||(ae=ne` <div class="bg-contrast-10 grid grid-cols-1 gap-1px"> ${0} </div> `),d(p,((e,l)=>l),((a,s)=>{var n;return t(se||(se=ne` <div class="bg-base"> ${0} </div> `),i({type:c,list:v,t:l.t,value:null!=a?a:"",label:a?String(s+1):"add_value",disabled:l.disabled,readonly:l.readonly,clearable:!0,displayValue:null===(n=null==v?void 0:v.find((e=>e.value===a)))||void 0===n?void 0:n.label,onChange:t=>{t?r[s]=t:r.splice(s,1),l.onChange(e(e({},l.parsedValue),{},{value:r.join(",")}))}}))})))}(N):M===b.IsDefined?function(l){return J({readonly:l.readonly,disabled:l.disabled,value:l.parsedValue.value,label:"value",list:[{label:"is_defined_true",value:"true"},{label:"is_defined_false",value:"false"}],t:l.t,onChange:t=>l.onChange(e(e({},l.parsedValue),{},{value:t}))})}(N):H===h.Boolean?function(l){var t,a,s,n,o,i;const{parsedValue:r,option:d,readonly:u,disabled:c,t:v,onChange:p}=l,f=null!==(s=null===(a=null===(t=null==d?void 0:d.list)||void 0===t?void 0:t.find((e=>"false"===e.value)))||void 0===a?void 0:a.label)&&void 0!==s?s:"false",h=[{label:null!==(i=null===(o=null===(n=null==d?void 0:d.list)||void 0===n?void 0:n.find((e=>"true"===e.value)))||void 0===o?void 0:o.label)&&void 0!==i?i:"true",value:"true"},{label:f,value:"false"}];return J({disabled:c,readonly:u,value:r.value,label:"value",list:h,t:v,onChange:l=>p(e(e({},r),{},{value:l}))})}(N):null===M&&[h.Number,h.Date].includes(H)?function(l){var a,s,n;const{t:o,parsedValue:i,option:r,readonly:d,disabled:u,onChange:c}=l,v=i.value.split(".."),p=v.length>=1?v[0]:"",f=v.length>=2?v[1]:"",b=(null==r?void 0:r.list)?J:te,g=null!==(a=null==r?void 0:r.type)&&void 0!==a?a:h.Any,m=g===h.Number?"number":g===h.Date?"date":"text",C=null==r?void 0:r.list;return t(de||(de=ue` <div class="grid bg-contrast-10 gap-1px grid-cols-1 grid-rows-2 sm-grid-cols-2 sm-grid-rows-1"> <div class="bg-base"> ${0} </div> <div class="bg-base"> ${0} </div> </div> `),b({displayValue:null===(s=null==C?void 0:C.find((e=>e.value===p)))||void 0===s?void 0:s.label,readonly:d,disabled:u,value:p,label:"range_from",type:m,list:C,t:o,onChange:l=>c(e(e({},i),{},{value:`${l}..${f}`}))}),b({displayValue:null===(n=null==C?void 0:C.find((e=>e.value===f)))||void 0===n?void 0:n.label,readonly:d,disabled:u,label:"range_to",value:f,type:m,list:C,t:o,onChange:l=>c(e(e({},i),{},{value:`${p}..${l}`}))}))}(N):function(l){var t,a,s,n;const{t:o,option:i,parsedValue:r,readonly:d,disabled:u,onChange:c}=l,v=(null==i?void 0:i.list)?J:te,p=null!==(t=null==i?void 0:i.type)&&void 0!==t?t:h.Any;return v({displayValue:null===(s=null===(a=null==i?void 0:i.list)||void 0===a?void 0:a.find((e=>e.value===r.value)))||void 0===s?void 0:s.label,readonly:d,disabled:u||!r.path,value:null!==(n=r.value)&&void 0!==n?n:"",label:"value",type:p===h.Number?"number":p===h.Date?"date":"text",list:null==i?void 0:i.list,t:o,onChange:l=>c(e(e({},r),{},{value:l}))})}(N),o({"-mr-s self-start flex-col sm-flex-row flex-shrink-0 items-center":!0,"border-t border-b border-transparent divide-y divide-transparent":!0,hidden:!!r||c,flex:!r}),f("delete"),o({"box-content flex w-m h-m rounded-full transition-colors":!0,"text-secondary hover-bg-contrast-5 hover-text-error":!v,"cursor-default text-disabled":v,"focus-outline-none focus-ring-2 ring-primary-50":!0,"opacity-0":!i.path}),v||c||!i.path,C,f("add_or_clause"),o({"box-content flex w-m h-m rounded-full transition-colors":!0,"text-success hover-bg-contrast-5":!v,"cursor-default text-disabled":v,"focus-outline-none focus-ring-2 ring-primary-50":!0,"opacity-0":!i.path||!!u}),v||c||!i.path,g)}let he,be,ge,me,Ce=e=>e;function ye(l){const a=t(he||(he=Ce`<div class="h-xs"></div>`)),s=t(be||(be=Ce` <div class="flex items-center h-s"> <div class="w-m text-center leading-none uppercase font-medium text-xs text-contrast-30"> ${0} </div> <div class="flex-1 border-t border-contrast-20"></div> <div class="w-m ml-s flex-shrink-0"></div> <div class="hidden sm-block w-m flex-shrink-0"></div> </div> `),l.t("or"));return t(ge||(ge=Ce` <div aria-label="${0}"> ${0} </div> `),l.t("query_builder_group"),d([...l.parsedValues,null],((e,l)=>String(l)),((n,o)=>{const i=o>0?l.isNested?s:a:"";return null===n?[i,fe({isFullSize:!l.isNested&&0===l.parsedValues.length,isNested:l.isNested,disabled:l.disabled,readonly:l.readonly,options:l.options,parsedValue:{path:"",operator:null,value:""},t:l.t,onChange:e=>l.onChange([...l.parsedValues,e])})]:Array.isArray(n)?[i,t(me||(me=Ce` <div class="bg-contrast-10 rounded-t-l rounded-b-l p-s -m-s"> ${0} </div> `),ye({parsedValues:n,isNested:!0,disabled:l.disabled,readonly:l.readonly,options:l.options,t:l.t,onChange:e=>{const t=[...l.parsedValues],a=e;t[o]=e.length>1?a:a[0],l.onChange(t)}}))]:[i,fe({parsedValue:n,isNested:l.isNested,disabled:l.disabled,readonly:l.readonly,options:l.options,t:l.t,onChange:e=>{const t=[...l.parsedValues];t[o]=e,l.onChange(t)},onDelete:()=>{const e=l.parsedValues.filter(((e,l)=>l!==o));l.onChange(e)},onConvert:()=>{const t=[...l.parsedValues];t[o]=[n,e(e({},n),{},{operator:null,value:""})],l.onChange(t)}})]})))}function xe(e){var l;const[t,a]=e.split("=").map(decodeURIComponent),s=null!==(l=Object.values(b).find((e=>t.endsWith(`:${e}`))))&&void 0!==l?l:null;let n,o=t.substring(0,s?t.lastIndexOf(":"):void 0);const i=t.lastIndexOf("[");return o.endsWith("]")&&-1!==i&&(n=o.substring(i+1,o.length-1),o=o.substring(0,i),o.endsWith(":name")&&(o=o.substring(0,o.length-5))),{name:n,path:o,value:a,operator:s}}function we(e){let l=e.path;return e.name&&(l+=`:name[${e.name}]`),e.operator&&(l+=`:${e.operator}`),l=`${encodeURIComponent(l)}=${encodeURIComponent(e.value)}`,"="===l?"":l}function Ve(e){const l=e.reduce(((e,l)=>{if(Array.isArray(l)){const t=[l[0].value,l.slice(1).map((e=>we(e)))].join("|");e.push(`${l[0].path}=${encodeURIComponent(t)}`)}else"zoom"!==l.path&&e.push(we(l));return e}),[]),t=$e(e).join(",");return t&&l.push(`zoom=${encodeURIComponent(t)}`),l.join("&")}function $e(e){return e.map((e=>{if(Array.isArray(e))return $e(e);if(e.name)return[e.path];const l=e.path.split(":");return l.slice(0,l.length-1)})).flat().sort(((e,l)=>l.length-e.length)).filter(((e,l,t)=>t.every(((t,a)=>(a>=l||t!==e)&&!t.startsWith(`${e}:`)))))}let He;const Le=a(He||(He=(e=>e)`.gap-1px{gap:1px}.grid-vertical{grid-template:auto/var(--lumo-size-m) 1fr}:host([sm]) .sm-grid-horizontal{grid-template:auto/var(--lumo-size-m) 1fr var(--lumo-size-m) 1fr}`)),Me=f(u(c(v(p(s),"query-builder"))));class Ze extends Me{constructor(){super(...arguments),this.options=null,this.value=null}static get properties(){return e(e({},super.properties),{},{options:{type:Array},value:{type:String}})}static get styles(){return[super.styles,Le]}render(){var e,l;const t=new Set(["zoom","limit","offset","order","fields"]),a=[],s=[];var n;return(n=null!==(e=this.value)&&void 0!==e?e:"",n.split("&").filter((e=>!!e)).map((e=>{const[l,t]=e.split("=").map(decodeURIComponent);return(null==t?void 0:t.includes("|"))?`${encodeURIComponent(l)}=${t}`.split("|").map((e=>xe(e))):xe(e)}))).forEach((e=>{Array.isArray(e)||!t.has(e.path)?s.push(e):a.push(e)})),ye({parsedValues:s,disabled:this.disabled,readonly:this.readonly,options:null!==(l=this.options)&&void 0!==l?l:[],t:this.t.bind(this),onChange:e=>{this.value=Ve([...e,...a]),this.dispatchEvent(new Ze.ChangeEvent("change"))}})}}Ze.ChangeEvent=class extends CustomEvent{},Ze.Operator=b,Ze.Type=h,customElements.define("foxy-query-builder",Ze);export{Ze as Q,h as T};
|
|
64
|
+
`));let R,U,G,W,F,Q=e=>e;function J(e){var l,a,s;const n=null===(a=null===(l=e.list)||void 0===l?void 0:l.every((l=>l.value!==e.value)))||void 0===a||a;return t(R||(R=Q` <label class="${0}"> <div class="relative flex-1 min-w-0 overflow-hidden"> <select class="${0}" ?disabled="${0}" @change="${0}"> ${0} ${0} </select> </div> ${0} </label> `),o({"flex items-center transition-colors group text-tertiary":!0,"cursor-pointer hover-bg-contrast-5":!e.disabled&&!e.readonly,"cursor-default":e.disabled||e.readonly}),o({"bg-transparent relative appearance-none flex h-m px-s":!0,"font-medium w-full max-w-full whitespace-nowrap focus-outline-none":!0,"text-tertiary":n&&!e.disabled,"text-body":!n&&!e.disabled&&!e.readonly,"text-disabled":e.disabled,"text-secondary":!n&&e.readonly,"cursor-pointer":!e.disabled&&!e.readonly,"cursor-default":e.disabled||e.readonly}),e.disabled||e.readonly,(l=>{const t=l.currentTarget,a=t.options[t.options.selectedIndex].value;e.onChange(a)}),n?t(U||(U=Q` <option value="" disabled="disabled" ?selected="${0}">${0}</option> `),n,e.t(e.label)):"",null===(s=e.list)||void 0===s?void 0:s.map((({label:l,value:a})=>t(G||(G=Q` <option value="${0}" ?selected="${0}"> ${0} </option> `),a,a===e.value,e.t(l)))),n?"":t(W||(W=Q` <span class="${0}"> ${0} </span> ${0} `),o({"font-tnum text-xs font-medium border mr-s px-xs rounded-s border-current inline-block":!0,"text-body":!e.disabled&&!e.readonly,"text-disabled":e.disabled,"text-secondary":e.readonly}),e.t(e.label),e.clearable&&!e.readonly?t(F||(F=Q` <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon aria-hidden="true" class="icon-inline text-l" icon="icons:remove-circle-outline"> </iron-icon> </button> `),e.t("delete"),o({"w-s h-s mr-xs flex items-center justify-center transition-colors rounded-full":!0,"focus-outline-none focus-ring-2 focus-ring-primary-50":!0,"hover-bg-contrast-5 hover-text-error text-body":!e.disabled,"text-disabled":e.disabled}),e.disabled,(()=>e.onChange(""))):""))}let K,P,X,Y,ee,le=e=>e;function te(e){var l;const a=`${null!==(l=e.id)&&void 0!==l?l:String(Math.floor(Math.random()*Math.pow(10,8)))}-list`,s=!!e.displayValue;let n=e.value;if("date"===e.type){const l=new Date(e.value);n=isNaN(l.getTime())?"":r(l)}return t(K||(K=le` <label class="relative flex items-center cursor-text group text-tertiary"> <div class="relative flex-1 min-w-0 overflow-hidden"> ${0} <input placeholder="${0}" class="${0}" list="${0}" type="${0}" max="${0}" .value="${0}" ?disabled="${0}" @input="${0}"> </div> <span class="${0}"> ${0} </span> ${0} ${0} </label> `),s?t(P||(P=le` <div aria-hidden="true" class="${0}"> <div class="truncate">${0}</div> </div> `),o({"absolute inset-0 h-m px-s font-medium flex items-center":!0,"text-body":!e.disabled&&!e.readonly,"text-disabled":e.disabled,"text-secondary":e.readonly}),e.t(e.displayValue)):"",n||"date"===e.type?"":e.t(e.label),o({"bg-base relative flex h-m px-s font-medium w-full":!0,"text-body":!e.disabled&&!e.readonly,"text-disabled":e.disabled,"text-secondary":e.readonly,"flex max-w-full whitespace-nowrap":!0,"focus-outline-none":!0,"opacity-0 focus-opacity-100":s}),i(e.list?a:void 0),"date"===e.type?"datetime-local":e.type,i("date"===e.type?"9999-12-31T23:59":""),n,e.disabled||e.readonly,(l=>{const t=l.currentTarget;let a=t.value;try{if("date"===e.type){const e=new Date(t.value);isNaN(e.getTime())||(a=e.toISOString())}}catch(e){}e.onChange(a)}),o({"font-tnum text-xs font-medium border border-current mr-s px-xs rounded-s":!0,"inline-block":!!n||"date"===e.type,"sr-only":!n&&"date"!==e.type,"text-body":!e.disabled&&!e.readonly,"text-disabled":e.disabled,"text-secondary":e.readonly}),e.t(e.label),e.list?t(X||(X=le` <datalist id="${0}"> ${0} </datalist> `),a,e.list.map((({label:l,value:a})=>t(Y||(Y=le`<option value="${0}">${0}</option>`),a,e.t(l))))):"",e.disabled||e.readonly?"":t(ee||(ee=le` <div class="absolute inset-0 transition-colors bg-transparent group-hover-bg-contrast-5 pointer-events-none"></div> `)))}let ae,se,ne=e=>e;let oe,ie=e=>e;function re({parsedValue:l,disabled:t,readonly:a,options:s,option:n,t:o,onChange:i}){return te({displayValue:null==n?void 0:n.label,disabled:t,readonly:a,value:l.path,label:"field",list:s.map((l=>e(e({},l),{},{value:l.path}))),type:"text",id:"path",t:o,onChange:e=>i({operator:null,value:"",path:e})})}let de,ue=e=>e;let ce,ve,pe=e=>e;function he(l){var a,s;const{parsedValue:i,isFullSize:r,isNested:u,readonly:c,disabled:v,options:p,t:h,onConvert:g,onDelete:C,onChange:x}=l,V=null!==(a=p.find((e=>e.path===i.path)))&&void 0!==a?a:null,H=null!==(s=null==V?void 0:V.type)&&void 0!==s?s:b.Any,M=i.operator,N={parsedValue:i,disabled:v,readonly:c,options:p,option:V,t:h,onChange:x},j={[b.Attribute]:B,[b.Boolean]:_,[b.Number]:S,[b.String]:z,[b.Date]:q,[b.Any]:A};return t(ce||(ce=pe` <div class="flex items-center space-x-s" aria-label="${0}"> <div class="${0}"> <div class="bg-contrast-10"> <div class="grid gap-1px grid-vertical sm-grid-horizontal"> <div class="bg-base" title="${0}"> <div class="${0}" aria-hidden="true"> ${0} </div> </div> <div class="bg-base"> ${0} </div> <div class="bg-base">${0}</div> <div class="bg-base"> ${0} </div> </div> </div> </div> <div class="${0}"> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon aria-hidden="true" class="m-auto icon-inline text-xl" icon="icons:remove-circle-outline"> </iron-icon> </button> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon aria-hidden="true" class="m-auto icon-inline text-xl" icon="icons:add-circle-outline"> </iron-icon> </button> </div> </div> `),h("query_builder_rule"),o({"flex-1 bg-base rounded overflow-hidden border":!0,"border-contrast-10":!u&&!c,"border-contrast-50":!!u||c,"border-dashed":c,"border-solid":!c}),h(`type_${H}`),o({"w-m h-m":!0,"text-tertiary":!c&&!v,"text-disabled":c||v}),V?j[H]:A,i.path&&(H===b.Attribute||i.name)?t(ve||(ve=pe` <div class="bg-contrast-10 grid gap-1px grid-cols-1 sm-grid-cols-2"> <div class="bg-base">${0}</div> <div class="bg-base">${0}</div> </div> `),re(N),function(l){var t;return te({disabled:l.disabled,readonly:l.readonly,value:null!==(t=l.parsedValue.name)&&void 0!==t?t:"",label:"name",type:"text",t:l.t,onChange:t=>l.onChange(e(e({},l.parsedValue),{},{name:t}))})}(N)):re(N),function(l){const a=l.parsedValue.operator,s={[f.GreaterThan]:y,[f.GreaterThanOrEqual]:n,[f.In]:w,[f.IsDefined]:$,[f.LessThan]:L,[f.LessThanOrEqual]:Z,[f.Not]:I},i={[b.Attribute]:[f.In,f.Not,f.IsDefined],[b.Boolean]:[],[b.String]:[f.In,f.Not],[b.Number]:[f.In,f.Not,f.GreaterThan,f.LessThan,f.GreaterThanOrEqual,f.LessThanOrEqual],[b.Date]:[f.In,f.Not],[b.Any]:Object.values(f)},r=l.option?i[l.option.type]:l.parsedValue.name?Object.values(f):Object.values(f).filter((e=>e!==f.IsDefined)),d=l.disabled||l.readonly||0===r.length||!l.parsedValue.path;return t(oe||(oe=ie` <button title="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <div aria-hidden="true">${0}</div> </button> `),l.t(`operator_${null!=a?a:"equal"}`),o({"flex items-center justify-center w-m h-m transition-colors":!0,"focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50":!0,"text-disabled cursor-default":d,"hover-bg-contrast-5":!d}),d,(()=>{var t;const s=a?r.indexOf(a):-1,n=null!==(t=r[s+1])&&void 0!==t?t:null;l.onChange(e(e({},l.parsedValue),{},{operator:n,value:l.parsedValue.value}))}),a?s[a]:m)}(N),M===f.In?function(l){var a,s,n,o;const i=(null===(a=l.option)||void 0===a?void 0:a.list)?J:te,r=l.parsedValue.value.split(","),u=null!==(n=null===(s=l.option)||void 0===s?void 0:s.type)&&void 0!==n?n:b.Any,c=u===b.Number?"number":u===b.Date?"date":"text",v=null===(o=l.option)||void 0===o?void 0:o.list,p=[...r.filter((e=>!!e))];return l.readonly||p.push(null),t(ae||(ae=ne` <div class="bg-contrast-10 grid grid-cols-1 gap-1px"> ${0} </div> `),d(p,((e,l)=>l),((a,s)=>{var n;return t(se||(se=ne` <div class="bg-base"> ${0} </div> `),i({type:c,list:v,t:l.t,value:null!=a?a:"",label:a?String(s+1):"add_value",disabled:l.disabled,readonly:l.readonly,clearable:!0,displayValue:null===(n=null==v?void 0:v.find((e=>e.value===a)))||void 0===n?void 0:n.label,onChange:t=>{t?r[s]=t:r.splice(s,1),l.onChange(e(e({},l.parsedValue),{},{value:r.join(",")}))}}))})))}(N):M===f.IsDefined?function(l){return J({readonly:l.readonly,disabled:l.disabled,value:l.parsedValue.value,label:"value",list:[{label:"is_defined_true",value:"true"},{label:"is_defined_false",value:"false"}],t:l.t,onChange:t=>l.onChange(e(e({},l.parsedValue),{},{value:t}))})}(N):H===b.Boolean?function(l){var t,a,s,n,o,i;const{parsedValue:r,option:d,readonly:u,disabled:c,t:v,onChange:p}=l,h=null!==(s=null===(a=null===(t=null==d?void 0:d.list)||void 0===t?void 0:t.find((e=>"false"===e.value)))||void 0===a?void 0:a.label)&&void 0!==s?s:"false",b=[{label:null!==(i=null===(o=null===(n=null==d?void 0:d.list)||void 0===n?void 0:n.find((e=>"true"===e.value)))||void 0===o?void 0:o.label)&&void 0!==i?i:"true",value:"true"},{label:h,value:"false"}];return J({disabled:c,readonly:u,value:r.value,label:"value",list:b,t:v,onChange:l=>p(e(e({},r),{},{value:l}))})}(N):null===M&&[b.Number,b.Date].includes(H)?function(l){var a,s,n;const{t:o,parsedValue:i,option:r,readonly:d,disabled:u,onChange:c}=l,v=i.value.split(".."),p=v.length>=1?v[0]:"",h=v.length>=2?v[1]:"",f=(null==r?void 0:r.list)?J:te,g=null!==(a=null==r?void 0:r.type)&&void 0!==a?a:b.Any,m=g===b.Number?"number":g===b.Date?"date":"text",C=null==r?void 0:r.list;return t(de||(de=ue` <div class="grid bg-contrast-10 gap-1px grid-cols-1 grid-rows-2 sm-grid-cols-2 sm-grid-rows-1"> <div class="bg-base"> ${0} </div> <div class="bg-base"> ${0} </div> </div> `),f({displayValue:null===(s=null==C?void 0:C.find((e=>e.value===p)))||void 0===s?void 0:s.label,readonly:d,disabled:u,value:p,label:"range_from",type:m,list:C,t:o,onChange:l=>c(e(e({},i),{},{value:`${l}..${h}`}))}),f({displayValue:null===(n=null==C?void 0:C.find((e=>e.value===h)))||void 0===n?void 0:n.label,readonly:d,disabled:u,label:"range_to",value:h,type:m,list:C,t:o,onChange:l=>c(e(e({},i),{},{value:`${p}..${l}`}))}))}(N):function(l){var t,a,s,n;const{t:o,option:i,parsedValue:r,readonly:d,disabled:u,onChange:c}=l,v=(null==i?void 0:i.list)?J:te,p=null!==(t=null==i?void 0:i.type)&&void 0!==t?t:b.Any;return v({displayValue:null===(s=null===(a=null==i?void 0:i.list)||void 0===a?void 0:a.find((e=>e.value===r.value)))||void 0===s?void 0:s.label,readonly:d,disabled:u||!r.path,value:null!==(n=r.value)&&void 0!==n?n:"",label:"value",type:p===b.Number?"number":p===b.Date?"date":"text",list:null==i?void 0:i.list,t:o,onChange:l=>c(e(e({},r),{},{value:l}))})}(N),o({"-mr-s self-start flex-col sm-flex-row flex-shrink-0 items-center":!0,"border-t border-b border-transparent divide-y divide-transparent":!0,hidden:!!r||c,flex:!r}),h("delete"),o({"box-content flex w-m h-m rounded-full transition-colors":!0,"text-secondary hover-bg-contrast-5 hover-text-error":!v,"cursor-default text-disabled":v,"focus-outline-none focus-ring-2 ring-primary-50":!0,"opacity-0":!i.path}),v||c||!i.path,C,h("add_or_clause"),o({"box-content flex w-m h-m rounded-full transition-colors":!0,"text-success hover-bg-contrast-5":!v,"cursor-default text-disabled":v,"focus-outline-none focus-ring-2 ring-primary-50":!0,"opacity-0":!i.path||!!u}),v||c||!i.path,g)}let be,fe,ge,me,Ce=e=>e;function ye(l){const a=t(be||(be=Ce`<div class="h-xs"></div>`)),s=t(fe||(fe=Ce` <div class="flex items-center h-s"> <div class="w-m text-center leading-none uppercase font-medium text-xs text-contrast-30"> ${0} </div> <div class="flex-1 border-t border-contrast-20"></div> <div class="w-m ml-s flex-shrink-0"></div> <div class="hidden sm-block w-m flex-shrink-0"></div> </div> `),l.t("or"));return t(ge||(ge=Ce` <div aria-label="${0}"> ${0} </div> `),l.t("query_builder_group"),d([...l.parsedValues,null],((e,l)=>String(l)),((n,o)=>{const i=o>0?l.isNested?s:a:"";return null===n?[i,he({isFullSize:!l.isNested&&0===l.parsedValues.length,isNested:l.isNested,disabled:l.disabled,readonly:l.readonly,options:l.options,parsedValue:{path:"",operator:null,value:""},t:l.t,onChange:e=>l.onChange([...l.parsedValues,e])})]:Array.isArray(n)?[i,t(me||(me=Ce` <div class="bg-contrast-10 rounded-t-l rounded-b-l p-s -m-s"> ${0} </div> `),ye({parsedValues:n,isNested:!0,disabled:l.disabled,readonly:l.readonly,options:l.options,t:l.t,onChange:e=>{const t=[...l.parsedValues],a=e;t[o]=e.length>1?a:a[0],l.onChange(t)}}))]:[i,he({parsedValue:n,isNested:l.isNested,disabled:l.disabled,readonly:l.readonly,options:l.options,t:l.t,onChange:e=>{const t=[...l.parsedValues];t[o]=e,l.onChange(t)},onDelete:()=>{const e=l.parsedValues.filter(((e,l)=>l!==o));l.onChange(e)},onConvert:()=>{const t=[...l.parsedValues];t[o]=[n,e(e({},n),{},{operator:null,value:""})],l.onChange(t)}})]})))}function xe(e){var l;const[t,a]=e.split("=").map(decodeURIComponent),s=null!==(l=Object.values(f).find((e=>t.endsWith(`:${e}`))))&&void 0!==l?l:null;let n,o=t.substring(0,s?t.lastIndexOf(":"):void 0);const i=t.lastIndexOf("[");return o.endsWith("]")&&-1!==i&&(n=o.substring(i+1,o.length-1),o=o.substring(0,i),o.endsWith(":name")&&(o=o.substring(0,o.length-5))),{name:n,path:o,value:a,operator:s}}function we(e){let l=e.path;return e.name&&(l+=`:name[${e.name}]`),e.operator&&(l+=`:${e.operator}`),l=`${encodeURIComponent(l)}=${encodeURIComponent(e.value)}`,"="===l?"":l}function Ve(e){const l=e.reduce(((e,l)=>{if(Array.isArray(l)){const t=[l[0].value,l.slice(1).map((e=>we(e)))].join("|");e.push(`${l[0].path}=${encodeURIComponent(t)}`)}else"zoom"!==l.path&&e.push(we(l));return e}),[]),t=$e(e).join(",");return t&&l.push(`zoom=${encodeURIComponent(t)}`),l.join("&")}function $e(e){return e.map((e=>{if(Array.isArray(e))return $e(e);if(e.name)return[e.path];const l=e.path.split(":");return l.slice(0,l.length-1)})).flat().sort(((e,l)=>l.length-e.length)).filter(((e,l,t)=>t.every(((t,a)=>(a>=l||t!==e)&&!t.startsWith(`${e}:`)))))}let He;const Le=a(He||(He=(e=>e)`.gap-1px{gap:1px}.grid-vertical{grid-template:auto/var(--lumo-size-m) 1fr}:host([sm]) .sm-grid-horizontal{grid-template:auto/var(--lumo-size-m) 1fr var(--lumo-size-m) 1fr}`)),Me=h(u(c(v(p(s),"query-builder"))));class Ze extends Me{constructor(){super(...arguments),this.options=null,this.value=null}static get properties(){return e(e({},super.properties),{},{options:{type:Array},value:{type:String}})}static get styles(){return[super.styles,Le]}render(){var e,l;const t=new Set(["zoom","limit","offset","order","fields"]),a=[],s=[];var n;return(n=null!==(e=this.value)&&void 0!==e?e:"",n.split("&").filter((e=>!!e)).map((e=>{const[l,t]=e.split("=").map(decodeURIComponent);return(null==t?void 0:t.includes("|"))?`${encodeURIComponent(l)}=${t}`.split("|").map((e=>xe(e))):xe(e)}))).forEach((e=>{Array.isArray(e)||!t.has(e.path)?s.push(e):a.push(e)})),ye({parsedValues:s,disabled:this.disabled,readonly:this.readonly,options:null!==(l=this.options)&&void 0!==l?l:[],t:this.t.bind(this),onChange:e=>{this.value=Ve([...e,...a]),this.dispatchEvent(new Ze.ChangeEvent("change"))}})}}Ze.ChangeEvent=class extends CustomEvent{},Ze.Operator=f,Ze.Type=b,customElements.define("foxy-query-builder",Ze);export{Ze as Q,b as T};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./shared-2376abfc.js";import{I as e}from"./shared-2062c274.js";import{_ as r}from"./shared-1522d76f.js";import{s as t}from"./shared-79d0699c.js";import{p as a}from"./shared-43e2c3f6.js";import{i as s}from"./shared-9803aa7c.js";import{h as i}from"./shared-dc73b9a5.js";let l,o=e=>e;customElements.define("foxy-internal-date-control",class extends e{constructor(){super(...arguments),this.format=null}static get properties(){return r(r({},super.properties),{},{format:{type:String}})}renderControl(){var e;let r;return r="unix"===this.format?t(new Date(1e3*(null!==(e=this._value)&&void 0!==e?e:0))):this._value,i(l||(l=o` <vaadin-date-picker error-message="${0}" placeholder="${0}" helper-text="${0}" label="${0}" class="w-full" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" .value="${0}" @keydown="${0}" @change="${0}"> </vaadin-date-picker> `),s(this._errorMessage),this.placeholder,this.helperText,this.label,this.disabled,this.readonly,this._checkValidity,r,(e=>{var r;return"Enter"===e.key&&(null===(r=this.nucleon)||void 0===r?void 0:r.submit())}),(e=>{var r,t;const s=e.currentTarget;"unix"===this.format?this._value=Math.floor((null!==(t=null===(r=a(s.value))||void 0===r?void 0:r.getTime())&&void 0!==t?t:0)/1e3):this._value=s.value}))}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./shared-51c4a6dd.js";import"./shared-f5d4dda0.js";import{_ as e}from"./shared-1522d76f.js";import{C as t}from"./shared-9f570db0.js";import{a as r,T as s}from"./shared-331a223c.js";import{h as i,r as l,L as n}from"./shared-dc73b9a5.js";import{I as o}from"./shared-30cbf0a6.js";import{N as h}from"./shared-a0435ec6.js";let p,a,u,d,_=e=>e;class c extends(t(r(s(o(n))))){constructor(){super(...arguments),this.nucleon=null}static get inferredProperties(){return[...super.inferredProperties,"nucleon"]}static get properties(){return e(e({},super.properties),{},{nucleon:{attribute:!1}})}inferFromElement(e,t){return"nucleon"===e&&t instanceof h?t:super.inferFromElement(e,t)}applyInferredProperties(e){var t,r;super.applyInferredProperties(e),this.nucleon=null!==(t=e.get("nucleon"))&&void 0!==t?t:null,!1===(null===(r=this.nucleon)||void 0===r?void 0:r.in("idle"))&&(this.disabled=!0)}updated(e){if(super.updated(e),"string"==typeof this.infer){const e=i(p||(p=_` <slot name="${0}:before" slot="before"></slot> <slot name="${0}:after" slot="after"></slot> `),this.infer,this.infer);l(e,this)}}renderControl(){return i(a||(a=_``))}render(){return this.hidden?i(u||(u=_``)):i(d||(d=_` ${0} ${0} ${0} `),this.renderTemplateOrSlot("before",this.nucleon),this.renderControl(),this.renderTemplateOrSlot("after",this.nucleon))}}customElements.define("foxy-internal-control",c);class f extends c{constructor(){super(...arguments),this.getValue=()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.form[this.property]},this.setValue=e=>{var t;return null===(t=this.nucleon)||void 0===t?void 0:t.edit({[this.property]:e})},this.__placeholder=null,this.__helperText=null,this.__v8nPrefix=null,this.__property=null,this.__label=null}static get properties(){return e(e({},super.properties),{},{placeholder:{type:String,noAccessor:!0},helperText:{type:String,attribute:"helper-text",noAccessor:!0},v8nPrefix:{type:String,attribute:"v8n-prefix",noAccessor:!0},getValue:{attribute:!1},setValue:{attribute:!1},property:{type:String,noAccessor:!0},label:{type:String,noAccessor:!0}})}get placeholder(){return"string"==typeof this.__placeholder?this.__placeholder:this.t("placeholder")}set placeholder(e){this.requestUpdate("placeholder",this.__placeholder),this.__placeholder=e}get helperText(){return"string"==typeof this.__helperText?this.__helperText:this.t("helper_text")}set helperText(e){this.requestUpdate("helperText",this.__helperText),this.__helperText=e}get v8nPrefix(){return"string"==typeof this.__v8nPrefix?this.__v8nPrefix:"string"==typeof this.infer?`${this.infer}:`:""}set v8nPrefix(e){this.requestUpdate("v8nPrefix",this.__v8nPrefix),this.__v8nPrefix=e}get property(){return"string"==typeof this.__property?this.__property:"string"==typeof this.infer?this.infer.replace(/-/g,"_"):""}set property(e){this.requestUpdate("property",this.__property),this.__property=e}get label(){return"string"==typeof this.__label?this.__label:this.t("label")}set label(e){this.requestUpdate("label",this.__label),this.__label=e}resetPlaceholder(){this.requestUpdate("placeholder",this.__placeholder),this.__placeholder=null}resetHelperText(){this.requestUpdate("helperText",this.__helperText),this.__helperText=null}resetV8nPrefix(){this.requestUpdate("v8nPrefix",this.__v8nPrefix),this.__v8nPrefix=null}resetProperty(){this.requestUpdate("property",this.__property),this.__property=null}resetLabel(){this.requestUpdate("label",this.__label),this.__label=null}reportValidity(){const e=this.ownerDocument.createTreeWalker(this.renderRoot,NodeFilter.SHOW_ELEMENT);do{const t=e.currentNode,r=["reportValidity","validate"];for(const e of r)if(e in t)try{t[e]();break}catch(e){continue}}while(e.nextNode())}get _value(){return this.getValue()}set _value(e){const t=new CustomEvent("change",{cancelable:!0,detail:e});this.dispatchEvent(t)&&this.setValue(e)}get _error(){var e;return null===(e=this.nucleon)||void 0===e?void 0:e.errors.find((e=>e.startsWith(this.v8nPrefix)))}get _errorMessage(){return this._error?this.t(this._error.substring(this.v8nPrefix.length)):void 0}get _checkValidity(){return()=>!this._error}}customElements.define("foxy-internal-editable-control",f);export{f as I,c as a};
|