@foxy.io/elements 1.27.0-beta.5 → 1.27.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.
Files changed (275) hide show
  1. package/dist/cdn/foxy-access-recovery-form.js +1 -1
  2. package/dist/cdn/foxy-address-card.js +1 -1
  3. package/dist/cdn/foxy-address-form.js +1 -1
  4. package/dist/cdn/foxy-admin-subscription-card.js +1 -1
  5. package/dist/cdn/foxy-api-browser.js +1 -1
  6. package/dist/cdn/foxy-applied-coupon-code-card.js +1 -1
  7. package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
  8. package/dist/cdn/foxy-applied-tax-card.js +1 -1
  9. package/dist/cdn/foxy-attribute-card.js +1 -1
  10. package/dist/cdn/foxy-attribute-form.js +1 -1
  11. package/dist/cdn/foxy-billing-address-card.js +1 -1
  12. package/dist/cdn/foxy-cancellation-form.js +1 -1
  13. package/dist/cdn/foxy-cart-card.js +1 -1
  14. package/dist/cdn/foxy-cart-form.js +1 -1
  15. package/dist/cdn/foxy-client-card.js +1 -1
  16. package/dist/cdn/foxy-client-form.js +1 -1
  17. package/dist/cdn/foxy-collection-page.js +1 -1
  18. package/dist/cdn/foxy-collection-pages.js +1 -1
  19. package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
  20. package/dist/cdn/foxy-coupon-card.js +1 -1
  21. package/dist/cdn/foxy-coupon-code-card.js +1 -0
  22. package/dist/cdn/foxy-coupon-code-form.js +1 -1
  23. package/dist/cdn/foxy-coupon-codes-form.js +1 -1
  24. package/dist/cdn/foxy-coupon-detail-card.js +1 -1
  25. package/dist/cdn/foxy-coupon-form.js +1 -1
  26. package/dist/cdn/foxy-custom-field-card.js +1 -1
  27. package/dist/cdn/foxy-custom-field-form.js +1 -1
  28. package/dist/cdn/foxy-customer-api.js +1 -1
  29. package/dist/cdn/foxy-customer-card.js +1 -1
  30. package/dist/cdn/foxy-customer-form.js +1 -1
  31. package/dist/cdn/foxy-customer-portal-settings-form.js +1 -1
  32. package/dist/cdn/foxy-customer-portal-settings.js +1 -1
  33. package/dist/cdn/foxy-customer-portal.js +2 -2
  34. package/dist/cdn/foxy-customer.js +1 -1
  35. package/dist/cdn/foxy-customers-table.js +1 -1
  36. package/dist/cdn/foxy-discount-builder.js +1 -1
  37. package/dist/cdn/foxy-discount-card.js +1 -1
  38. package/dist/cdn/foxy-discount-detail-card.js +1 -1
  39. package/dist/cdn/foxy-donation.js +1 -1
  40. package/dist/cdn/foxy-downloadable-card.js +1 -1
  41. package/dist/cdn/foxy-downloadable-form.js +2 -2
  42. package/dist/cdn/foxy-email-template-card.js +1 -1
  43. package/dist/cdn/foxy-email-template-form.js +1 -1
  44. package/dist/cdn/foxy-error-entry-card.js +1 -1
  45. package/dist/cdn/foxy-filter-attribute-card.js +1 -1
  46. package/dist/cdn/foxy-filter-attribute-form.js +1 -1
  47. package/dist/cdn/foxy-form-dialog.js +1 -1
  48. package/dist/cdn/foxy-generate-codes-form.js +1 -1
  49. package/dist/cdn/foxy-gift-card-card.js +1 -1
  50. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  51. package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
  52. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  53. package/dist/cdn/foxy-gift-card-form.js +1 -1
  54. package/dist/cdn/foxy-i18n-editor.js +2 -2
  55. package/dist/cdn/foxy-i18n.js +1 -1
  56. package/dist/cdn/foxy-integration-card.js +1 -1
  57. package/dist/cdn/foxy-integration-form.js +1 -1
  58. package/dist/cdn/foxy-item-card.js +1 -1
  59. package/dist/cdn/foxy-item-category-card.js +1 -1
  60. package/dist/cdn/foxy-item-category-form.js +1 -1
  61. package/dist/cdn/foxy-item-form.js +3 -3
  62. package/dist/cdn/foxy-item-option-card.js +1 -1
  63. package/dist/cdn/foxy-item-option-form.js +1 -1
  64. package/dist/cdn/foxy-items-form.js +1 -1
  65. package/dist/cdn/foxy-native-integration-card.js +1 -1
  66. package/dist/cdn/foxy-native-integration-form.js +1 -1
  67. package/dist/cdn/foxy-nucleon-element.js +1 -1
  68. package/dist/cdn/foxy-pagination.js +1 -1
  69. package/dist/cdn/foxy-passkey-card.js +1 -1
  70. package/dist/cdn/foxy-passkey-form.js +1 -1
  71. package/dist/cdn/foxy-payment-card.js +1 -1
  72. package/dist/cdn/foxy-payment-method-card.js +1 -1
  73. package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
  74. package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
  75. package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
  76. package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
  77. package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
  78. package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
  79. package/dist/cdn/foxy-query-builder.js +1 -1
  80. package/dist/cdn/foxy-report-form.js +1 -1
  81. package/dist/cdn/foxy-reports-table.js +1 -1
  82. package/dist/cdn/foxy-shipment-card.js +1 -1
  83. package/dist/cdn/foxy-shipping-method-card.js +1 -1
  84. package/dist/cdn/foxy-sign-in-form.js +1 -1
  85. package/dist/cdn/foxy-spinner.js +1 -1
  86. package/dist/cdn/foxy-store-card.js +1 -1
  87. package/dist/cdn/foxy-store-form.js +1 -1
  88. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  89. package/dist/cdn/foxy-subscription-card.js +1 -1
  90. package/dist/cdn/foxy-subscription-form.js +1 -1
  91. package/dist/cdn/foxy-subscription-settings-form.js +1 -1
  92. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  93. package/dist/cdn/foxy-table.js +1 -1
  94. package/dist/cdn/foxy-tax-card.js +1 -1
  95. package/dist/cdn/foxy-tax-form.js +1 -1
  96. package/dist/cdn/foxy-template-config-form.js +1 -1
  97. package/dist/cdn/foxy-template-form.js +1 -1
  98. package/dist/cdn/foxy-template-set-card.js +1 -1
  99. package/dist/cdn/foxy-template-set-form.js +1 -1
  100. package/dist/cdn/foxy-transaction-card.js +1 -1
  101. package/dist/cdn/foxy-transaction.js +1 -1
  102. package/dist/cdn/foxy-transactions-table.js +1 -1
  103. package/dist/cdn/foxy-user-card.js +1 -1
  104. package/dist/cdn/foxy-user-form.js +1 -1
  105. package/dist/cdn/foxy-users-table.js +1 -1
  106. package/dist/cdn/foxy-webhook-card.js +1 -1
  107. package/dist/cdn/foxy-webhook-form.js +1 -1
  108. package/dist/cdn/foxy-webhook-log-card.js +1 -1
  109. package/dist/cdn/foxy-webhook-status-card.js +1 -1
  110. package/dist/cdn/{shared-20c4310b.js → shared-065dbdf6.js} +1 -1
  111. package/dist/cdn/{shared-0f49d9c3.js → shared-07d5e225.js} +1 -1
  112. package/dist/cdn/{shared-82435697.js → shared-0e8dceb8.js} +1 -1
  113. package/dist/cdn/{shared-6ef4ce19.js → shared-1a9e80fa.js} +1 -1
  114. package/dist/cdn/{shared-e4e0dc11.js → shared-1d6beb48.js} +1 -1
  115. package/dist/cdn/shared-208e37af.js +88 -0
  116. package/dist/cdn/shared-29f2468c.js +6 -0
  117. package/dist/cdn/shared-400240f8.js +1 -0
  118. package/dist/cdn/{shared-9db9528b.js → shared-589e5d06.js} +15 -15
  119. package/dist/cdn/{shared-6be0a096.js → shared-5dbb9630.js} +1 -1
  120. package/dist/cdn/{shared-6350f7d9.js → shared-5e35c5a5.js} +1 -1
  121. package/dist/cdn/{shared-3cbcd9cb.js → shared-5f09205d.js} +1 -1
  122. package/dist/cdn/{shared-d15c3e2d.js → shared-61f67b16.js} +1 -1
  123. package/dist/cdn/shared-683145e5.js +1 -0
  124. package/dist/cdn/shared-6c4affb9.js +1 -0
  125. package/dist/cdn/{shared-4fb9d21f.js → shared-77fd8dae.js} +1 -1
  126. package/dist/cdn/{shared-92cdd504.js → shared-80eb1fee.js} +1 -1
  127. package/dist/cdn/shared-850e2ae1.js +10 -0
  128. package/dist/cdn/{shared-872151f5.js → shared-85979316.js} +1 -1
  129. package/dist/cdn/{shared-4fd17baf.js → shared-8def6325.js} +1 -1
  130. package/dist/cdn/{shared-18d109f5.js → shared-93812e51.js} +1 -1
  131. package/dist/cdn/{shared-6a998243.js → shared-9a5da74d.js} +21 -27
  132. package/dist/cdn/{shared-e52280d9.js → shared-b30f9b10.js} +1 -1
  133. package/dist/cdn/shared-bb08b5ce.js +32 -0
  134. package/dist/cdn/{shared-89b42eef.js → shared-bba8ae80.js} +1 -1
  135. package/dist/cdn/{shared-bf132324.js → shared-befe135a.js} +1 -1
  136. package/dist/cdn/{shared-7ff496f6.js → shared-bfa30d93.js} +1 -1
  137. package/dist/cdn/shared-c5f57aa8.js +1 -0
  138. package/dist/cdn/{shared-3277bbf5.js → shared-ca15d510.js} +1 -1
  139. package/dist/cdn/{shared-46454866.js → shared-cab2aa63.js} +4 -4
  140. package/dist/cdn/shared-cc723108.js +12 -0
  141. package/dist/cdn/{shared-97793410.js → shared-d04c2e0c.js} +1 -1
  142. package/dist/cdn/{shared-59a5edee.js → shared-da7a0bfb.js} +9 -9
  143. package/dist/cdn/shared-e35297c9.js +1 -0
  144. package/dist/cdn/{shared-8778d784.js → shared-e48fbf50.js} +1 -1
  145. package/dist/cdn/shared-e84be1c2.js +64 -0
  146. package/dist/cdn/{shared-8dd03329.js → shared-e966f1ef.js} +1 -1
  147. package/dist/cdn/{shared-1122a125.js → shared-fb8c09b8.js} +1 -1
  148. package/dist/cdn/{shared-fcaf15e5.js → shared-fd041b18.js} +1 -1
  149. package/dist/cdn/{shared-1b0992cc.js → shared-fda63db8.js} +5 -5
  150. package/dist/cdn/{shared-51ac503d.js → shared-fe7b3ed2.js} +1 -1
  151. package/dist/cdn/translations/coupon-code-card/en.json +11 -0
  152. package/dist/cdn/translations/coupon-form/en.json +522 -297
  153. package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.d.ts +10 -0
  154. package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.js +81 -2
  155. package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.js.map +1 -1
  156. package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControlFilterOverlay.d.ts +11 -0
  157. package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControlFilterOverlay.js +57 -0
  158. package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControlFilterOverlay.js.map +1 -0
  159. package/dist/elements/internal/InternalAsyncListControl/index.d.ts +1 -0
  160. package/dist/elements/internal/InternalAsyncListControl/index.js +3 -0
  161. package/dist/elements/internal/InternalAsyncListControl/index.js.map +1 -1
  162. package/dist/elements/internal/InternalAsyncListControl/types.d.ts +8 -0
  163. package/dist/elements/internal/InternalAsyncListControl/types.js +2 -0
  164. package/dist/elements/internal/InternalAsyncListControl/types.js.map +1 -0
  165. package/dist/elements/internal/InternalAsyncResourceLinkListControl/InternalAsyncResourceLinkListControl.d.ts +23 -0
  166. package/dist/elements/internal/InternalAsyncResourceLinkListControl/InternalAsyncResourceLinkListControl.js +224 -0
  167. package/dist/elements/internal/InternalAsyncResourceLinkListControl/InternalAsyncResourceLinkListControl.js.map +1 -0
  168. package/dist/elements/internal/InternalAsyncResourceLinkListControl/index.d.ts +8 -0
  169. package/dist/elements/internal/InternalAsyncResourceLinkListControl/index.js +10 -0
  170. package/dist/elements/internal/InternalAsyncResourceLinkListControl/index.js.map +1 -0
  171. package/dist/elements/internal/InternalForm/InternalForm.d.ts +10 -0
  172. package/dist/elements/internal/InternalForm/InternalForm.js +44 -0
  173. package/dist/elements/internal/InternalForm/InternalForm.js.map +1 -1
  174. package/dist/elements/internal/InternalForm/index.d.ts +2 -0
  175. package/dist/elements/internal/InternalForm/index.js +2 -0
  176. package/dist/elements/internal/InternalForm/index.js.map +1 -1
  177. package/dist/elements/internal/InternalIntegerControl/InternalIntegerControl.d.ts +1 -0
  178. package/dist/elements/internal/InternalIntegerControl/InternalIntegerControl.js +3 -0
  179. package/dist/elements/internal/InternalIntegerControl/InternalIntegerControl.js.map +1 -1
  180. package/dist/elements/internal/InternalQueryBuilderControl/InternalQueryBuilderControl.d.ts +10 -0
  181. package/dist/elements/internal/InternalQueryBuilderControl/InternalQueryBuilderControl.js +51 -0
  182. package/dist/elements/internal/InternalQueryBuilderControl/InternalQueryBuilderControl.js.map +1 -0
  183. package/dist/elements/internal/InternalQueryBuilderControl/index.d.ts +4 -0
  184. package/dist/elements/internal/InternalQueryBuilderControl/index.js +6 -0
  185. package/dist/elements/internal/InternalQueryBuilderControl/index.js.map +1 -0
  186. package/dist/elements/public/CartForm/CartForm.js +81 -81
  187. package/dist/elements/public/CartForm/CartForm.js.map +1 -1
  188. package/dist/elements/public/CouponCodeCard/CouponCodeCard.d.ts +16 -0
  189. package/dist/elements/public/CouponCodeCard/CouponCodeCard.js +41 -0
  190. package/dist/elements/public/CouponCodeCard/CouponCodeCard.js.map +1 -0
  191. package/dist/elements/public/CouponCodeCard/index.d.ts +4 -0
  192. package/dist/elements/public/CouponCodeCard/index.js +6 -0
  193. package/dist/elements/public/CouponCodeCard/index.js.map +1 -0
  194. package/dist/elements/public/CouponCodeCard/types.d.ts +3 -0
  195. package/dist/elements/public/CouponCodeCard/types.js +2 -0
  196. package/dist/elements/public/CouponCodeCard/types.js.map +1 -0
  197. package/dist/elements/public/CouponForm/CouponForm.d.ts +65 -41
  198. package/dist/elements/public/CouponForm/CouponForm.js +320 -1035
  199. package/dist/elements/public/CouponForm/CouponForm.js.map +1 -1
  200. package/dist/elements/public/CouponForm/index.d.ts +15 -16
  201. package/dist/elements/public/CouponForm/index.js +15 -16
  202. package/dist/elements/public/CouponForm/index.js.map +1 -1
  203. package/dist/elements/public/CouponForm/internal/InternalCouponFormBulkAddControl/InternalCouponFormBulkAddControl.d.ts +9 -0
  204. package/dist/elements/public/CouponForm/internal/InternalCouponFormBulkAddControl/InternalCouponFormBulkAddControl.js +49 -0
  205. package/dist/elements/public/CouponForm/internal/InternalCouponFormBulkAddControl/InternalCouponFormBulkAddControl.js.map +1 -0
  206. package/dist/elements/public/CouponForm/internal/InternalCouponFormBulkAddControl/index.d.ts +6 -0
  207. package/dist/elements/public/CouponForm/internal/InternalCouponFormBulkAddControl/index.js +8 -0
  208. package/dist/elements/public/CouponForm/internal/InternalCouponFormBulkAddControl/index.js.map +1 -0
  209. package/dist/elements/public/CouponForm/internal/InternalCouponFormRulesControl/InternalCouponFormRulesControl.d.ts +7 -0
  210. package/dist/elements/public/CouponForm/internal/InternalCouponFormRulesControl/InternalCouponFormRulesControl.js +141 -0
  211. package/dist/elements/public/CouponForm/internal/InternalCouponFormRulesControl/InternalCouponFormRulesControl.js.map +1 -0
  212. package/dist/elements/public/CouponForm/internal/InternalCouponFormRulesControl/index.d.ts +6 -0
  213. package/dist/elements/public/CouponForm/internal/InternalCouponFormRulesControl/index.js +8 -0
  214. package/dist/elements/public/CouponForm/internal/InternalCouponFormRulesControl/index.js.map +1 -0
  215. package/dist/elements/public/CouponForm/types.d.ts +10 -1
  216. package/dist/elements/public/CouponForm/types.js.map +1 -1
  217. package/dist/elements/public/CustomerPortalSettingsForm/CustomerPortalSettingsForm.js +7 -3
  218. package/dist/elements/public/CustomerPortalSettingsForm/CustomerPortalSettingsForm.js.map +1 -1
  219. package/dist/elements/public/CustomerPortalSettingsForm/toOrigin.d.ts +1 -0
  220. package/dist/elements/public/CustomerPortalSettingsForm/toOrigin.js +9 -0
  221. package/dist/elements/public/CustomerPortalSettingsForm/toOrigin.js.map +1 -0
  222. package/dist/elements/public/DownloadableForm/DownloadableForm.js +9 -9
  223. package/dist/elements/public/DownloadableForm/DownloadableForm.js.map +1 -1
  224. package/dist/elements/public/I18n/format/discount.js +9 -2
  225. package/dist/elements/public/I18n/format/discount.js.map +1 -1
  226. package/dist/elements/public/I18n/format/ordinal.js +6 -2
  227. package/dist/elements/public/I18n/format/ordinal.js.map +1 -1
  228. package/dist/elements/public/IntegrationForm/IntegrationForm.js +8 -6
  229. package/dist/elements/public/IntegrationForm/IntegrationForm.js.map +1 -1
  230. package/dist/elements/public/ItemCategoryForm/ItemCategoryForm.js +27 -27
  231. package/dist/elements/public/ItemCategoryForm/ItemCategoryForm.js.map +1 -1
  232. package/dist/elements/public/QueryBuilder/QueryBuilder.d.ts +4 -0
  233. package/dist/elements/public/QueryBuilder/QueryBuilder.js +10 -2
  234. package/dist/elements/public/QueryBuilder/QueryBuilder.js.map +1 -1
  235. package/dist/elements/public/QueryBuilder/components/Group.d.ts +3 -1
  236. package/dist/elements/public/QueryBuilder/components/Group.js +8 -1
  237. package/dist/elements/public/QueryBuilder/components/Group.js.map +1 -1
  238. package/dist/elements/public/QueryBuilder/components/OperatorToggle.d.ts +2 -1
  239. package/dist/elements/public/QueryBuilder/components/OperatorToggle.js +5 -4
  240. package/dist/elements/public/QueryBuilder/components/OperatorToggle.js.map +1 -1
  241. package/dist/elements/public/QueryBuilder/components/Rule.d.ts +3 -1
  242. package/dist/elements/public/QueryBuilder/components/Rule.js +2 -1
  243. package/dist/elements/public/QueryBuilder/components/Rule.js.map +1 -1
  244. package/dist/elements/public/StoreForm/StoreForm.js +7 -8
  245. package/dist/elements/public/StoreForm/StoreForm.js.map +1 -1
  246. package/dist/elements/public/TemplateSetForm/TemplateSetForm.js +28 -28
  247. package/dist/elements/public/TemplateSetForm/TemplateSetForm.js.map +1 -1
  248. package/dist/elements/public/index.d.ts +1 -0
  249. package/dist/elements/public/index.defined.d.ts +1 -0
  250. package/dist/elements/public/index.defined.js +1 -0
  251. package/dist/elements/public/index.defined.js.map +1 -1
  252. package/dist/elements/public/index.js +1 -0
  253. package/dist/elements/public/index.js.map +1 -1
  254. package/dist/mixins/inferrable.js +8 -3
  255. package/dist/mixins/inferrable.js.map +1 -1
  256. package/package.json +1 -1
  257. package/dist/cdn/shared-20f65e73.js +0 -1
  258. package/dist/cdn/shared-27c7514d.js +0 -1
  259. package/dist/cdn/shared-669decee.js +0 -1
  260. package/dist/cdn/shared-afefe2ac.js +0 -113
  261. package/dist/cdn/shared-b33fd700.js +0 -1
  262. package/dist/cdn/shared-b51b9df7.js +0 -64
  263. package/dist/cdn/shared-b914895b.js +0 -1
  264. package/dist/cdn/shared-cce18690.js +0 -1
  265. package/dist/cdn/shared-d04dd602.js +0 -20
  266. package/dist/cdn/shared-df58b901.js +0 -1
  267. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPage.d.ts +0 -20
  268. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPage.js +0 -99
  269. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPage.js.map +0 -1
  270. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItem.d.ts +0 -18
  271. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItem.js +0 -50
  272. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItem.js.map +0 -1
  273. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItemContent.d.ts +0 -18
  274. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItemContent.js +0 -53
  275. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItemContent.js.map +0 -1
