@foxy.io/elements 1.18.0-beta.3 → 1.18.0-beta.6
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 +2 -2
- package/dist/cdn/foxy-address-form.js +1 -1
- package/dist/cdn/foxy-api-browser.js +3 -3
- package/dist/cdn/foxy-applied-tax-card.js +1 -1
- package/dist/cdn/foxy-attribute-card.js +1 -1
- package/dist/cdn/foxy-attribute-form.js +1 -1
- package/dist/cdn/foxy-cancellation-form.js +1 -1
- package/dist/cdn/foxy-collection-page.js +1 -1
- package/dist/cdn/foxy-collection-pages.js +1 -1
- package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
- package/dist/cdn/foxy-coupon-card.js +1 -1
- package/dist/cdn/foxy-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-coupon-codes-form.js +1 -1
- package/dist/cdn/foxy-coupon-detail-card.js +1 -1
- package/dist/cdn/foxy-coupon-form.js +1 -1
- package/dist/cdn/foxy-custom-field-card.js +1 -1
- package/dist/cdn/foxy-custom-field-form.js +1 -1
- package/dist/cdn/foxy-customer-api.js +1 -1
- package/dist/cdn/foxy-customer-card.js +1 -1
- package/dist/cdn/foxy-customer-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings.js +1 -1
- package/dist/cdn/foxy-customer-portal.js +2 -2
- package/dist/cdn/foxy-customer.js +6 -6
- package/dist/cdn/foxy-customers-table.js +1 -1
- package/dist/cdn/foxy-discount-builder.js +1 -1
- package/dist/cdn/foxy-discount-card.js +1 -1
- package/dist/cdn/foxy-discount-detail-card.js +1 -1
- package/dist/cdn/foxy-donation.js +1 -1
- package/dist/cdn/foxy-email-template-form.js +1 -1
- package/dist/cdn/foxy-error-entry-card.js +1 -1
- package/dist/cdn/foxy-form-dialog.js +1 -1
- package/dist/cdn/foxy-generate-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-card.js +1 -1
- package/dist/cdn/foxy-gift-card-code-form.js +1 -1
- package/dist/cdn/foxy-gift-card-code-log-card.js +1 -0
- package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-form.js +1 -1
- package/dist/cdn/foxy-i18n.js +1 -1
- package/dist/cdn/foxy-item-card.js +1 -1
- package/dist/cdn/foxy-item-category-card.js +1 -0
- package/dist/cdn/foxy-item-category-form.js +1 -0
- package/dist/cdn/foxy-item-form.js +1 -1
- package/dist/cdn/foxy-item-option-card.js +1 -1
- package/dist/cdn/foxy-item-option-form.js +1 -1
- package/dist/cdn/foxy-items-form.js +1 -1
- package/dist/cdn/foxy-nucleon-element.js +1 -1
- package/dist/cdn/foxy-pagination.js +1 -1
- package/dist/cdn/foxy-payment-card.js +1 -1
- package/dist/cdn/foxy-payment-method-card.js +1 -1
- package/dist/cdn/foxy-query-builder.js +1 -1
- package/dist/cdn/foxy-report-form.js +2 -2
- package/dist/cdn/foxy-reports-table.js +5 -5
- package/dist/cdn/foxy-shipment-card.js +1 -1
- package/dist/cdn/foxy-sign-in-form.js +1 -1
- package/dist/cdn/foxy-spinner.js +1 -1
- package/dist/cdn/foxy-store-shipping-method-form.js +1 -150
- package/dist/cdn/foxy-subscription-card.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +5 -5
- package/dist/cdn/foxy-subscriptions-table.js +1 -1
- package/dist/cdn/foxy-swipe-actions.js +1 -1
- package/dist/cdn/foxy-table.js +1 -1
- package/dist/cdn/foxy-tax-card.js +1 -1
- package/dist/cdn/foxy-tax-form.js +1 -1
- package/dist/cdn/foxy-template-config-form.js +1 -1
- package/dist/cdn/foxy-template-form.js +1 -1
- package/dist/cdn/foxy-transaction-card.js +1 -1
- package/dist/cdn/foxy-transaction.js +1 -1
- package/dist/cdn/foxy-transactions-table.js +1 -1
- package/dist/cdn/foxy-user-form.js +1 -1
- package/dist/cdn/foxy-users-table.js +1 -1
- package/dist/cdn/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-e1c1e8e2.js → shared-0479553e.js} +1 -1
- package/dist/cdn/{shared-99940888.js → shared-11c2efc8.js} +1 -1
- package/dist/cdn/{shared-5482630e.js → shared-12abadda.js} +1 -1
- package/dist/cdn/{shared-a48a9dfc.js → shared-12e9933a.js} +1 -1
- package/dist/cdn/shared-146635ed.js +1 -0
- package/dist/cdn/{shared-9ef81b37.js → shared-1765d84b.js} +1 -1
- package/dist/cdn/{shared-189dfb49.js → shared-1c05004b.js} +1 -1
- package/dist/cdn/{shared-ff1d9854.js → shared-1e264485.js} +1 -1
- package/dist/cdn/{shared-23fd456c.js → shared-23e21265.js} +1 -1
- package/dist/cdn/shared-27200366.js +1 -0
- package/dist/cdn/{shared-5e43b817.js → shared-2af8c996.js} +5 -5
- package/dist/cdn/{shared-4560425c.js → shared-2b54d9fe.js} +1 -1
- package/dist/cdn/shared-36ed123a.js +11 -0
- package/dist/cdn/{shared-9be1a70f.js → shared-3ddbe8c9.js} +1 -1
- package/dist/cdn/{shared-2ca6d676.js → shared-4181eb12.js} +1 -1
- package/dist/cdn/shared-43dff1c8.js +1 -0
- package/dist/cdn/{shared-023c287a.js → shared-4ba52733.js} +1 -1
- package/dist/cdn/{shared-4773b634.js → shared-4ca7363a.js} +1 -1
- package/dist/cdn/shared-4d28c698.js +1 -0
- package/dist/cdn/{shared-a2a1193d.js → shared-525aabce.js} +1 -1
- package/dist/cdn/shared-55b49058.js +150 -0
- package/dist/cdn/shared-565feb2f.js +1 -0
- package/dist/cdn/{shared-872ceacf.js → shared-5c3d4435.js} +2 -2
- package/dist/cdn/shared-5f82e90e.js +1 -0
- package/dist/cdn/{shared-91b86bae.js → shared-64e3f8da.js} +1 -1
- package/dist/cdn/{shared-901ca702.js → shared-6534863a.js} +1 -1
- package/dist/cdn/{shared-c63ba384.js → shared-6f83a8cf.js} +1 -1
- package/dist/cdn/{shared-c0fb5a33.js → shared-75c7193c.js} +1 -1
- package/dist/cdn/{shared-11f0daea.js → shared-78dba0d5.js} +4 -4
- package/dist/cdn/shared-79d6676d.js +1 -0
- package/dist/cdn/{shared-dc73b9a5.js → shared-7f33a83a.js} +1 -1
- package/dist/cdn/shared-83344a27.js +1 -0
- package/dist/cdn/{shared-85d45495.js → shared-84b5d8f0.js} +1 -1
- package/dist/cdn/shared-85cd6cfb.js +1 -0
- package/dist/cdn/{shared-3a7cf739.js → shared-86d0d927.js} +1 -1
- package/dist/cdn/{shared-ec7cfc23.js → shared-946f88a0.js} +12 -22
- package/dist/cdn/shared-94e2d173.js +1 -0
- package/dist/cdn/{shared-0eb966c5.js → shared-99065f2a.js} +1 -1
- package/dist/cdn/{shared-80b90eec.js → shared-9943c9c2.js} +1 -1
- package/dist/cdn/{shared-74a27421.js → shared-9b401cca.js} +1 -1
- package/dist/cdn/{shared-68ab037d.js → shared-a639ff32.js} +1 -1
- package/dist/cdn/{shared-71acf673.js → shared-a6c41415.js} +1 -1
- package/dist/cdn/shared-aa1a0a7c.js +1 -0
- package/dist/cdn/shared-b160a8b2.js +1 -0
- package/dist/cdn/{shared-fd595d0a.js → shared-b5179f8e.js} +1 -1
- package/dist/cdn/{shared-c7280a24.js → shared-b886c58b.js} +1 -1
- package/dist/cdn/shared-ba11b8bd.js +1 -0
- package/dist/cdn/{shared-fcbf9a41.js → shared-bbf4b58e.js} +1 -1
- package/dist/cdn/shared-bc72765e.js +1 -0
- package/dist/cdn/{shared-4c0520f6.js → shared-bfca826a.js} +1 -1
- package/dist/cdn/{shared-fe68657a.js → shared-c6ed1e9d.js} +1 -1
- package/dist/cdn/shared-c7bd91d8.js +29 -0
- package/dist/cdn/{shared-3e3c07ac.js → shared-cd5789ea.js} +1 -1
- package/dist/cdn/{shared-f2639daf.js → shared-d0e0fe52.js} +1 -1
- package/dist/cdn/{shared-9803aa7c.js → shared-d3bf9ac0.js} +2 -2
- package/dist/cdn/{shared-084b6372.js → shared-d44a2a31.js} +1 -1
- package/dist/cdn/shared-d4d52840.js +1 -0
- package/dist/cdn/{shared-a0c6a159.js → shared-d519a301.js} +2 -2
- package/dist/cdn/{shared-60c862aa.js → shared-d6ba6d5e.js} +1 -1
- package/dist/cdn/{shared-ca0f14c1.js → shared-e34d2ef1.js} +1 -1
- package/dist/cdn/{shared-f9f9ed5b.js → shared-e6f3e9f0.js} +1 -1
- package/dist/cdn/{shared-412670b8.js → shared-e7b5cc83.js} +1 -1
- package/dist/cdn/{shared-22ba9566.js → shared-f3b35364.js} +1 -1
- package/dist/cdn/{shared-c7c8d1b6.js → shared-fe555bf4.js} +1 -1
- package/dist/cdn/translations/gift-card-code-form/en.json +32 -0
- package/dist/cdn/translations/gift-card-code-log-card/en.json +10 -0
- package/dist/cdn/translations/gift-card-form/en.json +58 -1
- package/dist/cdn/translations/item-category-form/en.json +196 -0
- package/dist/elements/internal/InternalAsyncComboBoxControl/InternalAsyncComboBoxControl.js +1 -0
- package/dist/elements/internal/InternalAsyncComboBoxControl/InternalAsyncComboBoxControl.js.map +1 -1
- package/dist/elements/internal/InternalControl/InternalControl.js +3 -2
- package/dist/elements/internal/InternalControl/InternalControl.js.map +1 -1
- package/dist/elements/internal/InternalIntegerControl/InternalIntegerControl.js +1 -1
- package/dist/elements/internal/InternalIntegerControl/InternalIntegerControl.js.map +1 -1
- package/dist/elements/internal/InternalNumberControl/InternalNumberControl.js +1 -1
- package/dist/elements/internal/InternalNumberControl/InternalNumberControl.js.map +1 -1
- package/dist/elements/internal/InternalSelectControl/InternalSelectControl.d.ts +17 -0
- package/dist/elements/internal/InternalSelectControl/InternalSelectControl.js +57 -0
- package/dist/elements/internal/InternalSelectControl/InternalSelectControl.js.map +1 -0
- package/dist/elements/internal/InternalSelectControl/index.d.ts +5 -0
- package/dist/elements/internal/InternalSelectControl/index.js +7 -0
- package/dist/elements/internal/InternalSelectControl/index.js.map +1 -0
- package/dist/elements/internal/InternalSelectControl/types.d.ts +6 -0
- package/dist/elements/internal/InternalSelectControl/types.js +2 -0
- package/dist/elements/internal/InternalSelectControl/types.js.map +1 -0
- package/dist/elements/internal/InternalTextControl/InternalTextControl.js +1 -0
- package/dist/elements/internal/InternalTextControl/InternalTextControl.js.map +1 -1
- package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.d.ts +4 -0
- package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.js +32 -0
- package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.js.map +1 -1
- package/dist/elements/public/GiftCardCodeForm/index.d.ts +7 -4
- package/dist/elements/public/GiftCardCodeForm/index.js +7 -4
- package/dist/elements/public/GiftCardCodeForm/index.js.map +1 -1
- package/dist/elements/public/GiftCardCodeForm/internal/InternalGiftCardCodeFormItemControl/InternalGiftCardCodeFormItemControl.d.ts +5 -0
- package/dist/elements/public/GiftCardCodeForm/internal/InternalGiftCardCodeFormItemControl/InternalGiftCardCodeFormItemControl.js +23 -0
- package/dist/elements/public/GiftCardCodeForm/internal/InternalGiftCardCodeFormItemControl/InternalGiftCardCodeFormItemControl.js.map +1 -0
- package/dist/elements/public/GiftCardCodeForm/internal/InternalGiftCardCodeFormItemControl/index.d.ts +6 -0
- package/dist/elements/public/GiftCardCodeForm/internal/InternalGiftCardCodeFormItemControl/index.js +8 -0
- package/dist/elements/public/GiftCardCodeForm/internal/InternalGiftCardCodeFormItemControl/index.js.map +1 -0
- package/dist/elements/public/GiftCardCodeLogCard/GiftCardCodeLogCard.d.ts +12 -0
- package/dist/elements/public/GiftCardCodeLogCard/GiftCardCodeLogCard.js +108 -0
- package/dist/elements/public/GiftCardCodeLogCard/GiftCardCodeLogCard.js.map +1 -0
- package/dist/elements/public/GiftCardCodeLogCard/index.d.ts +6 -0
- package/dist/elements/public/GiftCardCodeLogCard/index.js +8 -0
- package/dist/elements/public/GiftCardCodeLogCard/index.js.map +1 -0
- package/dist/elements/public/GiftCardCodeLogCard/types.d.ts +3 -0
- package/dist/elements/public/GiftCardCodeLogCard/types.js +2 -0
- package/dist/elements/public/GiftCardCodeLogCard/types.js.map +1 -0
- package/dist/elements/public/GiftCardForm/GiftCardForm.js +25 -0
- package/dist/elements/public/GiftCardForm/GiftCardForm.js.map +1 -1
- package/dist/elements/public/GiftCardForm/index.d.ts +1 -2
- package/dist/elements/public/GiftCardForm/index.js +1 -2
- package/dist/elements/public/GiftCardForm/index.js.map +1 -1
- package/dist/elements/public/GiftCardForm/internal/InternalGiftCardFormProvisioningControl/InternalGiftCardFormProvisioningControl.d.ts +14 -0
- package/dist/elements/public/GiftCardForm/internal/InternalGiftCardFormProvisioningControl/InternalGiftCardFormProvisioningControl.js +93 -0
- package/dist/elements/public/GiftCardForm/internal/InternalGiftCardFormProvisioningControl/InternalGiftCardFormProvisioningControl.js.map +1 -0
- package/dist/elements/public/GiftCardForm/internal/InternalGiftCardFormProvisioningControl/index.d.ts +6 -0
- package/dist/elements/public/GiftCardForm/internal/InternalGiftCardFormProvisioningControl/index.js +8 -0
- package/dist/elements/public/GiftCardForm/internal/InternalGiftCardFormProvisioningControl/index.js.map +1 -0
- package/dist/elements/public/ItemCard/ItemCard.js +8 -6
- package/dist/elements/public/ItemCard/ItemCard.js.map +1 -1
- package/dist/elements/public/ItemCategoryCard/ItemCategoryCard.d.ts +6 -0
- package/dist/elements/public/ItemCategoryCard/ItemCategoryCard.js +11 -0
- package/dist/elements/public/ItemCategoryCard/ItemCategoryCard.js.map +1 -0
- package/dist/elements/public/ItemCategoryCard/index.d.ts +2 -0
- package/dist/elements/public/ItemCategoryCard/index.js +4 -0
- package/dist/elements/public/ItemCategoryCard/index.js.map +1 -0
- package/dist/elements/public/ItemCategoryCard/types.d.ts +3 -0
- package/dist/elements/public/ItemCategoryCard/types.js +2 -0
- package/dist/elements/public/ItemCategoryCard/types.js.map +1 -0
- package/dist/elements/public/ItemCategoryForm/ItemCategoryForm.d.ts +31 -0
- package/dist/elements/public/ItemCategoryForm/ItemCategoryForm.js +309 -0
- package/dist/elements/public/ItemCategoryForm/ItemCategoryForm.js.map +1 -0
- package/dist/elements/public/ItemCategoryForm/index.d.ts +10 -0
- package/dist/elements/public/ItemCategoryForm/index.js +12 -0
- package/dist/elements/public/ItemCategoryForm/index.js.map +1 -0
- package/dist/elements/public/ItemCategoryForm/internal/InternalItemCategoryFormTaxesControl/InternalItemCategoryFormTaxesControl.d.ts +8 -0
- package/dist/elements/public/ItemCategoryForm/internal/InternalItemCategoryFormTaxesControl/InternalItemCategoryFormTaxesControl.js +52 -0
- package/dist/elements/public/ItemCategoryForm/internal/InternalItemCategoryFormTaxesControl/InternalItemCategoryFormTaxesControl.js.map +1 -0
- package/dist/elements/public/ItemCategoryForm/internal/InternalItemCategoryFormTaxesControl/index.d.ts +6 -0
- package/dist/elements/public/ItemCategoryForm/internal/InternalItemCategoryFormTaxesControl/index.js +8 -0
- package/dist/elements/public/ItemCategoryForm/internal/InternalItemCategoryFormTaxesControl/index.js.map +1 -0
- package/dist/elements/public/ItemCategoryForm/internal/InternalItemCategoryFormTaxesControlItem/InternalItemCategoryFormTaxesControlItem.d.ts +11 -0
- package/dist/elements/public/ItemCategoryForm/internal/InternalItemCategoryFormTaxesControlItem/InternalItemCategoryFormTaxesControlItem.js +85 -0
- package/dist/elements/public/ItemCategoryForm/internal/InternalItemCategoryFormTaxesControlItem/InternalItemCategoryFormTaxesControlItem.js.map +1 -0
- package/dist/elements/public/ItemCategoryForm/internal/InternalItemCategoryFormTaxesControlItem/index.d.ts +5 -0
- package/dist/elements/public/ItemCategoryForm/internal/InternalItemCategoryFormTaxesControlItem/index.js +7 -0
- package/dist/elements/public/ItemCategoryForm/internal/InternalItemCategoryFormTaxesControlItem/index.js.map +1 -0
- package/dist/elements/public/ItemCategoryForm/types.d.ts +3 -0
- package/dist/elements/public/ItemCategoryForm/types.js +2 -0
- package/dist/elements/public/ItemCategoryForm/types.js.map +1 -0
- package/dist/elements/public/NucleonElement/API.js +1 -1
- package/dist/elements/public/NucleonElement/API.js.map +1 -1
- package/dist/elements/public/NucleonElement/NucleonElement.js +2 -1
- package/dist/elements/public/NucleonElement/NucleonElement.js.map +1 -1
- package/dist/elements/public/ShipmentCard/types.d.ts +2 -16
- package/dist/elements/public/ShipmentCard/types.js.map +1 -1
- package/dist/elements/public/StoreShippingMethodForm/StoreShippingMethodForm.js +0 -4
- package/dist/elements/public/StoreShippingMethodForm/StoreShippingMethodForm.js.map +1 -1
- package/dist/elements/public/index.d.ts +3 -0
- package/dist/elements/public/index.defined.d.ts +3 -0
- package/dist/elements/public/index.defined.js +3 -0
- package/dist/elements/public/index.defined.js.map +1 -1
- package/dist/elements/public/index.js +3 -0
- package/dist/elements/public/index.js.map +1 -1
- package/dist/mixins/themeable.js +32 -0
- package/dist/mixins/themeable.js.map +1 -1
- package/package.json +2 -2
- package/dist/cdn/shared-2f0efb2c.js +0 -1
- package/dist/cdn/shared-37b61010.js +0 -1
- package/dist/cdn/shared-381aa7fe.js +0 -1
- package/dist/cdn/shared-619adfad.js +0 -1
- package/dist/cdn/shared-6af95088.js +0 -1
- package/dist/cdn/shared-6ce2acfa.js +0 -1
- package/dist/cdn/shared-6f89d2e0.js +0 -1
- package/dist/cdn/shared-9b392ba8.js +0 -1
- package/dist/cdn/shared-9ef13805.js +0 -1
- package/dist/cdn/shared-d91ed0a8.js +0 -1
- package/dist/cdn/shared-daa454bf.js +0 -1
- package/dist/cdn/shared-f31044b8.js +0 -29
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import{C as e}from"./shared-9943c9c2.js";import{T as t,D as r}from"./shared-d44a2a31.js";import"./shared-b886c58b.js";import{h as o,P as a}from"./shared-64e3f8da.js";import{F as s}from"./shared-cd5789ea.js";import{I as l}from"./shared-4ca7363a.js";import"./shared-5f82e90e.js";import{_ as i}from"./shared-e34d2ef1.js";import{i as h}from"./shared-d3bf9ac0.js";import{h as d}from"./shared-7f33a83a.js";const n=o`<dom-module id="lumo-checkbox-group" theme-for="vaadin-checkbox-group">
|
|
2
|
+
<template>
|
|
3
|
+
<style include="lumo-required-field">
|
|
4
|
+
:host {
|
|
5
|
+
color: var(--lumo-body-text-color);
|
|
6
|
+
font-size: var(--lumo-font-size-m);
|
|
7
|
+
font-family: var(--lumo-font-family);
|
|
8
|
+
-webkit-font-smoothing: antialiased;
|
|
9
|
+
-moz-osx-font-smoothing: grayscale;
|
|
10
|
+
-webkit-tap-highlight-color: transparent;
|
|
11
|
+
padding: var(--lumo-space-xs) 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:host::before {
|
|
15
|
+
height: var(--lumo-size-m);
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
display: inline-flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
:host([theme~="vertical"]) [part="group-field"] {
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
[part="label"] {
|
|
27
|
+
padding-bottom: 0.7em;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:host([disabled]) [part="label"] {
|
|
31
|
+
color: var(--lumo-disabled-text-color);
|
|
32
|
+
-webkit-text-fill-color: var(--lumo-disabled-text-color);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:host([focused]:not([disabled])) [part="label"] {
|
|
36
|
+
color: var(--lumo-primary-text-color);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
:host(:hover:not([disabled]):not([focused])) [part="label"],
|
|
40
|
+
:host(:hover:not([disabled]):not([focused])) [part="helper-text"],
|
|
41
|
+
:host(:hover:not([disabled]):not([focused])) [part="helper-text"] ::slotted(*) {
|
|
42
|
+
color: var(--lumo-body-text-color);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:host([has-helper]) [part="helper-text"]::before {
|
|
46
|
+
content: "";
|
|
47
|
+
display: block;
|
|
48
|
+
height: 0.4em;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
[part="helper-text"],
|
|
52
|
+
[part="helper-text"] ::slotted(*) {
|
|
53
|
+
display: block;
|
|
54
|
+
color: var(--lumo-secondary-text-color);
|
|
55
|
+
font-size: var(--lumo-font-size-xs);
|
|
56
|
+
line-height: var(--lumo-line-height-xs);
|
|
57
|
+
margin-left: calc(var(--lumo-border-radius-m) / 4);
|
|
58
|
+
transition: color 0.2s;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* helper-text position */
|
|
62
|
+
|
|
63
|
+
:host([has-helper][theme~="helper-above-field"]) [part="helper-text"]::before {
|
|
64
|
+
display: none;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:host([has-helper][theme~="helper-above-field"]) [part="helper-text"]::after {
|
|
68
|
+
content: "";
|
|
69
|
+
display: block;
|
|
70
|
+
height: 0.4em;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
:host([has-helper][theme~="helper-above-field"]) [part="label"] {
|
|
74
|
+
order: 0;
|
|
75
|
+
padding-bottom: 0.4em;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
:host([has-helper][theme~="helper-above-field"]) [part="helper-text"] {
|
|
79
|
+
order: 1;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
:host([has-helper][theme~="helper-above-field"]) [part="group-field"] {
|
|
83
|
+
order: 2;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
:host([has-helper][theme~="helper-above-field"]) [part="error-message"] {
|
|
87
|
+
order: 3;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* Touch device adjustment */
|
|
91
|
+
@media (pointer: coarse) {
|
|
92
|
+
:host(:hover:not([disabled]):not([focused])) [part="label"] {
|
|
93
|
+
color: var(--lumo-secondary-text-color);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
</style>
|
|
97
|
+
</template>
|
|
98
|
+
</dom-module>`;document.head.appendChild(n.content);
|
|
99
|
+
/**
|
|
100
|
+
@license
|
|
101
|
+
Copyright (c) 2017 Vaadin Ltd.
|
|
102
|
+
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
103
|
+
*/
|
|
104
|
+
class c extends(t(r(a))){static get template(){return o`
|
|
105
|
+
<style>
|
|
106
|
+
:host {
|
|
107
|
+
display: inline-flex;
|
|
108
|
+
|
|
109
|
+
/* Prevent horizontal overflow in IE 11 instead of wrapping checkboxes */
|
|
110
|
+
max-width: 100%;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
:host::before {
|
|
114
|
+
content: "\\2003";
|
|
115
|
+
width: 0;
|
|
116
|
+
display: inline-block;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
:host([hidden]) {
|
|
120
|
+
display: none !important;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.vaadin-group-field-container {
|
|
124
|
+
display: flex;
|
|
125
|
+
flex-direction: column;
|
|
126
|
+
|
|
127
|
+
/* Prevent horizontal overflow in IE 11 instead of wrapping checkboxes */
|
|
128
|
+
width: 100%;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
[part="label"]:empty {
|
|
132
|
+
display: none;
|
|
133
|
+
}
|
|
134
|
+
</style>
|
|
135
|
+
|
|
136
|
+
<div class="vaadin-group-field-container">
|
|
137
|
+
<label part="label">[[label]]</label>
|
|
138
|
+
|
|
139
|
+
<div part="group-field">
|
|
140
|
+
<slot id="slot"></slot>
|
|
141
|
+
</div>
|
|
142
|
+
|
|
143
|
+
<div part="helper-text" aria-live="assertive" aria-hidden\$="[[_getHelperTextAriaHidden(helperText, _hasSlottedHelper)]]">
|
|
144
|
+
<slot name="helper">[[helperText]]</slot>
|
|
145
|
+
</div>
|
|
146
|
+
|
|
147
|
+
<div part="error-message" aria-live="assertive" aria-hidden\$="[[_getErrorMessageAriaHidden(invalid, errorMessage)]]">[[errorMessage]]</div>
|
|
148
|
+
|
|
149
|
+
</div>
|
|
150
|
+
`}static get is(){return"vaadin-checkbox-group"}static get properties(){return{disabled:{type:Boolean,reflectToAttribute:!0,observer:"_disabledChanged"},label:{type:String,value:"",observer:"_labelChanged"},value:{type:Array,value:()=>[],notify:!0},errorMessage:{type:String,value:"",observer:"_errorMessageChanged"},helperText:{type:String,value:"",observer:"_helperTextChanged"},required:{type:Boolean,reflectToAttribute:!0},invalid:{type:Boolean,reflectToAttribute:!0,notify:!0,value:!1},_hasSlottedHelper:Boolean}}static get observers(){return["_updateValue(value, value.splices)"]}ready(){super.ready(),this.addEventListener("focusin",(()=>this._setFocused(this._containsFocus()))),this.addEventListener("focusout",(e=>{this._checkboxes.some((t=>e.relatedTarget===t||t.shadowRoot.contains(e.relatedTarget)))||(this.validate(),this._setFocused(!1))}));const e=e=>{this._changeSelectedCheckbox(e.target)};this._observer=new s(this,(t=>{const r=this._filterCheckboxes(t.addedNodes);r.forEach((t=>{t.addEventListener("checked-changed",e),this.disabled&&(t.disabled=!0),t.checked?this._addCheckboxToValue(t.value):this.value.indexOf(t.value)>-1&&(t.checked=!0)})),this._filterCheckboxes(t.removedNodes).forEach((t=>{t.removeEventListener("checked-changed",e),t.checked&&this._removeCheckboxFromValue(t.value)})),this._setOrToggleHasHelperAttribute();r.every((e=>{const{value:t}=e;return e.hasAttribute("value")||t&&"on"!==t}))||console.warn("Please add value attribute to all checkboxes in checkbox group")}))}validate(){return this.invalid=this.required&&0===this.value.length,!this.invalid}get _checkboxes(){return this._filterCheckboxes(this.querySelectorAll("*"))}_filterCheckboxes(t){return Array.from(t).filter((t=>t instanceof e))}_disabledChanged(e){this.setAttribute("aria-disabled",e),this._checkboxes.forEach((t=>t.disabled=e))}_addCheckboxToValue(e){-1===this.value.indexOf(e)&&(this.value=this.value.concat(e))}_removeCheckboxFromValue(e){this.value=this.value.filter((t=>t!==e))}_changeSelectedCheckbox(e){this._updatingValue||(e.checked?this._addCheckboxToValue(e.value):this._removeCheckboxFromValue(e.value))}_updateValue(e,t){0===e.length&&void 0===this._oldValue||(e.length?this.setAttribute("has-value",""):this.removeAttribute("has-value"),this._oldValue=e,this._updatingValue=!0,this._checkboxes.forEach((t=>{t.checked=e.indexOf(t.value)>-1})),this._updatingValue=!1,this.validate())}_labelChanged(e){this._setOrToggleAttribute("has-label",!!e)}_errorMessageChanged(e){this._setOrToggleAttribute("has-error-message",!!e)}_helperTextChanged(e){this._setOrToggleAttribute("has-helper",!!e)}_setOrToggleAttribute(e,t){e&&(t?this.setAttribute(e,"boolean"==typeof t?"":t):this.removeAttribute(e))}_getErrorMessageAriaHidden(e,t){return(!t||!e).toString()}_containsFocus(){const e=this.getRootNode(),t=void 0!==e._activeElement?e._activeElement:e.activeElement;return this.contains(t)}_setFocused(e){e?this.setAttribute("focused",""):this.removeAttribute("focused")}_setOrToggleHasHelperAttribute(){const e=this.shadowRoot.querySelector('[name="helper"]').assignedNodes();this._hasSlottedHelper=e.filter((e=>3!==e.nodeType)).length>0,this._setOrToggleAttribute("has-helper",this._hasSlottedHelper?"slotted":!!this.helperText)}_getHelperTextAriaHidden(e,t){return(!(e||t)).toString()}}customElements.define(c.is,c);let u,p,b=e=>e;customElements.define("foxy-internal-checkbox-group-control",class extends l{constructor(){super(...arguments),this.options=[],this.theme=null}static get properties(){return i(i({},super.properties),{},{options:{type:Array},theme:{type:String}})}renderControl(){var e;return d(u||(u=b` <vaadin-checkbox-group error-message="${0}" helper-text="${0}" label="${0}" class="w-full" theme="${0}" ?disabled="${0}" .checkValidity="${0}" .value="${0}" @change="${0}"> ${0} </vaadin-checkbox-group> `),h(this._errorMessage),this.helperText,this.label,h(null!==(e=this.theme)&&void 0!==e?e:void 0),this.disabled||this.readonly,this._checkValidity,this._value,(e=>{const t=e.currentTarget;this._value=t.value}),this.options.map((e=>d(p||(p=b` <vaadin-checkbox value="${0}"> <foxy-i18n infer="" key="${0}"></foxy-i18n> </vaadin-checkbox> `),e.value,e.label))))}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as e,A as s}from"./shared-86d0d927.js";class t extends s{constructor(s){super({base:new URL(document.baseURI),fetch:(...n)=>new Promise(((o,a)=>{const c="string"==typeof n[0]?new t.WHATWGRequest(...n):n[0];c.headers.set("Content-Type","application/json"),c.headers.set("FOXY-API-VERSION","1");const r=new e("fetch",{cancelable:!0,composed:!0,bubbles:!0,request:c,resolve:o,reject:a});s.dispatchEvent(r),r.defaultPrevented||o(new Response(null,{status:500}))}))})}}t.FetchEvent=e;export{t as A};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-e7b5cc83.js";import"./shared-cd5789ea.js";import{_ as e,I as l}from"./shared-e34d2ef1.js";import{s as t,h as n,c as a,L as s}from"./shared-7f33a83a.js";import{o}from"./shared-e6f3e9f0.js";import{c as i}from"./shared-4e709717.js";import{i as r}from"./shared-d3bf9ac0.js";import{s as d}from"./shared-2061be9a.js";import{r as u}from"./shared-d519a301.js";import{R as c,T as v}from"./shared-c7bd91d8.js";import{T as p}from"./shared-83344a27.js";var f,h;!function(e){e.Attribute="attribute",e.Boolean="boolean",e.String="string",e.Number="number",e.Date="date",e.Any="any"}(f||(f={})),function(e){e.LessThanOrEqual="lessthanorequal",e.LessThan="lessthan",e.GreaterThanOrEqual="greaterthanorequal",e.GreaterThan="greaterthan",e.IsDefined="isdefined",e.Not="not",e.In="in"}(h||(h={}));let g;const C=t(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-412670b8.js";import"./shared-3e3c07ac.js";import{_ as e,I as l}f
|
|
|
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 z,R,G,U,F,W=e=>e;function Q(e){var l,t,a;const s=null===(t=null===(l=e.list)||void 0===l?void 0:l.every((l=>l.value!==e.value)))||void 0===t||t;return n(z||(z=W` <label class="flex items-center cursor-pointer transition-colors group text-tertiary hover-bg-contrast-5"> <div class="relative flex-1 min-w-0 overflow-hidden"> <select class="${0}" @change="${0}"> ${0} ${0} </select> </div> ${0} </label> `),i({"cursor-pointer 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":s,"text-body":!s}),(l=>{const t=l.currentTarget,n=t.options[t.options.selectedIndex].value;e.onChange(n)}),s?n(R||(R=W`<option value disabled="disabled" ?selected="${0}">${0}</option>`),s,e.t(e.label)):"",null===(a=e.list)||void 0===a?void 0:a.map((({label:l,value:t})=>n(G||(G=W` <option value="${0}" ?selected="${0}"> ${0} </option> `),t,t===e.value,e.t(l)))),s?"":n(U||(U=W` <span class="font-tnum text-xs font-medium border mr-s px-xs rounded-s border-current inline-block"> ${0} </span> ${0} `),e.t(e.label),e.clearable?n(F||(F=W` <button aria-label="${0}" class="w-s h-s mr-xs text-body flex items-center justify-center transition-colors rounded-full focus-outline-none focus-ring-2 focus-ring-primary-50 hover-bg-contrast-5 hover-text-error" @click="${0}"> <iron-icon aria-hidden="true" class="icon-inline text-l" icon="icons:remove-circle-outline"> </iron-icon> </button> `),e.t("delete"),(()=>e.onChange(""))):""))}let J,K,P,X,Y,ee=e=>e;function le(e){var l;const t=`${null!==(l=e.id)&&void 0!==l?l:String(Math.floor(Math.random()*Math.pow(10,8)))}-list`,a=!!e.displayValue;let s=e.value;if("date"===e.type){const l=new Date(e.value);isNaN(l.getTime())||(s=u(l))}return n(J||(J=ee` <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}" .value="${0}" ?disabled="${0}" @input="${0}"> </div> <span class="${0}"> ${0} </span> ${0} ${0} </label> `),a?n(K||(K=ee` <div aria-hidden="true" class="absolute inset-0 h-m px-s font-medium text-body flex items-center"> <div class="truncate">${0}</div> </div> `),e.t(e.displayValue)):"",s||"date"===e.type?"":e.t(e.label),i({"bg-base text-body relative appearance-none flex h-m px-s font-medium w-full":!0,"flex max-w-full whitespace-nowrap":!0,"focus-outline-none":!0,"opacity-0 focus-opacity-100":a}),r(e.list?t:void 0),e.type,s,e.disabled,(l=>{var t,n;const a=l.currentTarget;"date"===e.type?e.onChange(null!==(n=null===(t=a.valueAsDate)||void 0===t?void 0:t.toISOString())&&void 0!==n?n:a.value):e.onChange(a.value)}),i({"font-tnum text-xs font-medium border border-current mr-s px-xs rounded-s":!0,"inline-block":!!s||"date"===e.type,"sr-only":!s&&"date"!==e.type}),e.t(e.label),e.list?n(P||(P=ee` <datalist id="${0}"> ${0} </datalist> `),t,e.list.map((({label:l,value:t})=>n(X||(X=ee`<option value="${0}">${0}</option>`),t,e.t(l))))):"",e.disabled?"":n(Y||(Y=ee` <div class="absolute inset-0 transition-colors bg-transparent group-hover-bg-contrast-5 pointer-events-none"></div> `)))}let te,ne,ae=e=>e;let se,oe=e=>e;function ie({parsedValue:l,option:t,options:n,t:a,onChange:s}){return le({displayValue:null==t?void 0:t.label,value:l.path,label:"field",list:n.map((l=>e(e({},l),{},{value:l.path}))),type:"text",id:"path",t:a,onChange:e=>s({operator:null,value:"",path:e})})}let re,ue=e=>e;let de,ce,ve=e=>e;function pe(l){var t,a;const{parsedValue:s,options:r,t:u,isNested:c,isFullSize:v,onChange:p,onDelete:g,onConvert:b}=l,x=null!==(t=r.find((e=>e.path===s.path)))&&void 0!==t?t:null,V=null!==(a=null==x?void 0:x.type)&&void 0!==a?a:f.Any,$=s.operator,L={parsedValue:s,option:x,options:r,t:u,onChange:p},Z={[f.Attribute]:A,[f.Boolean]:D,[f.Number]:E,[f.String]:k,[f.Date]:O,[f.Any]:j};return n(de||(de=ve` <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="w-m h-m text-tertiary" 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> `),u("query_builder_rule"),i({"flex-1 bg-base rounded overflow-hidden border":!0,"border-contrast-10":!c,"border-contrast-50":!!c}),u(`type_${V}`),x?Z[V]:j,s.path&&(V===f.Attribute||s.name)?n(ce||(ce=ve` <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> `),ie(L),function(l){var t;return le({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}))})}(L)):ie(L),function(l){const t=l.parsedValue.operator,a={[h.GreaterThan]:m,[h.GreaterThanOrEqual]:o,[h.In]:w,[h.IsDefined]:H,[h.LessThan]:y,[h.LessThanOrEqual]:M,[h.Not]:I},s={[f.Attribute]:[h.In,h.Not,h.IsDefined],[f.Boolean]:[],[f.String]:[h.In,h.Not],[f.Number]:[h.In,h.Not,h.GreaterThan,h.LessThan,h.GreaterThanOrEqual,h.LessThanOrEqual],[f.Date]:[h.In,h.Not],[f.Any]:Object.values(h)},r=l.option?s[l.option.type]:l.parsedValue.name?Object.values(h):Object.values(h).filter((e=>e!==h.IsDefined)),u=0===r.length||!l.parsedValue.path;return n(se||(se=oe` <button title="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <div aria-hidden="true">${0}</div> </button> `),l.t(`operator_${null!=t?t:"equal"}`),i({"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-tertiary cursor-default":u,"hover-bg-contrast-5":!u}),u,(()=>{var n;const a=t?r.indexOf(t):-1,s=null!==(n=r[a+1])&&void 0!==n?n:null;l.onChange(e(e({},l.parsedValue),{},{operator:s,value:l.parsedValue.value}))}),t?a[t]:C)}(L),$===h.In?function(l){var t,a,s,o;const i=(null===(t=l.option)||void 0===t?void 0:t.list)?Q:le,r=l.parsedValue.value.split(","),u=null!==(s=null===(a=l.option)||void 0===a?void 0:a.type)&&void 0!==s?s:f.Any,c=u===f.Number?"number":u===f.Date?"date":"text",v=null===(o=l.option)||void 0===o?void 0:o.list;return n(te||(te=ae` <div class="bg-contrast-10 grid grid-cols-1 gap-1px"> ${0} </div> `),d([...r.filter((e=>!!e)),null],((e,l)=>l),((t,a)=>{var s;return n(ne||(ne=ae` <div class="bg-base"> ${0} </div> `),i({type:c,list:v,t:l.t,value:null!=t?t:"",label:t?String(a+1):"add_value",clearable:!0,displayValue:null===(s=null==v?void 0:v.find((e=>e.value===t)))||void 0===s?void 0:s.label,onChange:t=>{t?r[a]=t:r.splice(a,1),l.onChange(e(e({},l.parsedValue),{},{value:r.join(",")}))}}))})))}(L):$===h.IsDefined?function(l){return Q({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}))})}(L):V===f.Boolean?function(l){var t,n,a,s,o,i;const{parsedValue:r,option:u,t:d,onChange:c}=l,v=null!==(a=null===(n=null===(t=null==u?void 0:u.list)||void 0===t?void 0:t.find((e=>"false"===e.value)))||void 0===n?void 0:n.label)&&void 0!==a?a:"false",p=[{label:null!==(i=null===(o=null===(s=null==u?void 0:u.list)||void 0===s?void 0:s.find((e=>"true"===e.value)))||void 0===o?void 0:o.label)&&void 0!==i?i:"true",value:"true"},{label:v,value:"false"}];return Q({value:r.value,label:"value",list:p,t:d,onChange:l=>c(e(e({},r),{},{value:l}))})}(L):null===$&&[f.Number,f.Date].includes(V)?function(l){var t,a,s;const{t:o,parsedValue:i,option:r,onChange:u}=l,[d,c]=i.value.split(".."),v=(null==r?void 0:r.list)?Q:le,p=null!==(t=null==r?void 0:r.type)&&void 0!==t?t:f.Any,h=p===f.Number?"number":p===f.Date?"date":"text",g=null==r?void 0:r.list;return n(re||(re=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> `),v({displayValue:null===(a=null==g?void 0:g.find((e=>e.value===d)))||void 0===a?void 0:a.label,value:d,label:"range_from",type:h,list:g,t:o,onChange:l=>u(e(e({},i),{},{value:`${l}..${c}`}))}),v({displayValue:null===(s=null==g?void 0:g.find((e=>e.value===c)))||void 0===s?void 0:s.label,label:"range_to",value:c,type:h,list:g,t:o,onChange:l=>u(e(e({},i),{},{value:`${d}..${l}`}))}))}(L):function(l){var t,n,a,s;const{t:o,option:i,parsedValue:r,onChange:u}=l,d=(null==i?void 0:i.list)?Q:le,c=null!==(t=null==i?void 0:i.type)&&void 0!==t?t:f.Any;return d({displayValue:null===(a=null===(n=null==i?void 0:i.list)||void 0===n?void 0:n.find((e=>e.value===r.value)))||void 0===a?void 0:a.label,disabled:!r.path,value:null!==(s=r.value)&&void 0!==s?s:"",label:"value",type:c===f.Number?"number":c===f.Date?"date":"text",list:null==i?void 0:i.list,t:o,onChange:l=>u(e(e({},r),{},{value:l}))})}(L),i({"-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:!!v,flex:!v}),u("delete"),i({"box-content flex w-m h-m rounded-full transition-colors":!0,"text-secondary hover-bg-contrast-5 hover-text-error":!0,"focus-outline-none focus-ring-2 ring-primary-50":!0,"opacity-0":!s.path}),!s.path,g,u("add_or_clause"),i({"box-content flex w-m h-m rounded-full transition-colors text-success":!0,"hover-bg-contrast-5 focus-outline-none focus-ring-2 ring-primary-50":!0,"opacity-0":!s.path||!!c}),!s.path,b)}let fe,he,ge,Ce,be=e=>e;function me(l){const t=n(fe||(fe=be`<div class="h-xs"></div>`)),a=n(he||(he=be` <div class="flex items-center h-s"> <div class="w-m text-center leading-none uppercase font-semibold 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 n(ge||(ge=be` <div aria-label="${0}"> ${0} </div> `),l.t("query_builder_group"),d([...l.parsedValues,null],((e,l)=>String(l)),((s,o)=>{const i=o>0?l.isNested?a:t:"";return null===s?[i,pe({isFullSize:!l.isNested&&0===l.parsedValues.length,isNested:l.isNested,options:l.options,parsedValue:{path:"",operator:null,value:""},t:l.t,onChange:e=>l.onChange([...l.parsedValues,e])})]:Array.isArray(s)?[i,n(Ce||(Ce=be` <div class="bg-contrast-10 rounded-t-l rounded-b-l p-s -m-s"> ${0} </div> `),me({parsedValues:s,isNested:!0,options:l.options,t:l.t,onChange:e=>{const t=[...l.parsedValues],n=e;t[o]=e.length>1?n:n[0],l.onChange(t)}}))]:[i,pe({parsedValue:s,isNested:l.isNested,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]=[s,e(e({},s),{},{operator:null,value:""})],l.onChange(t)}})]})))}function xe(e){var l;const[t,n]=e.split("=").map(decodeURIComponent),a=null!==(l=Object.values(h).find((e=>t.endsWith(`:${e}`))))&&void 0!==l?l:null;let s,o=t.substring(0,a?t.lastIndexOf(":"):void 0);const i=t.lastIndexOf("[");return o.endsWith("]")&&-1!==i&&(s=o.substring(i+1,o.length-1),o=o.substring(0,i)),{name:s,path:o,value:n,operator:a}}function we(e){let l=e.path;return e.name&&(l+=`[${e.name}]`),e.operator&&(l+=`:${e.operator}`),l=`${encodeURIComponent(l)}=${encodeURIComponent(e.value)}`,"="===l?"":l}let Ve;const He=a(Ve||(Ve=(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}`)),$e=c(v(p(l(s),"query-builder")));class ye extends $e{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,He]}render(){var e,l,t;return me({parsedValues:(t=null!==(e=this.value)&&void 0!==e?e:"",t.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)}))),options:null!==(l=this.options)&&void 0!==l?l:[],t:this.t.bind(this),onChange:e=>{this.value=function(e){return e.map((e=>{if(Array.isArray(e)){const l=[e[0].value,e.slice(1).map((e=>we(e)))].join("|");return`${e[0].path}=${encodeURIComponent(l)}`}return we(e)})).join("&")}(e),this.dispatchEvent(new ye.ChangeEvent("change"))}})}}ye.ChangeEvent=class extends CustomEvent{},ye.Operator=h,ye.Type=f,customElements.define("foxy-query-builder",ye);export{ye as Q,f as T};
|
|
64
|
+
`));let z,R,G,U,F,W=e=>e;function Q(e){var l,t,a;const s=null===(t=null===(l=e.list)||void 0===l?void 0:l.every((l=>l.value!==e.value)))||void 0===t||t;return n(z||(z=W` <label class="flex items-center cursor-pointer transition-colors group text-tertiary hover-bg-contrast-5"> <div class="relative flex-1 min-w-0 overflow-hidden"> <select class="${0}" @change="${0}"> ${0} ${0} </select> </div> ${0} </label> `),i({"cursor-pointer 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":s,"text-body":!s}),(l=>{const t=l.currentTarget,n=t.options[t.options.selectedIndex].value;e.onChange(n)}),s?n(R||(R=W`<option value disabled="disabled" ?selected="${0}">${0}</option>`),s,e.t(e.label)):"",null===(a=e.list)||void 0===a?void 0:a.map((({label:l,value:t})=>n(G||(G=W` <option value="${0}" ?selected="${0}"> ${0} </option> `),t,t===e.value,e.t(l)))),s?"":n(U||(U=W` <span class="font-tnum text-xs font-medium border mr-s px-xs rounded-s border-current inline-block"> ${0} </span> ${0} `),e.t(e.label),e.clearable?n(F||(F=W` <button aria-label="${0}" class="w-s h-s mr-xs text-body flex items-center justify-center transition-colors rounded-full focus-outline-none focus-ring-2 focus-ring-primary-50 hover-bg-contrast-5 hover-text-error" @click="${0}"> <iron-icon aria-hidden="true" class="icon-inline text-l" icon="icons:remove-circle-outline"> </iron-icon> </button> `),e.t("delete"),(()=>e.onChange(""))):""))}let J,K,P,X,Y,ee=e=>e;function le(e){var l;const t=`${null!==(l=e.id)&&void 0!==l?l:String(Math.floor(Math.random()*Math.pow(10,8)))}-list`,a=!!e.displayValue;let s=e.value;if("date"===e.type){const l=new Date(e.value);isNaN(l.getTime())||(s=d(l))}return n(J||(J=ee` <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}" .value="${0}" ?disabled="${0}" @input="${0}"> </div> <span class="${0}"> ${0} </span> ${0} ${0} </label> `),a?n(K||(K=ee` <div aria-hidden="true" class="absolute inset-0 h-m px-s font-medium text-body flex items-center"> <div class="truncate">${0}</div> </div> `),e.t(e.displayValue)):"",s||"date"===e.type?"":e.t(e.label),i({"bg-base text-body relative appearance-none flex h-m px-s font-medium w-full":!0,"flex max-w-full whitespace-nowrap":!0,"focus-outline-none":!0,"opacity-0 focus-opacity-100":a}),r(e.list?t:void 0),e.type,s,e.disabled,(l=>{var t,n;const a=l.currentTarget;"date"===e.type?e.onChange(null!==(n=null===(t=a.valueAsDate)||void 0===t?void 0:t.toISOString())&&void 0!==n?n:a.value):e.onChange(a.value)}),i({"font-tnum text-xs font-medium border border-current mr-s px-xs rounded-s":!0,"inline-block":!!s||"date"===e.type,"sr-only":!s&&"date"!==e.type}),e.t(e.label),e.list?n(P||(P=ee` <datalist id="${0}"> ${0} </datalist> `),t,e.list.map((({label:l,value:t})=>n(X||(X=ee`<option value="${0}">${0}</option>`),t,e.t(l))))):"",e.disabled?"":n(Y||(Y=ee` <div class="absolute inset-0 transition-colors bg-transparent group-hover-bg-contrast-5 pointer-events-none"></div> `)))}let te,ne,ae=e=>e;let se,oe=e=>e;function ie({parsedValue:l,option:t,options:n,t:a,onChange:s}){return le({displayValue:null==t?void 0:t.label,value:l.path,label:"field",list:n.map((l=>e(e({},l),{},{value:l.path}))),type:"text",id:"path",t:a,onChange:e=>s({operator:null,value:"",path:e})})}let re,de=e=>e;let ue,ce,ve=e=>e;function pe(l){var t,a;const{parsedValue:s,options:r,t:d,isNested:c,isFullSize:v,onChange:p,onDelete:g,onConvert:b}=l,x=null!==(t=r.find((e=>e.path===s.path)))&&void 0!==t?t:null,V=null!==(a=null==x?void 0:x.type)&&void 0!==a?a:f.Any,$=s.operator,L={parsedValue:s,option:x,options:r,t:d,onChange:p},Z={[f.Attribute]:A,[f.Boolean]:D,[f.Number]:E,[f.String]:k,[f.Date]:O,[f.Any]:j};return n(ue||(ue=ve` <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="w-m h-m text-tertiary" 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> `),d("query_builder_rule"),i({"flex-1 bg-base rounded overflow-hidden border":!0,"border-contrast-10":!c,"border-contrast-50":!!c}),d(`type_${V}`),x?Z[V]:j,s.path&&(V===f.Attribute||s.name)?n(ce||(ce=ve` <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> `),ie(L),function(l){var t;return le({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}))})}(L)):ie(L),function(l){const t=l.parsedValue.operator,a={[h.GreaterThan]:m,[h.GreaterThanOrEqual]:o,[h.In]:w,[h.IsDefined]:H,[h.LessThan]:y,[h.LessThanOrEqual]:M,[h.Not]:I},s={[f.Attribute]:[h.In,h.Not,h.IsDefined],[f.Boolean]:[],[f.String]:[h.In,h.Not],[f.Number]:[h.In,h.Not,h.GreaterThan,h.LessThan,h.GreaterThanOrEqual,h.LessThanOrEqual],[f.Date]:[h.In,h.Not],[f.Any]:Object.values(h)},r=l.option?s[l.option.type]:l.parsedValue.name?Object.values(h):Object.values(h).filter((e=>e!==h.IsDefined)),d=0===r.length||!l.parsedValue.path;return n(se||(se=oe` <button title="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <div aria-hidden="true">${0}</div> </button> `),l.t(`operator_${null!=t?t:"equal"}`),i({"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-tertiary cursor-default":d,"hover-bg-contrast-5":!d}),d,(()=>{var n;const a=t?r.indexOf(t):-1,s=null!==(n=r[a+1])&&void 0!==n?n:null;l.onChange(e(e({},l.parsedValue),{},{operator:s,value:l.parsedValue.value}))}),t?a[t]:C)}(L),$===h.In?function(l){var t,a,s,o;const i=(null===(t=l.option)||void 0===t?void 0:t.list)?Q:le,r=l.parsedValue.value.split(","),d=null!==(s=null===(a=l.option)||void 0===a?void 0:a.type)&&void 0!==s?s:f.Any,c=d===f.Number?"number":d===f.Date?"date":"text",v=null===(o=l.option)||void 0===o?void 0:o.list;return n(te||(te=ae` <div class="bg-contrast-10 grid grid-cols-1 gap-1px"> ${0} </div> `),u([...r.filter((e=>!!e)),null],((e,l)=>l),((t,a)=>{var s;return n(ne||(ne=ae` <div class="bg-base"> ${0} </div> `),i({type:c,list:v,t:l.t,value:null!=t?t:"",label:t?String(a+1):"add_value",clearable:!0,displayValue:null===(s=null==v?void 0:v.find((e=>e.value===t)))||void 0===s?void 0:s.label,onChange:t=>{t?r[a]=t:r.splice(a,1),l.onChange(e(e({},l.parsedValue),{},{value:r.join(",")}))}}))})))}(L):$===h.IsDefined?function(l){return Q({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}))})}(L):V===f.Boolean?function(l){var t,n,a,s,o,i;const{parsedValue:r,option:d,t:u,onChange:c}=l,v=null!==(a=null===(n=null===(t=null==d?void 0:d.list)||void 0===t?void 0:t.find((e=>"false"===e.value)))||void 0===n?void 0:n.label)&&void 0!==a?a:"false",p=[{label:null!==(i=null===(o=null===(s=null==d?void 0:d.list)||void 0===s?void 0:s.find((e=>"true"===e.value)))||void 0===o?void 0:o.label)&&void 0!==i?i:"true",value:"true"},{label:v,value:"false"}];return Q({value:r.value,label:"value",list:p,t:u,onChange:l=>c(e(e({},r),{},{value:l}))})}(L):null===$&&[f.Number,f.Date].includes(V)?function(l){var t,a,s;const{t:o,parsedValue:i,option:r,onChange:d}=l,[u,c]=i.value.split(".."),v=(null==r?void 0:r.list)?Q:le,p=null!==(t=null==r?void 0:r.type)&&void 0!==t?t:f.Any,h=p===f.Number?"number":p===f.Date?"date":"text",g=null==r?void 0:r.list;return n(re||(re=de` <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> `),v({displayValue:null===(a=null==g?void 0:g.find((e=>e.value===u)))||void 0===a?void 0:a.label,value:u,label:"range_from",type:h,list:g,t:o,onChange:l=>d(e(e({},i),{},{value:`${l}..${c}`}))}),v({displayValue:null===(s=null==g?void 0:g.find((e=>e.value===c)))||void 0===s?void 0:s.label,label:"range_to",value:c,type:h,list:g,t:o,onChange:l=>d(e(e({},i),{},{value:`${u}..${l}`}))}))}(L):function(l){var t,n,a,s;const{t:o,option:i,parsedValue:r,onChange:d}=l,u=(null==i?void 0:i.list)?Q:le,c=null!==(t=null==i?void 0:i.type)&&void 0!==t?t:f.Any;return u({displayValue:null===(a=null===(n=null==i?void 0:i.list)||void 0===n?void 0:n.find((e=>e.value===r.value)))||void 0===a?void 0:a.label,disabled:!r.path,value:null!==(s=r.value)&&void 0!==s?s:"",label:"value",type:c===f.Number?"number":c===f.Date?"date":"text",list:null==i?void 0:i.list,t:o,onChange:l=>d(e(e({},r),{},{value:l}))})}(L),i({"-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:!!v,flex:!v}),d("delete"),i({"box-content flex w-m h-m rounded-full transition-colors":!0,"text-secondary hover-bg-contrast-5 hover-text-error":!0,"focus-outline-none focus-ring-2 ring-primary-50":!0,"opacity-0":!s.path}),!s.path,g,d("add_or_clause"),i({"box-content flex w-m h-m rounded-full transition-colors text-success":!0,"hover-bg-contrast-5 focus-outline-none focus-ring-2 ring-primary-50":!0,"opacity-0":!s.path||!!c}),!s.path,b)}let fe,he,ge,Ce,be=e=>e;function me(l){const t=n(fe||(fe=be`<div class="h-xs"></div>`)),a=n(he||(he=be` <div class="flex items-center h-s"> <div class="w-m text-center leading-none uppercase font-semibold 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 n(ge||(ge=be` <div aria-label="${0}"> ${0} </div> `),l.t("query_builder_group"),u([...l.parsedValues,null],((e,l)=>String(l)),((s,o)=>{const i=o>0?l.isNested?a:t:"";return null===s?[i,pe({isFullSize:!l.isNested&&0===l.parsedValues.length,isNested:l.isNested,options:l.options,parsedValue:{path:"",operator:null,value:""},t:l.t,onChange:e=>l.onChange([...l.parsedValues,e])})]:Array.isArray(s)?[i,n(Ce||(Ce=be` <div class="bg-contrast-10 rounded-t-l rounded-b-l p-s -m-s"> ${0} </div> `),me({parsedValues:s,isNested:!0,options:l.options,t:l.t,onChange:e=>{const t=[...l.parsedValues],n=e;t[o]=e.length>1?n:n[0],l.onChange(t)}}))]:[i,pe({parsedValue:s,isNested:l.isNested,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]=[s,e(e({},s),{},{operator:null,value:""})],l.onChange(t)}})]})))}function xe(e){var l;const[t,n]=e.split("=").map(decodeURIComponent),a=null!==(l=Object.values(h).find((e=>t.endsWith(`:${e}`))))&&void 0!==l?l:null;let s,o=t.substring(0,a?t.lastIndexOf(":"):void 0);const i=t.lastIndexOf("[");return o.endsWith("]")&&-1!==i&&(s=o.substring(i+1,o.length-1),o=o.substring(0,i)),{name:s,path:o,value:n,operator:a}}function we(e){let l=e.path;return e.name&&(l+=`[${e.name}]`),e.operator&&(l+=`:${e.operator}`),l=`${encodeURIComponent(l)}=${encodeURIComponent(e.value)}`,"="===l?"":l}let Ve;const He=a(Ve||(Ve=(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}`)),$e=c(v(p(l(s),"query-builder")));class ye extends $e{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,He]}render(){var e,l,t;return me({parsedValues:(t=null!==(e=this.value)&&void 0!==e?e:"",t.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)}))),options:null!==(l=this.options)&&void 0!==l?l:[],t:this.t.bind(this),onChange:e=>{this.value=function(e){return e.map((e=>{if(Array.isArray(e)){const l=[e[0].value,e.slice(1).map((e=>we(e)))].join("|");return`${e[0].path}=${encodeURIComponent(l)}`}return we(e)})).join("&")}(e),this.dispatchEvent(new ye.ChangeEvent("change"))}})}}ye.ChangeEvent=class extends CustomEvent{},ye.Operator=h,ye.Type=f,customElements.define("foxy-query-builder",ye);export{ye as Q,f as T};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as e,_ as t}from"./shared-e34d2ef1.js";import{h as n,L as r}from"./shared-7f33a83a.js";import{i as s,T as a}from"./shared-83344a27.js";import{F as i,A as o}from"./shared-86d0d927.js";const c={type:"backend",init:()=>{},read:(e,t,n)=>{const r=async e=>{const t=e.ok?null:new Error(await e.text()),r=!!e.ok&&await e.json();n(t,r)},s=e=>{const t=e instanceof Error?e:new Error(String(e));n(t,!1)},a=new i("fetch",{cancelable:!0,composed:!0,bubbles:!0,request:new o.WHATWGRequest(`foxy://i18n/${t}/${e}`),resolve:r,reject:s});dispatchEvent(a),a.defaultPrevented||fetch(a.request).then(r).catch(s)},create:()=>{throw new Error("foxy-i18n does not support resource creation")}};function l(e,t=!1){var n;const r=e.replace(/(y|m|w|d)/,""),s=e.replace(/\.?\d+/,"");return{count:".5"===r?.5:parseInt(r),units:t&&null!==(n={y:"year",m:"month",w:"week",d:"day"}[s])&&void 0!==n?n:s}}const u={discount:({ns:e,type:t,details:n},r,s)=>{const a=t.endsWith("_percentage")?.01:1,i=n.split("|"),o=`${["allunits","incremental","repeat","single"].includes(i[0])?i.shift():"single"}_${t}_discount_summary`;return i.map((t=>{var n,r;const s=null!==(r=null===(n=/[-+]/.exec(t))||void 0===n?void 0:n.index)&&void 0!==r?r:-1,i=parseFloat(t.substring(s))*a,c=parseFloat(t.substring(0,s));return`$t(${o}, ${JSON.stringify({adjustment:i,from:c,ns:e})})`})).join("; ")},relative:(e,t,n)=>{const r=new Intl.RelativeTimeFormat(n);let{count:s,units:a}=l(e,!0);return.5===s&&"month"===a&&(s=2,a="week"),r.format(s,a)},percent:(e,t,n)=>{let r=null;try{"number"==typeof e&&(r=e.toLocaleString(n,{style:"percent"}))}catch(e){console.warn(`i18next formatter error: ${e.message}`)}return r||String(e)},ordinal:(e,t,n)=>`${e}$t(ordinal_${new Intl.PluralRules(n,{type:"ordinal"}).select(e)})`,price:(e,t,n,r)=>{var s;try{const[t,a]=e.split(" ");return parseFloat(t).toLocaleString(n,{maximumFractionDigits:2,minimumFractionDigits:2,currencyDisplay:null!==(s=null==r?void 0:r.currencyDisplay)&&void 0!==s?s:"symbol",style:"currency",currency:a})}catch(t){return e}},date:(e,t,n)=>{if(!e)return"$t(unknown)";const r=new Date(e),s=(new Date).getFullYear()===r.getFullYear()?void 0:"numeric";return r.toLocaleDateString(n,{month:"long",year:s,day:"numeric"})},time:(e,t,n)=>new Date(e).toLocaleTimeString(n,{hour:"numeric",minute:"numeric"})};let d,p=e=>e;class m extends(a(e(r),"")){constructor(){super(...arguments),this.options={},this.key=""}static onTranslationChange(e){const t=["initialized","loaded"],n=["removed","added"];return t.forEach((t=>m.i18next.on(t,e))),n.forEach((t=>m.i18next.store.on(t,e))),()=>{t.forEach((t=>m.i18next.off(t,e))),n.forEach((t=>m.i18next.store.off(t,e)))}}static onResourceFetch(e){const t=t=>{if(t instanceof i&&t.request.url.startsWith("foxy://i18n/")){const[n,r]=t.request.url.split("/").reverse();t.respondWith(e(r,n))}};return addEventListener("fetch",t),()=>removeEventListener("fetch",t)}static setGateways({values:e}){for(const t in e)this.i18next.addResource("en","gateways",`gateways.${t}`,e[t].name)}static get properties(){return t(t({},super.properties),{},{options:{type:Object},key:{type:String}})}connectedCallback(){super.connectedCallback(),this.__unsubscribe=m.onTranslationChange((()=>this.requestUpdate()))}render(){return n(d||(d=p`<span>${0}</span>`),this.t(this.key,t(t({},this.options),{},{lng:this.lang})))}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this.__unsubscribe)||void 0===e||e.call(this)}}m.FetchEvent=i,m.i18next=s.createInstance().use(c),m.i18next.init({interpolation:{format:(e,t="",n="en",r={})=>t.split(" ").filter((e=>!!e.trim())).reduce(((e,t)=>{var s,a;return null!==(a=null===(s=u[t])||void 0===s?void 0:s.call(u,e,t,n,r))&&void 0!==a?a:e}),e),escapeValue:!1},fallbackLng:"en",fallbackNS:"shared",defaultNS:"shared",ns:["shared"]}),customElements.define("foxy-i18n",m);export{m as I,l as p};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{D as t,r as e,
|
|
1
|
+
import{D as t,r as e,d as n,e as r,f as i,g as s,o,a,p as l,h as c,i as d,j as h,b as u,k as p,m as _,s as f,n as m,q as y}from"./shared-c7bd91d8.js";
|
|
2
2
|
/**
|
|
3
3
|
@license
|
|
4
4
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{T as e}from"./shared-
|
|
1
|
+
import{T as e}from"./shared-b886c58b.js";import"./shared-d44a2a31.js";import{h as t}from"./shared-64e3f8da.js";import{D as i}from"./shared-c7bd91d8.js";const n=t`<dom-module id="lumo-number-field" theme-for="vaadin-number-field">
|
|
2
2
|
<template>
|
|
3
3
|
<style include="lumo-field-button">
|
|
4
4
|
:host {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{T as e,D as t,E as i,C as s}from"./shared-
|
|
1
|
+
import{T as e,D as t,E as i,C as s}from"./shared-d44a2a31.js";import{h as o,P as n,D as r,t as a,a as l,p as h,i as d,e as c,y as u,z as _}from"./shared-64e3f8da.js";import"./shared-b886c58b.js";import{t as m,m as p,F as v,P as f,f as g,d as y,O as b,D as I,a as x}from"./shared-cd5789ea.js";import{u as w}from"./shared-c7bd91d8.js";
|
|
2
2
|
/**
|
|
3
3
|
@license
|
|
4
4
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as t}from"./shared-
|
|
1
|
+
import{h as t}from"./shared-64e3f8da.js";import{T as e}from"./shared-b886c58b.js";import{D as l}from"./shared-c7bd91d8.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{I as e,_ as t}from"./shared-
|
|
1
|
+
import{I as e,_ as t}from"./shared-e34d2ef1.js";import{F as a}from"./shared-cd5789ea.js";import{E as s,T as i}from"./shared-d44a2a31.js";import"./shared-2b54d9fe.js";import"./shared-6534863a.js";import"./shared-b886c58b.js";import"./shared-c6ed1e9d.js";import"./shared-23e21265.js";import{d as r,P as n,A as o,L as l,c as d,h}from"./shared-7f33a83a.js";import{h as u,P as c}from"./shared-64e3f8da.js";import"./shared-6f83a8cf.js";import{p as m}from"./shared-5f82e90e.js";import{T as p,a as v}from"./shared-83344a27.js";import{T as g,U as b,V as _,W as f,X as y,Y as x,Z as w,$ as E,b as T,a0 as $,a1 as A,a2 as S,a3 as k,a4 as V,a5 as C,a6 as I,m as M,a7 as j}from"./shared-86d0d927.js";import{s as z}from"./shared-11c2efc8.js";import{i as q}from"./shared-bfca826a.js";var L={raise:g,send:b,sendParent:_,sendUpdate:f,log:y,cancel:x,start:w,stop:E,assign:T,after:$,done:A,respond:S,forwardTo:k,escalate:V,choose:C,pure:I};const F=r((e=>t=>{const{element:a,name:s,strings:i}=t.committer;if(2!==i.length||""!==i[0]||""!==i[1])throw new Error("live directive bindings must not contain any static values");if(t.committer.parts.length>1)throw new Error("live directive must be the only directive for an attribute or property");if(t instanceof n)a[s]!==e&&t.setValue(e);else{if(!(t instanceof o))throw new Error("live directive can only be used on attributes or properties");a.getAttribute(s)!==e&&t.setValue(e)}}));class O extends CustomEvent{constructor(e){super("change",{detail:e})}}const P=u`<dom-module id="lumo-custom-field" theme-for="vaadin-custom-field">
|
|
2
2
|
<template>
|
|
3
3
|
<style include="lumo-required-field">
|
|
4
4
|
:host {
|
|
@@ -122,12 +122,12 @@ import{I as e,_ as t}from"./shared-ca0f14c1.js";import{F as s}from"./shared-3e3c
|
|
|
122
122
|
}
|
|
123
123
|
</style>
|
|
124
124
|
</template>
|
|
125
|
-
</dom-module>`;document.head.appendChild(P.content);const D=e=>class extends e{static get properties(){return{inputs:{type:Array,readOnly:!0},i18n:{type:Object,value:()=>({parseValue:function(e){return e.split("\t")},formatValue:function(e){return e.join("\t")}})},__errorId:String,__labelId:String,__helperTextId:String,__hasSlottedHelper:Boolean}}connectedCallback(){super.connectedCallback(),this.__observer&&this.__observer.connect()}disconnectedCallback(){super.disconnectedCallback(),this.__observer&&this.__observer.disconnect()}ready(){super.ready(),this.__setInputsFromSlot(),this.__observer=new
|
|
125
|
+
</dom-module>`;document.head.appendChild(P.content);const D=e=>class extends e{static get properties(){return{inputs:{type:Array,readOnly:!0},i18n:{type:Object,value:()=>({parseValue:function(e){return e.split("\t")},formatValue:function(e){return e.join("\t")}})},__errorId:String,__labelId:String,__helperTextId:String,__hasSlottedHelper:Boolean}}connectedCallback(){super.connectedCallback(),this.__observer&&this.__observer.connect()}disconnectedCallback(){super.disconnectedCallback(),this.__observer&&this.__observer.disconnect()}ready(){super.ready(),this.__setInputsFromSlot(),this.__observer=new a(this.$.slot,(()=>{this.__setInputsFromSlot()})),this.$.helperSlot.addEventListener("slotchange",this.__onHelperSlotChange.bind(this)),this.__onHelperSlotChange();const e=/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor);this.addEventListener("keydown",(t=>{if(9===t.keyCode){if("slot"===t.target.parentElement.localName&&!t.defaultPrevented&&e){const e=t.target.parentElement;e.setAttribute("tabindex",-1),setTimeout((()=>e.removeAttribute("tabindex")))}this.inputs.indexOf(t.target)<this.inputs.length-1&&!t.shiftKey||this.inputs.indexOf(t.target)>0&&t.shiftKey?this.dispatchEvent(new CustomEvent("internal-tab")):this.__setValue()}})),this.addEventListener("focusin",(()=>this.setAttribute("focused",""))),this.addEventListener("focusout",(e=>{const t=this.getRootNode().activeElement;this.inputs.some((e=>t===e||e.shadowRoot&&e.shadowRoot.contains(t)))||this.removeAttribute("focused")}));var t=D._uniqueId=1+D._uniqueId||1;this.__errorId=`${this.constructor.is}-error-${t}`,this.__labelId=`${this.constructor.is}-label-${t}`,this.__helperTextId=`${this.constructor.is}-helper-${t}`}focus(){this.inputs&&this.inputs[0]&&this.inputs[0].focus()}__updateValue(e){e&&e.stopPropagation(),this.__setValue(),this.validate(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,detail:{value:this.value}}))}__setValue(){this.__settingValue=!0,this.value=this.i18n.formatValue.apply(this,[this.inputs.map((e=>e.value))]),this.__settingValue=!1}__queryAllAssignedElements(e){const t=[];let a;return"SLOT"===e.tagName?a=e.assignedNodes({flatten:!0}).filter((e=>e.nodeType===Node.ELEMENT_NODE)):(t.push(e),a=Array.from(e.children)),a.forEach((e=>t.push(...this.__queryAllAssignedElements(e)))),t}__getInputsFromSlot(){return this.__queryAllAssignedElements(this.$.slot).filter((e=>e.validate||e.checkValidity))}__setInputsFromSlot(){this._setInputs(this.__getInputsFromSlot()),this.__setValue()}__valueChanged(e,t){if(this.__settingValue||!this.inputs)return;const a=this.i18n.parseValue(e);a&&0!=a.length?(this.inputs.forEach(((e,t)=>e.value=a[t])),void 0!==t&&this.validate()):console.warn("Value parser has not provided values array")}__onHelperSlotChange(){const e=this.$.helperSlot.assignedNodes({flatten:!0});this.__hasSlottedHelper=e.filter((e=>3!==e.nodeType)).length>0,this.__hasSlottedHelper?this.setAttribute("has-helper","slotted"):""!==this.helperText&&null!==this.helperText||this.removeAttribute("has-helper")}}
|
|
126
126
|
/**
|
|
127
127
|
@license
|
|
128
128
|
Copyright (c) 2018 Vaadin Ltd.
|
|
129
129
|
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
130
|
-
*/;class N extends(
|
|
130
|
+
*/;class N extends(s(D(i(c)))){static get template(){return u`
|
|
131
131
|
<style>
|
|
132
132
|
:host {
|
|
133
133
|
display: inline-flex;
|
|
@@ -166,4 +166,4 @@ This program is available under Apache License Version 2.0, available at https:/
|
|
|
166
166
|
</div>
|
|
167
167
|
<div part="error-message" id="[[__errorId]]" aria-live="assertive" aria-hidden\$="[[__getErrorMessageAriaHidden(invalid, errorMessage, __errorId)]]">[[errorMessage]]</div>
|
|
168
168
|
</div>
|
|
169
|
-
`}static get is(){return"vaadin-custom-field"}static get version(){return"1.3.0"}static get properties(){return{label:{type:String,value:"",observer:"_labelChanged"},name:String,required:{type:Boolean,reflectToAttribute:!0},value:{type:String,observer:"__valueChanged",notify:!0},invalid:{type:Boolean,reflectToAttribute:!0,notify:!0,value:!1,observer:"__invalidChanged"},errorMessage:{type:String,value:"",observer:"__errorMessageChanged"},helperText:{type:String,value:"",observer:"__helperTextChanged"}}}static get observers(){return["__getActiveErrorId(invalid, errorMessage, __errorId, helperText, __helperTextId, __hasSlottedHelper)","__getActiveLabelId(label, __labelId)","__toggleHasValue(value)"]}__invalidChanged(e){this.__setOrToggleAttribute("aria-invalid",e,this)}__errorMessageChanged(e){this.__setOrToggleAttribute("has-error-message",!!e,this)}__helperTextChanged(e){this.__setOrToggleAttribute("has-helper",!!e,this)}__toggleHasValue(e){null!==e&&""!==e.trim()?this.setAttribute("has-value",""):this.removeAttribute("has-value")}_labelChanged(e){""!==e&&null!=e?this.setAttribute("has-label",""):this.removeAttribute("has-label")}validate(){return!(this.invalid=!this.checkValidity())}checkValidity(){return!(this.inputs.filter((e=>!(e.validate||e.checkValidity).call(e))).length||this.required&&!this.value.trim())}__setOrToggleAttribute(e,t,s){e&&s&&s.hasAttribute(e)===!t&&(t?s.setAttribute(e,"boolean"==typeof t?"":t):s.removeAttribute(e))}__getActiveErrorId(e,t,s,a,i,r){const n=[];(a||r)&&n.push(i),t&&e&&n.push(s),n.length>0?this.setAttribute("aria-describedby",n.join(" ")):this.removeAttribute("aria-describedby")}__getActiveLabelId(e,t){this.__setOrToggleAttribute("aria-labelledby",e?t:void 0,this)}__getErrorMessageAriaHidden(e,t,s){return(!(t&&e?s:void 0)).toString()}}customElements.define(N.is,N);class U extends CustomEvent{constructor(e){super("change",{detail:e})}}class H extends U{}let B,R,Y=e=>e;class X extends(p(e(l))){constructor(){super(...arguments),this.label="",this.value="",this.disabled=!1,this.readonly=!1,this.errorMessage="",this.__i18n={formatValue:e=>e.join(""),parseValue:e=>{const{count:t,units:s}=m(e);return[t.toString(),s]}},this.__getItems=M((e=>{const t=m(e).count;return[{value:"d",label:this.t("day",{count:t})},{value:"w",label:this.t("week",{count:t})},{value:"m",label:this.t("month",{count:t})},{value:"y",label:this.t("year",{count:t})}]}))}static get properties(){return t(t({},super.properties),{},{checkValidity:{attribute:!1},errorMessage:{type:String,attribute:"error-message"},disabled:{type:Boolean,reflect:!0},readonly:{type:Boolean,reflect:!0},label:{type:String},value:{type:String}})}static get styles(){return d(B||(B=Y`:host{display:block}vaadin-custom-field{width:100%;font-size:0;line-height:0;padding-top:0!important}vaadin-custom-field::part(label){padding-bottom:var(--lumo-space-s)}vaadin-custom-field::part(error-message)[aria-hidden=false]{padding-top:var(--lumo-space-xs)}vaadin-combo-box,vaadin-integer-field{width:calc(50% - (var(--lumo-space-s)/ 2))}vaadin-integer-field{margin-right:var(--lumo-space-s);padding:0}vaadin-combo-box::part(text-field){padding:0}`))}render(){return h(R||(R=Y` <vaadin-custom-field data-testid="field" .i18n="${0}" .label="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" .errorMessage="${0}" .checkValidity="${0}" @change="${0}"> <vaadin-integer-field data-testid="value" min="1" max="999" has-controls prevent-invalid-input ?invalid="${0}" ?disabled="${0}" ?readonly="${0}"> </vaadin-integer-field> <vaadin-combo-box data-testid="units" item-value-path="value" item-label-path="label" .items="${0}" ?invalid="${0}" ?disabled="${0}" ?readonly="${0}"> </vaadin-combo-box> </vaadin-custom-field> `),this.__i18n,this.label,F(this.value),this.disabled,this.readonly,this.errorMessage,this.checkValidity,this.__handleChange,!this.checkValidity(),this.disabled,this.readonly,this.__getItems(this.value),!this.checkValidity(),this.disabled,this.readonly)}updated(e){super.updated(e);const t=this.renderRoot.firstElementChild;t.value!==this.value&&(t.value=this.value)}checkValidity(){return!0}__handleChange(e){const t=e.target;this.value=t.value,this.dispatchEvent(new H(this.value))}}const K=j({id:"choice",type:"parallel",context:{defaultCustomValue:"",customValue:null,custom:!1,items:[],value:null,type:"text",min:null,max:null},states:{mutability:{initial:"editable",states:{editable:{},readonly:{}},on:{SET_READONLY:[{target:".editable",cond:"isPayloadFalsey"},{target:".readonly",cond:"isPayloadTruthy"}]}},interactivity:{initial:"enabled",states:{enabled:{},disabled:{}},on:{SET_DISABLED:[{target:".enabled",cond:"isPayloadFalsey"},{target:".disabled",cond:"isPayloadTruthy"}]}},selection:{initial:"unknown",states:{unknown:{always:[{target:"multiple",cond:"isValueArray"},{target:"single"}]},none:{},single:{},multiple:{}}},extension:{initial:"unknown",states:{unknown:{always:[{target:"present",cond:"hasCustom"},{target:"absent"}]},absent:{},present:{initial:"unknown",states:{unknown:{always:[{target:"selected",cond:"hasCustomValue"},{target:"available"}]},available:{on:{SET_TYPE:{actions:"setType"}}},selected:{initial:"unknown",states:{unknown:{always:[{target:"integer",cond:"showsIntegerField"},{target:"textarea",cond:"showsTextarea"},{target:"frequency",cond:"showsFrequency"},{target:"text"}]},text:{},frequency:{},textarea:{},integer:{type:"parallel",states:{min:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMinConstraint"},{target:"none"}]},none:{},custom:{}}},max:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMaxConstraint"},{target:"none"}]},none:{},custom:{}}}}}}}}}}}},on:{SET_DEFAULT_CUSTOM_VALUE:{actions:"setDefaultCustomValue"},SET_CUSTOM:{actions:"setCustom",target:[".selection.unknown",".extension.unknown"]},SET_VALUE:{actions:"setValue",target:[".selection.unknown",".extension.unknown"]},SET_ITEMS:{actions:"setItems",target:[".selection.unknown",".extension.unknown"]},SET_TYPE:{actions:"setType",target:".extension.unknown"},SET_MIN:{actions:"setMin",target:".extension.unknown"},SET_MAX:{actions:"setMax",target:".extension.unknown"}}},{guards:{isPayloadFalsey:(e,t)=>!t.data,isPayloadTruthy:(e,t)=>!!t.data,isValueArray:e=>Array.isArray(e.value),showsIntegerField:e=>"integer"===e.type,showsFrequency:e=>"frequency"===e.type,showsTextarea:e=>"textarea"===e.type,hasMinConstraint:e=>"number"==typeof e.min,hasMaxConstraint:e=>"number"==typeof e.max,hasCustomValue:e=>"string"==typeof e.customValue,hasCustom:e=>e.custom},actions:{setDefaultCustomValue:L.assign({defaultCustomValue:(e,t)=>t.data}),setValue:L.assign({value:(e,t)=>t.data,customValue:(e,t)=>Array.isArray(t.data)?t.data.find((t=>!e.items.includes(t))):e.items.includes(t.data)?null:t.data}),setCustom:L.assign({custom:(e,t)=>t.data}),setItems:L.assign({items:(e,t)=>t.data}),setType:L.assign({type:(e,t)=>t.data}),setMin:L.assign({min:(e,t)=>t.data}),setMax:L.assign({max:(e,t)=>t.data})}});let G,W,Z,J,Q,ee,te,se,ae,ie,re,ne,oe,le=e=>e;const de=`@foxy.io/elements::other[${(Math.pow(10,10)*Math.random()).toFixed(0)}]`;class he extends v{constructor(){super(...arguments),this.getText=e=>e,this.__service=q(K).onChange((()=>this.requestUpdate())).onTransition((({changed:e})=>e&&this.requestUpdate())).start()}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"vaadin-text-field":customElements.get("vaadin-text-field"),"x-frequency-input":X,"vaadin-text-area":customElements.get("vaadin-text-area"),"iron-icon":customElements.get("iron-icon")}}static get styles(){return[super.styles,d(Z||(Z=le`:host{--item-width:calc((var(--lumo-space-m) * 2) + 1.25rem)}.ml-xxl{margin-left:var(--item-width)}.item{height:var(--lumo-size-l);width:var(--item-width)}.radio{height:1.25rem;width:1.25rem}.check{height:1.125rem;width:1.125rem}.dot{height:.5rem;width:.5rem}`))]}static get properties(){return t(t({},super.properties),{},{defaultCustomValue:{type:String,attribute:"default-custom-value"},disabled:{type:Boolean},readonly:{type:Boolean},custom:{type:Boolean},type:{type:String},min:{type:Number},max:{type:Number},value:{type:Array},items:{type:Array},getText:{attribute:!1}})}get defaultCustomValue(){return this.__service.state.context.defaultCustomValue}set defaultCustomValue(e){this.__service.send("SET_DEFAULT_CUSTOM_VALUE",{data:e})}get readonly(){return this.__service.state.matches("mutability.readonly")}set readonly(e){this.__service.send("SET_READONLY",{data:e})}get disabled(){return this.__service.state.matches("interactivity.disabled")}set disabled(e){this.__service.send("SET_DISABLED",{data:e})}get custom(){return this.__service.state.matches("extension.present")}set custom(e){this.__service.send("SET_CUSTOM",{data:e})}get type(){return this.__service.state.context.type}set type(e){this.__service.send("SET_TYPE",{data:e})}get min(){return this.__service.state.context.min}set min(e){this.__service.send("SET_MIN",{data:e})}get max(){return this.__service.state.context.max}set max(e){this.__service.send("SET_MAX",{data:e})}get value(){return this.__service.state.context.value}set value(e){this.__service.send("SET_VALUE",{data:e})}get items(){return this.__service.state.context.items}set items(e){this.__service.send("SET_ITEMS",{data:e})}render(){const e=this.custom?[...this.items,de]:this.items,t=Array.isArray(this.value),s=this.__service.state.matches("extension.present.selected"),a=h(J||(J=le` ${0} `),e.map(((e,a,i)=>{var r;const n=this.custom&&a===i.length-1,o=n?s:t?!!(null===(r=this.value)||void 0===r?void 0:r.includes(e)):e===String(this.value),l=this.disabled||!this._isI18nReady,d=z({value:n?de:e,name:t?e:"choice","data-testid":`item-${e}`,"?disabled":l,"@change":t=>{if(this.readonly)return t.preventDefault();const s=t.target.checked,a=e===de?this.defaultCustomValue:e,i=this.value;Array.isArray(i)?this.value=e===de?s?[...i,a]:i.slice(0,i.length-1):s?[a,...i]:i.filter((e=>e!==a)):this.value=s?a:null,this.dispatchEvent(new O(this.value))}}),u=h(Q||(Q=le` <div> ${0} </div> `),e===de?this._t("choice.other").toString():h(ee||(ee=le`<slot name="${0}">${0}</slot>`),`${e}-label`,this.getText(e)));return h(te||(te=le` <div class="ml-xxl border-t border-contrast-10 ${0}"></div> ${0} <div class="mr-m ml-xxl"> ${0} ${0} </div> `),a?"":"hidden",t?function(e,t,s,a,i){const r="transition ease-in-out duration-200",n=`${r} transform ${s?"scale-100":"scale-0"} ${e?"text-contrast-70":"text-tint"}`;return h(W||(W=le` <label class="group flex items-center ${0}"> <div class="item flex items-center justify-center flex-shrink-0 text-primary-contrast"> <div class="check rounded-s ${0} ${0} ${0} focus-within-shadow-outline"> <iron-icon icon="lumo:checkmark" class="block w-full h-full ${0}"></iron-icon> <input type="checkbox" class="sr-only" .checked="${0}" ...="${0}"> </div> </div> <div class="font-lumo leading-m ${0}">${0}</div> </label> `),t||e?"":"cursor-pointer","border "+(e?"border-dashed border-contrast-30":"border-transparent"),r,e?"":t?s?"bg-primary-50":"bg-contrast-10":s?"bg-primary":"bg-contrast-20 group-hover-bg-contrast-30",n,s,a,t?"text-disabled":e?"text-secondary":"text-body",i)}(this.readonly,l,o,d,u):function(e,t,s,a,i){const r="transition ease-in-out duration-200",n=`${r} ${t||e?"":"shadow-xs"} transform ${s?"scale-100":"scale-0"} ${e?"bg-contrast-70":"bg-tint"}`;return h(G||(G=le` <label class="group flex items-center ${0}"> <div class="item flex items-center justify-center flex-shrink-0"> <div class="flex radio rounded-full ${0} ${0} ${0} focus-within-shadow-outline"> <div class="dot m-auto rounded-full ${0}"></div> <input type="radio" class="sr-only" .checked="${0}" ...="${0}"> </div> </div> <div class="font-lumo leading-m ${0}">${0}</div> </label> `),t||e?"":"cursor-pointer","border "+(e?"border-dashed border-contrast-30":"border-transparent"),r,e?"":t?s?"bg-primary-50":"bg-contrast-10":s?"bg-primary":"bg-contrast-20 group-hover-bg-contrast-30",n,s,a,t?"text-disabled":e?"text-secondary":"text-body",i)}(this.readonly,l,o,d,u),e===de&&s?this.__field:"",e!==de?h(se||(se=le`<slot name="${0}"></slot>`),e):"")})));return h(ae||(ae=le`<form>${0}</form> `),a)}get __field(){const e=z({placeholder:this._t("choice.other").toString(),class:"w-full mb-m",value:this.__service.state.context.customValue,max:this.max,min:this.min,ns:this.ns,"?disabled":this.disabled,"?readonly":this.readonly,"data-testid":"field","@change":e=>{e.stopPropagation();const t=e.target.value;Array.isArray(this.value)?this.value=this.value.slice(0,this.value.length-1).concat(t):this.value=t,this.dispatchEvent(new O(this.value))}});return"frequency"===this.type?h(ie||(ie=le`<x-frequency-input ...="${0}"></x-frequency-input>`),e):"integer"===this.type?h(re||(re=le`<vaadin-integer-field ...="${0}" has-controls></vaadin-integer-field>`),e):"textarea"===this.type?h(ne||(ne=le`<vaadin-text-area ...="${0}"></vaadin-text-area>`),e):h(oe||(oe=le`<vaadin-text-field ...="${0}"></vaadin-text-field>`),e)}}export{he as C,U as D,X as F,N as a,O as b,L as c};
|
|
169
|
+
`}static get is(){return"vaadin-custom-field"}static get version(){return"1.3.0"}static get properties(){return{label:{type:String,value:"",observer:"_labelChanged"},name:String,required:{type:Boolean,reflectToAttribute:!0},value:{type:String,observer:"__valueChanged",notify:!0},invalid:{type:Boolean,reflectToAttribute:!0,notify:!0,value:!1,observer:"__invalidChanged"},errorMessage:{type:String,value:"",observer:"__errorMessageChanged"},helperText:{type:String,value:"",observer:"__helperTextChanged"}}}static get observers(){return["__getActiveErrorId(invalid, errorMessage, __errorId, helperText, __helperTextId, __hasSlottedHelper)","__getActiveLabelId(label, __labelId)","__toggleHasValue(value)"]}__invalidChanged(e){this.__setOrToggleAttribute("aria-invalid",e,this)}__errorMessageChanged(e){this.__setOrToggleAttribute("has-error-message",!!e,this)}__helperTextChanged(e){this.__setOrToggleAttribute("has-helper",!!e,this)}__toggleHasValue(e){null!==e&&""!==e.trim()?this.setAttribute("has-value",""):this.removeAttribute("has-value")}_labelChanged(e){""!==e&&null!=e?this.setAttribute("has-label",""):this.removeAttribute("has-label")}validate(){return!(this.invalid=!this.checkValidity())}checkValidity(){return!(this.inputs.filter((e=>!(e.validate||e.checkValidity).call(e))).length||this.required&&!this.value.trim())}__setOrToggleAttribute(e,t,a){e&&a&&a.hasAttribute(e)===!t&&(t?a.setAttribute(e,"boolean"==typeof t?"":t):a.removeAttribute(e))}__getActiveErrorId(e,t,a,s,i,r){const n=[];(s||r)&&n.push(i),t&&e&&n.push(a),n.length>0?this.setAttribute("aria-describedby",n.join(" ")):this.removeAttribute("aria-describedby")}__getActiveLabelId(e,t){this.__setOrToggleAttribute("aria-labelledby",e?t:void 0,this)}__getErrorMessageAriaHidden(e,t,a){return(!(t&&e?a:void 0)).toString()}}customElements.define(N.is,N);class U extends CustomEvent{constructor(e){super("change",{detail:e})}}class H extends U{}let B,R,Y=e=>e;class X extends(p(e(l))){constructor(){super(...arguments),this.label="",this.value="",this.disabled=!1,this.readonly=!1,this.errorMessage="",this.__i18n={formatValue:e=>e.join(""),parseValue:e=>{const{count:t,units:a}=m(e);return[t.toString(),a]}},this.__getItems=M((e=>{const t=m(e).count;return[{value:"d",label:this.t("day",{count:t})},{value:"w",label:this.t("week",{count:t})},{value:"m",label:this.t("month",{count:t})},{value:"y",label:this.t("year",{count:t})}]}))}static get properties(){return t(t({},super.properties),{},{checkValidity:{attribute:!1},errorMessage:{type:String,attribute:"error-message"},disabled:{type:Boolean,reflect:!0},readonly:{type:Boolean,reflect:!0},label:{type:String},value:{type:String}})}static get styles(){return d(B||(B=Y`:host{display:block}vaadin-custom-field{width:100%;font-size:0;line-height:0;padding-top:0!important}vaadin-custom-field::part(label){padding-bottom:var(--lumo-space-s)}vaadin-custom-field::part(error-message)[aria-hidden=false]{padding-top:var(--lumo-space-xs)}vaadin-combo-box,vaadin-integer-field{width:calc(50% - (var(--lumo-space-s)/ 2))}vaadin-integer-field{margin-right:var(--lumo-space-s);padding:0}vaadin-combo-box::part(text-field){padding:0}`))}render(){return h(R||(R=Y` <vaadin-custom-field data-testid="field" .i18n="${0}" .label="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" .errorMessage="${0}" .checkValidity="${0}" @change="${0}"> <vaadin-integer-field data-testid="value" min="1" max="999" has-controls prevent-invalid-input ?invalid="${0}" ?disabled="${0}" ?readonly="${0}"> </vaadin-integer-field> <vaadin-combo-box data-testid="units" item-value-path="value" item-label-path="label" .items="${0}" ?invalid="${0}" ?disabled="${0}" ?readonly="${0}"> </vaadin-combo-box> </vaadin-custom-field> `),this.__i18n,this.label,F(this.value),this.disabled,this.readonly,this.errorMessage,this.checkValidity,this.__handleChange,!this.checkValidity(),this.disabled,this.readonly,this.__getItems(this.value),!this.checkValidity(),this.disabled,this.readonly)}updated(e){super.updated(e);const t=this.renderRoot.firstElementChild;t.value!==this.value&&(t.value=this.value)}checkValidity(){return!0}__handleChange(e){const t=e.target;this.value=t.value,this.dispatchEvent(new H(this.value))}}const K=j({id:"choice",type:"parallel",context:{defaultCustomValue:"",customValue:null,custom:!1,items:[],value:null,type:"text",min:null,max:null},states:{mutability:{initial:"editable",states:{editable:{},readonly:{}},on:{SET_READONLY:[{target:".editable",cond:"isPayloadFalsey"},{target:".readonly",cond:"isPayloadTruthy"}]}},interactivity:{initial:"enabled",states:{enabled:{},disabled:{}},on:{SET_DISABLED:[{target:".enabled",cond:"isPayloadFalsey"},{target:".disabled",cond:"isPayloadTruthy"}]}},selection:{initial:"unknown",states:{unknown:{always:[{target:"multiple",cond:"isValueArray"},{target:"single"}]},none:{},single:{},multiple:{}}},extension:{initial:"unknown",states:{unknown:{always:[{target:"present",cond:"hasCustom"},{target:"absent"}]},absent:{},present:{initial:"unknown",states:{unknown:{always:[{target:"selected",cond:"hasCustomValue"},{target:"available"}]},available:{on:{SET_TYPE:{actions:"setType"}}},selected:{initial:"unknown",states:{unknown:{always:[{target:"integer",cond:"showsIntegerField"},{target:"textarea",cond:"showsTextarea"},{target:"frequency",cond:"showsFrequency"},{target:"text"}]},text:{},frequency:{},textarea:{},integer:{type:"parallel",states:{min:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMinConstraint"},{target:"none"}]},none:{},custom:{}}},max:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMaxConstraint"},{target:"none"}]},none:{},custom:{}}}}}}}}}}}},on:{SET_DEFAULT_CUSTOM_VALUE:{actions:"setDefaultCustomValue"},SET_CUSTOM:{actions:"setCustom",target:[".selection.unknown",".extension.unknown"]},SET_VALUE:{actions:"setValue",target:[".selection.unknown",".extension.unknown"]},SET_ITEMS:{actions:"setItems",target:[".selection.unknown",".extension.unknown"]},SET_TYPE:{actions:"setType",target:".extension.unknown"},SET_MIN:{actions:"setMin",target:".extension.unknown"},SET_MAX:{actions:"setMax",target:".extension.unknown"}}},{guards:{isPayloadFalsey:(e,t)=>!t.data,isPayloadTruthy:(e,t)=>!!t.data,isValueArray:e=>Array.isArray(e.value),showsIntegerField:e=>"integer"===e.type,showsFrequency:e=>"frequency"===e.type,showsTextarea:e=>"textarea"===e.type,hasMinConstraint:e=>"number"==typeof e.min,hasMaxConstraint:e=>"number"==typeof e.max,hasCustomValue:e=>"string"==typeof e.customValue,hasCustom:e=>e.custom},actions:{setDefaultCustomValue:L.assign({defaultCustomValue:(e,t)=>t.data}),setValue:L.assign({value:(e,t)=>t.data,customValue:(e,t)=>Array.isArray(t.data)?t.data.find((t=>!e.items.includes(t))):e.items.includes(t.data)?null:t.data}),setCustom:L.assign({custom:(e,t)=>t.data}),setItems:L.assign({items:(e,t)=>t.data}),setType:L.assign({type:(e,t)=>t.data}),setMin:L.assign({min:(e,t)=>t.data}),setMax:L.assign({max:(e,t)=>t.data})}});let G,W,Z,J,Q,ee,te,ae,se,ie,re,ne,oe,le=e=>e;const de=`@foxy.io/elements::other[${(Math.pow(10,10)*Math.random()).toFixed(0)}]`;class he extends v{constructor(){super(...arguments),this.getText=e=>e,this.__service=q(K).onChange((()=>this.requestUpdate())).onTransition((({changed:e})=>e&&this.requestUpdate())).start()}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"vaadin-text-field":customElements.get("vaadin-text-field"),"x-frequency-input":X,"vaadin-text-area":customElements.get("vaadin-text-area"),"iron-icon":customElements.get("iron-icon")}}static get styles(){return[super.styles,d(Z||(Z=le`:host{--item-width:calc((var(--lumo-space-m) * 2) + 1.25rem)}.ml-xxl{margin-left:var(--item-width)}.item{height:var(--lumo-size-l);width:var(--item-width)}.radio{height:1.25rem;width:1.25rem}.check{height:1.125rem;width:1.125rem}.dot{height:.5rem;width:.5rem}`))]}static get properties(){return t(t({},super.properties),{},{defaultCustomValue:{type:String,attribute:"default-custom-value"},disabled:{type:Boolean},readonly:{type:Boolean},custom:{type:Boolean},type:{type:String},min:{type:Number},max:{type:Number},value:{type:Array},items:{type:Array},getText:{attribute:!1}})}get defaultCustomValue(){return this.__service.state.context.defaultCustomValue}set defaultCustomValue(e){this.__service.send("SET_DEFAULT_CUSTOM_VALUE",{data:e})}get readonly(){return this.__service.state.matches("mutability.readonly")}set readonly(e){this.__service.send("SET_READONLY",{data:e})}get disabled(){return this.__service.state.matches("interactivity.disabled")}set disabled(e){this.__service.send("SET_DISABLED",{data:e})}get custom(){return this.__service.state.matches("extension.present")}set custom(e){this.__service.send("SET_CUSTOM",{data:e})}get type(){return this.__service.state.context.type}set type(e){this.__service.send("SET_TYPE",{data:e})}get min(){return this.__service.state.context.min}set min(e){this.__service.send("SET_MIN",{data:e})}get max(){return this.__service.state.context.max}set max(e){this.__service.send("SET_MAX",{data:e})}get value(){return this.__service.state.context.value}set value(e){this.__service.send("SET_VALUE",{data:e})}get items(){return this.__service.state.context.items}set items(e){this.__service.send("SET_ITEMS",{data:e})}render(){const e=this.custom?[...this.items,de]:this.items,t=Array.isArray(this.value),a=this.__service.state.matches("extension.present.selected"),s=h(J||(J=le` ${0} `),e.map(((e,s,i)=>{var r;const n=this.custom&&s===i.length-1,o=n?a:t?!!(null===(r=this.value)||void 0===r?void 0:r.includes(e)):e===String(this.value),l=this.disabled||!this._isI18nReady,d=z({value:n?de:e,name:t?e:"choice","data-testid":`item-${e}`,"?disabled":l,"@change":t=>{if(this.readonly)return t.preventDefault();const a=t.target.checked,s=e===de?this.defaultCustomValue:e,i=this.value;Array.isArray(i)?this.value=e===de?a?[...i,s]:i.slice(0,i.length-1):a?[s,...i]:i.filter((e=>e!==s)):this.value=a?s:null,this.dispatchEvent(new O(this.value))}}),u=h(Q||(Q=le` <div> ${0} </div> `),e===de?this._t("choice.other").toString():h(ee||(ee=le`<slot name="${0}">${0}</slot>`),`${e}-label`,this.getText(e)));return h(te||(te=le` <div class="ml-xxl border-t border-contrast-10 ${0}"></div> ${0} <div class="mr-m ml-xxl"> ${0} ${0} </div> `),s?"":"hidden",t?function(e,t,a,s,i){const r="transition ease-in-out duration-200",n=`${r} transform ${a?"scale-100":"scale-0"} ${e?"text-contrast-70":"text-tint"}`;return h(W||(W=le` <label class="group flex items-center ${0}"> <div class="item flex items-center justify-center flex-shrink-0 text-primary-contrast"> <div class="check rounded-s ${0} ${0} ${0} focus-within-shadow-outline"> <iron-icon icon="lumo:checkmark" class="block w-full h-full ${0}"></iron-icon> <input type="checkbox" class="sr-only" .checked="${0}" ...="${0}"> </div> </div> <div class="font-lumo leading-m ${0}">${0}</div> </label> `),t||e?"":"cursor-pointer","border "+(e?"border-dashed border-contrast-30":"border-transparent"),r,e?"":t?a?"bg-primary-50":"bg-contrast-10":a?"bg-primary":"bg-contrast-20 group-hover-bg-contrast-30",n,a,s,t?"text-disabled":e?"text-secondary":"text-body",i)}(this.readonly,l,o,d,u):function(e,t,a,s,i){const r="transition ease-in-out duration-200",n=`${r} ${t||e?"":"shadow-xs"} transform ${a?"scale-100":"scale-0"} ${e?"bg-contrast-70":"bg-tint"}`;return h(G||(G=le` <label class="group flex items-center ${0}"> <div class="item flex items-center justify-center flex-shrink-0"> <div class="flex radio rounded-full ${0} ${0} ${0} focus-within-shadow-outline"> <div class="dot m-auto rounded-full ${0}"></div> <input type="radio" class="sr-only" .checked="${0}" ...="${0}"> </div> </div> <div class="font-lumo leading-m ${0}">${0}</div> </label> `),t||e?"":"cursor-pointer","border "+(e?"border-dashed border-contrast-30":"border-transparent"),r,e?"":t?a?"bg-primary-50":"bg-contrast-10":a?"bg-primary":"bg-contrast-20 group-hover-bg-contrast-30",n,a,s,t?"text-disabled":e?"text-secondary":"text-body",i)}(this.readonly,l,o,d,u),e===de&&a?this.__field:"",e!==de?h(ae||(ae=le`<slot name="${0}"></slot>`),e):"")})));return h(se||(se=le`<form>${0}</form> `),s)}get __field(){const e=z({placeholder:this._t("choice.other").toString(),class:"w-full mb-m",value:this.__service.state.context.customValue,max:this.max,min:this.min,ns:this.ns,"?disabled":this.disabled,"?readonly":this.readonly,"data-testid":"field","@change":e=>{e.stopPropagation();const t=e.target.value;Array.isArray(this.value)?this.value=this.value.slice(0,this.value.length-1).concat(t):this.value=t,this.dispatchEvent(new O(this.value))}});return"frequency"===this.type?h(ie||(ie=le`<x-frequency-input ...="${0}"></x-frequency-input>`),e):"integer"===this.type?h(re||(re=le`<vaadin-integer-field ...="${0}" has-controls></vaadin-integer-field>`),e):"textarea"===this.type?h(ne||(ne=le`<vaadin-text-area ...="${0}"></vaadin-text-area>`),e):h(oe||(oe=le`<vaadin-text-field ...="${0}"></vaadin-text-field>`),e)}}export{he as C,U as D,X as F,N as a,O as b,L as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,I as t}from"./shared-e34d2ef1.js";import{L as s,c as i,h as a}from"./shared-7f33a83a.js";import{A as o}from"./shared-565feb2f.js";import{C as n}from"./shared-84b5d8f0.js";import{T as l,R as d}from"./shared-c7bd91d8.js";import{F as r}from"./shared-86d0d927.js";import{T as h}from"./shared-83344a27.js";import{c}from"./shared-4e709717.js";class u extends CustomEvent{constructor(e=!1){super("hide",{detail:{cancelled:e}})}}class m extends CustomEvent{constructor(){super("show")}}let p,v=e=>e;class b extends(l(d(s))){static get styles(){return[super.styles,i(p||(p=v`:host{position:relative;z-index:200}`))]}}let _,y,f,g,w,x,$,D=e=>e;const k=h(n(l(t(s))));class E extends k{constructor(){super(...arguments),this.closable=!1,this.editable=!1,this.header="",this.alert=!1,this.__handleKeyDown=e=>{"Escape"===e.key&&E.openDialogs[0]===this&&this.closable&&this.hide(this.editable)},this.__connected=!1,this.__visible=!1}static get properties(){return e(e({},super.properties),{},{__connected:{attribute:!1},__visible:{attribute:!1},centered:{type:Boolean},closable:{type:Boolean},editable:{type:Boolean},header:{type:String},alert:{type:Boolean},open:{type:Boolean,noAccessor:!0}})}static get styles(){return[super.styles,i(_||(_=D`.grid-cols-header{grid-template-columns:1fr auto 1fr}.scale-85{--tw-scale-x:0.85;--tw-scale-y:0.85}`))]}get open(){return this.__visible&&this.__connected}set open(e){e===this.open||(e?this.show():this.hide(this.editable))}connectedCallback(){super.connectedCallback(),addEventListener("keydown",this.__handleKeyDown)}disconnectedCallback(){var e;super.disconnectedCallback(),removeEventListener("keydown",this.__handleKeyDown),null===(e=E.dialogWindows.get(this))||void 0===e||e.remove(),E.dialogWindows.delete(this)}createRenderRoot(){const e=new b,t=document.querySelectorAll(E.dialogWindowsHost),s=Array.from(t).pop();return e.addEventListener("fetch",(e=>{e instanceof r&&(e.stopImmediatePropagation(),e.preventDefault(),e.respondWith(new o(this).fetch(e.request)))})),null==s||s.appendChild(e),E.dialogWindows.set(this,e),e.shadowRoot}render(e){if(!this.__connected)return a(y||(y=D``));const t=E.openDialogs[0]===this,s=E.openDialogs[1]===this,i=E.openDialogs[2]===this,o=!t&&!s&&!i;return a(f||(f=D` <div class="${0}"> <div id="backdrop" class="${0}" tabindex="-1" @click="${0}"></div> <div role="dialog" aria-labelledby="dialog-title" class="${0}"> <div class="${0}"> <div class="h-l grid grid-cols-header text-m font-lumo font-medium border-b border-contrast-10"> ${0} <h1 id="dialog-title" class="truncate self-center text-center"> <foxy-i18n ns="${0}" lang="${0}" key="${0}"></foxy-i18n> </h1> ${0} </div> <div class="flex-1 overflow-y-auto overflow-x-hidden overscroll-contain"> <div class="p-m relative">${0}</div> </div> </div> </div> </div> `),c({"z-50 fixed inset-0":!0,"pointer-events-none":!this.__visible}),c({"select-none ease-in-out transition duration-500 absolute inset-0 bg-shade-50 focus-outline-none":!0,"opacity-100":this.__visible,"opacity-0":!this.__visible}),(()=>this.closable&&this.hide(this.editable)),c({"transform origin-bottom ease-in-out transition duration-500 relative h-full ml-auto sm-origin-center sm-max-w-modal":!0,"flex justify-center items-end sm-items-center mr-auto":this.alert,"translate-y-full sm-translate-y-0":!this.__visible,"sm-translate-x-full":!this.alert&&!this.__visible,"sm-opacity-0 sm-scale-110":this.alert&&!this.__visible,"translate-y-0 translate-x-0":t&&this.__visible,"scale-95 -translate-y-s sm-translate-y-0":s&&this.__visible,"scale-90 -translate-y-m sm-translate-y-0":i&&this.__visible,"opacity-0 scale-85 -translate-y-l sm-translate-y-0":o&&this.__visible}),c({"overflow-hidden flex flex-col bg-base rounded-t-l sm-rounded-b-l":!0,"absolute inset-0 mt-xl sm-m-xl":!this.alert,"shadow-xxl":this.__visible}),this.closable&&!this.hiddenSelector.matches("close-button",!0)?a(g||(g=D` <vaadin-button id="close-button" theme="tertiary-inline" class="mr-auto m-s px-s" ?disabled="${0}" @click="${0}"> <foxy-i18n lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> </vaadin-button> `),this.disabledSelector.matches("close-button",!0),(()=>this.hide(this.editable)),this.lang,this.editable?"cancel":"close",this.ns):a(w||(w=D`<div></div>`)),this.ns,this.lang,this.header,this.editable&&!this.hiddenSelector.matches("save-button",!0)?a(x||(x=D` <vaadin-button data-testid="save-button" ?disabled="${0}" theme="primary" class="ml-auto h-auto min-h-0 min-w-0 m-xs px-m" @click="${0}"> <foxy-i18n ns="${0}" lang="${0}" key="save"></foxy-i18n> </vaadin-button> `),this.disabledSelector.matches("save-button",!0),this.save,this.ns,this.lang):a($||($=D`<div></div>`)),null==e?void 0:e())}async hide(e=!1){var t;null===(t=this.__returnFocusTo)||void 0===t||t.focus(),await this.__setOpenDialogs(E.openDialogs.filter((e=>e!==this))),await this.__setConnected(!1),this.dispatchEvent(new E.HideEvent(!!e))}async show(e){this.__returnFocusTo=e,await this.__setConnected(!0),await this.__setOpenDialogs([this,...E.openDialogs]);const t=this.renderRoot.querySelector("#close-button");null==t||t.focus(),this.dispatchEvent(new E.ShowEvent)}async save(){await this.hide(!1)}async __setOpenDialogs(e){E.openDialogs.length=0,E.openDialogs.push(...e),await Promise.all([Promise.all(E.openDialogs.map((e=>e.requestUpdate()))),new Promise((e=>{this.renderRoot.querySelector("#backdrop").addEventListener("transitionend",e,{once:!0}),this.__visible=E.openDialogs.includes(this)}))])}async __setConnected(e){this.__connected=e,await this.updateComplete.then((()=>this.getBoundingClientRect()))}}E.dialogWindowsHost="#foxy-dialog-windows-host, body",E.dialogWindows=new WeakMap,E.openDialogs=[],E.ShowEvent=m,E.HideEvent=u,customElements.define("foxy-dialog-window",b);export{E as D};
|
|
@@ -156,4 +156,4 @@ const Y=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad
|
|
|
156
156
|
* subject to an additional IP rights grant found at
|
|
157
157
|
* http://polymer.github.io/PATENTS.txt
|
|
158
158
|
*/
|
|
159
|
-
(window.litElementVersions||(window.litElementVersions=[])).push("2.5.1");const it={};class nt extends X{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const t=this.getStyles();if(Array.isArray(t)){const e=(t,s)=>t.reduceRight(((t,s)=>Array.isArray(s)?e(s,t):(t.add(s),t)),s),s=e(t,new Set),i=[];s.forEach((t=>i.unshift(t))),this._styles=i}else this._styles=void 0===t?[]:[t];this._styles=this._styles.map((t=>{if(t instanceof CSSStyleSheet&&!Y){const e=Array.prototype.slice.call(t.cssRules).reduce(((t,e)=>t+e.cssText),"");return et(e)}return t}))}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow(this.constructor.shadowRootOptions)}adoptStyles(){const t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?Y?this.renderRoot.adoptedStyleSheets=t.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map((t=>t.cssText)),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(t){const e=this.render();super.update(t),e!==it&&this.constructor.render(e,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach((t=>{const e=document.createElement("style");e.textContent=t.cssText,this.renderRoot.appendChild(e)})))}render(){return it}}nt.finalized=!0,nt.render=(t,e,i)=>{if(!i||"object"!=typeof i||!i.scopeName)throw new Error("The `scopeName` option is required.");const n=i.scopeName,r=q.has(e),o=F&&11===e.nodeType&&!!e.host,a=o&&!D.has(n),l=a?document.createDocumentFragment():e;if(L(t,l,Object.assign({templateFactory:z(n)},i)),a){const t=q.get(l);q.delete(l);const i=t.value instanceof S?t.value.template:void 0;J(n,l,i),s(e,e.firstChild),e.appendChild(l),q.set(e,t)}!r&&o&&window.ShadyCSS.styleElement(e.host)},nt.shadowRootOptions={mode:"open"};export{T as A,E as B,tt as C,R as E,nt as L,A as N,U as P,o as T,b as a,h as b,st as c,_ as d,e,
|
|
159
|
+
(window.litElementVersions||(window.litElementVersions=[])).push("2.5.1");const it={};class nt extends X{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const t=this.getStyles();if(Array.isArray(t)){const e=(t,s)=>t.reduceRight(((t,s)=>Array.isArray(s)?e(s,t):(t.add(s),t)),s),s=e(t,new Set),i=[];s.forEach((t=>i.unshift(t))),this._styles=i}else this._styles=void 0===t?[]:[t];this._styles=this._styles.map((t=>{if(t instanceof CSSStyleSheet&&!Y){const e=Array.prototype.slice.call(t.cssRules).reduce(((t,e)=>t+e.cssText),"");return et(e)}return t}))}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow(this.constructor.shadowRootOptions)}adoptStyles(){const t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?Y?this.renderRoot.adoptedStyleSheets=t.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map((t=>t.cssText)),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(t){const e=this.render();super.update(t),e!==it&&this.constructor.render(e,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach((t=>{const e=document.createElement("style");e.textContent=t.cssText,this.renderRoot.appendChild(e)})))}render(){return it}}nt.finalized=!0,nt.render=(t,e,i)=>{if(!i||"object"!=typeof i||!i.scopeName)throw new Error("The `scopeName` option is required.");const n=i.scopeName,r=q.has(e),o=F&&11===e.nodeType&&!!e.host,a=o&&!D.has(n),l=a?document.createDocumentFragment():e;if(L(t,l,Object.assign({templateFactory:z(n)},i)),a){const t=q.get(l);q.delete(l);const i=t.value instanceof S?t.value.template:void 0;J(n,l,i),s(e,e.firstChild),e.appendChild(l),q.set(e,t)}!r&&o&&window.ShadyCSS.styleElement(e.host)},nt.shadowRootOptions={mode:"open"};export{T as A,E as B,tt as C,R as E,nt as L,A as N,U as P,o as T,b as a,h as b,st as c,_ as d,s as e,L as f,j as h,i as m,y as n,e as r,H as s,$ as t,et as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e,g as t,b as n,d as o,e as i,_ as r}from"./shared-e34d2ef1.js";import{t as a}from"./shared-c7bd91d8.js";function s(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&o.push.apply(o,Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach((function(t){l(e,t,n[t])}))}return e}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function g(e,t,n){return t&&f(e.prototype,t),n&&f(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var h=e((function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})),d=t(h);function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(e,t){if(t&&("object"===d(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return v(e)}function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},m(e)}function b(e,t){return b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},b(e,t)}function k(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");Object.defineProperty(e,"prototype",{value:Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),writable:!1}),t&&b(e,t)}var w={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},x=new(function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};p(this,e),this.init(t,n)}return g(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||w,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,o){return o&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,c({},{prefix:"".concat(this.prefix,":").concat(t,":")},this.options))}}]),e}()),S=function(){function e(){p(this,e),this.observers={}}return g(e,[{key:"on",value:function(e,t){var n=this;return e.split(" ").forEach((function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];if(this.observers[e]){var i=[].concat(this.observers[e]);i.forEach((function(e){e.apply(void 0,n)}))}if(this.observers["*"]){var r=[].concat(this.observers["*"]);r.forEach((function(t){t.apply(t,[e].concat(n))}))}}}]),e}();function L(){var e,t,n=new Promise((function(n,o){e=n,t=o}));return n.resolve=e,n.reject=t,n}function O(e){return null==e?"":""+e}function R(e,t,n){e.forEach((function(e){t[e]&&(n[e]=t[e])}))}function j(e,t,n){function o(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function i(){return!e||"string"==typeof e}for(var r="string"!=typeof t?[].concat(t):t.split(".");r.length>1;){if(i())return{};var a=o(r.shift());!e[a]&&n&&(e[a]=new n),e=Object.prototype.hasOwnProperty.call(e,a)?e[a]:{}}return i()?{}:{obj:e,k:o(r.shift())}}function P(e,t,n){var o=j(e,t,Object);o.obj[o.k]=n}function _(e,t){var n=j(e,t),o=n.obj,i=n.k;if(o)return o[i]}function C(e,t,n){var o=_(e,n);return void 0!==o?o:_(t,n)}function N(e,t,n){for(var o in t)"__proto__"!==o&&"constructor"!==o&&(o in e?"string"==typeof e[o]||e[o]instanceof String||"string"==typeof t[o]||t[o]instanceof String?n&&(e[o]=t[o]):N(e[o],t[o],n):e[o]=t[o]);return e}function E(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var T={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function F(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return T[e]})):e}var I="undefined"!=typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,A=function(e){function t(e){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return p(this,t),n=y(this,m(t).call(this)),I&&S.call(v(n)),n.data=e||{},n.options=o,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n}return k(t,S),g(t,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,r=[e,t];return n&&"string"!=typeof n&&(r=r.concat(n)),n&&"string"==typeof n&&(r=r.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(r=e.split(".")),_(this.data,r)}},{key:"addResource",value:function(e,t,n,o){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},r=this.options.keySeparator;void 0===r&&(r=".");var a=[e,t];n&&(a=a.concat(r?n.split(r):n)),e.indexOf(".")>-1&&(o=t,t=(a=e.split("."))[1]),this.addNamespaces(t),P(this.data,a,o),i.silent||this.emit("added",e,t,n,o)}},{key:"addResources",value:function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in n)"string"!=typeof n[i]&&"[object Array]"!==Object.prototype.toString.apply(n[i])||this.addResource(e,t,i,n[i],{silent:!0});o.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,o,i){var r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(o=n,n=t,t=(a=e.split("."))[1]),this.addNamespaces(t);var s=_(this.data,a)||{};o?N(s,n,i):s=c({},s,n),P(this.data,a,s),r.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?c({},{},this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"toJSON",value:function(){return this.data}}]),t}(),M={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,o,i){var r=this;return e.forEach((function(e){r.processors[e]&&(t=r.processors[e].process(t,n,o,i))})),t}},q={},H=function(e){function t(e){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return p(this,t),n=y(this,m(t).call(this)),I&&S.call(v(n)),R(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,v(n)),n.options=o,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n.logger=x.create("translator"),n}return k(t,S),g(t,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var o=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS;if(n&&e.indexOf(n)>-1){var r=e.match(this.interpolator.nestingRegexp);if(r&&r.length>0)return{key:e,namespaces:i};var a=e.split(n);(n!==o||n===o&&this.options.ns.indexOf(a[0])>-1)&&(i=a.shift()),e=a.join(o)}return"string"==typeof i&&(i=[i]),{key:e,namespaces:i}}},{key:"translate",value:function(e,n,o){var i=this;if("object"!==u(n)&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),n||(n={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var r=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,a=this.extractFromKey(e[e.length-1],n),s=a.key,l=a.namespaces,p=l[l.length-1],f=n.lng||this.language,g=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(f&&"cimode"===f.toLowerCase()){if(g){var h=n.nsSeparator||this.options.nsSeparator;return p+h+s}return s}var d=this.resolve(e,n),v=d&&d.res,y=d&&d.usedKey||s,m=d&&d.exactUsedKey||s,b=Object.prototype.toString.apply(v),k=["[object Number]","[object Function]","[object RegExp]"],w=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,S="string"!=typeof v&&"boolean"!=typeof v&&"number"!=typeof v;if(x&&v&&S&&k.indexOf(b)<0&&("string"!=typeof w||"[object Array]"!==b)){if(!n.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,v,n):"key '".concat(s," (").concat(this.language,")' returned an object instead of string.");if(r){var L="[object Array]"===b,O=L?[]:{},R=L?m:y;for(var j in v)if(Object.prototype.hasOwnProperty.call(v,j)){var P="".concat(R).concat(r).concat(j);O[j]=this.translate(P,c({},n,{joinArrays:!1,ns:l})),O[j]===P&&(O[j]=v[j])}v=O}}else if(x&&"string"==typeof w&&"[object Array]"===b)(v=v.join(w))&&(v=this.extendTranslation(v,e,n,o));else{var _=!1,C=!1,N=void 0!==n.count&&"string"!=typeof n.count,E=t.hasDefaultValue(n),T=N?this.pluralResolver.getSuffix(f,n.count):"",F=n["defaultValue".concat(T)]||n.defaultValue;!this.isValidLookup(v)&&E&&(_=!0,v=F),this.isValidLookup(v)||(C=!0,v=s);var I=E&&F!==v&&this.options.updateMissing;if(C||_||I){if(this.logger.log(I?"updateKey":"missingKey",f,p,s,I?F:v),r){var A=this.resolve(s,c({},n,{keySeparator:!1}));A&&A.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var M=[],q=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&q&&q[0])for(var H=0;H<q.length;H++)M.push(q[H]);else"all"===this.options.saveMissingTo?M=this.languageUtils.toResolveHierarchy(n.lng||this.language):M.push(n.lng||this.language);var U=function(e,t,o){i.options.missingKeyHandler?i.options.missingKeyHandler(e,p,t,I?o:v,I,n):i.backendConnector&&i.backendConnector.saveMissing&&i.backendConnector.saveMissing(e,p,t,I?o:v,I,n),i.emit("missingKey",e,p,t,v)};this.options.saveMissing&&(this.options.saveMissingPlurals&&N?M.forEach((function(e){i.pluralResolver.getSuffixes(e).forEach((function(t){U([e],s+t,n["defaultValue".concat(t)]||F)}))})):U(M,s,F))}v=this.extendTranslation(v,e,n,d,o),C&&v===s&&this.options.appendNamespaceToMissingKey&&(v="".concat(p,":").concat(s)),C&&this.options.parseMissingKeyHandler&&(v=this.options.parseMissingKeyHandler(v))}return v}},{key:"extendTranslation",value:function(e,t,n,o,i){var r=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,n,o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(c({},n,{interpolation:c({},this.options.interpolation,n.interpolation)}));var a,s=n.interpolation&&n.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;if(s){var u=e.match(this.interpolator.nestingRegexp);a=u&&u.length}var l=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(l=c({},this.options.interpolation.defaultVariables,l)),e=this.interpolator.interpolate(e,l,n.lng||this.language,n),s){var p=e.match(this.interpolator.nestingRegexp);a<(p&&p.length)&&(n.nest=!1)}!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,o=new Array(e),a=0;a<e;a++)o[a]=arguments[a];return i&&i[0]===o[0]&&!n.context?(r.logger.warn("It seems you are nesting recursively key: ".concat(o[0]," in key: ").concat(t[0])),null):r.translate.apply(r,o.concat([t]))}),n)),n.interpolation&&this.interpolator.reset()}var f=n.postProcess||this.options.postProcess,g="string"==typeof f?[f]:f;return null!=e&&g&&g.length&&!1!==n.applyPostProcessor&&(e=M.handle(g,e,t,this.options&&this.options.postProcessPassResolved?c({i18nResolved:o},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,o,i,r,a=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!a.isValidLookup(t)){var u=a.extractFromKey(e,s),l=u.key;n=l;var c=u.namespaces;a.options.fallbackNS&&(c=c.concat(a.options.fallbackNS));var p=void 0!==s.count&&"string"!=typeof s.count,f=void 0!==s.context&&"string"==typeof s.context&&""!==s.context,g=s.lngs?s.lngs:a.languageUtils.toResolveHierarchy(s.lng||a.language,s.fallbackLng);c.forEach((function(e){a.isValidLookup(t)||(r=e,!q["".concat(g[0],"-").concat(e)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(r)&&(q["".concat(g[0],"-").concat(e)]=!0,a.logger.warn('key "'.concat(n,'" for languages "').concat(g.join(", "),'" won\'t get resolved as namespace "').concat(r,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),g.forEach((function(n){if(!a.isValidLookup(t)){i=n;var r,u,c=l,g=[c];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(g,l,n,e,s);else p&&(r=a.pluralResolver.getSuffix(n,s.count)),p&&f&&g.push(c+r),f&&g.push(c+="".concat(a.options.contextSeparator).concat(s.context)),p&&g.push(c+=r);for(;u=g.pop();)a.isValidLookup(t)||(o=u,t=a.getResource(n,e,u,s))}})))}))}})),{res:t,usedKey:n,exactUsedKey:o,usedLng:i,usedNS:r}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,o):this.resourceStore.getResource(e,t,n,o)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}]),t}();function U(e){return e.charAt(0).toUpperCase()+e.slice(1)}var V=function(){function e(t){p(this,e),this.options=t,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=x.create("languageUtils")}return g(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=U(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=U(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=U(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isWhitelisted",value:function(e){return this.logger.deprecate("languageUtils.isWhitelisted",'function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it\'s usage asap.'),this.isSupportedCode(e)}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var o=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(o)||(t=o)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var o=n.getLanguagePartFromCode(e);if(n.isSupportedCode(o))return t=o;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(o))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,o=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],r=function(e){e&&(n.isSupportedCode(e)?i.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&r(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&r(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&r(this.getLanguagePartFromCode(e))):"string"==typeof e&&r(this.formatLanguageCode(e)),o.forEach((function(e){i.indexOf(e)<0&&r(n.formatLanguageCode(e))})),i}}]),e}(),D=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],K={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}};function B(){var e={};return D.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:K[t.fc]}}))})),e}var z=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};p(this,e),this.languageUtils=t,this.options=n,this.logger=x.create("pluralResolver"),this.rules=B()}return g(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=this.getRule(e);return t&&t.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){return this.getSuffixes(e).map((function(e){return t+e}))}},{key:"getSuffixes",value:function(e){var t=this,n=this.getRule(e);return n?n.numbers.map((function(n){return t.getSuffix(e,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=this,o=this.getRule(e);if(o){var i=o.noAbs?o.plurals(t):o.plurals(Math.abs(t)),r=o.numbers[i];this.options.simplifyPluralSuffix&&2===o.numbers.length&&1===o.numbers[0]&&(2===r?r="plural":1===r&&(r=""));var a=function(){return n.options.prepend&&r.toString()?n.options.prepend+r.toString():r.toString()};return"v1"===this.options.compatibilityJSON?1===r?"":"number"==typeof r?"_plural_".concat(r.toString()):a():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===o.numbers.length&&1===o.numbers[0]?a():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}return this.logger.warn("no plural rule found for: ".concat(e)),""}}]),e}(),$=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};p(this,e),this.logger=x.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return g(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:F,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?E(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?E(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?E(t.nestingPrefix):t.nestingPrefixEscaped||E("$t("),this.nestingSuffix=t.nestingSuffix?E(t.nestingSuffix):t.nestingSuffixEscaped||E(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,o){var i,r,a,s=this,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function l(e){return e.replace(/\$/g,"$$$$")}var c=function(e){if(e.indexOf(s.formatSeparator)<0){var i=C(t,u,e);return s.alwaysFormat?s.format(i,void 0,n):i}var r=e.split(s.formatSeparator),a=r.shift().trim(),l=r.join(s.formatSeparator).trim();return s.format(C(t,u,a),l,n,o)};this.resetRegExp();var p=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,f=o&&o.interpolation&&o.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return l(e)}},{regex:this.regexp,safeValue:function(e){return s.escapeValue?l(s.escape(e)):l(e)}}].forEach((function(t){for(a=0;i=t.regex.exec(e);){if(void 0===(r=c(i[1].trim())))if("function"==typeof p){var n=p(e,i,o);r="string"==typeof n?n:""}else{if(f){r=i[0];continue}s.logger.warn("missed to pass in variable ".concat(i[1]," for interpolating ").concat(e)),r=""}else"string"==typeof r||s.useRawValueToEscape||(r=O(r));if(e=e.replace(i[0],t.safeValue(r)),t.regex.lastIndex=0,++a>=s.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,o,i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=c({},r);function s(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var o=e.split(new RegExp("".concat(n,"[ ]*{"))),i="{".concat(o[1]);e=o[0],i=(i=this.interpolate(i,a)).replace(/'/g,'"');try{a=JSON.parse(i),t&&(a=c({},t,a))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(n).concat(i)}return delete a.defaultValue,e}for(a.applyPostProcessor=!1,delete a.defaultValue;n=this.nestingRegexp.exec(e);){var u=[],l=!1;if(n[0].includes(this.formatSeparator)&&!/{.*}/.test(n[1])){var p=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=p.shift(),u=p,l=!0}if((o=t(s.call(this,n[1].trim(),a),a))&&n[0]===e&&"string"!=typeof o)return o;"string"!=typeof o&&(o=O(o)),o||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),o=""),l&&(o=u.reduce((function(e,t){return i.format(e,t,r.lng,r)}),o.trim())),e=e.replace(n[0],o),this.regexp.lastIndex=0}return e}}]),e}();var X=function(e){function t(e,n,o){var i,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return p(this,t),i=y(this,m(t).call(this)),I&&S.call(v(i)),i.backend=e,i.store=n,i.services=o,i.languageUtils=o.languageUtils,i.options=r,i.logger=x.create("backendConnector"),i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(o,r.backend,r),i}return k(t,S),g(t,[{key:"queueLoad",value:function(e,t,n,o){var i=this,r=[],a=[],s=[],u=[];return e.forEach((function(e){var o=!0;t.forEach((function(t){var s="".concat(e,"|").concat(t);!n.reload&&i.store.hasResourceBundle(e,t)?i.state[s]=2:i.state[s]<0||(1===i.state[s]?a.indexOf(s)<0&&a.push(s):(i.state[s]=1,o=!1,a.indexOf(s)<0&&a.push(s),r.indexOf(s)<0&&r.push(s),u.indexOf(t)<0&&u.push(t)))})),o||s.push(e)})),(r.length||a.length)&&this.queue.push({pending:a,loaded:{},errors:[],callback:o}),{toLoad:r,pending:a,toLoadLanguages:s,toLoadNamespaces:u}}},{key:"loaded",value:function(e,t,n){var o=e.split("|"),i=o[0],r=o[1];t&&this.emit("failedLoading",i,r,t),n&&this.store.addResourceBundle(i,r,n),this.state[e]=t?-1:2;var a={};this.queue.forEach((function(n){var o,s,u,l,c,p;o=n.loaded,s=r,l=j(o,[i],Object),c=l.obj,p=l.k,c[p]=c[p]||[],u&&(c[p]=c[p].concat(s)),u||c[p].push(s),function(e,t){for(var n=e.indexOf(t);-1!==n;)e.splice(n,1),n=e.indexOf(t)}(n.pending,e),t&&n.errors.push(t),0!==n.pending.length||n.done||(Object.keys(n.loaded).forEach((function(e){a[e]||(a[e]=[]),n.loaded[e].length&&n.loaded[e].forEach((function(t){a[e].indexOf(t)<0&&a[e].push(t)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var o=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,a=arguments.length>5?arguments[5]:void 0;return e.length?this.backend[n](e,t,(function(s,u){s&&u&&i<5?setTimeout((function(){o.read.call(o,e,t,n,i+1,2*r,a)}),r):a(s,u)})):a(null,{})}},{key:"prepareLoading",value:function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var r=this.queueLoad(e,t,o,i);if(!r.toLoad.length)return r.pending.length||i(),null;r.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=e.split("|"),i=o[0],r=o[1];this.read(i,r,"read",void 0,void 0,(function(o,a){o&&t.logger.warn("".concat(n,"loading namespace ").concat(r," for language ").concat(i," failed"),o),!o&&a&&t.logger.log("".concat(n,"loaded namespace ").concat(r," for language ").concat(i),a),t.loaded(e,o,a)}))}},{key:"saveMissing",value:function(e,t,n,o,i){var r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(e,t,n,o,null,c({},r,{isUpdate:i})),e&&e[0]&&this.store.addResource(e[0],t,n,o))}}]),t}();function W(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===u(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===u(e[2])||"object"===u(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,o){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}}}function J(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.whitelist&&(e.whitelist&&e.whitelist.indexOf("cimode")<0&&(e.whitelist=e.whitelist.concat(["cimode"])),e.supportedLngs=e.whitelist),e.nonExplicitWhitelist&&(e.nonExplicitSupportedLngs=e.nonExplicitWhitelist),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function G(){}var Y=new(function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(p(this,t),e=y(this,m(t).call(this)),I&&S.call(v(e)),e.options=J(n),e.services={},e.logger=x,e.modules={external:[]},o&&!e.isInitialized&&!n.isClone){if(!e.options.initImmediate)return e.init(n,o),y(e,v(e));setTimeout((function(){e.init(n,o)}),0)}return e}return k(t,S),g(t,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;function o(e){return e?"function"==typeof e?new e:e:null}if("function"==typeof t&&(n=t,t={}),t.whitelist&&!t.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),t.nonExplicitWhitelist&&!t.nonExplicitSupportedLngs&&this.logger.deprecate("whitelist",'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.'),this.options=c({},W(),this.options,J(t)),this.format=this.options.interpolation.format,n||(n=G),!this.options.isClone){this.modules.logger?x.init(o(this.modules.logger),this.options):x.init(null,this.options);var i=new V(this.options);this.store=new A(this.options.resources,this.options);var r=this.services;r.logger=x,r.resourceStore=this.store,r.languageUtils=i,r.pluralResolver=new z(i,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),r.interpolator=new $(this.options),r.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},r.backendConnector=new X(o(this.modules.backend),r.resourceStore,r,this.options),r.backendConnector.on("*",(function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];e.emit.apply(e,[t].concat(o))})),this.modules.languageDetector&&(r.languageDetector=o(this.modules.languageDetector),r.languageDetector.init(r,this.options.detection,this.options)),this.modules.i18nFormat&&(r.i18nFormat=o(this.modules.i18nFormat),r.i18nFormat.init&&r.i18nFormat.init(this)),this.translator=new H(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];e.emit.apply(e,[t].concat(o))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var a=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);a.length>0&&"dev"!==a[0]&&(this.options.lng=a[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var s=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];s.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}}));var u=["addResource","addResources","addResourceBundle","removeResourceBundle"];u.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var l=L(),p=function(){var t=function(t,o){e.isInitialized&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),l.resolve(o),n(t,o)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?p():setTimeout(p,0),l}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:G,o=n,i="string"==typeof e?e:this.language;if("function"==typeof e&&(o=e),!this.options.resources||this.options.partialBundledLanguages){if(i&&"cimode"===i.toLowerCase())return o();var r=[],a=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){r.indexOf(e)<0&&r.push(e)}))};if(i)a(i);else{var s=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);s.forEach((function(e){return a(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return a(e)})),this.services.backendConnector.load(r,this.options.ns,o)}else o(null)}},{key:"reloadResources",value:function(e,t,n){var o=L();return e||(e=this.languages),t||(t=this.options.ns),n||(n=G),this.services.backendConnector.reload(e,t,(function(e){o.resolve(),n(e)})),o}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&M.addPostProcessor(e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var o=L();this.emit("languageChanging",e);var i=function(e){var i="string"==typeof e?e:n.services.languageUtils.getBestMatchFromCodes(e);i&&(n.language||(n.language=i,n.languages=n.services.languageUtils.toResolveHierarchy(i)),n.translator.language||n.translator.changeLanguage(i),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(i)),n.loadResources(i,(function(e){!function(e,i){i?(n.language=i,n.languages=n.services.languageUtils.toResolveHierarchy(i),n.translator.changeLanguage(i),n.isLanguageChangingTo=void 0,n.emit("languageChanged",i),n.logger.log("languageChanged",i)):n.isLanguageChangingTo=void 0,o.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,i)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),o}},{key:"getFixedT",value:function(e,t){var n=this,o=function e(t,o){var i;if("object"!==u(o)){for(var r=arguments.length,a=new Array(r>2?r-2:0),s=2;s<r;s++)a[s-2]=arguments[s];i=n.options.overloadTranslationOptionHandler([t,o].concat(a))}else i=c({},o);return i.lng=i.lng||e.lng,i.lngs=i.lngs||e.lngs,i.ns=i.ns||e.ns,n.t(t,i)};return"string"==typeof e?o.lng=e:o.lngs=e,o.ns=t,o}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var o=this.languages[0],i=!!this.options&&this.options.fallbackLng,r=this.languages[this.languages.length-1];if("cimode"===o.toLowerCase())return!0;var a=function(e,n){var o=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===o||2===o};if(n.precheck){var s=n.precheck(this,a);if(void 0!==s)return s}return!!this.hasResourceBundle(o,e)||(!this.services.backendConnector.backend||!(!a(o,e)||i&&!a(r,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,o=L();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){o.resolve(),t&&t(e)})),o):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=L();"string"==typeof e&&(e=[e]);var o=this.options.preload||[],i=e.filter((function(e){return o.indexOf(e)<0}));return i.length?(this.options.preload=o.concat(i),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.languages&&this.languages.length>0?this.languages[0]:this.language),!e)return"rtl";return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr"}},{key:"createInstance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new t(e,n)}},{key:"cloneInstance",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:G,i=c({},this.options,n,{isClone:!0}),r=new t(i),a=["store","services","language"];return a.forEach((function(t){r[t]=e[t]})),r.services=c({},this.services),r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},r.translator=new H(r.services,r.options),r.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];r.emit.apply(r,[e].concat(n))})),r.init(i,o),r.translator.options=r.options,r.translator.backendConnector.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},r}}]),t}());function Q(e){return Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Q(e)}var Z=[],ee=Z.forEach,te=Z.slice;function ne(e){return ee.call(te.call(arguments,1),(function(t){if(t)for(var n in t)void 0===e[n]&&(e[n]=t[n])})),e}function oe(){return"function"==typeof XMLHttpRequest||"object"===("undefined"==typeof XMLHttpRequest?"undefined":Q(XMLHttpRequest))}var ie,re,ae,se=e((function(e,t){var r;if("function"==typeof fetch&&(void 0!==n&&n.fetch?r=n.fetch:"undefined"!=typeof window&&window.fetch&&(r=window.fetch)),void 0!==o&&("undefined"==typeof window||void 0===window.document)){var a=r||i;a.default&&(a=a.default),t.default=a,e.exports=t.default}})),ue=s({__proto__:null,default:se},[se]);function le(e){return le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},le(e)}"function"==typeof fetch&&("undefined"!=typeof global&&global.fetch?ie=global.fetch:"undefined"!=typeof window&&window.fetch&&(ie=window.fetch)),oe&&("undefined"!=typeof global&&global.XMLHttpRequest?re=global.XMLHttpRequest:"undefined"!=typeof window&&window.XMLHttpRequest&&(re=window.XMLHttpRequest)),"function"==typeof ActiveXObject&&("undefined"!=typeof global&&global.ActiveXObject?ae=global.ActiveXObject:"undefined"!=typeof window&&window.ActiveXObject&&(ae=window.ActiveXObject)),ie||!ue||re||ae||(ie=se||ue),"function"!=typeof ie&&(ie=void 0);var ce=function(e,t){if(t&&"object"===le(t)){var n="";for(var o in t)n+="&"+encodeURIComponent(o)+"="+encodeURIComponent(t[o]);if(!n)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+n.slice(1)}return e},pe=function(e,t,n,o){return"function"==typeof n&&(o=n,n=void 0),o=o||function(){},ie?function(e,t,n,o){e.queryStringParams&&(t=ce(t,e.queryStringParams));var i=ne({},"function"==typeof e.customHeaders?e.customHeaders():e.customHeaders);n&&(i["Content-Type"]="application/json"),ie(t,ne({method:n?"POST":"GET",body:n?e.stringify(n):void 0,headers:i},"function"==typeof e.requestOptions?e.requestOptions(n):e.requestOptions)).then((function(e){if(!e.ok)return o(e.statusText||"Error",{status:e.status});e.text().then((function(t){o(null,{status:e.status,data:t})})).catch(o)})).catch(o)}(e,t,n,o):oe||"function"==typeof ActiveXObject?function(e,t,n,o){n&&"object"===le(n)&&(n=ce("",n).slice(1)),e.queryStringParams&&(t=ce(t,e.queryStringParams));try{var i;(i=re?new re:new ae("MSXML2.XMLHTTP.3.0")).open(n?"POST":"GET",t,1),e.crossDomain||i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.withCredentials=!!e.withCredentials,n&&i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.overrideMimeType&&i.overrideMimeType("application/json");var r=e.customHeaders;if(r="function"==typeof r?r():r)for(var a in r)i.setRequestHeader(a,r[a]);i.onreadystatechange=function(){i.readyState>3&&o(i.status>=400?i.statusText:null,{status:i.status,data:i.responseText})},i.send(n)}catch(e){console&&console.log(e)}}(e,t,n,o):void 0};function fe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ge(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}var he=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",allowMultiLoading:!1,parse:function(e){return JSON.parse(e)},stringify:JSON.stringify,parsePayload:function(e,t,n){return function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},t,n||"")},request:pe,reloadInterval:"undefined"==typeof window&&36e5,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},de=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};fe(this,e),this.services=t,this.options=n,this.allOptions=o,this.type="backend",this.init(t,n,o)}var t,n,o;return t=e,n=[{key:"init",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=ne(n,this.options||{},he()),this.allOptions=o,this.services&&this.options.reloadInterval&&setInterval((function(){return t.reload()}),this.options.reloadInterval)}},{key:"readMulti",value:function(e,t,n){this._readAny(e,e,t,t,n)}},{key:"read",value:function(e,t,n){this._readAny([e],e,[t],t,n)}},{key:"_readAny",value:function(e,t,n,o,i){var r,a=this,s=this.options.loadPath;"function"==typeof this.options.loadPath&&(s=this.options.loadPath(e,n)),(s=function(e){return!!e&&"function"==typeof e.then}(r=s)?r:Promise.resolve(r)).then((function(r){var s=a.services.interpolator.interpolate(r,{lng:e.join("+"),ns:n.join("+")});a.loadUrl(s,i,t,o)}))}},{key:"loadUrl",value:function(e,t,n,o){var i=this;this.options.request(this.options,e,void 0,(function(r,a){if(a&&(a.status>=500&&a.status<600||!a.status))return t("failed loading "+e+"; status code: "+a.status,!0);if(a&&a.status>=400&&a.status<500)return t("failed loading "+e+"; status code: "+a.status,!1);if(!a&&r&&r.message&&r.message.indexOf("Failed to fetch")>-1)return t("failed loading "+e+": "+r.message,!0);if(r)return t(r,!1);var s,u;try{s="string"==typeof a.data?i.options.parse(a.data,n,o):a.data}catch(t){u="failed parsing "+e+" to json"}if(u)return t(u,!1);t(null,s)}))}},{key:"create",value:function(e,t,n,o,i){var r=this;if(this.options.addPath){"string"==typeof e&&(e=[e]);var a=this.options.parsePayload(t,n,o),s=0,u=[],l=[];e.forEach((function(n){var o=r.options.addPath;"function"==typeof r.options.addPath&&(o=r.options.addPath(n,t));var c=r.services.interpolator.interpolate(o,{lng:n,ns:t});r.options.request(r.options,c,a,(function(t,n){s+=1,u.push(t),l.push(n),s===e.length&&i&&i(u,l)}))}))}}},{key:"reload",value:function(){var e=this,t=this.services,n=t.backendConnector,o=t.languageUtils,i=t.logger,r=n.language;if(!r||"cimode"!==r.toLowerCase()){var a=[],s=function(e){o.toResolveHierarchy(e).forEach((function(e){a.indexOf(e)<0&&a.push(e)}))};s(r),this.allOptions.preload&&this.allOptions.preload.forEach((function(e){return s(e)})),a.forEach((function(t){e.allOptions.ns.forEach((function(e){n.read(t,e,"read",null,null,(function(o,r){o&&i.warn("loading namespace ".concat(e," for language ").concat(t," failed"),o),!o&&r&&i.log("loaded namespace ".concat(e," for language ").concat(t),r),n.loaded("".concat(t,"|").concat(e),o,r)}))}))}))}}}],n&&ge(t.prototype,n),o&&ge(t,o),e}();de.type="backend";let ve="";try{ve="https://static.www.foxycart.com/beta/foxy-elements/0.3.0"}catch(e){}class ye extends a{constructor(e="global"){super(),this.__lang=this._i18n.options.fallbackLng[0],this.__ns=this._i18n.options.fallbackNS[0],this.ns=e,this._whenI18nReady.then((()=>this.requestUpdate()))}static get properties(){return r(r({},super.properties),{},{lang:{type:String,noAccessor:!0},ns:{type:String,noAccessor:!0}})}get lang(){return this.__lang}set lang(e){e&&"undefined"!==e&&(this.__lang=e,this._i18n.loadLanguages(e).then((()=>{this.__lang===e&&this.requestUpdate()})))}get ns(){return this.__ns}set ns(e){this.__ns=e,this._i18n.loadNamespaces(e).then((()=>{this.__ns===e&&this.requestUpdate()}))}static __initI18N(){return this.__i18n=Y.createInstance(),this.__i18n.use(de),this.__whenI18NReady=this.__i18n.init({ns:["global"],supportedLngs:["nl","en","es","sv","fi","fr","de","zh","no","it","pl","se"],interpolation:{format:ye.__f},fallbackLng:"en",fallbackNS:"global",defaultNS:"global",detection:{order:["querystring","navigator","htmlTag","path","subdomain"],caches:[]},backend:{loadPath:`${ve}/translations/{{ns}}/{{lng}}.json`}}),this.__whenI18NReady.then((()=>this.__isI18NReady=!0)),this.__i18n}get _i18n(){var e;return null!==(e=ye.__i18n)&&void 0!==e?e:ye.__initI18N()}get _whenI18nReady(){return ye.__whenI18NReady}get _isI18nReady(){return ye.__isI18NReady}get _t(){const e=[this.__ns,this._i18n.options.fallbackNS];return this._i18n.getFixedT(this.__lang,e)}}ye.__fLowercase=e=>e.toLowerCase(),ye.__fList=e=>e.map(((e,t,n)=>{if(0===t)return e;return`${t===n.length-1?" $t(and) ":","} ${e}`})).join(""),ye.__f=(...e)=>{var t,n;const o=e[0];return(null!==(n=null===(t=e[1])||void 0===t?void 0:t.split(" "))&&void 0!==n?n:[]).reduce(((e,t)=>{switch(t){case"lowercase":return ye.__fLowercase(e);case"list":return ye.__fList(e);default:return e}}),o)},ye.__isI18NReady=!1;const me=(e,t="")=>class extends e{constructor(){super(...arguments),this.lang="",this.ns=t,this.t=(e,t)=>{const n=customElements.get("foxy-i18n");if(!n)return e;const o=[...this.ns.split(" ").reverse().map((e=>e.trim())).filter((e=>e.length>0)).reverse().map(((t,n,o)=>`${t}:${[...o.slice(n+1),e].join(".")}`)),`shared:${e}`];return n.i18next.t(o,r({lng:this.lang},t)).toString()}}static get inferredProperties(){return[...super.inferredProperties,"lang","ns"]}static get properties(){return r(r({},super.properties),{},{lang:{type:String},ns:{type:String}})}static get defaultNS(){return t}connectedCallback(){super.connectedCallback();const e=customElements.get("foxy-i18n");this.__untrackTranslations=null==e?void 0:e.onTranslationChange((()=>this.requestUpdate()))}updated(e){super.updated(e);const t=customElements.get("foxy-i18n");t&&(e.has("lang")&&t.i18next.loadLanguages(this.lang),e.has("ns")&&t.i18next.loadNamespaces(this.ns.split(" ")))}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this.__untrackTranslations)||void 0===e||e.call(this)}applyInferredProperties(e){if(super.applyInferredProperties(e),null===this.infer)return;const n=e.get("lang"),o=e.get("ns");this.lang=null!=n?n:"",this.ns=o?`${o} ${this.infer}`.trim():t}};export{me as T,ye as a,Y as i};
|