@@ -0,0 +1,6 @@
1
+ import{O as t}from"./shared-208e37af.js";import"./shared-931db653.js";import"./foxy-collection-page.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./foxy-pagination.js";import"./shared-683145e5.js";import{I as e}from"./shared-befe135a.js";import"./shared-80eb1fee.js";import{h as i,r as n}from"./shared-dc73b9a5.js";import{_ as r}from"./shared-11014aad.js";import{i as s}from"./shared-9803aa7c.js";import{c as o}from"./shared-4e709717.js";
2
+ /**
3
+ @license
4
+ Copyright (c) 2019 Vaadin Ltd.
5
+ This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
6
+ */let a,l=t=>t;const d=t=>class e extends t{static get properties(){return{positionTarget:{type:Object,value:null},horizontalAlign:{type:String,value:"start"},verticalAlign:{type:String,value:"top"},noHorizontalOverlap:{type:Boolean,value:!1},noVerticalOverlap:{type:Boolean,value:!1}}}static get observers(){return["__positionSettingsChanged(positionTarget, horizontalAlign, verticalAlign,\n noHorizontalOverlap, noVerticalOverlap)"]}constructor(){super();const t=this._updatePosition.bind(this);this.addEventListener("opened-changed",(e=>{const i=e.detail.value?"addEventListener":"removeEventListener";window[i]("scroll",t),window[i]("resize",t),e.detail.value&&this._updatePosition()}))}ready(){super.ready(),console.warn("PositionMixin is not considered stable and might change any time")}__positionSettingsChanged(){this._updatePosition()}_updatePosition(){if(!this.positionTarget)return;const t=getComputedStyle(this);this.__margins||(this.__margins={},["top","bottom","left","right"].forEach((e=>{this.__margins[e]=parseInt(t[e],10)})));const e="rtl"===t.direction,i=this.positionTarget.getBoundingClientRect(),n=this.__calculateHorizontalPosition(i,e),r=this.__calculateVerticalPosition(i),s=Object.assign({},n,r);this.__doSetPosition(s,e)}__calculateHorizontalPosition(t,i){const n=Math.max(this.__oldContentWidth||0,this.$.overlay.offsetWidth);this.__oldContentWidth=this.$.overlay.offsetWidth;const r=Math.min(window.innerWidth,document.documentElement.clientWidth),s=!i&&"start"===this.horizontalAlign||i&&"end"===this.horizontalAlign,o=!!this.style.left;return e.__calculatePositionInOneDimension(t,n,r,this.__margins,s,o,this.noHorizontalOverlap,{start:"left",end:"right"})}__calculateVerticalPosition(t){const i=Math.max(this.__oldContentHeight||0,this.$.overlay.offsetHeight);this.__oldContentHeight=this.$.overlay.offsetHeight;const n=Math.min(window.innerHeight,document.documentElement.clientHeight),r="top"===this.verticalAlign,s=!!this.style.top;return e.__calculatePositionInOneDimension(t,i,n,this.__margins,r,s,this.noVerticalOverlap,{start:"top",end:"bottom"})}static __calculatePositionInOneDimension(t,e,i,n,r,s,o,a){const l=i-t[o?a.end:a.start]-n[a.end],d=t[o?a.start:a.end]-n[a.start],c=r?l:d,h=r===(c>(r?d:l)||c>e),f=h?a.start:a.end,p=h?a.end:a.start,u=(h?t[o?a.end:a.start]:i-t[o?a.start:a.end])+"px",m={};return m[f]=u,m[p]="",m}__doSetPosition(t,e){Object.assign(this.style,t);const i=!e&&t.left||e&&t.right;this.style.alignItems=i?"flex-start":"flex-end",this.style.justifyContent=t.top?"flex-start":"flex-end"}};class c extends(d(t)){constructor(){super(...arguments),this.renderer=(t,e,r)=>{var s;const o=null!==(s=t.firstElementChild)&&void 0!==s?s:document.createElement("div");t.firstElementChild||t.appendChild(o);const d=r,c=i(a||(a=l` <div style="display:grid;gap:var(--lumo-space-m);padding:var(--lumo-space-s);width:22rem"> <foxy-query-builder lang="${0}" ns="${0}" .options="${0}" .value="${0}"> </foxy-query-builder> <div style="display:flex;justify-content:space-between"> <vaadin-button theme="primary" style="margin:0" @click="${0}"> <foxy-i18n lang="${0}" ns="${0}" key="search"></foxy-i18n> </vaadin-button> <vaadin-button theme="secondary contrast" style="margin:0" @click="${0}"> <foxy-i18n lang="${0}" ns="${0}" key="clear"></foxy-i18n> </vaadin-button> </div> </div> `),d.lang,`${d.ns} query-builder`.trim(),d.options,d.value,(()=>{var t;const e=null!==(t=o.querySelector("foxy-query-builder").value)&&void 0!==t?t:"";this.dispatchEvent(new CustomEvent("search",{detail:e}))}),d.lang,d.ns,(()=>this.dispatchEvent(new CustomEvent("search"))),d.lang,d.ns);n(c,o)}}static get is(){return"foxy-internal-async-list-control-filter-overlay"}}let h,f,p,u,m,g,y,_,v,b,x,$,P=t=>t;customElements.define("foxy-internal-async-list-control",class extends e{constructor(){super(...arguments),this.keepDialogOpenOnDelete=!1,this.keepDialogOpenOnPost=!1,this.createPageHref=null,this.related=[],this.actions=[],this.filters=[],this.limit=20,this.first=null,this.form=null,this.formProps={},this.item=null,this.itemProps={},this.wide=!1,this.alert=!1,this.hideDeleteButton=!1,this.hideCreateButton=!1,this.getPageHref=null,this.__deletionConfimationCallback=null,this.__cachedCardRenderer=null,this.__isFilterVisible=!1,this.__itemRenderer=t=>{var e;if(!t.data)return this.__cardRenderer(t);if("string"!=typeof(null===(e=this.getPageHref)||void 0===e?void 0:e.call(this,t.href,t.data))&&!this.form)return this.__cardRenderer(t);const n=this.disabledSelector.matches("card",!0),r=this.__cardRenderer(t);let s;const a=o({"rounded-t":!t.previous,"rounded-b":!t.next,"focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50":!0,"text-left w-full block transition-colors":!0,"hover-bg-contrast-5":!n});if(this.getPageHref)if(n)s=i(h||(h=P`<div class="${0}">${0}</div>`),a,r);else{const e=this.getPageHref(t.href,t.data);s=i(f||(f=P`<a class="${0}" href="${0}">${0}</a>`),a,e,r)}else{s=i(p||(p=P` <button ?disabled="${0}" class="${0}" @click="${0}">${0}</button> `),n,a,(e=>{const i=e.currentTarget,n=this.__dialog;n.header="header_update",n.href=t.href,n.show(i)}),r)}return this.hideDeleteButton||this.readonly?s:i(u||(u=P` <foxy-swipe-actions class="block"> ${0} ${0} <vaadin-button theme="primary error" class="h-full rounded-none" slot="action" @click="${0}"> <foxy-i18n infer="" key="delete_button_text"></foxy-i18n> </vaadin-button> </foxy-swipe-actions> `),s,this.actions.map((e=>i(m||(m=P` <vaadin-button data-testclass="action" theme="${0}" class="h-full rounded-none relative" slot="action" ?disabled="${0}" @click="${0}"> <foxy-i18n class="${0}" infer="" key="${0}"> </foxy-i18n> <div class="${0}"> <foxy-spinner layout="no-label" infer="spinner" state="${0}"> </foxy-spinner> </div> </vaadin-button> `),e.theme,this.disabled,(()=>e.onClick(t.data)),o({"transition-opacity":!0,"opacity-0":"idle"!==e.state}),e.text,o({"absolute inset-0 flex items-center justify-center transition-opacity":!0,"opacity-0":"idle"===e.state}),e.state))),(t=>{const e=t.currentTarget;this.renderRoot.querySelector("#confirm").show(e),this.__deletionConfimationCallback=()=>{const t=e.parentElement.firstElementChild.querySelector("[href]");null==t||t.delete(),this.__deletionConfimationCallback=null}}))},this.__filter=""}static get properties(){return r(r({},super.properties),{},{keepDialogOpenOnDelete:{type:Boolean,attribute:"keep-dialog-open-on-delete"},keepDialogOpenOnPost:{type:Boolean,attribute:"keep-dialog-open-on-post"},hideDeleteButton:{type:Boolean,attribute:"hide-delete-button"},hideCreateButton:{type:Boolean,attribute:"hide-create-button"},createPageHref:{attribute:"create-page-href"},getPageHref:{attribute:!1},related:{type:Array},first:{},limit:{type:Number},form:{},formProps:{type:Object,attribute:"form-props"},item:{},itemProps:{type:Object,attribute:"item-props"},wide:{type:Boolean},alert:{type:Boolean},actions:{type:Array},filters:{type:Array},__filter:{attribute:!1},__isFilterVisible:{attribute:!1}})}renderControl(){var t,e;let n;try{const e=new URL(null!==(t=this.first)&&void 0!==t?t:""),i=new URLSearchParams(this.__filter);e.searchParams.set("limit",String(this.limit)),i.forEach(((t,i)=>e.searchParams.set(i,t))),n=e.toString()}catch(t){n=void 0}return i(g||(g=P` ${0} ${0} <div class="flex items-center justify-between mb-xs text-s font-medium"> <span class="text-secondary"> ${0} </span> ${0} ${0} </div> <foxy-pagination first="${0}" infer="pagination"> <foxy-collection-page class="${0}" infer="card" .related="${0}" .props="${0}" .item="${0}"> </foxy-collection-page> </foxy-pagination> <div class="${0}" ?hidden="${0}"> ${0} </div> <div class="mt-xs text-xs leading-xs text-error" ?hidden="${0}"> ${0} </div> `),this.form?i(y||(y=P` <foxy-form-dialog parent="${0}" infer="dialog" id="form" ?wide="${0}" ?alert="${0}" ?keep-open-on-post="${0}" ?keep-open-on-delete="${0}" .related="${0}" .props="${0}" .form="${0}"> </foxy-form-dialog> `),s(null!==(e=this.first)&&void 0!==e?e:void 0),this.wide,this.alert,this.keepDialogOpenOnPost,this.keepDialogOpenOnDelete,this.related,this.formProps,this.form):"",this.hideDeleteButton||this.readonly?"":i(_||(_=P` <foxy-internal-confirm-dialog message="delete_message" confirm="delete_confirm" cancel="delete_cancel" header="delete_header" theme="error" infer="" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> `),(t=>{var e;t.detail.cancelled||null===(e=this.__deletionConfimationCallback)||void 0===e||e.call(this)})),this.label&&"label"!==this.label?this.label:"",this.filters.length>0?i(v||(v=P` <foxy-internal-async-list-control-filter-overlay .noVerticalOverlap="${0}" .positionTarget="${0}" .model="${0}" ?opened="${0}" @vaadin-overlay-close="${0}" @search="${0}"> </foxy-internal-async-list-control-filter-overlay> <vaadin-button theme="tertiary-inline contrast" class="ml-auto mr-m" id="filters" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="pagination" key="search_button_text"></foxy-i18n> </vaadin-button> `),!0,this.renderRoot.querySelector("#filters"),{options:this.filters,value:this.__filter,lang:this.lang,ns:this.ns},this.__isFilterVisible,(()=>this.__isFilterVisible=!1),(t=>{var e;this.__filter=null!==(e=t.detail)&&void 0!==e?e:""}),this.disabled,(()=>this.__isFilterVisible=!this.__isFilterVisible)):"",!this.form&&!this.createPageHref||this.readonly||this.hideCreateButton?"":this.createPageHref&&!this.disabled?i(b||(b=P` <a class="rounded-s text-primary group focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n class="transition-opacity group-hover-opacity-80" infer="" key="create_button_text"> </foxy-i18n> </a> `),this.createPageHref):i(x||(x=P` <vaadin-button theme="tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="pagination" key="create_button_text"></foxy-i18n> </vaadin-button> `),this.disabled,(t=>{t.preventDefault(),t.stopPropagation();const e=this.__dialog,i=t.currentTarget;e.header="header_create",e.href="",e.show(i)})),s(n),o({"block divide-y divide-contrast-5 rounded overflow-hidden":!0,"ring-1 ring-inset ring-contrast-10":!this.form&&!this.getPageHref,"bg-contrast-5":!!this.form||!!this.getPageHref}),this.related,this.itemProps,this.__itemRenderer,o({"transition-colors mt-xs text-xs":!0,"text-secondary group-hover-text-body":!this.disabled&&!this.readonly,"text-disabled":this.disabled}),!this.helperText||"helper_text"===this.helperText,this.helperText,!this._errorMessage||this.disabled||this.readonly,this._errorMessage)}get __dialog(){return this.renderRoot.querySelector("#form")}get __cardRenderer(){var t;const e=this.item;return(null===(t=this.__cachedCardRenderer)||void 0===t?void 0:t.item)!==e&&(this.__cachedCardRenderer={item:e,render:"string"==typeof e?new Function("ctx",`return ctx.html\`\n <${e}\n related=\${JSON.stringify(ctx.related)}\n parent=\${ctx.parent}\n style="padding: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)"\n infer=""\n href=\${ctx.href}\n ...=\${ctx.spread(ctx.props)}\n >\n </${e}>\``):t=>i($||($=P` <div style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} </div> `),null==e?void 0:e(t))}),this.__cachedCardRenderer.render}}),customElements.define(c.is,c);
@@ -0,0 +1 @@
1
+ import{_ as r}from"./shared-11014aad.js";import{p as s}from"./shared-683145e5.js";function a(a){var t;const n=s(a),o=null!==(t={y:"yearly",m:"monthly",w:"weekly",d:"daily"}[n.units])&&void 0!==t?t:n.units;return r(r({},n),{},{units:o})}export{a as p};
@@ -1,4 +1,4 @@
1
- import{T as e,D as t,E as a}from"./shared-4877ed05.js";import{O as i,I as s,a as o}from"./shared-afefe2ac.js";import{h as n,G as r,P as l,D as d,t as h,b as u,s as c}from"./shared-48b76c74.js";import"./shared-931db653.js";import"./shared-205721a3.js";import{T as p}from"./shared-6e977271.js";import"./shared-0e5ea9cf.js";import{C as m}from"./shared-61ade33e.js";import{D as _,t as f,f as v,a as g}from"./shared-7e201abd.js";import{a as y,I as b}from"./shared-d04dd602.js";const D=n`<dom-module id="lumo-date-picker-overlay" theme-for="vaadin-date-picker-overlay">
1
+ import{T as e,D as t,E as a}from"./shared-4877ed05.js";import{I as i,a as s}from"./shared-bb08b5ce.js";import{h as o,G as r,P as n,D as l,t as h,b as d,s as u}from"./shared-48b76c74.js";import"./shared-931db653.js";import"./shared-205721a3.js";import{T as c}from"./shared-6e977271.js";import"./shared-0e5ea9cf.js";import{C as p}from"./shared-61ade33e.js";import{O as m}from"./shared-208e37af.js";import{D as _,t as f,f as v,a as g}from"./shared-7e201abd.js";import{a as y}from"./shared-850e2ae1.js";import{I as b}from"./shared-cc723108.js";const D=o`<dom-module id="lumo-date-picker-overlay" theme-for="vaadin-date-picker-overlay">
2
2
  <template>
3
3
  <style include="lumo-menu-overlay">
4
4
  [part="overlay"] {
@@ -41,7 +41,7 @@ import{T as e,D as t,E as a}from"./shared-4877ed05.js";import{O as i,I as s,a as
41
41
  }
42
42
  </style>
43
43
  </template>
44
- </dom-module>`;document.head.appendChild(D.content);const w=n`<dom-module id="lumo-date-picker-overlay-content" theme-for="vaadin-date-picker-overlay-content">
44
+ </dom-module>`;document.head.appendChild(D.content);const w=o`<dom-module id="lumo-date-picker-overlay-content" theme-for="vaadin-date-picker-overlay-content">
45
45
  <template>
46
46
  <style>
47
47
  :host {
@@ -244,7 +244,7 @@ import{T as e,D as t,E as a}from"./shared-4877ed05.js";import{O as i,I as s,a as
244
244
  }
245
245
  </style>
246
246
  </template>
247
- </dom-module>`;document.head.appendChild(w.content);const k=n`<dom-module id="lumo-month-calendar" theme-for="vaadin-month-calendar">
247
+ </dom-module>`;document.head.appendChild(w.content);const k=o`<dom-module id="lumo-month-calendar" theme-for="vaadin-month-calendar">
248
248
  <template>
249
249
  <style>
250
250
  :host {
@@ -390,7 +390,7 @@ import{T as e,D as t,E as a}from"./shared-4877ed05.js";import{O as i,I as s,a as
390
390
  }
391
391
  }
392
392
  </style>
393
- </custom-style>`;document.head.appendChild(k.content);const x=n`<dom-module id="lumo-date-picker" theme-for="vaadin-date-picker">
393
+ </custom-style>`;document.head.appendChild(k.content);const x=o`<dom-module id="lumo-date-picker" theme-for="vaadin-date-picker">
394
394
  <template>
395
395
  <style include="lumo-field-button">
396
396
  :host {
@@ -412,7 +412,7 @@ import{T as e,D as t,E as a}from"./shared-4877ed05.js";import{O as i,I as s,a as
412
412
  }
413
413
  </style>
414
414
  </template>
415
- </dom-module>`;document.head.appendChild(x.content);const S=n`<dom-module id="lumo-date-picker-text-field" theme-for="vaadin-date-picker-text-field">
415
+ </dom-module>`;document.head.appendChild(x.content);const S=o`<dom-module id="lumo-date-picker-text-field" theme-for="vaadin-date-picker-text-field">
416
416
  <template>
417
417
  <style>
418
418
  :not(*):placeholder-shown, /* to prevent broken styles on IE */
@@ -433,24 +433,24 @@ import{T as e,D as t,E as a}from"./shared-4877ed05.js";import{O as i,I as s,a as
433
433
  Copyright (c) 2019 Vaadin Ltd.
434
434
  This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
435
435
  */
436
- const C=document.createElement("template");C.innerHTML='<dom-module id="vaadin-date-picker-text-field-styles" theme-for="vaadin-date-picker-text-field">\n <template>\n <style>\n :host([dir="rtl"]) [part="input-field"] {\n direction: ltr;\n }\n\n :host([dir="rtl"]) [part="value"]::placeholder {\n direction: rtl;\n text-align: left;\n }\n\n :host([dir="rtl"]) [part="input-field"] ::slotted(input)::placeholder {\n direction: rtl;\n text-align: left;\n }\n\n :host([dir="rtl"]) [part="value"]:-ms-input-placeholder,\n :host([dir="rtl"]) [part="input-field"] ::slotted(input):-ms-input-placeholder {\n direction: rtl;\n text-align: left;\n }\n </style>\n </template>\n</dom-module>',document.head.appendChild(C.content);class E extends p{static get is(){return"vaadin-date-picker-text-field"}}customElements.define(E.is,E);
436
+ const C=document.createElement("template");C.innerHTML='<dom-module id="vaadin-date-picker-text-field-styles" theme-for="vaadin-date-picker-text-field">\n <template>\n <style>\n :host([dir="rtl"]) [part="input-field"] {\n direction: ltr;\n }\n\n :host([dir="rtl"]) [part="value"]::placeholder {\n direction: rtl;\n text-align: left;\n }\n\n :host([dir="rtl"]) [part="input-field"] ::slotted(input)::placeholder {\n direction: rtl;\n text-align: left;\n }\n\n :host([dir="rtl"]) [part="value"]:-ms-input-placeholder,\n :host([dir="rtl"]) [part="input-field"] ::slotted(input):-ms-input-placeholder {\n direction: rtl;\n text-align: left;\n }\n </style>\n </template>\n</dom-module>',document.head.appendChild(C.content);class E extends c{static get is(){return"vaadin-date-picker-text-field"}}customElements.define(E.is,E);
437
437
  /**
438
438
  @license
439
439
  Copyright (c) 2017 Vaadin Ltd.
440
440
  This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
441
441
  */
442
- class M extends(_(i)){static get is(){return"vaadin-date-picker-overlay"}}customElements.define(M.is,M);
442
+ class M extends(_(m)){static get is(){return"vaadin-date-picker-overlay"}}customElements.define(M.is,M);
443
443
  /**
444
444
  @license
445
445
  Copyright (c) 2017 Vaadin Ltd.
446
446
  This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
447
447
  */
448
- const I=class{static _getISOWeekNumber(e){var t=e.getDay();0===t&&(t=7);var a=4-t,i=new Date(e.getTime()+24*a*3600*1e3),s=new Date(0,0);s.setFullYear(i.getFullYear());var o=i.getTime()-s.getTime(),n=Math.round(o/864e5);return Math.floor(n/7+1)}static _getAdjustedYear(e,t,a=0,i=1){if(t>99)throw new Error("The provided year cannot have more than 2 digits.");if(t<0)throw new Error("The provided year cannot be negative.");let s=t+100*Math.floor(e.getFullYear()/100);return e<new Date(s-50,a,i)?s-=100:e>new Date(s+50,a,i)&&(s+=100),s}static _parseDate(e){var t=/^([-+]\d{1}|\d{2,4}|[-+]\d{6})-(\d{1,2})-(\d{1,2})$/.exec(e);if(t){var a=new Date(0,0);return a.setFullYear(parseInt(t[1],10)),a.setMonth(parseInt(t[2],10)-1),a.setDate(parseInt(t[3],10)),a}}static _dateEquals(e,t){return e instanceof Date&&t instanceof Date&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}static _dateAllowed(e,t,a){return(!t||e>=t)&&(!a||e<=a)}static _getClosestDate(e,t){return t.filter((e=>void 0!==e)).reduce(((t,a)=>a?t?Math.abs(e.getTime()-a.getTime())<Math.abs(t.getTime()-e.getTime())?a:t:a:t))}static _extractDateParts(e){return{day:e.getDate(),month:e.getMonth(),year:e.getFullYear()}}};
448
+ const I=class{static _getISOWeekNumber(e){var t=e.getDay();0===t&&(t=7);var a=4-t,i=new Date(e.getTime()+24*a*3600*1e3),s=new Date(0,0);s.setFullYear(i.getFullYear());var o=i.getTime()-s.getTime(),r=Math.round(o/864e5);return Math.floor(r/7+1)}static _getAdjustedYear(e,t,a=0,i=1){if(t>99)throw new Error("The provided year cannot have more than 2 digits.");if(t<0)throw new Error("The provided year cannot be negative.");let s=t+100*Math.floor(e.getFullYear()/100);return e<new Date(s-50,a,i)?s-=100:e>new Date(s+50,a,i)&&(s+=100),s}static _parseDate(e){var t=/^([-+]\d{1}|\d{2,4}|[-+]\d{6})-(\d{1,2})-(\d{1,2})$/.exec(e);if(t){var a=new Date(0,0);return a.setFullYear(parseInt(t[1],10)),a.setMonth(parseInt(t[2],10)-1),a.setDate(parseInt(t[3],10)),a}}static _dateEquals(e,t){return e instanceof Date&&t instanceof Date&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}static _dateAllowed(e,t,a){return(!t||e>=t)&&(!a||e<=a)}static _getClosestDate(e,t){return t.filter((e=>void 0!==e)).reduce(((t,a)=>a?t?Math.abs(e.getTime()-a.getTime())<Math.abs(t.getTime()-e.getTime())?a:t:a:t))}static _extractDateParts(e){return{day:e.getDate(),month:e.getMonth(),year:e.getFullYear()}}};
449
449
  /**
450
450
  @license
451
451
  Copyright (c) 2017 Vaadin Ltd.
452
452
  This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
453
- */class T extends(e(r(l))){static get template(){return n`
453
+ */class T extends(e(r(n))){static get template(){return o`
454
454
  <style>
455
455
  :host {
456
456
  display: block;
@@ -522,7 +522,7 @@ This program is available under Apache License Version 2.0, available at https:/
522
522
  Copyright (c) 2017 Vaadin Ltd.
523
523
  This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
524
524
  */
525
- class A extends l{static get template(){return n`
525
+ class A extends n{static get template(){return o`
526
526
  <style>
527
527
  :host {
528
528
  display: block;
@@ -569,13 +569,13 @@ class A extends l{static get template(){return n`
569
569
  <div class="buffer"></div>
570
570
  <div id="fullHeight"></div>
571
571
  </div>
572
- `}static get is(){return"vaadin-infinite-scroller"}static get properties(){return{bufferSize:{type:Number,value:20},_initialScroll:{value:5e5},_initialIndex:{value:0},_buffers:Array,_preventScrollEvent:Boolean,_mayHaveMomentum:Boolean,_initialized:Boolean,active:{type:Boolean,observer:"_activated"}}}ready(){super.ready(),this._buffers=Array.prototype.slice.call(this.root.querySelectorAll(".buffer")),this.$.fullHeight.style.height=2*this._initialScroll+"px";var e=this.querySelector("template");this._TemplateClass=f(e,this,{forwardHostProp:function(e,t){"index"!==e&&this._buffers.forEach((a=>{[].forEach.call(a.children,(a=>{a._itemWrapper.instance[e]=t}))}))}}),navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&(this.$.scroller.tabIndex=-1)}forceUpdate(){this._debouncerUpdateClones&&(this._buffers[0].updated=this._buffers[1].updated=!1,this._updateClones(),this._debouncerUpdateClones.cancel())}_activated(e){e&&!this._initialized&&(this._createPool(),this._initialized=!0)}_finishInit(){this._initDone||(this._buffers.forEach((e=>{[].forEach.call(e.children,(e=>this._ensureStampedInstance(e._itemWrapper)))}),this),this._buffers[0].translateY||this._reset(),this._initDone=!0)}_translateBuffer(e){var t=e?1:0;this._buffers[t].translateY=this._buffers[t?0:1].translateY+this._bufferHeight*(t?-1:1),this._buffers[t].style.transform="translate3d(0, "+this._buffers[t].translateY+"px, 0)",this._buffers[t].updated=!1,this._buffers.reverse()}_scroll(){if(this._scrollDisabled)return;var e=this.$.scroller.scrollTop;(e<this._bufferHeight||e>2*this._initialScroll-this._bufferHeight)&&(this._initialIndex=~~this.position,this._reset());const t=this.itemHeight+this.bufferOffset,a=e>this._buffers[1].translateY+t,i=e<this._buffers[0].translateY+t;(a||i)&&(this._translateBuffer(i),this._updateClones()),this._preventScrollEvent||(this.dispatchEvent(new CustomEvent("custom-scroll",{bubbles:!1,composed:!0})),this._mayHaveMomentum=!0),this._preventScrollEvent=!1,this._debouncerScrollFinish=d.debounce(this._debouncerScrollFinish,h.after(200),(()=>{var e=this.$.scroller.getBoundingClientRect();this._isVisible(this._buffers[0],e)||this._isVisible(this._buffers[1],e)||(this.position=this.position)}))}set position(e){this._preventScrollEvent=!0,e>this._firstIndex&&e<this._firstIndex+2*this.bufferSize?this.$.scroller.scrollTop=this.itemHeight*(e-this._firstIndex)+this._buffers[0].translateY:(this._initialIndex=~~e,this._reset(),this._scrollDisabled=!0,this.$.scroller.scrollTop+=e%1*this.itemHeight,this._scrollDisabled=!1),this._mayHaveMomentum&&(this.$.scroller.classList.add("notouchscroll"),this._mayHaveMomentum=!1,setTimeout((()=>{this.$.scroller.classList.remove("notouchscroll")}),10))}get bufferOffset(){return this._buffers[0].offsetTop}get position(){return(this.$.scroller.scrollTop-this._buffers[0].translateY)/this.itemHeight+this._firstIndex}get itemHeight(){if(!this._itemHeightVal){window.ShadyCSS&&window.ShadyCSS.nativeCss||this.updateStyles();const e=window.ShadyCSS?window.ShadyCSS.getComputedStyleValue(this,"--vaadin-infinite-scroller-item-height"):getComputedStyle(this).getPropertyValue("--vaadin-infinite-scroller-item-height"),t="background-position";this.$.fullHeight.style.setProperty(t,e);const a=getComputedStyle(this.$.fullHeight).getPropertyValue(t);this.$.fullHeight.style.removeProperty(t),this._itemHeightVal=parseFloat(a)}return this._itemHeightVal}get _bufferHeight(){return this.itemHeight*this.bufferSize}_reset(){this._scrollDisabled=!0,this.$.scroller.scrollTop=this._initialScroll,this._buffers[0].translateY=this._initialScroll-this._bufferHeight,this._buffers[1].translateY=this._initialScroll,this._buffers.forEach((e=>{e.style.transform="translate3d(0, "+e.translateY+"px, 0)"})),this._buffers[0].updated=this._buffers[1].updated=!1,this._updateClones(!0),this._debouncerUpdateClones=d.debounce(this._debouncerUpdateClones,h.after(200),(()=>{this._buffers[0].updated=this._buffers[1].updated=!1,this._updateClones()})),this._scrollDisabled=!1}_createPool(){var e=this.getBoundingClientRect();this._buffers.forEach((t=>{for(var a=0;a<this.bufferSize;a++){const a=document.createElement("div");a.style.height=this.itemHeight+"px",a.instance={};const i="vaadin-infinite-scroller-item-content-"+(A._contentIndex=A._contentIndex+1||0),s=document.createElement("slot");s.setAttribute("name",i),s._itemWrapper=a,t.appendChild(s),a.setAttribute("slot",i),this.appendChild(a),v(),setTimeout((()=>{this._isVisible(a,e)&&this._ensureStampedInstance(a)}),1)}}),this),setTimeout((()=>{y(this,this._finishInit.bind(this))}),1)}_ensureStampedInstance(e){if(!e.firstElementChild){var t=e.instance;e.instance=new this._TemplateClass({}),e.appendChild(e.instance.root),Object.keys(t).forEach((a=>{e.instance.set(a,t[a])}))}}_updateClones(e){this._firstIndex=~~((this._buffers[0].translateY-this._initialScroll)/this.itemHeight)+this._initialIndex;var t=e?this.$.scroller.getBoundingClientRect():void 0;this._buffers.forEach(((a,i)=>{if(!a.updated){var s=this._firstIndex+this.bufferSize*i;[].forEach.call(a.children,((a,i)=>{const o=a._itemWrapper;e&&!this._isVisible(o,t)||(o.instance.index=s+i)})),a.updated=!0}}),this)}_isVisible(e,t){var a=e.getBoundingClientRect();return a.bottom>t.top&&a.top<t.bottom}}customElements.define(A.is,A);const O=document.createElement("template");O.innerHTML='<dom-module id="vaadin-date-picker-overlay-styles" theme-for="vaadin-date-picker-overlay">\n <template>\n <style>\n :host {\n align-items: flex-start;\n justify-content: flex-start;\n }\n\n :host([bottom-aligned]) {\n justify-content: flex-end;\n }\n\n :host([right-aligned]) {\n align-items: flex-end;\n }\n\n :host([dir="rtl"]) {\n align-items: flex-end;\n }\n\n :host([dir="rtl"][right-aligned]) {\n align-items: flex-start;\n }\n\n [part="overlay"] {\n display: flex;\n flex: auto;\n }\n\n [part~="content"] {\n flex: auto;\n }\n </style>\n </template>\n</dom-module>',document.head.appendChild(O.content);
572
+ `}static get is(){return"vaadin-infinite-scroller"}static get properties(){return{bufferSize:{type:Number,value:20},_initialScroll:{value:5e5},_initialIndex:{value:0},_buffers:Array,_preventScrollEvent:Boolean,_mayHaveMomentum:Boolean,_initialized:Boolean,active:{type:Boolean,observer:"_activated"}}}ready(){super.ready(),this._buffers=Array.prototype.slice.call(this.root.querySelectorAll(".buffer")),this.$.fullHeight.style.height=2*this._initialScroll+"px";var e=this.querySelector("template");this._TemplateClass=f(e,this,{forwardHostProp:function(e,t){"index"!==e&&this._buffers.forEach((a=>{[].forEach.call(a.children,(a=>{a._itemWrapper.instance[e]=t}))}))}}),navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&(this.$.scroller.tabIndex=-1)}forceUpdate(){this._debouncerUpdateClones&&(this._buffers[0].updated=this._buffers[1].updated=!1,this._updateClones(),this._debouncerUpdateClones.cancel())}_activated(e){e&&!this._initialized&&(this._createPool(),this._initialized=!0)}_finishInit(){this._initDone||(this._buffers.forEach((e=>{[].forEach.call(e.children,(e=>this._ensureStampedInstance(e._itemWrapper)))}),this),this._buffers[0].translateY||this._reset(),this._initDone=!0)}_translateBuffer(e){var t=e?1:0;this._buffers[t].translateY=this._buffers[t?0:1].translateY+this._bufferHeight*(t?-1:1),this._buffers[t].style.transform="translate3d(0, "+this._buffers[t].translateY+"px, 0)",this._buffers[t].updated=!1,this._buffers.reverse()}_scroll(){if(this._scrollDisabled)return;var e=this.$.scroller.scrollTop;(e<this._bufferHeight||e>2*this._initialScroll-this._bufferHeight)&&(this._initialIndex=~~this.position,this._reset());const t=this.itemHeight+this.bufferOffset,a=e>this._buffers[1].translateY+t,i=e<this._buffers[0].translateY+t;(a||i)&&(this._translateBuffer(i),this._updateClones()),this._preventScrollEvent||(this.dispatchEvent(new CustomEvent("custom-scroll",{bubbles:!1,composed:!0})),this._mayHaveMomentum=!0),this._preventScrollEvent=!1,this._debouncerScrollFinish=l.debounce(this._debouncerScrollFinish,h.after(200),(()=>{var e=this.$.scroller.getBoundingClientRect();this._isVisible(this._buffers[0],e)||this._isVisible(this._buffers[1],e)||(this.position=this.position)}))}set position(e){this._preventScrollEvent=!0,e>this._firstIndex&&e<this._firstIndex+2*this.bufferSize?this.$.scroller.scrollTop=this.itemHeight*(e-this._firstIndex)+this._buffers[0].translateY:(this._initialIndex=~~e,this._reset(),this._scrollDisabled=!0,this.$.scroller.scrollTop+=e%1*this.itemHeight,this._scrollDisabled=!1),this._mayHaveMomentum&&(this.$.scroller.classList.add("notouchscroll"),this._mayHaveMomentum=!1,setTimeout((()=>{this.$.scroller.classList.remove("notouchscroll")}),10))}get bufferOffset(){return this._buffers[0].offsetTop}get position(){return(this.$.scroller.scrollTop-this._buffers[0].translateY)/this.itemHeight+this._firstIndex}get itemHeight(){if(!this._itemHeightVal){window.ShadyCSS&&window.ShadyCSS.nativeCss||this.updateStyles();const e=window.ShadyCSS?window.ShadyCSS.getComputedStyleValue(this,"--vaadin-infinite-scroller-item-height"):getComputedStyle(this).getPropertyValue("--vaadin-infinite-scroller-item-height"),t="background-position";this.$.fullHeight.style.setProperty(t,e);const a=getComputedStyle(this.$.fullHeight).getPropertyValue(t);this.$.fullHeight.style.removeProperty(t),this._itemHeightVal=parseFloat(a)}return this._itemHeightVal}get _bufferHeight(){return this.itemHeight*this.bufferSize}_reset(){this._scrollDisabled=!0,this.$.scroller.scrollTop=this._initialScroll,this._buffers[0].translateY=this._initialScroll-this._bufferHeight,this._buffers[1].translateY=this._initialScroll,this._buffers.forEach((e=>{e.style.transform="translate3d(0, "+e.translateY+"px, 0)"})),this._buffers[0].updated=this._buffers[1].updated=!1,this._updateClones(!0),this._debouncerUpdateClones=l.debounce(this._debouncerUpdateClones,h.after(200),(()=>{this._buffers[0].updated=this._buffers[1].updated=!1,this._updateClones()})),this._scrollDisabled=!1}_createPool(){var e=this.getBoundingClientRect();this._buffers.forEach((t=>{for(var a=0;a<this.bufferSize;a++){const a=document.createElement("div");a.style.height=this.itemHeight+"px",a.instance={};const i="vaadin-infinite-scroller-item-content-"+(A._contentIndex=A._contentIndex+1||0),s=document.createElement("slot");s.setAttribute("name",i),s._itemWrapper=a,t.appendChild(s),a.setAttribute("slot",i),this.appendChild(a),v(),setTimeout((()=>{this._isVisible(a,e)&&this._ensureStampedInstance(a)}),1)}}),this),setTimeout((()=>{y(this,this._finishInit.bind(this))}),1)}_ensureStampedInstance(e){if(!e.firstElementChild){var t=e.instance;e.instance=new this._TemplateClass({}),e.appendChild(e.instance.root),Object.keys(t).forEach((a=>{e.instance.set(a,t[a])}))}}_updateClones(e){this._firstIndex=~~((this._buffers[0].translateY-this._initialScroll)/this.itemHeight)+this._initialIndex;var t=e?this.$.scroller.getBoundingClientRect():void 0;this._buffers.forEach(((a,i)=>{if(!a.updated){var s=this._firstIndex+this.bufferSize*i;[].forEach.call(a.children,((a,i)=>{const o=a._itemWrapper;e&&!this._isVisible(o,t)||(o.instance.index=s+i)})),a.updated=!0}}),this)}_isVisible(e,t){var a=e.getBoundingClientRect();return a.bottom>t.top&&a.top<t.bottom}}customElements.define(A.is,A);const O=document.createElement("template");O.innerHTML='<dom-module id="vaadin-date-picker-overlay-styles" theme-for="vaadin-date-picker-overlay">\n <template>\n <style>\n :host {\n align-items: flex-start;\n justify-content: flex-start;\n }\n\n :host([bottom-aligned]) {\n justify-content: flex-end;\n }\n\n :host([right-aligned]) {\n align-items: flex-end;\n }\n\n :host([dir="rtl"]) {\n align-items: flex-end;\n }\n\n :host([dir="rtl"][right-aligned]) {\n align-items: flex-start;\n }\n\n [part="overlay"] {\n display: flex;\n flex: auto;\n }\n\n [part~="content"] {\n flex: auto;\n }\n </style>\n </template>\n</dom-module>',document.head.appendChild(O.content);
573
573
  /**
574
574
  @license
575
575
  Copyright (c) 2017 Vaadin Ltd.
576
576
  This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
577
577
  */
578
- class $ extends(e(t(r(l)))){static get template(){return n`
578
+ class $ extends(e(t(r(n)))){static get template(){return o`
579
579
  <style>
580
580
  :host {
581
581
  display: flex;
@@ -754,18 +754,18 @@ class $ extends(e(t(r(l)))){static get template(){return n`
754
754
  </div>
755
755
 
756
756
  <iron-media-query query="(min-width: 375px)" query-matches="{{_desktopMode}}"></iron-media-query>
757
- `}static get is(){return"vaadin-date-picker-overlay-content"}static get properties(){return{selectedDate:{type:Date,notify:!0},focusedDate:{type:Date,notify:!0,observer:"_focusedDateChanged"},_focusedMonthDate:Number,initialPosition:{type:Date,observer:"_initialPositionChanged"},_originDate:{value:new Date},_visibleMonthIndex:Number,_desktopMode:Boolean,_translateX:{observer:"_translateXChanged"},_yearScrollerWidth:{value:50},i18n:{type:Object},showWeekNumbers:{type:Boolean},_ignoreTaps:Boolean,_notTapping:Boolean,minDate:Date,maxDate:Date,_focused:Boolean,label:String}}get __isRTL(){return"rtl"===this.getAttribute("dir")}get __useSubMonthScrolling(){return this.$.monthScroller.clientHeight<this.$.monthScroller.itemHeight+this.$.monthScroller.bufferOffset}ready(){super.ready(),this.setAttribute("tabindex",0),this.addEventListener("keydown",this._onKeydown.bind(this)),u(this,"tap",this._stopPropagation),this.addEventListener("focus",this._onOverlayFocus.bind(this)),this.addEventListener("blur",this._onOverlayBlur.bind(this))}connectedCallback(){super.connectedCallback(),this._closeYearScroller(),this._toggleAnimateClass(!0),c(this.$.scrollers,"pan-y"),s.requestAvailability()}announceFocusedDate(){var e=this._currentlyFocusedDate(),t=[];I._dateEquals(e,new Date)&&t.push(this.i18n.today),t=t.concat([this.i18n.weekdays[e.getDay()],e.getDate(),this.i18n.monthNames[e.getMonth()],e.getFullYear()]),this.showWeekNumbers&&1===this.i18n.firstDayOfWeek&&(t.push(this.i18n.week),t.push(I._getISOWeekNumber(e))),this.dispatchEvent(new CustomEvent("iron-announce",{bubbles:!0,composed:!0,detail:{text:t.join(" ")}}))}focusCancel(){this.$.cancelButton.focus()}scrollToDate(e,t){const a=this.__useSubMonthScrolling?this._calculateWeekScrollOffset(e):0;this._scrollToPosition(this._differenceInMonths(e,this._originDate)+a,t),this.$.monthScroller.forceUpdate()}_focusedDateChanged(e){this.revealDate(e)}_isCurrentYear(e){return 0===e}_isSelectedYear(e,t){if(t)return t.getFullYear()===this._originDate.getFullYear()+e}revealDate(e,t=!0){if(!e)return;const a=this._differenceInMonths(e,this._originDate);if(this.__useSubMonthScrolling){const i=this._calculateWeekScrollOffset(e);return void this._scrollToPosition(a+i,t)}const i=this.$.monthScroller.position>a,s=Math.max(this.$.monthScroller.itemHeight,this.$.monthScroller.clientHeight-2*this.$.monthScroller.bufferOffset)/this.$.monthScroller.itemHeight,o=this.$.monthScroller.position+s-1<a;i?this._scrollToPosition(a,t):o&&this._scrollToPosition(a-s+1,t)}_calculateWeekScrollOffset(e){const t=new Date(0,0);t.setFullYear(e.getFullYear()),t.setMonth(e.getMonth()),t.setDate(1);let a=0;for(;t.getDate()<e.getDate();)t.setDate(t.getDate()+1),t.getDay()===this.i18n.firstDayOfWeek&&(a+=1);return a/6}_onOverlayFocus(){this._focused=!0}_onOverlayBlur(){this._focused=!1}_initialPositionChanged(e){this.scrollToDate(e)}_repositionYearScroller(){this._visibleMonthIndex=Math.floor(this.$.monthScroller.position),this.$.yearScroller.position=(this.$.monthScroller.position+this._originDate.getMonth())/12}_repositionMonthScroller(){this.$.monthScroller.position=12*this.$.yearScroller.position-this._originDate.getMonth(),this._visibleMonthIndex=Math.floor(this.$.monthScroller.position)}_onMonthScroll(){this._repositionYearScroller(),this._doIgnoreTaps()}_onYearScroll(){this._repositionMonthScroller(),this._doIgnoreTaps()}_onYearScrollTouchStart(){this._notTapping=!1,setTimeout((()=>this._notTapping=!0),300),this._repositionMonthScroller()}_onMonthScrollTouchStart(){this._repositionYearScroller()}_doIgnoreTaps(){this._ignoreTaps=!0,this._debouncer=d.debounce(this._debouncer,h.after(300),(()=>this._ignoreTaps=!1))}_formatDisplayed(e,t,a){return e?t(I._extractDateParts(e)):a}_onTodayTap(){var e=new Date;Math.abs(this.$.monthScroller.position-this._differenceInMonths(e,this._originDate))<.001?(this.selectedDate=e,this._close()):this._scrollToCurrentMonth()}_scrollToCurrentMonth(){this.focusedDate&&(this.focusedDate=new Date),this.scrollToDate(new Date,!0)}_showClear(e){return!!e}_onYearTap(e){if(!this._ignoreTaps&&!this._notTapping){var t=(e.detail.y-(this.$.yearScroller.getBoundingClientRect().top+this.$.yearScroller.clientHeight/2))/this.$.yearScroller.itemHeight;this._scrollToPosition(this.$.monthScroller.position+12*t,!0)}}_scrollToPosition(e,t){if(void 0===this._targetPosition){if(!t)return this.$.monthScroller.position=e,this._targetPosition=void 0,void this._repositionYearScroller();this._targetPosition=e;var a=t?300:0,i=0,s=this.$.monthScroller.position,o=e=>{var t,n,r,l=e-(i=i||e);if(l<a){var d=(t=l,n=s,r=this._targetPosition-s,(t/=a/2)<1?r/2*t*t+n:-r/2*(--t*(t-2)-1)+n);this.$.monthScroller.position=d,window.requestAnimationFrame(o)}else this.dispatchEvent(new CustomEvent("scroll-animation-finished",{bubbles:!0,composed:!0,detail:{position:this._targetPosition,oldPosition:s}})),this.$.monthScroller.position=this._targetPosition,this._targetPosition=void 0;setTimeout(this._repositionYearScroller.bind(this),1)};window.requestAnimationFrame(o)}else this._targetPosition=e}_limit(e,t){return Math.min(t.max,Math.max(t.min,e))}_handleTrack(e){if(!(Math.abs(e.detail.dx)<10||Math.abs(e.detail.ddy)>10)){Math.abs(e.detail.ddx)>this._yearScrollerWidth/3&&this._toggleAnimateClass(!0);var t=this._translateX+e.detail.ddx;this._translateX=this._limit(t,{min:0,max:this._yearScrollerWidth})}}_track(e){if(!this._desktopMode)switch(e.detail.state){case"start":this._toggleAnimateClass(!1);break;case"track":this._handleTrack(e);break;case"end":this._toggleAnimateClass(!0),this._translateX>=this._yearScrollerWidth/2?this._closeYearScroller():this._openYearScroller()}}_toggleAnimateClass(e){e?this.classList.add("animate"):this.classList.remove("animate")}_toggleYearScroller(){this._isYearScrollerVisible()?this._closeYearScroller():this._openYearScroller()}_openYearScroller(){this._translateX=0,this.setAttribute("years-visible","")}_closeYearScroller(){this.removeAttribute("years-visible"),this._translateX=this._yearScrollerWidth}_isYearScrollerVisible(){return this._translateX<this._yearScrollerWidth/2}_translateXChanged(e){this._desktopMode||(this.$.monthScroller.style.transform="translateX("+(e-this._yearScrollerWidth)+"px)",this.$.yearScroller.style.transform="translateX("+e+"px)")}_yearAfterXYears(e){var t=new Date(this._originDate);return t.setFullYear(parseInt(e)+this._originDate.getFullYear()),t.getFullYear()}_yearAfterXMonths(e){return this._dateAfterXMonths(e).getFullYear()}_dateAfterXMonths(e){var t=new Date(this._originDate);return t.setDate(1),t.setMonth(parseInt(e)+this._originDate.getMonth()),t}_differenceInMonths(e,t){return 12*(e.getFullYear()-t.getFullYear())-t.getMonth()+e.getMonth()}_differenceInYears(e,t){return this._differenceInMonths(e,t)/12}_clear(){this.selectedDate=""}_close(){const e=this.getRootNode().host,t=e?e.getRootNode().host:null;t&&(t.opened=!1),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}_cancel(){this.focusedDate=this.selectedDate,this._close()}_preventDefault(e){e.preventDefault()}_eventKey(e){for(var t=["down","up","right","left","enter","space","home","end","pageup","pagedown","tab","esc"],a=0;a<t.length;a++){var i=t[a];if(o.keyboardEventMatchesKeys(e,i))return i}}_onKeydown(e){var t=this._currentlyFocusedDate();const a=e.composedPath().indexOf(this.$.todayButton)>=0,i=e.composedPath().indexOf(this.$.cancelButton)>=0,s=!a&&!i;var o=this._eventKey(e);if("tab"===o){e.stopPropagation();const t=this.hasAttribute("fullscreen"),o=e.shiftKey;t?e.preventDefault():o&&s||!o&&i?(e.preventDefault(),this.dispatchEvent(new CustomEvent("focus-input",{bubbles:!0,composed:!0}))):o&&a?(this._focused=!0,setTimeout((()=>this.revealDate(this.focusedDate)),1)):this._focused=!1}else if(o)switch(e.preventDefault(),e.stopPropagation(),o){case"down":this._moveFocusByDays(7),this.focus();break;case"up":this._moveFocusByDays(-7),this.focus();break;case"right":s&&this._moveFocusByDays(this.__isRTL?-1:1);break;case"left":s&&this._moveFocusByDays(this.__isRTL?1:-1);break;case"enter":s||i?this._close():a&&this._onTodayTap();break;case"space":if(i)this._close();else if(a)this._onTodayTap();else{var n=this.focusedDate;I._dateEquals(n,this.selectedDate)?(this.selectedDate="",this.focusedDate=n):this.selectedDate=n}break;case"home":this._moveFocusInsideMonth(t,"minDate");break;case"end":this._moveFocusInsideMonth(t,"maxDate");break;case"pagedown":this._moveFocusByMonths(e.shiftKey?12:1);break;case"pageup":this._moveFocusByMonths(e.shiftKey?-12:-1);break;case"esc":this._cancel()}}_currentlyFocusedDate(){return this.focusedDate||this.selectedDate||this.initialPosition||new Date}_focusDate(e){this.focusedDate=e,this._focusedMonthDate=e.getDate()}_focusClosestDate(e){this._focusDate(I._getClosestDate(e,[this.minDate,this.maxDate]))}_moveFocusByDays(e){var t=this._currentlyFocusedDate(),a=new Date(0,0);a.setFullYear(t.getFullYear()),a.setMonth(t.getMonth()),a.setDate(t.getDate()+e),this._dateAllowed(a,this.minDate,this.maxDate)?this._focusDate(a):this._dateAllowed(t,this.minDate,this.maxDate)?e>0?this._focusDate(this.maxDate):this._focusDate(this.minDate):this._focusClosestDate(t)}_moveFocusByMonths(e){var t=this._currentlyFocusedDate(),a=new Date(0,0);a.setFullYear(t.getFullYear()),a.setMonth(t.getMonth()+e);var i=a.getMonth();a.setDate(this._focusedMonthDate||(this._focusedMonthDate=t.getDate())),a.getMonth()!==i&&a.setDate(0),this._dateAllowed(a,this.minDate,this.maxDate)?this.focusedDate=a:this._dateAllowed(t,this.minDate,this.maxDate)?e>0?this._focusDate(this.maxDate):this._focusDate(this.minDate):this._focusClosestDate(t)}_moveFocusInsideMonth(e,t){var a=new Date(0,0);a.setFullYear(e.getFullYear()),"minDate"===t?(a.setMonth(e.getMonth()),a.setDate(1)):(a.setMonth(e.getMonth()+1),a.setDate(0)),this._dateAllowed(a,this.minDate,this.maxDate)?this._focusDate(a):this._dateAllowed(e,this.minDate,this.maxDate)?this._focusDate(this[t]):this._focusClosestDate(e)}_dateAllowed(e,t,a){return(!t||e>=t)&&(!a||e<=a)}_isTodayAllowed(e,t){var a=new Date,i=new Date(0,0);return i.setFullYear(a.getFullYear()),i.setMonth(a.getMonth()),i.setDate(a.getDate()),this._dateAllowed(i,e,t)}_stopPropagation(e){e.stopPropagation()}}customElements.define($.is,$);
757
+ `}static get is(){return"vaadin-date-picker-overlay-content"}static get properties(){return{selectedDate:{type:Date,notify:!0},focusedDate:{type:Date,notify:!0,observer:"_focusedDateChanged"},_focusedMonthDate:Number,initialPosition:{type:Date,observer:"_initialPositionChanged"},_originDate:{value:new Date},_visibleMonthIndex:Number,_desktopMode:Boolean,_translateX:{observer:"_translateXChanged"},_yearScrollerWidth:{value:50},i18n:{type:Object},showWeekNumbers:{type:Boolean},_ignoreTaps:Boolean,_notTapping:Boolean,minDate:Date,maxDate:Date,_focused:Boolean,label:String}}get __isRTL(){return"rtl"===this.getAttribute("dir")}get __useSubMonthScrolling(){return this.$.monthScroller.clientHeight<this.$.monthScroller.itemHeight+this.$.monthScroller.bufferOffset}ready(){super.ready(),this.setAttribute("tabindex",0),this.addEventListener("keydown",this._onKeydown.bind(this)),d(this,"tap",this._stopPropagation),this.addEventListener("focus",this._onOverlayFocus.bind(this)),this.addEventListener("blur",this._onOverlayBlur.bind(this))}connectedCallback(){super.connectedCallback(),this._closeYearScroller(),this._toggleAnimateClass(!0),u(this.$.scrollers,"pan-y"),i.requestAvailability()}announceFocusedDate(){var e=this._currentlyFocusedDate(),t=[];I._dateEquals(e,new Date)&&t.push(this.i18n.today),t=t.concat([this.i18n.weekdays[e.getDay()],e.getDate(),this.i18n.monthNames[e.getMonth()],e.getFullYear()]),this.showWeekNumbers&&1===this.i18n.firstDayOfWeek&&(t.push(this.i18n.week),t.push(I._getISOWeekNumber(e))),this.dispatchEvent(new CustomEvent("iron-announce",{bubbles:!0,composed:!0,detail:{text:t.join(" ")}}))}focusCancel(){this.$.cancelButton.focus()}scrollToDate(e,t){const a=this.__useSubMonthScrolling?this._calculateWeekScrollOffset(e):0;this._scrollToPosition(this._differenceInMonths(e,this._originDate)+a,t),this.$.monthScroller.forceUpdate()}_focusedDateChanged(e){this.revealDate(e)}_isCurrentYear(e){return 0===e}_isSelectedYear(e,t){if(t)return t.getFullYear()===this._originDate.getFullYear()+e}revealDate(e,t=!0){if(!e)return;const a=this._differenceInMonths(e,this._originDate);if(this.__useSubMonthScrolling){const i=this._calculateWeekScrollOffset(e);return void this._scrollToPosition(a+i,t)}const i=this.$.monthScroller.position>a,s=Math.max(this.$.monthScroller.itemHeight,this.$.monthScroller.clientHeight-2*this.$.monthScroller.bufferOffset)/this.$.monthScroller.itemHeight,o=this.$.monthScroller.position+s-1<a;i?this._scrollToPosition(a,t):o&&this._scrollToPosition(a-s+1,t)}_calculateWeekScrollOffset(e){const t=new Date(0,0);t.setFullYear(e.getFullYear()),t.setMonth(e.getMonth()),t.setDate(1);let a=0;for(;t.getDate()<e.getDate();)t.setDate(t.getDate()+1),t.getDay()===this.i18n.firstDayOfWeek&&(a+=1);return a/6}_onOverlayFocus(){this._focused=!0}_onOverlayBlur(){this._focused=!1}_initialPositionChanged(e){this.scrollToDate(e)}_repositionYearScroller(){this._visibleMonthIndex=Math.floor(this.$.monthScroller.position),this.$.yearScroller.position=(this.$.monthScroller.position+this._originDate.getMonth())/12}_repositionMonthScroller(){this.$.monthScroller.position=12*this.$.yearScroller.position-this._originDate.getMonth(),this._visibleMonthIndex=Math.floor(this.$.monthScroller.position)}_onMonthScroll(){this._repositionYearScroller(),this._doIgnoreTaps()}_onYearScroll(){this._repositionMonthScroller(),this._doIgnoreTaps()}_onYearScrollTouchStart(){this._notTapping=!1,setTimeout((()=>this._notTapping=!0),300),this._repositionMonthScroller()}_onMonthScrollTouchStart(){this._repositionYearScroller()}_doIgnoreTaps(){this._ignoreTaps=!0,this._debouncer=l.debounce(this._debouncer,h.after(300),(()=>this._ignoreTaps=!1))}_formatDisplayed(e,t,a){return e?t(I._extractDateParts(e)):a}_onTodayTap(){var e=new Date;Math.abs(this.$.monthScroller.position-this._differenceInMonths(e,this._originDate))<.001?(this.selectedDate=e,this._close()):this._scrollToCurrentMonth()}_scrollToCurrentMonth(){this.focusedDate&&(this.focusedDate=new Date),this.scrollToDate(new Date,!0)}_showClear(e){return!!e}_onYearTap(e){if(!this._ignoreTaps&&!this._notTapping){var t=(e.detail.y-(this.$.yearScroller.getBoundingClientRect().top+this.$.yearScroller.clientHeight/2))/this.$.yearScroller.itemHeight;this._scrollToPosition(this.$.monthScroller.position+12*t,!0)}}_scrollToPosition(e,t){if(void 0===this._targetPosition){if(!t)return this.$.monthScroller.position=e,this._targetPosition=void 0,void this._repositionYearScroller();this._targetPosition=e;var a=t?300:0,i=0,s=this.$.monthScroller.position,o=e=>{var t,r,n,l=e-(i=i||e);if(l<a){var h=(t=l,r=s,n=this._targetPosition-s,(t/=a/2)<1?n/2*t*t+r:-n/2*(--t*(t-2)-1)+r);this.$.monthScroller.position=h,window.requestAnimationFrame(o)}else this.dispatchEvent(new CustomEvent("scroll-animation-finished",{bubbles:!0,composed:!0,detail:{position:this._targetPosition,oldPosition:s}})),this.$.monthScroller.position=this._targetPosition,this._targetPosition=void 0;setTimeout(this._repositionYearScroller.bind(this),1)};window.requestAnimationFrame(o)}else this._targetPosition=e}_limit(e,t){return Math.min(t.max,Math.max(t.min,e))}_handleTrack(e){if(!(Math.abs(e.detail.dx)<10||Math.abs(e.detail.ddy)>10)){Math.abs(e.detail.ddx)>this._yearScrollerWidth/3&&this._toggleAnimateClass(!0);var t=this._translateX+e.detail.ddx;this._translateX=this._limit(t,{min:0,max:this._yearScrollerWidth})}}_track(e){if(!this._desktopMode)switch(e.detail.state){case"start":this._toggleAnimateClass(!1);break;case"track":this._handleTrack(e);break;case"end":this._toggleAnimateClass(!0),this._translateX>=this._yearScrollerWidth/2?this._closeYearScroller():this._openYearScroller()}}_toggleAnimateClass(e){e?this.classList.add("animate"):this.classList.remove("animate")}_toggleYearScroller(){this._isYearScrollerVisible()?this._closeYearScroller():this._openYearScroller()}_openYearScroller(){this._translateX=0,this.setAttribute("years-visible","")}_closeYearScroller(){this.removeAttribute("years-visible"),this._translateX=this._yearScrollerWidth}_isYearScrollerVisible(){return this._translateX<this._yearScrollerWidth/2}_translateXChanged(e){this._desktopMode||(this.$.monthScroller.style.transform="translateX("+(e-this._yearScrollerWidth)+"px)",this.$.yearScroller.style.transform="translateX("+e+"px)")}_yearAfterXYears(e){var t=new Date(this._originDate);return t.setFullYear(parseInt(e)+this._originDate.getFullYear()),t.getFullYear()}_yearAfterXMonths(e){return this._dateAfterXMonths(e).getFullYear()}_dateAfterXMonths(e){var t=new Date(this._originDate);return t.setDate(1),t.setMonth(parseInt(e)+this._originDate.getMonth()),t}_differenceInMonths(e,t){return 12*(e.getFullYear()-t.getFullYear())-t.getMonth()+e.getMonth()}_differenceInYears(e,t){return this._differenceInMonths(e,t)/12}_clear(){this.selectedDate=""}_close(){const e=this.getRootNode().host,t=e?e.getRootNode().host:null;t&&(t.opened=!1),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}_cancel(){this.focusedDate=this.selectedDate,this._close()}_preventDefault(e){e.preventDefault()}_eventKey(e){for(var t=["down","up","right","left","enter","space","home","end","pageup","pagedown","tab","esc"],a=0;a<t.length;a++){var i=t[a];if(s.keyboardEventMatchesKeys(e,i))return i}}_onKeydown(e){var t=this._currentlyFocusedDate();const a=e.composedPath().indexOf(this.$.todayButton)>=0,i=e.composedPath().indexOf(this.$.cancelButton)>=0,s=!a&&!i;var o=this._eventKey(e);if("tab"===o){e.stopPropagation();const t=this.hasAttribute("fullscreen"),o=e.shiftKey;t?e.preventDefault():o&&s||!o&&i?(e.preventDefault(),this.dispatchEvent(new CustomEvent("focus-input",{bubbles:!0,composed:!0}))):o&&a?(this._focused=!0,setTimeout((()=>this.revealDate(this.focusedDate)),1)):this._focused=!1}else if(o)switch(e.preventDefault(),e.stopPropagation(),o){case"down":this._moveFocusByDays(7),this.focus();break;case"up":this._moveFocusByDays(-7),this.focus();break;case"right":s&&this._moveFocusByDays(this.__isRTL?-1:1);break;case"left":s&&this._moveFocusByDays(this.__isRTL?1:-1);break;case"enter":s||i?this._close():a&&this._onTodayTap();break;case"space":if(i)this._close();else if(a)this._onTodayTap();else{var r=this.focusedDate;I._dateEquals(r,this.selectedDate)?(this.selectedDate="",this.focusedDate=r):this.selectedDate=r}break;case"home":this._moveFocusInsideMonth(t,"minDate");break;case"end":this._moveFocusInsideMonth(t,"maxDate");break;case"pagedown":this._moveFocusByMonths(e.shiftKey?12:1);break;case"pageup":this._moveFocusByMonths(e.shiftKey?-12:-1);break;case"esc":this._cancel()}}_currentlyFocusedDate(){return this.focusedDate||this.selectedDate||this.initialPosition||new Date}_focusDate(e){this.focusedDate=e,this._focusedMonthDate=e.getDate()}_focusClosestDate(e){this._focusDate(I._getClosestDate(e,[this.minDate,this.maxDate]))}_moveFocusByDays(e){var t=this._currentlyFocusedDate(),a=new Date(0,0);a.setFullYear(t.getFullYear()),a.setMonth(t.getMonth()),a.setDate(t.getDate()+e),this._dateAllowed(a,this.minDate,this.maxDate)?this._focusDate(a):this._dateAllowed(t,this.minDate,this.maxDate)?e>0?this._focusDate(this.maxDate):this._focusDate(this.minDate):this._focusClosestDate(t)}_moveFocusByMonths(e){var t=this._currentlyFocusedDate(),a=new Date(0,0);a.setFullYear(t.getFullYear()),a.setMonth(t.getMonth()+e);var i=a.getMonth();a.setDate(this._focusedMonthDate||(this._focusedMonthDate=t.getDate())),a.getMonth()!==i&&a.setDate(0),this._dateAllowed(a,this.minDate,this.maxDate)?this.focusedDate=a:this._dateAllowed(t,this.minDate,this.maxDate)?e>0?this._focusDate(this.maxDate):this._focusDate(this.minDate):this._focusClosestDate(t)}_moveFocusInsideMonth(e,t){var a=new Date(0,0);a.setFullYear(e.getFullYear()),"minDate"===t?(a.setMonth(e.getMonth()),a.setDate(1)):(a.setMonth(e.getMonth()+1),a.setDate(0)),this._dateAllowed(a,this.minDate,this.maxDate)?this._focusDate(a):this._dateAllowed(e,this.minDate,this.maxDate)?this._focusDate(this[t]):this._focusClosestDate(e)}_dateAllowed(e,t,a){return(!t||e>=t)&&(!a||e<=a)}_isTodayAllowed(e,t){var a=new Date,i=new Date(0,0);return i.setFullYear(a.getFullYear()),i.setMonth(a.getMonth()),i.setDate(a.getDate()),this._dateAllowed(i,e,t)}_stopPropagation(e){e.stopPropagation()}}customElements.define($.is,$);
758
758
  /**
759
759
  @license
760
760
  Copyright (c) 2017 Vaadin Ltd.
761
761
  This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
762
762
  */
763
- const F=e=>class extends(g([b],e)){static get properties(){return{_selectedDate:{type:Date},_focusedDate:Date,value:{type:String,observer:"_valueChanged",notify:!0,value:""},required:{type:Boolean,value:!1},name:{type:String},initialPosition:String,label:String,opened:{type:Boolean,reflectToAttribute:!0,notify:!0,observer:"_openedChanged"},autoOpenDisabled:Boolean,showWeekNumbers:{type:Boolean},_fullscreen:{value:!1,observer:"_fullscreenChanged"},_fullscreenMediaQuery:{value:"(max-width: 420px), (max-height: 420px)"},_touchPrevented:Array,i18n:{type:Object,value:()=>({monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],firstDayOfWeek:0,week:"Week",calendar:"Calendar",clear:"Clear",today:"Today",cancel:"Cancel",referenceDate:"",formatDate:e=>{const t=String(e.year).replace(/\d+/,(e=>"0000".substr(e.length)+e));return[e.month+1,e.day,t].join("/")},parseDate(e){const t=e.split("/"),a=new Date;let i,s=a.getMonth(),o=a.getFullYear();if(3===t.length){if(s=parseInt(t[0])-1,i=parseInt(t[1]),o=parseInt(t[2]),t[2].length<3&&o>=0){const e=this.referenceDate?I._parseDate(this.referenceDate):new Date;o=I._getAdjustedYear(e,o,s,i)}}else 2===t.length?(s=parseInt(t[0])-1,i=parseInt(t[1])):1===t.length&&(i=parseInt(t[0]));if(void 0!==i)return{day:i,month:s,year:o}},formatTitle:(e,t)=>`${e} ${t}`})},min:{type:String,observer:"_minChanged"},max:{type:String,observer:"_maxChanged"},_minDate:{type:Date,value:""},_maxDate:{type:Date,value:""},_noInput:{type:Boolean,computed:"_isNoInput(_fullscreen, _ios, i18n, i18n.*, opened, autoOpenDisabled)"},_hasInputValue:{type:Boolean,value:!1,observer:"_hasInputValueChanged"},_ios:{type:Boolean,value:navigator.userAgent.match(/iP(?:hone|ad;(?: U;)? CPU) OS (\d+)/)},_webkitOverflowScroll:{type:Boolean,value:""===document.createElement("div").style.webkitOverflowScrolling},_ignoreAnnounce:{value:!0},_focusOverlayOnOpen:Boolean,_overlayInitialized:Boolean}}static get observers(){return["_updateHasValue(value)","_selectedDateChanged(_selectedDate, i18n.formatDate)","_focusedDateChanged(_focusedDate, i18n.formatDate)","_announceFocusedDate(_focusedDate, opened, _ignoreAnnounce)"]}ready(){super.ready(),this._boundOnScroll=this._onScroll.bind(this),this._boundFocus=this._focus.bind(this),this._boundUpdateAlignmentAndPosition=this._updateAlignmentAndPosition.bind(this);const e=e=>{const t=e.composedPath(),a=t.indexOf(this._inputElement);return 1===t.slice(0,a).filter((e=>e.getAttribute&&"clear-button"===e.getAttribute("part"))).length};u(this,"tap",(t=>{e(t)||this.autoOpenDisabled&&!this._noInput||this.open()})),this.addEventListener("touchend",(t=>{this._noInput&&!e(t)&&t.preventDefault()})),this.addEventListener("keydown",this._onKeydown.bind(this)),this.addEventListener("input",this.__onUserInput.bind(this)),this.addEventListener("focus",(e=>this._noInput&&e.target.blur())),this.addEventListener("blur",(e=>{if(!this.opened){if(this.autoOpenDisabled){const e=this._getParsedDate();this._isValidDate(e)&&(this._selectedDate=e)}""===this._inputElementValue&&this.__dispatchChange?(this.validate(),this.value="",this.__dispatchChange=!1):this.validate()}}))}_initOverlay(){this.$.overlay.removeAttribute("disable-upgrade"),this._overlayInitialized=!0,this.$.overlay.addEventListener("opened-changed",(e=>this.opened=e.detail.value)),this._overlayContent.addEventListener("close",this._close.bind(this)),this._overlayContent.addEventListener("focus-input",this._focusAndSelect.bind(this)),this.$.overlay.addEventListener("vaadin-overlay-escape-press",this._boundFocus),this._overlayContent.addEventListener("focus",(()=>this.focusElement._setFocused(!0))),this.$.overlay.addEventListener("vaadin-overlay-close",this._onVaadinOverlayClose.bind(this));const e=e=>{this.$.overlay.bringToFront&&requestAnimationFrame((()=>{this.$.overlay.bringToFront()}))};this.addEventListener("mousedown",e),this.addEventListener("touchstart",e)}disconnectedCallback(){super.disconnectedCallback(),this._overlayInitialized&&this.$.overlay.removeEventListener("vaadin-overlay-escape-press",this._boundFocus),this.opened=!1}open(){this.disabled||this.readonly||(this.opened=!0)}_close(e){e&&e.stopPropagation(),this._focus(),this.close()}close(){(this._overlayInitialized||this.autoOpenDisabled)&&this.$.overlay.close()}get _inputElement(){return this._input()}get _nativeInput(){if(this._inputElement)return this._inputElement.focusElement?this._inputElement.focusElement:this._inputElement.inputElement?this._inputElement.inputElement:window.unwrap?window.unwrap(this._inputElement):this._inputElement}_parseDate(e){var t=/^([-+]\d{1}|\d{2,4}|[-+]\d{6})-(\d{1,2})-(\d{1,2})$/.exec(e);if(t){var a=new Date(0,0);return a.setFullYear(parseInt(t[1],10)),a.setMonth(parseInt(t[2],10)-1),a.setDate(parseInt(t[3],10)),a}}_isNoInput(e,t,a,i,s,o){const n=e&&(!o||s),r=t&&s;return!this._inputElement||n||r||!a.parseDate}_formatISO(e){if(!(e instanceof Date))return"";const t=(e,t="00")=>(t+e).substr((t+e).length-t.length);let a="",i="0000",s=e.getFullYear();s<0?(s=-s,a="-",i="000000"):e.getFullYear()>=1e4&&(a="+",i="000000");return[a+t(s,i),t(e.getMonth()+1),t(e.getDate())].join("-")}_openedChanged(e){e&&!this._overlayInitialized&&this._initOverlay(),this._overlayInitialized&&(this.$.overlay.opened=e),e&&this._updateAlignmentAndPosition()}_selectedDateChanged(e,t){if(void 0===e||void 0===t)return;this.__userInputOccurred&&(this.__dispatchChange=!0);const a=this._formatISO(e);this.__keepInputValue||this._applyInputValue(e),a!==this.value&&(this.validate(),this.value=a),this.__userInputOccurred=!1,this.__dispatchChange=!1,this._ignoreFocusedDateChange=!0,this._focusedDate=e,this._ignoreFocusedDateChange=!1}_focusedDateChanged(e,t){void 0!==e&&void 0!==t&&(this.__userInputOccurred=!0,this._ignoreFocusedDateChange||this._noInput||this._applyInputValue(e))}_updateHasValue(e){e?this.setAttribute("has-value",""):this.removeAttribute("has-value")}__getOverlayTheme(e,t){if(t)return e}_handleDateChange(e,t,a){if(t){var i=this._parseDate(t);i?I._dateEquals(this[e],i)||(this[e]=i,this.value&&this.validate()):this.value=a}else this[e]=""}_valueChanged(e,t){this.__dispatchChange&&this.dispatchEvent(new CustomEvent("change",{bubbles:!0})),this._handleDateChange("_selectedDate",e,t)}_minChanged(e,t){this._handleDateChange("_minDate",e,t)}_maxChanged(e,t){this._handleDateChange("_maxDate",e,t)}_updateAlignmentAndPosition(){if(this._overlayInitialized){if(!this._fullscreen){const e=this._inputElement.getBoundingClientRect(),t=e.top>window.innerHeight/2;if(e.left+this.clientWidth/2>window.innerWidth/2){const t=Math.min(window.innerWidth,document.documentElement.clientWidth);this.$.overlay.setAttribute("right-aligned",""),this.$.overlay.style.removeProperty("left"),this.$.overlay.style.right=t-e.right+"px"}else this.$.overlay.removeAttribute("right-aligned"),this.$.overlay.style.removeProperty("right"),this.$.overlay.style.left=e.left+"px";if(t){const t=Math.min(window.innerHeight,document.documentElement.clientHeight);this.$.overlay.setAttribute("bottom-aligned",""),this.$.overlay.style.removeProperty("top"),this.$.overlay.style.bottom=t-e.top+"px"}else this.$.overlay.removeAttribute("bottom-aligned"),this.$.overlay.style.removeProperty("bottom"),this.$.overlay.style.top=e.bottom+"px"}this.$.overlay.setAttribute("dir",getComputedStyle(this._inputElement).getPropertyValue("direction")),this._overlayContent._repositionYearScroller()}}_fullscreenChanged(){this._overlayInitialized&&this.$.overlay.opened&&this._updateAlignmentAndPosition()}_onOverlayOpened(){this._openedWithFocusRing=this.hasAttribute("focus-ring")||this.focusElement&&this.focusElement.hasAttribute("focus-ring");var e=this._parseDate(this.initialPosition),t=this._selectedDate||this._overlayContent.initialPosition||e||new Date;e||I._dateAllowed(t,this._minDate,this._maxDate)?this._overlayContent.initialPosition=t:this._overlayContent.initialPosition=I._getClosestDate(t,[this._minDate,this._maxDate]),this._overlayContent.scrollToDate(this._overlayContent.focusedDate||this._overlayContent.initialPosition),this._ignoreFocusedDateChange=!0,this._overlayContent.focusedDate=this._overlayContent.focusedDate||this._overlayContent.initialPosition,this._ignoreFocusedDateChange=!1,window.addEventListener("scroll",this._boundOnScroll,!0),this.addEventListener("iron-resize",this._boundUpdateAlignmentAndPosition),this._webkitOverflowScroll&&(this._touchPrevented=this._preventWebkitOverflowScrollingTouch(this.parentElement)),this._focusOverlayOnOpen?(this._overlayContent.focus(),this._focusOverlayOnOpen=!1):this._focus(),this._noInput&&this.focusElement&&this.focusElement.blur(),this.updateStyles(),this._ignoreAnnounce=!1}_preventWebkitOverflowScrollingTouch(e){for(var t=[];e;){if("touch"===window.getComputedStyle(e).webkitOverflowScrolling){var a=e.style.webkitOverflowScrolling;e.style.webkitOverflowScrolling="auto",t.push({element:e,oldInlineValue:a})}e=e.parentElement}return t}_selectParsedOrFocusedDate(){if(this._ignoreFocusedDateChange=!0,this.i18n.parseDate){const e=this._inputElementValue||"",t=this._getParsedDate(e);this._isValidDate(t)?this._selectedDate=t:(this.__keepInputValue=!0,this._selectedDate=null,this.__keepInputValue=!1)}else this._focusedDate&&(this._selectedDate=this._focusedDate);this._ignoreFocusedDateChange=!1}_onOverlayClosed(){this._ignoreAnnounce=!0,window.removeEventListener("scroll",this._boundOnScroll,!0),this.removeEventListener("iron-resize",this._boundUpdateAlignmentAndPosition),this._touchPrevented&&(this._touchPrevented.forEach((e=>e.element.style.webkitOverflowScrolling=e.oldInlineValue)),this._touchPrevented=[]),this.updateStyles(),this._selectParsedOrFocusedDate(),this._nativeInput&&this._nativeInput.selectionStart&&(this._nativeInput.selectionStart=this._nativeInput.selectionEnd),this.value||this.validate()}get _inputElementValueProperty(){return"value"}get _inputElementValue(){return this._inputElement?this._inputElement[this._inputElementValueProperty]:void 0}set _inputElementValue(e){this._inputElement&&(this._inputElement[this._inputElementValueProperty]=e,this._hasInputValue=!1)}_setInvalid(e){this._shouldSetInvalid(e)&&(this.invalid=e)}_shouldSetInvalid(e){return!0}validate(){const e=this.checkValidity(this._inputElementValue);return this._setInvalid(!e),this.dispatchEvent(new CustomEvent("validated",{detail:{valid:e}})),e}checkValidity(){const e=!this._inputElementValue||this._selectedDate&&this._inputElementValue===this._getFormattedDate(this.i18n.formatDate,this._selectedDate),t=!this._selectedDate||I._dateAllowed(this._selectedDate,this._minDate,this._maxDate);let a=!0;return this._inputElement&&(this._inputElement.checkValidity?(this._inputElement.__forceCheckValidity=!0,a=this._inputElement.checkValidity(),this._inputElement.__forceCheckValidity=!1):this._inputElement.validate&&(a=this._inputElement.validate())),!!(e&&t&&a)}_onScroll(e){e.target!==window&&this._overlayContent.contains(e.target)||this._updateAlignmentAndPosition()}_focus(){this._noInput?this._overlayInitialized&&this._overlayContent.focus():this._inputElement.focus()}_focusAndSelect(){this._focus(),this._setSelectionRange(0,this._inputElementValue.length)}_applyInputValue(e){this._inputElementValue=e?this._getFormattedDate(this.i18n.formatDate,e):""}_getFormattedDate(e,t){return e(I._extractDateParts(t))}_setSelectionRange(e,t){this._nativeInput&&this._nativeInput.setSelectionRange&&this._nativeInput.setSelectionRange(e,t)}_eventKey(e){for(var t=["down","up","enter","esc","tab"],a=0;a<t.length;a++){var i=t[a];if(o.keyboardEventMatchesKeys(e,i))return i}}_isValidDate(e){return e&&!isNaN(e.getTime())}_onKeydown(e){if(this._noInput){-1===[9].indexOf(e.keyCode)&&e.preventDefault()}switch(this._eventKey(e)){case"down":case"up":e.preventDefault(),this.opened?(this._overlayContent.focus(),this._overlayContent._onKeydown(e)):(this._focusOverlayOnOpen=!0,this.open());break;case"enter":{const e=this._getParsedDate(),t=this._isValidDate(e);if(this.opened)this._overlayInitialized&&this._overlayContent.focusedDate&&t&&(this._selectedDate=this._overlayContent.focusedDate),this.close();else if(t||""===this._inputElementValue){const e=this.value;this._selectParsedOrFocusedDate(),e===this.value&&this.validate()}else this.validate();break}case"esc":this.opened?(this._focusedDate=this._selectedDate,this._close()):this.autoOpenDisabled?(""===this._inputElementValue&&(this._selectedDate=null),this._applyInputValue(this._selectedDate)):(this._focusedDate=this._selectedDate,this._selectParsedOrFocusedDate());break;case"tab":this.opened&&(e.preventDefault(),this._setSelectionRange(0,0),e.shiftKey?this._overlayContent.focusCancel():(this._overlayContent.focus(),this._overlayContent.revealDate(this._focusedDate)))}}_getParsedDate(e=this._inputElementValue){const t=this.i18n.parseDate&&this.i18n.parseDate(e);return t&&this._parseDate(t.year+"-"+(t.month+1)+"-"+t.day)}_setHasInputValue(e){const t=e.composedPath()[0];this._hasInputValue=t.value.length>0}__onUserInput(e){this._setHasInputValue(e),this._onUserInput(e)}_hasInputValueChanged(e,t){(e||t)&&this.dispatchEvent(new CustomEvent("has-input-value-changed"))}_onUserInput(e){this.opened||!this._inputElementValue||this.autoOpenDisabled||this.open(),this._userInputValueChanged(),e.__fromClearButton&&(this.validate(),this.__dispatchChange=!0,this.value="",this.__dispatchChange=!1)}_userInputValueChanged(e){if(this._inputElementValue){const e=this._getParsedDate();this._isValidDate(e)&&(this._ignoreFocusedDateChange=!0,I._dateEquals(e,this._focusedDate)||(this._focusedDate=e),this._ignoreFocusedDateChange=!1)}}_announceFocusedDate(e,t,a){t&&!a&&this._overlayContent.announceFocusedDate()}get _overlayContent(){return this.$.overlay.content.querySelector("#overlay-content")}}
763
+ const F=e=>class extends(g([b],e)){static get properties(){return{_selectedDate:{type:Date},_focusedDate:Date,value:{type:String,observer:"_valueChanged",notify:!0,value:""},required:{type:Boolean,value:!1},name:{type:String},initialPosition:String,label:String,opened:{type:Boolean,reflectToAttribute:!0,notify:!0,observer:"_openedChanged"},autoOpenDisabled:Boolean,showWeekNumbers:{type:Boolean},_fullscreen:{value:!1,observer:"_fullscreenChanged"},_fullscreenMediaQuery:{value:"(max-width: 420px), (max-height: 420px)"},_touchPrevented:Array,i18n:{type:Object,value:()=>({monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],firstDayOfWeek:0,week:"Week",calendar:"Calendar",clear:"Clear",today:"Today",cancel:"Cancel",referenceDate:"",formatDate:e=>{const t=String(e.year).replace(/\d+/,(e=>"0000".substr(e.length)+e));return[e.month+1,e.day,t].join("/")},parseDate(e){const t=e.split("/"),a=new Date;let i,s=a.getMonth(),o=a.getFullYear();if(3===t.length){if(s=parseInt(t[0])-1,i=parseInt(t[1]),o=parseInt(t[2]),t[2].length<3&&o>=0){const e=this.referenceDate?I._parseDate(this.referenceDate):new Date;o=I._getAdjustedYear(e,o,s,i)}}else 2===t.length?(s=parseInt(t[0])-1,i=parseInt(t[1])):1===t.length&&(i=parseInt(t[0]));if(void 0!==i)return{day:i,month:s,year:o}},formatTitle:(e,t)=>`${e} ${t}`})},min:{type:String,observer:"_minChanged"},max:{type:String,observer:"_maxChanged"},_minDate:{type:Date,value:""},_maxDate:{type:Date,value:""},_noInput:{type:Boolean,computed:"_isNoInput(_fullscreen, _ios, i18n, i18n.*, opened, autoOpenDisabled)"},_hasInputValue:{type:Boolean,value:!1,observer:"_hasInputValueChanged"},_ios:{type:Boolean,value:navigator.userAgent.match(/iP(?:hone|ad;(?: U;)? CPU) OS (\d+)/)},_webkitOverflowScroll:{type:Boolean,value:""===document.createElement("div").style.webkitOverflowScrolling},_ignoreAnnounce:{value:!0},_focusOverlayOnOpen:Boolean,_overlayInitialized:Boolean}}static get observers(){return["_updateHasValue(value)","_selectedDateChanged(_selectedDate, i18n.formatDate)","_focusedDateChanged(_focusedDate, i18n.formatDate)","_announceFocusedDate(_focusedDate, opened, _ignoreAnnounce)"]}ready(){super.ready(),this._boundOnScroll=this._onScroll.bind(this),this._boundFocus=this._focus.bind(this),this._boundUpdateAlignmentAndPosition=this._updateAlignmentAndPosition.bind(this);const e=e=>{const t=e.composedPath(),a=t.indexOf(this._inputElement);return 1===t.slice(0,a).filter((e=>e.getAttribute&&"clear-button"===e.getAttribute("part"))).length};d(this,"tap",(t=>{e(t)||this.autoOpenDisabled&&!this._noInput||this.open()})),this.addEventListener("touchend",(t=>{this._noInput&&!e(t)&&t.preventDefault()})),this.addEventListener("keydown",this._onKeydown.bind(this)),this.addEventListener("input",this.__onUserInput.bind(this)),this.addEventListener("focus",(e=>this._noInput&&e.target.blur())),this.addEventListener("blur",(e=>{if(!this.opened){if(this.autoOpenDisabled){const e=this._getParsedDate();this._isValidDate(e)&&(this._selectedDate=e)}""===this._inputElementValue&&this.__dispatchChange?(this.validate(),this.value="",this.__dispatchChange=!1):this.validate()}}))}_initOverlay(){this.$.overlay.removeAttribute("disable-upgrade"),this._overlayInitialized=!0,this.$.overlay.addEventListener("opened-changed",(e=>this.opened=e.detail.value)),this._overlayContent.addEventListener("close",this._close.bind(this)),this._overlayContent.addEventListener("focus-input",this._focusAndSelect.bind(this)),this.$.overlay.addEventListener("vaadin-overlay-escape-press",this._boundFocus),this._overlayContent.addEventListener("focus",(()=>this.focusElement._setFocused(!0))),this.$.overlay.addEventListener("vaadin-overlay-close",this._onVaadinOverlayClose.bind(this));const e=e=>{this.$.overlay.bringToFront&&requestAnimationFrame((()=>{this.$.overlay.bringToFront()}))};this.addEventListener("mousedown",e),this.addEventListener("touchstart",e)}disconnectedCallback(){super.disconnectedCallback(),this._overlayInitialized&&this.$.overlay.removeEventListener("vaadin-overlay-escape-press",this._boundFocus),this.opened=!1}open(){this.disabled||this.readonly||(this.opened=!0)}_close(e){e&&e.stopPropagation(),this._focus(),this.close()}close(){(this._overlayInitialized||this.autoOpenDisabled)&&this.$.overlay.close()}get _inputElement(){return this._input()}get _nativeInput(){if(this._inputElement)return this._inputElement.focusElement?this._inputElement.focusElement:this._inputElement.inputElement?this._inputElement.inputElement:window.unwrap?window.unwrap(this._inputElement):this._inputElement}_parseDate(e){var t=/^([-+]\d{1}|\d{2,4}|[-+]\d{6})-(\d{1,2})-(\d{1,2})$/.exec(e);if(t){var a=new Date(0,0);return a.setFullYear(parseInt(t[1],10)),a.setMonth(parseInt(t[2],10)-1),a.setDate(parseInt(t[3],10)),a}}_isNoInput(e,t,a,i,s,o){const r=e&&(!o||s),n=t&&s;return!this._inputElement||r||n||!a.parseDate}_formatISO(e){if(!(e instanceof Date))return"";const t=(e,t="00")=>(t+e).substr((t+e).length-t.length);let a="",i="0000",s=e.getFullYear();s<0?(s=-s,a="-",i="000000"):e.getFullYear()>=1e4&&(a="+",i="000000");return[a+t(s,i),t(e.getMonth()+1),t(e.getDate())].join("-")}_openedChanged(e){e&&!this._overlayInitialized&&this._initOverlay(),this._overlayInitialized&&(this.$.overlay.opened=e),e&&this._updateAlignmentAndPosition()}_selectedDateChanged(e,t){if(void 0===e||void 0===t)return;this.__userInputOccurred&&(this.__dispatchChange=!0);const a=this._formatISO(e);this.__keepInputValue||this._applyInputValue(e),a!==this.value&&(this.validate(),this.value=a),this.__userInputOccurred=!1,this.__dispatchChange=!1,this._ignoreFocusedDateChange=!0,this._focusedDate=e,this._ignoreFocusedDateChange=!1}_focusedDateChanged(e,t){void 0!==e&&void 0!==t&&(this.__userInputOccurred=!0,this._ignoreFocusedDateChange||this._noInput||this._applyInputValue(e))}_updateHasValue(e){e?this.setAttribute("has-value",""):this.removeAttribute("has-value")}__getOverlayTheme(e,t){if(t)return e}_handleDateChange(e,t,a){if(t){var i=this._parseDate(t);i?I._dateEquals(this[e],i)||(this[e]=i,this.value&&this.validate()):this.value=a}else this[e]=""}_valueChanged(e,t){this.__dispatchChange&&this.dispatchEvent(new CustomEvent("change",{bubbles:!0})),this._handleDateChange("_selectedDate",e,t)}_minChanged(e,t){this._handleDateChange("_minDate",e,t)}_maxChanged(e,t){this._handleDateChange("_maxDate",e,t)}_updateAlignmentAndPosition(){if(this._overlayInitialized){if(!this._fullscreen){const e=this._inputElement.getBoundingClientRect(),t=e.top>window.innerHeight/2;if(e.left+this.clientWidth/2>window.innerWidth/2){const t=Math.min(window.innerWidth,document.documentElement.clientWidth);this.$.overlay.setAttribute("right-aligned",""),this.$.overlay.style.removeProperty("left"),this.$.overlay.style.right=t-e.right+"px"}else this.$.overlay.removeAttribute("right-aligned"),this.$.overlay.style.removeProperty("right"),this.$.overlay.style.left=e.left+"px";if(t){const t=Math.min(window.innerHeight,document.documentElement.clientHeight);this.$.overlay.setAttribute("bottom-aligned",""),this.$.overlay.style.removeProperty("top"),this.$.overlay.style.bottom=t-e.top+"px"}else this.$.overlay.removeAttribute("bottom-aligned"),this.$.overlay.style.removeProperty("bottom"),this.$.overlay.style.top=e.bottom+"px"}this.$.overlay.setAttribute("dir",getComputedStyle(this._inputElement).getPropertyValue("direction")),this._overlayContent._repositionYearScroller()}}_fullscreenChanged(){this._overlayInitialized&&this.$.overlay.opened&&this._updateAlignmentAndPosition()}_onOverlayOpened(){this._openedWithFocusRing=this.hasAttribute("focus-ring")||this.focusElement&&this.focusElement.hasAttribute("focus-ring");var e=this._parseDate(this.initialPosition),t=this._selectedDate||this._overlayContent.initialPosition||e||new Date;e||I._dateAllowed(t,this._minDate,this._maxDate)?this._overlayContent.initialPosition=t:this._overlayContent.initialPosition=I._getClosestDate(t,[this._minDate,this._maxDate]),this._overlayContent.scrollToDate(this._overlayContent.focusedDate||this._overlayContent.initialPosition),this._ignoreFocusedDateChange=!0,this._overlayContent.focusedDate=this._overlayContent.focusedDate||this._overlayContent.initialPosition,this._ignoreFocusedDateChange=!1,window.addEventListener("scroll",this._boundOnScroll,!0),this.addEventListener("iron-resize",this._boundUpdateAlignmentAndPosition),this._webkitOverflowScroll&&(this._touchPrevented=this._preventWebkitOverflowScrollingTouch(this.parentElement)),this._focusOverlayOnOpen?(this._overlayContent.focus(),this._focusOverlayOnOpen=!1):this._focus(),this._noInput&&this.focusElement&&this.focusElement.blur(),this.updateStyles(),this._ignoreAnnounce=!1}_preventWebkitOverflowScrollingTouch(e){for(var t=[];e;){if("touch"===window.getComputedStyle(e).webkitOverflowScrolling){var a=e.style.webkitOverflowScrolling;e.style.webkitOverflowScrolling="auto",t.push({element:e,oldInlineValue:a})}e=e.parentElement}return t}_selectParsedOrFocusedDate(){if(this._ignoreFocusedDateChange=!0,this.i18n.parseDate){const e=this._inputElementValue||"",t=this._getParsedDate(e);this._isValidDate(t)?this._selectedDate=t:(this.__keepInputValue=!0,this._selectedDate=null,this.__keepInputValue=!1)}else this._focusedDate&&(this._selectedDate=this._focusedDate);this._ignoreFocusedDateChange=!1}_onOverlayClosed(){this._ignoreAnnounce=!0,window.removeEventListener("scroll",this._boundOnScroll,!0),this.removeEventListener("iron-resize",this._boundUpdateAlignmentAndPosition),this._touchPrevented&&(this._touchPrevented.forEach((e=>e.element.style.webkitOverflowScrolling=e.oldInlineValue)),this._touchPrevented=[]),this.updateStyles(),this._selectParsedOrFocusedDate(),this._nativeInput&&this._nativeInput.selectionStart&&(this._nativeInput.selectionStart=this._nativeInput.selectionEnd),this.value||this.validate()}get _inputElementValueProperty(){return"value"}get _inputElementValue(){return this._inputElement?this._inputElement[this._inputElementValueProperty]:void 0}set _inputElementValue(e){this._inputElement&&(this._inputElement[this._inputElementValueProperty]=e,this._hasInputValue=!1)}_setInvalid(e){this._shouldSetInvalid(e)&&(this.invalid=e)}_shouldSetInvalid(e){return!0}validate(){const e=this.checkValidity(this._inputElementValue);return this._setInvalid(!e),this.dispatchEvent(new CustomEvent("validated",{detail:{valid:e}})),e}checkValidity(){const e=!this._inputElementValue||this._selectedDate&&this._inputElementValue===this._getFormattedDate(this.i18n.formatDate,this._selectedDate),t=!this._selectedDate||I._dateAllowed(this._selectedDate,this._minDate,this._maxDate);let a=!0;return this._inputElement&&(this._inputElement.checkValidity?(this._inputElement.__forceCheckValidity=!0,a=this._inputElement.checkValidity(),this._inputElement.__forceCheckValidity=!1):this._inputElement.validate&&(a=this._inputElement.validate())),!!(e&&t&&a)}_onScroll(e){e.target!==window&&this._overlayContent.contains(e.target)||this._updateAlignmentAndPosition()}_focus(){this._noInput?this._overlayInitialized&&this._overlayContent.focus():this._inputElement.focus()}_focusAndSelect(){this._focus(),this._setSelectionRange(0,this._inputElementValue.length)}_applyInputValue(e){this._inputElementValue=e?this._getFormattedDate(this.i18n.formatDate,e):""}_getFormattedDate(e,t){return e(I._extractDateParts(t))}_setSelectionRange(e,t){this._nativeInput&&this._nativeInput.setSelectionRange&&this._nativeInput.setSelectionRange(e,t)}_eventKey(e){for(var t=["down","up","enter","esc","tab"],a=0;a<t.length;a++){var i=t[a];if(s.keyboardEventMatchesKeys(e,i))return i}}_isValidDate(e){return e&&!isNaN(e.getTime())}_onKeydown(e){if(this._noInput){-1===[9].indexOf(e.keyCode)&&e.preventDefault()}switch(this._eventKey(e)){case"down":case"up":e.preventDefault(),this.opened?(this._overlayContent.focus(),this._overlayContent._onKeydown(e)):(this._focusOverlayOnOpen=!0,this.open());break;case"enter":{const e=this._getParsedDate(),t=this._isValidDate(e);if(this.opened)this._overlayInitialized&&this._overlayContent.focusedDate&&t&&(this._selectedDate=this._overlayContent.focusedDate),this.close();else if(t||""===this._inputElementValue){const e=this.value;this._selectParsedOrFocusedDate(),e===this.value&&this.validate()}else this.validate();break}case"esc":this.opened?(this._focusedDate=this._selectedDate,this._close()):this.autoOpenDisabled?(""===this._inputElementValue&&(this._selectedDate=null),this._applyInputValue(this._selectedDate)):(this._focusedDate=this._selectedDate,this._selectParsedOrFocusedDate());break;case"tab":this.opened&&(e.preventDefault(),this._setSelectionRange(0,0),e.shiftKey?this._overlayContent.focusCancel():(this._overlayContent.focus(),this._overlayContent.revealDate(this._focusedDate)))}}_getParsedDate(e=this._inputElementValue){const t=this.i18n.parseDate&&this.i18n.parseDate(e);return t&&this._parseDate(t.year+"-"+(t.month+1)+"-"+t.day)}_setHasInputValue(e){const t=e.composedPath()[0];this._hasInputValue=t.value.length>0}__onUserInput(e){this._setHasInputValue(e),this._onUserInput(e)}_hasInputValueChanged(e,t){(e||t)&&this.dispatchEvent(new CustomEvent("has-input-value-changed"))}_onUserInput(e){this.opened||!this._inputElementValue||this.autoOpenDisabled||this.open(),this._userInputValueChanged(),e.__fromClearButton&&(this.validate(),this.__dispatchChange=!0,this.value="",this.__dispatchChange=!1)}_userInputValueChanged(e){if(this._inputElementValue){const e=this._getParsedDate();this._isValidDate(e)&&(this._ignoreFocusedDateChange=!0,I._dateEquals(e,this._focusedDate)||(this._focusedDate=e),this._ignoreFocusedDateChange=!1)}}_announceFocusedDate(e,t,a){t&&!a&&this._overlayContent.announceFocusedDate()}get _overlayContent(){return this.$.overlay.content.querySelector("#overlay-content")}}
764
764
  /**
765
765
  @license
766
766
  Copyright (c) 2017 Vaadin Ltd.
767
767
  This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
768
- */;class Y extends(a(m(e(F(r(l)))))){static get template(){return n`
768
+ */;class Y extends(a(p(e(F(r(n)))))){static get template(){return o`
769
769
  <style>
770
770
  :host {
771
771
  display: inline-block;
@@ -1 +1 @@
1
- import{_ as e}from"./shared-11014aad.js";import{c as t,L as s,h as i}from"./shared-dc73b9a5.js";import{A as a}from"./shared-e07b24ca.js";import{C as o}from"./shared-6af480b8.js";import{T as n,R as l,a as d}from"./shared-56addb06.js";import{I as r}from"./shared-4fd17baf.js";import{F as h}from"./shared-343d1fd7.js";import{c}from"./shared-4e709717.js";class u extends CustomEvent{constructor(e=!1){super("hide",{detail:{cancelled:e}})}}class p extends CustomEvent{constructor(){super("show")}}let m,v=e=>e;class b extends(o(n(l(d(r(s)))))){constructor(){super(...arguments),this.group=""}static get properties(){return e(e({},super.properties),{},{group:{}})}static get styles(){return[super.styles,t(m||(m=v`:host{position:relative;z-index:200}`))]}}let _,g,y,f,w,x,$,C=e=>e;const D=d(o(n(r(s))));class k extends D{constructor(){super(...arguments),this.closable=!1,this.editable=!1,this.header="",this.group="",this.alert=!1,this.wide=!1,this.__handleKeyDown=e=>{"Escape"===e.key&&k.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},group:{},alert:{type:Boolean},wide:{type:Boolean},open:{type:Boolean,noAccessor:!0}})}static get styles(){return[super.styles,t(_||(_=C`.grid-cols-header{grid-template-columns:1fr auto 1fr}.scale-85{--tw-scale-x:0.85;--tw-scale-y:0.85}.max-h-alert{max-height:calc(100vh - var(--lumo-size-l) - var(--lumo-space-m) * 2)}`))]}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=k.dialogWindows.get(this))||void 0===e||e.remove(),k.dialogWindows.delete(this)}createRenderRoot(){const e=new b,t=document.querySelectorAll(k.dialogWindowsHost),s=Array.from(t).pop();return e.addEventListener("fetch",(e=>{e instanceof h&&(e.stopImmediatePropagation(),e.preventDefault(),e.respondWith(new a(this).fetch(e.request)))})),null==s||s.appendChild(e),k.dialogWindows.set(this,e),e.shadowRoot}render(e){if(!this.__connected)return i(g||(g=C``));const t=k.openDialogs[0]===this,s=k.openDialogs[1]===this,a=k.openDialogs[2]===this,o=!t&&!s&&!a;return i(y||(y=C` <div class="${0}"> <div id="backdrop" class="${0}" tabindex="-1" @click="${0}"></div> <div tabindex="0" 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="${0}"> <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 ease-in-out transition duration-500 relative h-full ml-auto":!0,"origin-bottom sm-origin-center":!0,"focus-outline-none":!0,"sm-max-w-modal":!this.wide,"sm-max-w-modal-wide":this.wide,"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":a&&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,"flex-1":this.alert}),this.closable&&!this.hiddenSelector.matches("close-button",!0)?i(f||(f=C` <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):i(w||(w=C`<div></div>`)),this.ns,this.lang,this.header,this.editable&&!this.hiddenSelector.matches("save-button",!0)?i(x||(x=C` <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):i($||($=C`<div></div>`)),c({"flex-1 overflow-y-auto overflow-x-hidden overscroll-contain":!0,"max-h-alert":this.alert}),null==e?void 0:e())}updated(e){super.updated(e);const t=k.dialogWindows.get(this);t&&(t.disabledControls=this.disabledControls,t.disabled=this.disabled,t.readonlyControls=this.readonlyControls,t.readonly=this.readonly,t.hiddenControls=this.hiddenControls,t.hidden=this.hidden,t.group=this.group,t.lang=this.lang,t.ns=this.ns)}async hide(e=!1){var t;null===(t=this.__returnFocusTo)||void 0===t||t.focus(),await this.__setOpenDialogs(k.openDialogs.filter((e=>e!==this))),await this.__setConnected(!1),this.dispatchEvent(new k.HideEvent(!!e))}async show(e){var t;this.__returnFocusTo=e,await this.__setConnected(!0),await this.__setOpenDialogs([this,...k.openDialogs]),null===(t=this.renderRoot.querySelector('[role="dialog"]'))||void 0===t||t.focus(),this.dispatchEvent(new k.ShowEvent)}async save(){await this.hide(!1)}async __setOpenDialogs(e){k.openDialogs.length=0,k.openDialogs.push(...e),await Promise.all([Promise.all(k.openDialogs.map((e=>e.requestUpdate()))),new Promise((e=>{const t=this.renderRoot.querySelector("#backdrop");t?(t.addEventListener("transitionend",(()=>e()),{once:!0}),setTimeout((()=>e()),2e3)):e(),this.__visible=k.openDialogs.includes(this)}))])}async __setConnected(e){this.__connected=e,await this.updateComplete.then((()=>this.getBoundingClientRect()))}}k.dialogWindowsHost="#foxy-dialog-windows-host, body",k.dialogWindows=new WeakMap,k.openDialogs=[],k.ShowEvent=p,k.HideEvent=u,customElements.define("foxy-dialog-window",b);export{k as D};
1
+ import{_ as e}from"./shared-11014aad.js";import{c as t,L as s,h as i}from"./shared-dc73b9a5.js";import{A as a}from"./shared-e07b24ca.js";import{C as o}from"./shared-6af480b8.js";import{T as n,R as l,a as d}from"./shared-56addb06.js";import{I as r}from"./shared-8def6325.js";import{F as h}from"./shared-343d1fd7.js";import{c}from"./shared-4e709717.js";class u extends CustomEvent{constructor(e=!1){super("hide",{detail:{cancelled:e}})}}class p extends CustomEvent{constructor(){super("show")}}let m,v=e=>e;class b extends(o(n(l(d(r(s)))))){constructor(){super(...arguments),this.group=""}static get properties(){return e(e({},super.properties),{},{group:{}})}static get styles(){return[super.styles,t(m||(m=v`:host{position:relative;z-index:200}`))]}}let _,g,y,f,w,x,$,C=e=>e;const D=d(o(n(r(s))));class k extends D{constructor(){super(...arguments),this.closable=!1,this.editable=!1,this.header="",this.group="",this.alert=!1,this.wide=!1,this.__handleKeyDown=e=>{"Escape"===e.key&&k.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},group:{},alert:{type:Boolean},wide:{type:Boolean},open:{type:Boolean,noAccessor:!0}})}static get styles(){return[super.styles,t(_||(_=C`.grid-cols-header{grid-template-columns:1fr auto 1fr}.scale-85{--tw-scale-x:0.85;--tw-scale-y:0.85}.max-h-alert{max-height:calc(100vh - var(--lumo-size-l) - var(--lumo-space-m) * 2)}`))]}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=k.dialogWindows.get(this))||void 0===e||e.remove(),k.dialogWindows.delete(this)}createRenderRoot(){const e=new b,t=document.querySelectorAll(k.dialogWindowsHost),s=Array.from(t).pop();return e.addEventListener("fetch",(e=>{e instanceof h&&(e.stopImmediatePropagation(),e.preventDefault(),e.respondWith(new a(this).fetch(e.request)))})),null==s||s.appendChild(e),k.dialogWindows.set(this,e),e.shadowRoot}render(e){if(!this.__connected)return i(g||(g=C``));const t=k.openDialogs[0]===this,s=k.openDialogs[1]===this,a=k.openDialogs[2]===this,o=!t&&!s&&!a;return i(y||(y=C` <div class="${0}"> <div id="backdrop" class="${0}" tabindex="-1" @click="${0}"></div> <div tabindex="0" 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="${0}"> <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 ease-in-out transition duration-500 relative h-full ml-auto":!0,"origin-bottom sm-origin-center":!0,"focus-outline-none":!0,"sm-max-w-modal":!this.wide,"sm-max-w-modal-wide":this.wide,"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":a&&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,"flex-1":this.alert}),this.closable&&!this.hiddenSelector.matches("close-button",!0)?i(f||(f=C` <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):i(w||(w=C`<div></div>`)),this.ns,this.lang,this.header,this.editable&&!this.hiddenSelector.matches("save-button",!0)?i(x||(x=C` <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):i($||($=C`<div></div>`)),c({"flex-1 overflow-y-auto overflow-x-hidden overscroll-contain":!0,"max-h-alert":this.alert}),null==e?void 0:e())}updated(e){super.updated(e);const t=k.dialogWindows.get(this);t&&(t.disabledControls=this.disabledControls,t.disabled=this.disabled,t.readonlyControls=this.readonlyControls,t.readonly=this.readonly,t.hiddenControls=this.hiddenControls,t.hidden=this.hidden,t.group=this.group,t.lang=this.lang,t.ns=this.ns)}async hide(e=!1){var t;null===(t=this.__returnFocusTo)||void 0===t||t.focus(),await this.__setOpenDialogs(k.openDialogs.filter((e=>e!==this))),await this.__setConnected(!1),this.dispatchEvent(new k.HideEvent(!!e))}async show(e){var t;this.__returnFocusTo=e,await this.__setConnected(!0),await this.__setOpenDialogs([this,...k.openDialogs]),null===(t=this.renderRoot.querySelector('[role="dialog"]'))||void 0===t||t.focus(),this.dispatchEvent(new k.ShowEvent)}async save(){await this.hide(!1)}async __setOpenDialogs(e){k.openDialogs.length=0,k.openDialogs.push(...e),await Promise.all([Promise.all(k.openDialogs.map((e=>e.requestUpdate()))),new Promise((e=>{const t=this.renderRoot.querySelector("#backdrop");t?(t.addEventListener("transitionend",(()=>e()),{once:!0}),setTimeout((()=>e()),2e3)):e(),this.__visible=k.openDialogs.includes(this)}))])}async __setConnected(e){this.__connected=e,await this.updateComplete.then((()=>this.getBoundingClientRect()))}}k.dialogWindowsHost="#foxy-dialog-windows-host, body",k.dialogWindows=new WeakMap,k.openDialogs=[],k.ShowEvent=p,k.HideEvent=u,customElements.define("foxy-dialog-window",b);export{k as D};
@@ -1 +1 @@
1
- import{n as e,_ as t}from"./shared-11014aad.js";import"./shared-845f8bf1.js";import"./shared-6e977271.js";import"./shared-a0cbfb2f.js";import"./shared-2c70f0b6.js";import"./shared-6a998243.js";import{p as a}from"./shared-669decee.js";import{d as i,P as s,A as r,L as d,c as l,h as n}from"./shared-dc73b9a5.js";import{a as o}from"./shared-56addb06.js";import{I as h}from"./shared-4fd17baf.js";const c=i((e=>t=>{const{element:a,name:i,strings:d}=t.committer;if(2!==d.length||""!==d[0]||""!==d[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 s)a[i]!==e&&t.setValue(e);else{if(!(t instanceof r))throw new Error("live directive can only be used on attributes or properties");a.getAttribute(i)!==e&&t.setValue(e)}}));class u extends CustomEvent{constructor(e){super("change",{detail:e})}}class p extends u{}let m,v,b=e=>e;class f extends(o(h(d))){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:i}=a(e);return[t.toString(),i]}},this.__getItems=e((e=>{const t=a(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 l(m||(m=b`:host{display:block}vaadin-custom-field{width:100%;font-size:0;line-height:0;padding-top:0!important}vaadin-custom-field::part(label){padding-bottom:var(--lumo-space-s)}vaadin-custom-field::part(error-message)[aria-hidden=false]{padding-top:var(--lumo-space-xs)}vaadin-combo-box,vaadin-integer-field{width:calc(50% - (var(--lumo-space-s)/ 2))}vaadin-integer-field{margin-right:var(--lumo-space-s);padding:0}vaadin-combo-box::part(text-field){padding:0}`))}render(){return n(v||(v=b` <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,c(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 p(this.value))}}export{u as D,f as F};
1
+ import{n as e,_ as t}from"./shared-11014aad.js";import"./shared-845f8bf1.js";import"./shared-6e977271.js";import"./shared-a0cbfb2f.js";import"./shared-2c70f0b6.js";import"./shared-9a5da74d.js";import{p as a}from"./shared-683145e5.js";import{d as i,P as s,A as r,L as d,c as l,h as n}from"./shared-dc73b9a5.js";import{a as o}from"./shared-56addb06.js";import{I as h}from"./shared-8def6325.js";const c=i((e=>t=>{const{element:a,name:i,strings:d}=t.committer;if(2!==d.length||""!==d[0]||""!==d[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 s)a[i]!==e&&t.setValue(e);else{if(!(t instanceof r))throw new Error("live directive can only be used on attributes or properties");a.getAttribute(i)!==e&&t.setValue(e)}}));class u extends CustomEvent{constructor(e){super("change",{detail:e})}}class p extends u{}let m,v,b=e=>e;class g extends(o(h(d))){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:i}=a(e);return[t.toString(),i]}},this.__getItems=e((e=>{const t=a(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 l(m||(m=b`:host{display:block}vaadin-custom-field{width:100%;font-size:0;line-height:0;padding-top:0!important}vaadin-custom-field::part(label){padding-bottom:var(--lumo-space-s)}vaadin-custom-field::part(error-message)[aria-hidden=false]{padding-top:var(--lumo-space-xs)}vaadin-combo-box,vaadin-integer-field{width:calc(50% - (var(--lumo-space-s)/ 2))}vaadin-integer-field{margin-right:var(--lumo-space-s);padding:0}vaadin-combo-box::part(text-field){padding:0}`))}render(){return n(v||(v=b` <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,c(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 p(this.value))}}export{u as D,g as F};
@@ -1,4 +1,4 @@
1
- import{C as e}from"./shared-bc95d87e.js";import{T as t,D as r}from"./shared-4877ed05.js";import"./shared-039de1fd.js";import{h as o,P as a}from"./shared-48b76c74.js";import{F as s}from"./shared-7e201abd.js";import{I as l}from"./shared-bf132324.js";import"./shared-669decee.js";import{_ as i}from"./shared-11014aad.js";import{i as h}from"./shared-9803aa7c.js";import{h as d}from"./shared-dc73b9a5.js";const n=o`<dom-module id="lumo-checkbox-group" theme-for="vaadin-checkbox-group">
1
+ import{C as e}from"./shared-bc95d87e.js";import{T as t,D as r}from"./shared-4877ed05.js";import"./shared-039de1fd.js";import{h as o,P as a}from"./shared-48b76c74.js";import{F as s}from"./shared-7e201abd.js";import{I as l}from"./shared-befe135a.js";import"./shared-683145e5.js";import{_ as i}from"./shared-11014aad.js";import{i as h}from"./shared-9803aa7c.js";import{h as d}from"./shared-dc73b9a5.js";const n=o`<dom-module id="lumo-checkbox-group" theme-for="vaadin-checkbox-group">
2
2
  <template>
3
3
  <style include="lumo-required-field">
4
4
  :host {
@@ -1 +1 @@
1
- import"./shared-6e977271.js";import{I as e}from"./shared-bf132324.js";import{_ as s}from"./shared-11014aad.js";import{i as t}from"./shared-9803aa7c.js";import{h as r}from"./shared-dc73b9a5.js";let i,l,a,o=e=>e;customElements.define("foxy-internal-text-control",class extends e{constructor(){super(...arguments),this.prefix=null,this.suffix=null}static get properties(){return s(s({},super.properties),{},{prefix:{},suffix:{}})}renderControl(){return r(i||(i=o` <vaadin-text-field error-message="${0}" helper-text="${0}" placeholder="${0}" label="${0}" class="w-full" ?clear-button-visible="${0}" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" .value="${0}" @keydown="${0}" @input="${0}"> ${0} ${0} </vaadin-text-field> `),t(this._errorMessage),this.helperText,this.placeholder,this.label,!this.suffix,this.disabled,this.readonly,this._checkValidity,this._value,(e=>{var s;return"Enter"===e.key&&(null===(s=this.nucleon)||void 0===s?void 0:s.submit())}),(e=>{const s=e.currentTarget;this._value=s.value}),this.prefix?r(l||(l=o`<div slot="prefix">${0}</div>`),this.prefix):"",this.suffix?r(a||(a=o`<div class="pr-s font-medium" slot="suffix">${0}</div>`),this.suffix):"")}get _value(){var e;return null!==(e=super._value)&&void 0!==e?e:""}set _value(e){super._value=e}});
1
+ import"./shared-6e977271.js";import{I as e}from"./shared-befe135a.js";import{_ as s}from"./shared-11014aad.js";import{i as t}from"./shared-9803aa7c.js";import{h as r}from"./shared-dc73b9a5.js";let i,l,a,o=e=>e;customElements.define("foxy-internal-text-control",class extends e{constructor(){super(...arguments),this.prefix=null,this.suffix=null}static get properties(){return s(s({},super.properties),{},{prefix:{},suffix:{}})}renderControl(){return r(i||(i=o` <vaadin-text-field error-message="${0}" helper-text="${0}" placeholder="${0}" label="${0}" class="w-full" ?clear-button-visible="${0}" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" .value="${0}" @keydown="${0}" @input="${0}"> ${0} ${0} </vaadin-text-field> `),t(this._errorMessage),this.helperText,this.placeholder,this.label,!this.suffix,this.disabled,this.readonly,this._checkValidity,this._value,(e=>{var s;return"Enter"===e.key&&(null===(s=this.nucleon)||void 0===s?void 0:s.submit())}),(e=>{const s=e.currentTarget;this._value=s.value}),this.prefix?r(l||(l=o`<div slot="prefix">${0}</div>`),this.prefix):"",this.suffix?r(a||(a=o`<div class="pr-s font-medium" slot="suffix">${0}</div>`),this.suffix):"")}get _value(){var e;return null!==(e=super._value)&&void 0!==e?e:""}set _value(e){super._value=e}});
@@ -0,0 +1 @@
1
+ import{A as e,_ as t}from"./shared-11014aad.js";import{h as n,L as r}from"./shared-dc73b9a5.js";import{i as s,a as i}from"./shared-56addb06.js";import{F as a}from"./shared-343d1fd7.js";import{I as o}from"./shared-8def6325.js";const l={type:"backend",init:()=>{},read:(t,n,r)=>{const s=async e=>{const t=e.ok?null:new Error(await e.text()),n=!!e.ok&&await e.json();r(t,n)},i=e=>{const t=e instanceof Error?e:new Error(String(e));r(t,!1)},o=new a("fetch",{cancelable:!0,composed:!0,bubbles:!0,request:new e.WHATWGRequest(`foxy://i18n/${n}/${t}`),resolve:s,reject:i});dispatchEvent(o),o.defaultPrevented||fetch(o.request).then(s).catch(i)},create:()=>{throw new Error("foxy-i18n does not support resource creation")}};function c(e,t=!1){var n;const r=e.replace(/^\.?\d+/,""),s=e.substring(0,e.length-r.length);return{count:".5"===s?.5:parseInt(s),units:t&&null!==(n={y:"year",m:"month",w:"week",d:"day"}[r])&&void 0!==n?n:r}}const u={discount:({ns:e,type:t,details:n},r,s)=>{const i=t.endsWith("_percentage")?.01:1,a=n.split("|"),o=["allunits","incremental","repeat","single"].includes(a[0])?a.shift():"single",l=e.split(" "),c=l.shift(),u=[...l,`${o}_${t}_discount_summary`].join(".");return a.map((e=>{var t,n;const r=null!==(n=null===(t=/[-+]/.exec(e))||void 0===t?void 0:t.index)&&void 0!==n?n:-1,s=parseFloat(e.substring(r))*i,a=parseFloat(e.substring(0,r));return`$t(${u}, ${JSON.stringify({maximumFractionDigits:10,adjustment:s,from:a,ns:c})})`})).join("; ")},relative:(e,t,n)=>{const r=new Intl.RelativeTimeFormat(n);let{count:s,units:i}=c(e,!0);return.5===s&&"month"===i&&(s=2,i="week"),r.format(s,i)},percent:(e,n,r,s)=>{let i=null;try{"number"==typeof e&&(i=e.toLocaleString(r,t(t({},s),{},{style:"percent"})))}catch(e){console.warn(`i18next formatter error: ${e.message}`)}return i||String(e)},ordinal:(e,t,n,r)=>{var s,i;const a=new Intl.PluralRules(n,{type:"ordinal"}),o=null!==(i=null===(s=null==r?void 0:r.ns)||void 0===s?void 0:s.split(" "))&&void 0!==i?i:[];null==o||o.shift();return`${e}$t(${[...o,`ordinal_${a.select(e)}`].join(".")})`},price:(e,t,n,r)=>{var s;try{const[t,i]=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",signDisplay:null==r?void 0:r.signDisplay,style:"currency",currency:i})}catch(t){return e}},date:(e,t,n,r)=>{var s,i,a;if(!e)return"$t(unknown)";const o=new Date(e),l=null!==(s=null==r?void 0:r.month)&&void 0!==s?s:"long",c=(null!==(i=null==r?void 0:r.year)&&void 0!==i?i:(new Date).getFullYear()===o.getFullYear())?void 0:"numeric",u=null!==(a=null==r?void 0:r.day)&&void 0!==a?a:"numeric";return o.toLocaleDateString(n,{month:l,year:c,day:u})},time:(e,t,n)=>new Date(e).toLocaleTimeString(n,{hour:"numeric",minute:"numeric"})};let d,p=e=>e;class m extends(i(o(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 a&&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=a,m.i18next=s.createInstance().use(l),m.i18next.init({interpolation:{format:(e,t="",n="en",r={})=>t.split(" ").filter((e=>!!e.trim())).reduce(((e,t)=>{var s,i;return null!==(i=null===(s=u[t])||void 0===s?void 0:s.call(u,e,t,n,r))&&void 0!==i?i:e}),e),escapeValue:!1},fallbackLng:"en",fallbackNS:"shared",defaultNS:"shared",ns:["shared"]}),customElements.define("foxy-i18n",m);export{m as I,c as p};
@@ -0,0 +1 @@
1
+ import"./foxy-spinner.js";import{I as e}from"./shared-e48fbf50.js";customElements.define("foxy-internal-card",e);
@@ -1 +1 @@
1
- import{e,f as t,t as r,d as s,g as i,h as n,j as o,k as a,l as h,m as u,_ as l,n as c,o as d,p as f,R as _}from"./shared-11014aad.js";import{h as v,L as m}from"./shared-dc73b9a5.js";import{A as p}from"./shared-e07b24ca.js";import{F as g}from"./shared-343d1fd7.js";import{U as y,a as R}from"./shared-3ab0306f.js";import{I as E}from"./shared-4fd17baf.js";import{d as S,i as w,a as b,c as P,b as k}from"./shared-8a04bea3.js";import{i as T}from"./shared-250e652f.js";var x=Date.now;var L,U,A,H=S?function(e,t){return S(e,"toString",{configurable:!0,enumerable:!1,value:(r=t,function(){return r}),writable:!0});var r}:w,j=(L=H,U=0,A=0,function(){var e=x(),t=16-(e-A);if(A=e,t>0){if(++U>=800)return arguments[0]}else U=0;return L.apply(void 0,arguments)});function F(e){return e!=e}function N(e,t,r){return t==t?function(e,t,r){for(var s=r-1,i=e.length;++s<i;)if(e[s]===t)return s;return-1}(e,t,r):function(e,t,r,s){for(var i=e.length,n=r+(s?1:-1);s?n--:++n<i;)if(t(e[n],n,e))return n;return-1}(e,F,r)}var C=Math.max;function D(t,r){return r.length<2?t:e(t,function(e,t,r){var s=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var n=Array(i);++s<i;)n[s]=e[s+t];return n}(r,0,-1))}function I(e,t,r,s){for(var i=r-1,n=e.length;++i<n;)if(s(e[i],t))return i;return-1}var Q=Array.prototype.splice;var O=function(e,t){return j(function(e,t,r){return t=C(void 0===t?e.length-1:t,0),function(){for(var s=arguments,i=-1,n=C(s.length-t,0),o=Array(n);++i<n;)o[i]=s[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=s[i];return a[t]=r(o),function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}(e,this,a)}}(e,t,w),e+"")}((function(e,t){return e&&e.length&&t&&t.length?function(e,t,r,s){var i=s?I:N,a=-1,h=t.length,u=e;for(e===t&&(t=P(t)),r&&(u=n(e,o(r)));++a<h;)for(var l=0,c=t[a],d=r?r(c):c;(l=i(u,d,l,s))>-1;)u!==e&&Q.call(u,l,1),Q.call(e,l,1);return e}(e,t):e})),W=O;function $(e,n,o){return null==e?e:function(e,n,o,a){if(!s(e))return e;for(var h=-1,u=(n=t(n,e)).length,l=u-1,c=e;null!=c&&++h<u;){var d=r(n[h]),f=o;if("__proto__"===d||"constructor"===d||"prototype"===d)return e;if(h!=l){var _=c[d];void 0===(f=a?a(_,d,c):void 0)&&(f=s(_)?_:i(n[h+1])?[]:{})}b(c,d,f),c=c[d]}return e}(e,n,o)}var G=0;function M(e,s){return null==e||function(e,s){return null==(e=D(e,s=t(s,e)))||delete e[r((i=s,n=null==i?0:i.length,n?i[n-1]:void 0))];var i,n}(e,s)}function q(e,t){let r=null;return h(t).forEach((function(){var t,s,i,n,o,a,h,u,l,c,d;if(null===(i=null===(s=null===(t=this.node)||void 0===t?void 0:t._links)||void 0===s?void 0:s.self)||void 0===i?void 0:i.href){const t=null===(a=null===(o=null===(n=this.node)||void 0===n?void 0:n._links)||void 0===o?void 0:o.self)||void 0===a?void 0:a.href,s=new URL(null===(l=null===(u=null===(h=this.node)||void 0===h?void 0:h._links)||void 0===u?void 0:u.self)||void 0===l?void 0:l.href);if(s.searchParams.delete("zoom"),e===t||e===s.toString())return r=JSON.stringify(this.node),void this.stop()}Object.entries(null!==(d=null===(c=this.node)||void 0===c?void 0:c._links)&&void 0!==d?d:{}).some((([t,s])=>{var i,n;if(s.href!==e)return!1;const o=null===(n=null===(i=this.node)||void 0===i?void 0:i._embedded)||void 0===n?void 0:n[t];if(!o||!Array.isArray(o))return!1;const a=o.length<20?o.length:21,h=new URL(e),u=new URL(e);return h.searchParams.set("offset",o.length.toString()),u.searchParams.set("offset",a.toString()),r=JSON.stringify({returned_items:o.length,total_items:a,offset:0,limit:20,_embedded:{[t]:o},_links:{curies:this.node._links.curies,first:{href:e},last:{href:u.toString()},prev:{href:e},next:{href:h.toString()},self:{href:e}}}),this.stop(),!0}))})),new Response(r,{status:r?200:404})}async function J(e,t){var r,s;if(t.in("busy"))return Promise.resolve(new Response(null,{status:500}));const i=new URL(e.url);i.search="",i.hash="";const n=i.toString().replace(`foxy://${t.virtualHost}/form/`,"").split("/").map(decodeURIComponent),o=u(t.form,n);let a,h=405;if("GET"===e.method)if(Array.isArray(o)){const i=parseInt(null!==(r=new URL(e.url).searchParams.get("offset"))&&void 0!==r?r:""),u=parseInt(null!==(s=new URL(e.url).searchParams.get("limit"))&&void 0!==s?s:""),c=isNaN(i)||i<0?0:i,d=isNaN(u)||u<0?20:u,f=o.slice(c,c+d).map(((e,r)=>{const s=["form",...n,String(r)],i=`foxy://${t.virtualHost}/${s.map(encodeURIComponent).join("/")}`;return l({_links:{self:{href:i}}},e)})),_=new URL(e.url);_.searchParams.set("offset","0"),_.searchParams.set("limit",String(d));const v=new URL(e.url);v.searchParams.set("offset",String(Math.max(0,c-d))),v.searchParams.set("limit",String(d));const m=new URL(e.url);m.searchParams.set("offset",String(Math.min(o.length,c+d))),m.searchParams.set("limit",String(d));const p=new URL(e.url);p.searchParams.set("offset",String(Math.max(0,o.length-d))),p.searchParams.set("limit",String(d)),h=200,a={returned_items:f.length,total_items:o.length,offset:c,limit:d,_embedded:{"fx:slice":f},_links:{first:{href:_.toString()},last:{href:p.toString()},prev:{href:v.toString()},next:{href:m.toString()},self:{href:e.url}}}}else h=200,a=l({_links:{self:{href:e.url}}},o);if("POST"===e.method){const r=await e.json(),s=k(t.form),i=u(s,n).push(r)-1;t.edit(s);const o=["form",...n,String(i)].map(encodeURIComponent).join("/");h=200,a={_links:{self:{href:`foxy://${t.virtualHost}/${o}`}},message:"Resource created successfully."}}if("PATCH"===e.method){const r=k(t.form),s=l(l({},u(r,n)),await e.json());t.edit($(r,n,s)),h=200,a=l({_links:{self:{href:e.url}}},s)}if("DELETE"===e.method){const r=k(t.form),s=u(r,n.slice(0,-1));Array.isArray(s)?W(s,u(r,n)):M(r,n),t.edit(r),h=200,a={_links:{self:{href:e.url}},message:"Resource deleted successfully."}}return Promise.resolve(new Response(JSON.stringify(a),{status:h}))}let V,z=e=>e;class B extends(E(m)){constructor(){var e;super(),this.lang="",this.parent="",this.related=[],this.virtualHost=(e=++G,a("nucleon-")+e),this.__hrefToLoad=null,this.__group="",this.__unsubscribeFromRumour=null,this.__fetchEventQueue=[],this.__service=T(d.withConfig({services:{sendDelete:()=>this._sendDelete(),sendPatch:({edits:e})=>this._sendPatch(e),sendPost:({edits:e})=>this._sendPost(e),sendGet:()=>this._sendGet()},actions:{validate:f({errors:e=>{const t=this.constructor.v8n,r=l(l({},e.data),e.edits);return t.map((e=>e(r,this))).filter((e=>"string"==typeof e)).filter(((e,t,r)=>r.indexOf(e)===t))}})}})),this.__createService()}static get inferredProperties(){return[...super.inferredProperties,"group","lang"]}static get properties(){return{__state:{type:String,reflect:!0,attribute:"state"},virtualHost:{attribute:"virtual-host"},related:{type:Array},parent:{type:String},group:{type:String,noAccessor:!0},href:{type:String,noAccessor:!0},lang:{type:String}}}static get v8n(){return[]}get failure(){return this.__service.state.context.failure}get errors(){return this.__service.state.context.errors}get form(){const{data:e,edits:t}=this.__service.state.context;return l(l({},e),t)}get data(){return this.__service.state.context.data}set data(e){this.__destroyRumour(),this.__hrefToLoad=null,this.__service.send({type:"SET_DATA",data:e}),e&&this.__createRumour()}get group(){return this.__group}set group(e){this.__group=e,this.__destroyRumour(),this.__createRumour()}get href(){var e,t,r;return null!==(r=null!==(t=null===(e=this.form._links)||void 0===e?void 0:e.self.href)&&void 0!==t?t:this.__hrefToLoad)&&void 0!==r?r:""}set href(e){this.__hrefToLoad=e,e?this.__service.send({type:"FETCH"}):this.data=null}in(e){return this.__service.state.matches(e)}undo(){this.__service.send({type:"UNDO"})}edit(e){var t;"string"==typeof(null===(t=e._links)||void 0===t?void 0:t.self.href)&&(this.__hrefToLoad=null),this.__service.send({type:"EDIT",data:e})}submit(){this.reportValidity(),this.__service.send({type:"SUBMIT"})}checkValidity(){const e=this.in({idle:{template:{dirty:"valid"}}}),t=this.in({idle:{snapshot:{dirty:"valid"}}}),r=this.in({idle:{template:{clean:"valid"}}}),s=this.in({idle:{snapshot:{clean:"valid"}}});return r||e||(s||t)}reportValidity(){const e=this.ownerDocument.createTreeWalker(this.renderRoot,NodeFilter.SHOW_ELEMENT);do{const t=e.currentNode,r=["reportValidity","validate"];for(const e of r)if(e in t)try{t[e]();break}catch(e){continue}}while(e.nextNode());return this.checkValidity()}delete(){this.__service.send({type:"DELETE"})}refresh(){this.__service.send({type:"REFRESH"})}render(){return v(V||(V=z`<slot></slot>`))}connectedCallback(){super.connectedCallback(),this.href&&!this.data&&this.__service.send({type:"FETCH"}),this.__createRumour(),this.__createServer(),this.__processFetchEventQueue(),this.dispatchEvent(new y)}disconnectedCallback(){super.disconnectedCallback(),this.__destroyRumour(),this.__destroyServer(),this.__flushFetchEventQueue("parent element was disconnected"),this.dispatchEvent(new y)}applyInferredProperties(e){var t,r;super.applyInferredProperties(e),null!==this.infer&&(this.group=null!==(t=e.get("group"))&&void 0!==t?t:"",this.lang=null!==(r=e.get("lang"))&&void 0!==r?r:"")}async _fetch(...e){const t=await new p(this).fetch(...e);if(!t.ok)throw t;return t.json()}async _sendPost(e){let t;this.__destroyRumour();try{const r=JSON.stringify(e),s=await this._fetch(this.parent,{body:r,method:"POST"});t=await this._fetch(s._links.self.href);const i=B.Rumour(this.group),n=[...this.related,this.parent];i.share({data:t,related:n,source:t._links.self.href})}finally{this.__createRumour()}return t}async _sendGet(){let e;this.__destroyRumour();try{e=await this._fetch(this.href),B.Rumour(this.group).share({data:e,source:this.href})}finally{this.__createRumour()}return e}async _sendPatch(e){let t;this.__destroyRumour();try{const r=JSON.stringify(e);t=await this._fetch(this.href,{body:r,method:"PATCH"});B.Rumour(this.group).share({data:t,source:this.href,related:this.related})}finally{this.__createRumour()}return t}async _sendDelete(){this.__destroyRumour();try{await this._fetch(this.href,{method:"DELETE"});const e=B.Rumour(this.group),t=[...this.related,this.parent];e.share({data:null,source:this.href,related:t})}finally{this.__createRumour()}return null}get __state(){const e=this.__service.state.toStrings().reduce(((e,t)=>[...e,...t.split(".")]),[]);return[...new Set(e)].join(" ")}__createService(){this.__service.onTransition((e=>{var t,r;if(!e.changed)return;let s;e.matches("idle")&&((null===(t=e.history)||void 0===t?void 0:t.matches({busy:"deleting"}))?s=R.ResourceDeleted:(null===(r=e.history)||void 0===r?void 0:r.matches({busy:"creating"}))&&(s=R.ResourceCreated)),this.requestUpdate(),this.dispatchEvent(new y("update",{detail:{result:s}})),e.matches("busy")||this.__processFetchEventQueue()})),this.__service.onChange((()=>{this.requestUpdate(),this.dispatchEvent(new y)})),this.__service.start()}__createRumour(){const e=B.Rumour(this.group);this.__unsubscribeFromRumour=e.track((e=>this.__handleRumourUpdate(e)))}__destroyRumour(){var e;null===(e=this.__unsubscribeFromRumour)||void 0===e||e.call(this),this.__unsubscribeFromRumour=null}__createServer(){this.__fetchEventHandler=this.__handleFetchEvent.bind(this),this.addEventListener("fetch",this.__fetchEventHandler)}__destroyServer(){this.removeEventListener("fetch",this.__fetchEventHandler)}__handleRumourUpdate(e){var t;try{const r=null===(t=this.__service.state)||void 0===t?void 0:t.context.data,s=r?e(r):r;if(s!==r&&(this.data=s,!s)){const e=R.ResourceDeleted,t=new y("update",{detail:{result:e}});this.dispatchEvent(t)}}catch(e){if(!(e instanceof _.UpdateError))throw e;setTimeout((()=>this.refresh()))}}__processFetchEventQueue(){const e=new B.API(this);this.__fetchEventQueue.forEach((t=>{const r=t.request;if(this.virtualHost&&r.url.startsWith(`foxy://${this.virtualHost}/form/`))return t.respondWith(J(r,this));const s=q(r.url,this.data),i=s.ok?s:e.fetch(r);t.respondWith(Promise.resolve(i)),s.ok&&console.debug(`%c@foxy.io/elements::${this.localName}\n%c200%c GET ${r.url}`,"color: gray","background: gray; padding: 0 .2em; border-radius: .2em; color: white;","")})),this.__fetchEventQueue=[]}__flushFetchEventQueue(e){this.__fetchEventQueue.forEach((t=>{t.respondWith(Promise.reject(new Error(e)))})),this.__fetchEventQueue=[]}__handleFetchEvent(e){if(!(e instanceof g))return;if(e.defaultPrevented)return;if(e.composedPath()[0]===this)return;const{url:t,method:r}=e.request;if(t.startsWith("foxy://")){if(!this.virtualHost||!t.startsWith(`foxy://${this.virtualHost}/form/`))return;if("GET"!==r)return e.respondWith(J(e.request,this))}"GET"===r&&(e.preventDefault(),this.__fetchEventQueue.push(e),this.__service.state.matches("busy")||this.__processFetchEventQueue())}}B.UpdateEvent=y,B.Rumour=c((()=>new _)),B.API=p;export{B as N,q as a,$ as s};
1
+ import{e,f as t,t as r,d as s,g as i,h as n,j as o,k as a,l as h,m as u,_ as l,n as c,o as d,p as f,R as _}from"./shared-11014aad.js";import{h as v,L as m}from"./shared-dc73b9a5.js";import{A as p}from"./shared-e07b24ca.js";import{F as g}from"./shared-343d1fd7.js";import{U as y,a as R}from"./shared-3ab0306f.js";import{I as E}from"./shared-8def6325.js";import{d as S,i as w,a as b,c as P,b as k}from"./shared-8a04bea3.js";import{i as T}from"./shared-250e652f.js";var x=Date.now;var L,U,A,H=S?function(e,t){return S(e,"toString",{configurable:!0,enumerable:!1,value:(r=t,function(){return r}),writable:!0});var r}:w,j=(L=H,U=0,A=0,function(){var e=x(),t=16-(e-A);if(A=e,t>0){if(++U>=800)return arguments[0]}else U=0;return L.apply(void 0,arguments)});function F(e){return e!=e}function N(e,t,r){return t==t?function(e,t,r){for(var s=r-1,i=e.length;++s<i;)if(e[s]===t)return s;return-1}(e,t,r):function(e,t,r,s){for(var i=e.length,n=r+(s?1:-1);s?n--:++n<i;)if(t(e[n],n,e))return n;return-1}(e,F,r)}var C=Math.max;function D(t,r){return r.length<2?t:e(t,function(e,t,r){var s=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var n=Array(i);++s<i;)n[s]=e[s+t];return n}(r,0,-1))}function I(e,t,r,s){for(var i=r-1,n=e.length;++i<n;)if(s(e[i],t))return i;return-1}var Q=Array.prototype.splice;var O=function(e,t){return j(function(e,t,r){return t=C(void 0===t?e.length-1:t,0),function(){for(var s=arguments,i=-1,n=C(s.length-t,0),o=Array(n);++i<n;)o[i]=s[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=s[i];return a[t]=r(o),function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}(e,this,a)}}(e,t,w),e+"")}((function(e,t){return e&&e.length&&t&&t.length?function(e,t,r,s){var i=s?I:N,a=-1,h=t.length,u=e;for(e===t&&(t=P(t)),r&&(u=n(e,o(r)));++a<h;)for(var l=0,c=t[a],d=r?r(c):c;(l=i(u,d,l,s))>-1;)u!==e&&Q.call(u,l,1),Q.call(e,l,1);return e}(e,t):e})),W=O;function $(e,n,o){return null==e?e:function(e,n,o,a){if(!s(e))return e;for(var h=-1,u=(n=t(n,e)).length,l=u-1,c=e;null!=c&&++h<u;){var d=r(n[h]),f=o;if("__proto__"===d||"constructor"===d||"prototype"===d)return e;if(h!=l){var _=c[d];void 0===(f=a?a(_,d,c):void 0)&&(f=s(_)?_:i(n[h+1])?[]:{})}b(c,d,f),c=c[d]}return e}(e,n,o)}var G=0;function M(e,s){return null==e||function(e,s){return null==(e=D(e,s=t(s,e)))||delete e[r((i=s,n=null==i?0:i.length,n?i[n-1]:void 0))];var i,n}(e,s)}function q(e,t){let r=null;return h(t).forEach((function(){var t,s,i,n,o,a,h,u,l,c,d;if(null===(i=null===(s=null===(t=this.node)||void 0===t?void 0:t._links)||void 0===s?void 0:s.self)||void 0===i?void 0:i.href){const t=null===(a=null===(o=null===(n=this.node)||void 0===n?void 0:n._links)||void 0===o?void 0:o.self)||void 0===a?void 0:a.href,s=new URL(null===(l=null===(u=null===(h=this.node)||void 0===h?void 0:h._links)||void 0===u?void 0:u.self)||void 0===l?void 0:l.href);if(s.searchParams.delete("zoom"),e===t||e===s.toString())return r=JSON.stringify(this.node),void this.stop()}Object.entries(null!==(d=null===(c=this.node)||void 0===c?void 0:c._links)&&void 0!==d?d:{}).some((([t,s])=>{var i,n;if(s.href!==e)return!1;const o=null===(n=null===(i=this.node)||void 0===i?void 0:i._embedded)||void 0===n?void 0:n[t];if(!o||!Array.isArray(o))return!1;const a=o.length<20?o.length:21,h=new URL(e),u=new URL(e);return h.searchParams.set("offset",o.length.toString()),u.searchParams.set("offset",a.toString()),r=JSON.stringify({returned_items:o.length,total_items:a,offset:0,limit:20,_embedded:{[t]:o},_links:{curies:this.node._links.curies,first:{href:e},last:{href:u.toString()},prev:{href:e},next:{href:h.toString()},self:{href:e}}}),this.stop(),!0}))})),new Response(r,{status:r?200:404})}async function J(e,t){var r,s;if(t.in("busy"))return Promise.resolve(new Response(null,{status:500}));const i=new URL(e.url);i.search="",i.hash="";const n=i.toString().replace(`foxy://${t.virtualHost}/form/`,"").split("/").map(decodeURIComponent),o=u(t.form,n);let a,h=405;if("GET"===e.method)if(Array.isArray(o)){const i=parseInt(null!==(r=new URL(e.url).searchParams.get("offset"))&&void 0!==r?r:""),u=parseInt(null!==(s=new URL(e.url).searchParams.get("limit"))&&void 0!==s?s:""),c=isNaN(i)||i<0?0:i,d=isNaN(u)||u<0?20:u,f=o.slice(c,c+d).map(((e,r)=>{const s=["form",...n,String(r)],i=`foxy://${t.virtualHost}/${s.map(encodeURIComponent).join("/")}`;return l({_links:{self:{href:i}}},e)})),_=new URL(e.url);_.searchParams.set("offset","0"),_.searchParams.set("limit",String(d));const v=new URL(e.url);v.searchParams.set("offset",String(Math.max(0,c-d))),v.searchParams.set("limit",String(d));const m=new URL(e.url);m.searchParams.set("offset",String(Math.min(o.length,c+d))),m.searchParams.set("limit",String(d));const p=new URL(e.url);p.searchParams.set("offset",String(Math.max(0,o.length-d))),p.searchParams.set("limit",String(d)),h=200,a={returned_items:f.length,total_items:o.length,offset:c,limit:d,_embedded:{"fx:slice":f},_links:{first:{href:_.toString()},last:{href:p.toString()},prev:{href:v.toString()},next:{href:m.toString()},self:{href:e.url}}}}else h=200,a=l({_links:{self:{href:e.url}}},o);if("POST"===e.method){const r=await e.json(),s=k(t.form),i=u(s,n).push(r)-1;t.edit(s);const o=["form",...n,String(i)].map(encodeURIComponent).join("/");h=200,a={_links:{self:{href:`foxy://${t.virtualHost}/${o}`}},message:"Resource created successfully."}}if("PATCH"===e.method){const r=k(t.form),s=l(l({},u(r,n)),await e.json());t.edit($(r,n,s)),h=200,a=l({_links:{self:{href:e.url}}},s)}if("DELETE"===e.method){const r=k(t.form),s=u(r,n.slice(0,-1));Array.isArray(s)?W(s,u(r,n)):M(r,n),t.edit(r),h=200,a={_links:{self:{href:e.url}},message:"Resource deleted successfully."}}return Promise.resolve(new Response(JSON.stringify(a),{status:h}))}let V,z=e=>e;class B extends(E(m)){constructor(){var e;super(),this.lang="",this.parent="",this.related=[],this.virtualHost=(e=++G,a("nucleon-")+e),this.__hrefToLoad=null,this.__group="",this.__unsubscribeFromRumour=null,this.__fetchEventQueue=[],this.__service=T(d.withConfig({services:{sendDelete:()=>this._sendDelete(),sendPatch:({edits:e})=>this._sendPatch(e),sendPost:({edits:e})=>this._sendPost(e),sendGet:()=>this._sendGet()},actions:{validate:f({errors:e=>{const t=this.constructor.v8n,r=l(l({},e.data),e.edits);return t.map((e=>e(r,this))).filter((e=>"string"==typeof e)).filter(((e,t,r)=>r.indexOf(e)===t))}})}})),this.__createService()}static get inferredProperties(){return[...super.inferredProperties,"group","lang"]}static get properties(){return{__state:{type:String,reflect:!0,attribute:"state"},virtualHost:{attribute:"virtual-host"},related:{type:Array},parent:{type:String},group:{type:String,noAccessor:!0},href:{type:String,noAccessor:!0},lang:{type:String}}}static get v8n(){return[]}get failure(){return this.__service.state.context.failure}get errors(){return this.__service.state.context.errors}get form(){const{data:e,edits:t}=this.__service.state.context;return l(l({},e),t)}get data(){return this.__service.state.context.data}set data(e){this.__destroyRumour(),this.__hrefToLoad=null,this.__service.send({type:"SET_DATA",data:e}),e&&this.__createRumour()}get group(){return this.__group}set group(e){this.__group=e,this.__destroyRumour(),this.__createRumour()}get href(){var e,t,r;return null!==(r=null!==(t=null===(e=this.form._links)||void 0===e?void 0:e.self.href)&&void 0!==t?t:this.__hrefToLoad)&&void 0!==r?r:""}set href(e){this.__hrefToLoad=e,e?this.__service.send({type:"FETCH"}):this.data=null}in(e){return this.__service.state.matches(e)}undo(){this.__service.send({type:"UNDO"})}edit(e){var t;"string"==typeof(null===(t=e._links)||void 0===t?void 0:t.self.href)&&(this.__hrefToLoad=null),this.__service.send({type:"EDIT",data:e})}submit(){this.reportValidity(),this.__service.send({type:"SUBMIT"})}checkValidity(){const e=this.in({idle:{template:{dirty:"valid"}}}),t=this.in({idle:{snapshot:{dirty:"valid"}}}),r=this.in({idle:{template:{clean:"valid"}}}),s=this.in({idle:{snapshot:{clean:"valid"}}});return r||e||(s||t)}reportValidity(){const e=this.ownerDocument.createTreeWalker(this.renderRoot,NodeFilter.SHOW_ELEMENT);do{const t=e.currentNode,r=["reportValidity","validate"];for(const e of r)if(e in t)try{t[e]();break}catch(e){continue}}while(e.nextNode());return this.checkValidity()}delete(){this.__service.send({type:"DELETE"})}refresh(){this.__service.send({type:"REFRESH"})}render(){return v(V||(V=z`<slot></slot>`))}connectedCallback(){super.connectedCallback(),this.href&&!this.data&&this.__service.send({type:"FETCH"}),this.__createRumour(),this.__createServer(),this.__processFetchEventQueue(),this.dispatchEvent(new y)}disconnectedCallback(){super.disconnectedCallback(),this.__destroyRumour(),this.__destroyServer(),this.__flushFetchEventQueue("parent element was disconnected"),this.dispatchEvent(new y)}applyInferredProperties(e){var t,r;super.applyInferredProperties(e),null!==this.infer&&(this.group=null!==(t=e.get("group"))&&void 0!==t?t:"",this.lang=null!==(r=e.get("lang"))&&void 0!==r?r:"")}async _fetch(...e){const t=await new p(this).fetch(...e);if(!t.ok)throw t;return t.json()}async _sendPost(e){let t;this.__destroyRumour();try{const r=JSON.stringify(e),s=await this._fetch(this.parent,{body:r,method:"POST"});t=await this._fetch(s._links.self.href);const i=B.Rumour(this.group),n=[...this.related,this.parent];i.share({data:t,related:n,source:t._links.self.href})}finally{this.__createRumour()}return t}async _sendGet(){let e;this.__destroyRumour();try{e=await this._fetch(this.href),B.Rumour(this.group).share({data:e,source:this.href})}finally{this.__createRumour()}return e}async _sendPatch(e){let t;this.__destroyRumour();try{const r=JSON.stringify(e);t=await this._fetch(this.href,{body:r,method:"PATCH"});B.Rumour(this.group).share({data:t,source:this.href,related:this.related})}finally{this.__createRumour()}return t}async _sendDelete(){this.__destroyRumour();try{await this._fetch(this.href,{method:"DELETE"});const e=B.Rumour(this.group),t=[...this.related,this.parent];e.share({data:null,source:this.href,related:t})}finally{this.__createRumour()}return null}get __state(){const e=this.__service.state.toStrings().reduce(((e,t)=>[...e,...t.split(".")]),[]);return[...new Set(e)].join(" ")}__createService(){this.__service.onTransition((e=>{var t,r;if(!e.changed)return;let s;e.matches("idle")&&((null===(t=e.history)||void 0===t?void 0:t.matches({busy:"deleting"}))?s=R.ResourceDeleted:(null===(r=e.history)||void 0===r?void 0:r.matches({busy:"creating"}))&&(s=R.ResourceCreated)),this.requestUpdate(),this.dispatchEvent(new y("update",{detail:{result:s}})),e.matches("busy")||this.__processFetchEventQueue()})),this.__service.onChange((()=>{this.requestUpdate(),this.dispatchEvent(new y)})),this.__service.start()}__createRumour(){const e=B.Rumour(this.group);this.__unsubscribeFromRumour=e.track((e=>this.__handleRumourUpdate(e)))}__destroyRumour(){var e;null===(e=this.__unsubscribeFromRumour)||void 0===e||e.call(this),this.__unsubscribeFromRumour=null}__createServer(){this.__fetchEventHandler=this.__handleFetchEvent.bind(this),this.addEventListener("fetch",this.__fetchEventHandler)}__destroyServer(){this.removeEventListener("fetch",this.__fetchEventHandler)}__handleRumourUpdate(e){var t;try{const r=null===(t=this.__service.state)||void 0===t?void 0:t.context.data,s=r?e(r):r;if(s!==r&&(this.data=s,!s)){const e=R.ResourceDeleted,t=new y("update",{detail:{result:e}});this.dispatchEvent(t)}}catch(e){if(!(e instanceof _.UpdateError))throw e;setTimeout((()=>this.refresh()))}}__processFetchEventQueue(){const e=new B.API(this);this.__fetchEventQueue.forEach((t=>{const r=t.request;if(this.virtualHost&&r.url.startsWith(`foxy://${this.virtualHost}/form/`))return t.respondWith(J(r,this));const s=q(r.url,this.data),i=s.ok?s:e.fetch(r);t.respondWith(Promise.resolve(i)),s.ok&&console.debug(`%c@foxy.io/elements::${this.localName}\n%c200%c GET ${r.url}`,"color: gray","background: gray; padding: 0 .2em; border-radius: .2em; color: white;","")})),this.__fetchEventQueue=[]}__flushFetchEventQueue(e){this.__fetchEventQueue.forEach((t=>{t.respondWith(Promise.reject(new Error(e)))})),this.__fetchEventQueue=[]}__handleFetchEvent(e){if(!(e instanceof g))return;if(e.defaultPrevented)return;if(e.composedPath()[0]===this)return;const{url:t,method:r}=e.request;if(t.startsWith("foxy://")){if(!this.virtualHost||!t.startsWith(`foxy://${this.virtualHost}/form/`))return;if("GET"!==r)return e.respondWith(J(e.request,this))}"GET"===r&&(e.preventDefault(),this.__fetchEventQueue.push(e),this.__service.state.matches("busy")||this.__processFetchEventQueue())}}B.UpdateEvent=y,B.Rumour=c((()=>new _)),B.API=p;export{B as N,q as a,$ as s};
@@ -1 +1 @@
1
- import"./shared-931db653.js";import"./shared-669decee.js";import{_ as t}from"./shared-11014aad.js";import{h as e}from"./shared-dc73b9a5.js";import{D as s}from"./shared-6be0a096.js";let i,n=t=>t;customElements.define("foxy-internal-confirm-dialog",class extends s{constructor(){super(...arguments),this.closable=!1,this.editable=!1,this.alert=!0,this.confirm="confirm",this.message="message",this.cancel="cancel",this.theme="primary"}static get properties(){return t(t({},super.properties),{},{confirm:{type:String},message:{type:String},cancel:{type:String},theme:{type:String}})}render(){return super.render((()=>e(i||(i=n` <foxy-i18n class="block font-lumo text-m text-body text-center mb-m" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> <div class="grid grid-cols-2 gap-m"> <vaadin-button data-testid="cancelButton" @click="${0}"> <foxy-i18n ns="${0}" lang="${0}" key="${0}"></foxy-i18n> </vaadin-button> <vaadin-button theme="${0}" data-testid="confirmButton" @click="${0}"> <foxy-i18n ns="${0}" lang="${0}" key="${0}"></foxy-i18n> </vaadin-button> </div> `),this.lang,this.message,this.ns,this.__handleCancel,this.ns,this.lang,this.cancel,this.theme,this.__handleConfirm,this.ns,this.lang,this.confirm)))}async __handleCancel(){await this.hide(!0)}async __handleConfirm(){await this.hide()}});
1
+ import"./shared-931db653.js";import"./shared-683145e5.js";import{_ as t}from"./shared-11014aad.js";import{h as e}from"./shared-dc73b9a5.js";import{D as s}from"./shared-5dbb9630.js";let i,n=t=>t;customElements.define("foxy-internal-confirm-dialog",class extends s{constructor(){super(...arguments),this.closable=!1,this.editable=!1,this.alert=!0,this.confirm="confirm",this.message="message",this.cancel="cancel",this.theme="primary"}static get properties(){return t(t({},super.properties),{},{confirm:{type:String},message:{type:String},cancel:{type:String},theme:{type:String}})}render(){return super.render((()=>e(i||(i=n` <foxy-i18n class="block font-lumo text-m text-body text-center mb-m" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> <div class="grid grid-cols-2 gap-m"> <vaadin-button data-testid="cancelButton" @click="${0}"> <foxy-i18n ns="${0}" lang="${0}" key="${0}"></foxy-i18n> </vaadin-button> <vaadin-button theme="${0}" data-testid="confirmButton" @click="${0}"> <foxy-i18n ns="${0}" lang="${0}" key="${0}"></foxy-i18n> </vaadin-button> </div> `),this.lang,this.message,this.ns,this.__handleCancel,this.ns,this.lang,this.cancel,this.theme,this.__handleConfirm,this.ns,this.lang,this.confirm)))}async __handleCancel(){await this.hide(!0)}async __handleConfirm(){await this.hide()}});
@@ -0,0 +1,10 @@
1
+ import"./shared-56addb06.js";
2
+ /**
3
+ @license
4
+ Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
5
+ This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
6
+ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
7
+ The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
8
+ Code distributed by Google as part of the polymer project is also
9
+ subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
10
+ */let t=!1,n=[],o=[];function i(){t=!0,requestAnimationFrame((function(){t=!1,function(t){for(;t.length;)e(t.shift())}(n),setTimeout((function(){!function(t){for(let n=0,o=t.length;n<o;n++)e(t.shift())}(o)}))}))}function e(t){const n=t[0],o=t[1],i=t[2];try{o.apply(n,i)}catch(t){setTimeout((()=>{throw t}))}}function f(n,e,f){t||i(),o.push([n,e,f])}export{f as a};
@@ -1,2 +1,2 @@
1
- import{I as e}from"./shared-bf132324.js";import{_ as t}from"./shared-11014aad.js";import{c as r,h as s}from"./shared-dc73b9a5.js";import{r as a}from"./shared-a0c6a159.js";let o,i,d,l,n,c=e=>e;customElements.define("foxy-internal-source-control",class extends e{constructor(){super(...arguments),this.__isErrorVisible=!1,this.__hovered=!1,this.__focused=!1}static get properties(){return t(t({},super.properties),{},{__isErrorVisible:{attribute:!1},__hovered:{attribute:!1},__focused:{attribute:!1}})}static get styles(){return[...super.styles,r(o||(o=c`.monospace{font-family:monospace}.resize-none{resize:none}.max-h-16em{max-height:16em}textarea::selection{background:var(--lumo-contrast-10pct)}`))]}renderControl(){var e;let t,r,o,h,b;return this.disabled?(t="bg-contrast-5 text-disabled",r="text-disabled",h="text-disabled",b="text-disabled",this.readonly?(t+=" border-dashed border-contrast-20",o="border-dashed border-contrast-30"):(t+=" border-transparent",o="border-contrast-10")):this.readonly?(t="border-dashed border-contrast-30 bg-transparent text-secondary",r="text-secondary",o="border-dashed border-contrast-30",h="text-secondary",b="text-secondary",this.__focused&&(o+=" ring-2 ring-primary-50")):this.__focused?(t="border-transparent bg-contrast-10 text-tertiary",r="text-secondary",o="border-primary-50 ring-1 ring-primary-50",h="text-body",b="text-primary"):this.__hovered?(t="border-transparent bg-contrast-20 text-tertiary",r="text-body",o="border-contrast-20",h="text-body",b="text-body"):(t="border-transparent bg-contrast-10 text-tertiary",r="text-secondary",o="border-contrast-10",h="text-body",b="text-secondary"),s(i||(i=c` <label class="block h-full" @mouseenter="${0}" @mouseleave="${0}"> <div class="mb-xs transition-colors leading-none text-s font-medium ${0}" part="label"> ${0} </div> <div class="max-h-16em h-full transition-colors flex-1 flex bg-base rounded overflow-auto border ${0}" part="editor"> <div class="h-full transition-colors monospace leading-s text-s text-right border-r ${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} </div> <textarea placeholder="${0}" class="bg-base whitespace-pre leading-s text-s focus-outline-none monospace resize-none block w-full select-text transition-colors ${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" rows="1" .value="${0}" ?disabled="${0}" ?readonly="${0}" @focus="${0}" @blur="${0}" @input="${0}">
1
+ import{I as e}from"./shared-befe135a.js";import{_ as t}from"./shared-11014aad.js";import{c as r,h as s}from"./shared-dc73b9a5.js";import{r as a}from"./shared-a0c6a159.js";let o,i,d,l,n,c=e=>e;customElements.define("foxy-internal-source-control",class extends e{constructor(){super(...arguments),this.__isErrorVisible=!1,this.__hovered=!1,this.__focused=!1}static get properties(){return t(t({},super.properties),{},{__isErrorVisible:{attribute:!1},__hovered:{attribute:!1},__focused:{attribute:!1}})}static get styles(){return[...super.styles,r(o||(o=c`.monospace{font-family:monospace}.resize-none{resize:none}.max-h-16em{max-height:16em}textarea::selection{background:var(--lumo-contrast-10pct)}`))]}renderControl(){var e;let t,r,o,h,b;return this.disabled?(t="bg-contrast-5 text-disabled",r="text-disabled",h="text-disabled",b="text-disabled",this.readonly?(t+=" border-dashed border-contrast-20",o="border-dashed border-contrast-30"):(t+=" border-transparent",o="border-contrast-10")):this.readonly?(t="border-dashed border-contrast-30 bg-transparent text-secondary",r="text-secondary",o="border-dashed border-contrast-30",h="text-secondary",b="text-secondary",this.__focused&&(o+=" ring-2 ring-primary-50")):this.__focused?(t="border-transparent bg-contrast-10 text-tertiary",r="text-secondary",o="border-primary-50 ring-1 ring-primary-50",h="text-body",b="text-primary"):this.__hovered?(t="border-transparent bg-contrast-20 text-tertiary",r="text-body",o="border-contrast-20",h="text-body",b="text-body"):(t="border-transparent bg-contrast-10 text-tertiary",r="text-secondary",o="border-contrast-10",h="text-body",b="text-secondary"),s(i||(i=c` <label class="block h-full" @mouseenter="${0}" @mouseleave="${0}"> <div class="mb-xs transition-colors leading-none text-s font-medium ${0}" part="label"> ${0} </div> <div class="max-h-16em h-full transition-colors flex-1 flex bg-base rounded overflow-auto border ${0}" part="editor"> <div class="h-full transition-colors monospace leading-s text-s text-right border-r ${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} </div> <textarea placeholder="${0}" class="bg-base whitespace-pre leading-s text-s focus-outline-none monospace resize-none block w-full select-text transition-colors ${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" rows="1" .value="${0}" ?disabled="${0}" ?readonly="${0}" @focus="${0}" @blur="${0}" @input="${0}">
2
2
  </textarea> </div> <div class="mt-xs transition-colors leading-xs text-xs ${0}" part="helper-text" ?hidden="${0}"> ${0} </div> <div class="mt-xs text-xs leading-xs text-error" ?hidden="${0}"> ${0} </div> </label> `),(()=>this.__hovered=!0),(()=>this.__hovered=!1),b,this.label,o,t,a(null!==(e=this._value.split("\n"))&&void 0!==e?e:[],((e,t)=>String(t)),((e,t)=>s(d||(d=c`<div>${0}${0}<span>${0}<span></span></span></div>`),t<9?s(l||(l=c`<span class="opacity-0">0</span>`)):"",t<99?s(n||(n=c`<span class="opacity-0">0</span>`)):"",t+1))),this.placeholder,h,this._value,this.disabled,this.readonly,(()=>this.__focused=!0),(()=>{this.__focused=!1,this.__isErrorVisible=!0}),(e=>{const t=e.currentTarget;this._value=t.value}),r,!this.helperText,this.helperText,!this.__isErrorVisible||!this._errorMessage||this.disabled||this.readonly,this._errorMessage)}updated(e){super.updated(e),this.renderRoot.querySelectorAll("textarea").forEach((e=>{e.style.height="auto",e.style.height=`${e.scrollHeight}px`,e.style.overflowY="hidden"}))}get _value(){var e;return null!==(e=super._value)&&void 0!==e?e:""}set _value(e){super._value=e}});
@@ -1 +1 @@
1
- import{_ as e}from"./shared-11014aad.js";const r=r=>class extends r{constructor(){super(...arguments),this.infer=null}static get inferredProperties(){return[]}static get properties(){return e(e({},super.properties),{},{infer:{type:String,reflect:!0}})}inferFromElement(e,r){if(e in r)return r[e]}inferProperties(){this.updateComplete.then((()=>{var e;const r=new Map,t=this.constructor,n=new Set(t.inferredProperties),s=e=>{e&&(e instanceof ShadowRoot?s(e.host):e instanceof HTMLElement&&(n.forEach((t=>{const s=this.inferFromElement(t,e);void 0!==s&&(r.set(t,s),n.delete(t))})),n.size>0&&s(e.parentNode)))};s(this.parentNode),null===(e=this.applyInferredProperties)||void 0===e||e.call(this,r)}))}inferPropertiesInDescendants(){(this.renderRoot===this?[this.renderRoot]:[this.renderRoot,this]).forEach((e=>e.querySelectorAll("[infer]").forEach((e=>e.inferProperties()))))}applyInferredProperties(e){}connectedCallback(){super.connectedCallback(),this.inferPropertiesInDescendants()}updated(e){super.updated(e),this.inferPropertiesInDescendants()}};export{r as I};
1
+ import{_ as e}from"./shared-11014aad.js";const r=r=>class extends r{constructor(){super(...arguments),this.infer=null}static get inferredProperties(){return[]}static get properties(){return e(e({},super.properties),{},{infer:{type:String,reflect:!0}})}inferFromElement(e,r){if(e in r)return r[e]}inferProperties(){this.updateComplete.then((()=>{var e;const r=new Map,t=this.constructor,n=new Set(t.inferredProperties),s=e=>{e&&(e instanceof ShadowRoot?s(e.host):e instanceof HTMLElement&&(n.forEach((t=>{const s=this.inferFromElement(t,e);void 0!==s&&(r.set(t,s),n.delete(t))})),n.size>0&&s(e.parentNode)))};s(this.parentNode),null===(e=this.applyInferredProperties)||void 0===e||e.call(this,r)}))}inferPropertiesInDescendants(){(this.renderRoot===this?[this.renderRoot]:[this.renderRoot,this]).forEach((e=>e.querySelectorAll("[infer]").forEach((e=>{try{e.inferProperties()}catch(r){console.warn(`Failed to infer properties for ${e.tagName}`,e,r)}}))))}applyInferredProperties(e){}connectedCallback(){super.connectedCallback(),this.inferPropertiesInDescendants()}updated(e){super.updated(e),this.inferPropertiesInDescendants()}};export{r as I};
@@ -1 +1 @@
1
- import"./shared-f7a5b12a.js";import"./shared-6e977271.js";import{I as e}from"./shared-bf132324.js";import{_ as t}from"./shared-11014aad.js";import{i as r}from"./shared-9803aa7c.js";import{h as a,s}from"./shared-dc73b9a5.js";import{c as l}from"./shared-4e709717.js";let o,i,n,d=e=>e;customElements.define("foxy-internal-password-control",class extends e{constructor(){super(...arguments),this.generatorOptions=null,this.showGenerator=!1}static get properties(){return t(t({},super.properties),{},{generatorOptions:{type:Object,attribute:"generator-options"},showGenerator:{type:Boolean,attribute:"show-generator"}})}renderControl(){return a(o||(o=d` <vaadin-password-field error-message="${0}" helper-text="${0}" placeholder="${0}" label="${0}" class="w-full" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" .value="${0}" @keydown="${0}" @input="${0}"> ${0} </vaadin-password-field> `),r(this._errorMessage),this.helperText,this.placeholder,this.label,this.disabled,this.readonly,this._checkValidity,this._value,(e=>{var t;return"Enter"===e.key&&(null===(t=this.nucleon)||void 0===t?void 0:t.submit())}),(e=>{const t=e.currentTarget;this._value=t.value}),this.showGenerator?this.__renderGenerator():"")}get _value(){var e;return null!==(e=super._value)&&void 0!==e?e:""}set _value(e){super._value=e}__renderGenerator(){return a(i||(i=d` <div data-testid="generator" class="${0}" slot="suffix" @click="${0}"> ${0} </div> `),l({"w-s h-s flex items-center justify-center cursor-default transition-colors":!0,"text-contrast-60 hover-text-contrast-80":!this.disabled&&!this.readonly,"text-contrast-20":this.disabled||this.readonly}),(()=>{var e;this._value=function(e){var t,r;const a=null!==(t=null==e?void 0:e.charset)&&void 0!==t?t:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",s=null!==(r=null==e?void 0:e.length)&&void 0!==r?r:18;let l="";for(let e=0;e<s;e++)e>0&&e%6==0&&(l+="-"),l+=a[Math.floor(Math.random()*a.length)];return l}(null!==(e=this.generatorOptions)&&void 0!==e?e:void 0);const t=this.renderRoot.querySelector("vaadin-password-field");null==t||t._setPasswordVisible(!0)}),s(n||(n=d`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.15em; height: 1.15em"><path d="M15.98 1.804a1 1 0 00-1.96 0l-.24 1.192a1 1 0 01-.784.785l-1.192.238a1 1 0 000 1.962l1.192.238a1 1 0 01.785.785l.238 1.192a1 1 0 001.962 0l.238-1.192a1 1 0 01.785-.785l1.192-.238a1 1 0 000-1.962l-1.192-.238a1 1 0 01-.785-.785l-.238-1.192zM6.949 5.684a1 1 0 00-1.898 0l-.683 2.051a1 1 0 01-.633.633l-2.051.683a1 1 0 000 1.898l2.051.684a1 1 0 01.633.632l.683 2.051a1 1 0 001.898 0l.683-2.051a1 1 0 01.633-.633l2.051-.683a1 1 0 000-1.898l-2.051-.683a1 1 0 01-.633-.633L6.95 5.684zM13.949 13.684a1 1 0 00-1.898 0l-.184.551a1 1 0 01-.632.633l-.551.183a1 1 0 000 1.898l.551.183a1 1 0 01.633.633l.183.551a1 1 0 001.898 0l.184-.551a1 1 0 01.632-.633l.551-.183a1 1 0 000-1.898l-.551-.184a1 1 0 01-.633-.632l-.183-.551z" /></svg>`)))}});
1
+ import"./shared-f7a5b12a.js";import"./shared-6e977271.js";import{I as e}from"./shared-befe135a.js";import{_ as t}from"./shared-11014aad.js";import{i as r}from"./shared-9803aa7c.js";import{h as a,s}from"./shared-dc73b9a5.js";import{c as l}from"./shared-4e709717.js";let o,i,n,d=e=>e;customElements.define("foxy-internal-password-control",class extends e{constructor(){super(...arguments),this.generatorOptions=null,this.showGenerator=!1}static get properties(){return t(t({},super.properties),{},{generatorOptions:{type:Object,attribute:"generator-options"},showGenerator:{type:Boolean,attribute:"show-generator"}})}renderControl(){return a(o||(o=d` <vaadin-password-field error-message="${0}" helper-text="${0}" placeholder="${0}" label="${0}" class="w-full" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" .value="${0}" @keydown="${0}" @input="${0}"> ${0} </vaadin-password-field> `),r(this._errorMessage),this.helperText,this.placeholder,this.label,this.disabled,this.readonly,this._checkValidity,this._value,(e=>{var t;return"Enter"===e.key&&(null===(t=this.nucleon)||void 0===t?void 0:t.submit())}),(e=>{const t=e.currentTarget;this._value=t.value}),this.showGenerator?this.__renderGenerator():"")}get _value(){var e;return null!==(e=super._value)&&void 0!==e?e:""}set _value(e){super._value=e}__renderGenerator(){return a(i||(i=d` <div data-testid="generator" class="${0}" slot="suffix" @click="${0}"> ${0} </div> `),l({"w-s h-s flex items-center justify-center cursor-default transition-colors":!0,"text-contrast-60 hover-text-contrast-80":!this.disabled&&!this.readonly,"text-contrast-20":this.disabled||this.readonly}),(()=>{var e;this._value=function(e){var t,r;const a=null!==(t=null==e?void 0:e.charset)&&void 0!==t?t:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",s=null!==(r=null==e?void 0:e.length)&&void 0!==r?r:18;let l="";for(let e=0;e<s;e++)e>0&&e%6==0&&(l+="-"),l+=a[Math.floor(Math.random()*a.length)];return l}(null!==(e=this.generatorOptions)&&void 0!==e?e:void 0);const t=this.renderRoot.querySelector("vaadin-password-field");null==t||t._setPasswordVisible(!0)}),s(n||(n=d`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.15em; height: 1.15em"><path d="M15.98 1.804a1 1 0 00-1.96 0l-.24 1.192a1 1 0 01-.784.785l-1.192.238a1 1 0 000 1.962l1.192.238a1 1 0 01.785.785l.238 1.192a1 1 0 001.962 0l.238-1.192a1 1 0 01.785-.785l1.192-.238a1 1 0 000-1.962l-1.192-.238a1 1 0 01-.785-.785l-.238-1.192zM6.949 5.684a1 1 0 00-1.898 0l-.683 2.051a1 1 0 01-.633.633l-2.051.683a1 1 0 000 1.898l2.051.684a1 1 0 01.633.632l.683 2.051a1 1 0 001.898 0l.683-2.051a1 1 0 01.633-.633l2.051-.683a1 1 0 000-1.898l-2.051-.683a1 1 0 01-.633-.633L6.95 5.684zM13.949 13.684a1 1 0 00-1.898 0l-.184.551a1 1 0 01-.632.633l-.551.183a1 1 0 000 1.898l.551.183a1 1 0 01.633.633l.183.551a1 1 0 001.898 0l.184-.551a1 1 0 01.632-.633l.551-.183a1 1 0 000-1.898l-.551-.184a1 1 0 01-.633-.632l-.183-.551z" /></svg>`)))}});