@foxy.io/elements 1.27.0-beta.7 → 1.27.0-beta.8

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 (279) hide show
  1. package/dist/cdn/foxy-access-recovery-form.js +1 -1
  2. package/dist/cdn/foxy-address-card.js +5 -5
  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 +2 -2
  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 -1
  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 +13 -13
  34. package/dist/cdn/foxy-customer.js +6 -6
  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 +7 -7
  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-card.js +1 -1
  51. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  52. package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
  53. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  54. package/dist/cdn/foxy-gift-card-form.js +1 -1
  55. package/dist/cdn/foxy-i18n-editor.js +2 -2
  56. package/dist/cdn/foxy-i18n.js +1 -1
  57. package/dist/cdn/foxy-integration-card.js +1 -1
  58. package/dist/cdn/foxy-integration-form.js +1 -1
  59. package/dist/cdn/foxy-item-card.js +1 -1
  60. package/dist/cdn/foxy-item-category-card.js +1 -1
  61. package/dist/cdn/foxy-item-category-form.js +1 -1
  62. package/dist/cdn/foxy-item-form.js +3 -3
  63. package/dist/cdn/foxy-item-option-card.js +1 -1
  64. package/dist/cdn/foxy-item-option-form.js +1 -1
  65. package/dist/cdn/foxy-items-form.js +1 -1
  66. package/dist/cdn/foxy-native-integration-card.js +1 -1
  67. package/dist/cdn/foxy-native-integration-form.js +1 -1
  68. package/dist/cdn/foxy-nucleon-element.js +1 -1
  69. package/dist/cdn/foxy-pagination.js +1 -1
  70. package/dist/cdn/foxy-passkey-card.js +1 -1
  71. package/dist/cdn/foxy-passkey-form.js +1 -1
  72. package/dist/cdn/foxy-payment-card-embed-element.js +1 -0
  73. package/dist/cdn/foxy-payment-card.js +1 -1
  74. package/dist/cdn/foxy-payment-method-card.js +1 -1
  75. package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
  76. package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
  77. package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
  78. package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
  79. package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
  80. package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
  81. package/dist/cdn/foxy-payments-api.js +1 -1
  82. package/dist/cdn/foxy-query-builder.js +1 -1
  83. package/dist/cdn/foxy-report-form.js +2 -2
  84. package/dist/cdn/foxy-reports-table.js +3 -3
  85. package/dist/cdn/foxy-shipment-card.js +1 -1
  86. package/dist/cdn/foxy-shipping-method-card.js +1 -1
  87. package/dist/cdn/foxy-sign-in-form.js +1 -1
  88. package/dist/cdn/foxy-spinner.js +2 -2
  89. package/dist/cdn/foxy-store-card.js +1 -1
  90. package/dist/cdn/foxy-store-form.js +1 -1
  91. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  92. package/dist/cdn/foxy-subscription-card.js +1 -1
  93. package/dist/cdn/foxy-subscription-form.js +1 -1
  94. package/dist/cdn/foxy-subscription-settings-form.js +1 -1
  95. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  96. package/dist/cdn/foxy-table.js +1 -1
  97. package/dist/cdn/foxy-tax-card.js +1 -1
  98. package/dist/cdn/foxy-tax-form.js +1 -1
  99. package/dist/cdn/foxy-template-config-form.js +1 -1
  100. package/dist/cdn/foxy-template-form.js +1 -1
  101. package/dist/cdn/foxy-template-set-card.js +1 -1
  102. package/dist/cdn/foxy-template-set-form.js +1 -1
  103. package/dist/cdn/foxy-transaction-card.js +1 -1
  104. package/dist/cdn/foxy-transaction.js +1 -1
  105. package/dist/cdn/foxy-transactions-table.js +1 -1
  106. package/dist/cdn/foxy-update-payment-method-form.js +1 -0
  107. package/dist/cdn/foxy-user-card.js +1 -1
  108. package/dist/cdn/foxy-user-form.js +1 -1
  109. package/dist/cdn/foxy-users-table.js +1 -1
  110. package/dist/cdn/foxy-webhook-card.js +1 -1
  111. package/dist/cdn/foxy-webhook-form.js +1 -1
  112. package/dist/cdn/foxy-webhook-log-card.js +1 -1
  113. package/dist/cdn/foxy-webhook-status-card.js +1 -1
  114. package/dist/cdn/{shared-684cd55a.js → shared-0062cab1.js} +1 -1
  115. package/dist/cdn/{shared-8a247f48.js → shared-036b25a3.js} +1 -1
  116. package/dist/cdn/{shared-18bfe97c.js → shared-04d8a434.js} +1 -1
  117. package/dist/cdn/{shared-07e7d118.js → shared-0aa511d0.js} +1 -1
  118. package/dist/cdn/shared-102dfbe0.js +1 -0
  119. package/dist/cdn/shared-12e531b8.js +1 -0
  120. package/dist/cdn/{shared-b2fd98e6.js → shared-15fe01fe.js} +1 -1
  121. package/dist/cdn/{shared-2314add3.js → shared-1ab8b12e.js} +1 -1
  122. package/dist/cdn/{shared-4c7a8fcc.js → shared-1d12db26.js} +1 -1
  123. package/dist/cdn/{shared-99e354b1.js → shared-25fc0ceb.js} +1 -1
  124. package/dist/cdn/shared-272e7269.js +1 -0
  125. package/dist/cdn/{shared-3cabd589.js → shared-2808f43a.js} +1 -1
  126. package/dist/cdn/{shared-be0fca15.js → shared-292585a0.js} +1 -1
  127. package/dist/cdn/shared-2e2d45c4.js +1 -0
  128. package/dist/cdn/{shared-0a9d860d.js → shared-2f2b5a28.js} +1 -1
  129. package/dist/cdn/{shared-412c19c2.js → shared-30143820.js} +1 -1
  130. package/dist/cdn/{shared-739f24fe.js → shared-328e5fdc.js} +1 -1
  131. package/dist/cdn/{shared-03673673.js → shared-337f2fe9.js} +1 -1
  132. package/dist/cdn/{shared-91c88f14.js → shared-34f4330c.js} +1 -1
  133. package/dist/cdn/{shared-482b2b86.js → shared-37391934.js} +1 -1
  134. package/dist/cdn/shared-39fc8fed.js +1 -0
  135. package/dist/cdn/{shared-b3db7611.js → shared-3c58ddf1.js} +1 -1
  136. package/dist/cdn/{shared-58951f74.js → shared-40cbbbae.js} +4 -4
  137. package/dist/cdn/{shared-018d5724.js → shared-4128d453.js} +1 -1
  138. package/dist/cdn/{shared-28be347b.js → shared-41e9ef02.js} +2 -2
  139. package/dist/cdn/{shared-0f59fd6a.js → shared-432d66f4.js} +1 -1
  140. package/dist/cdn/{shared-612ea9ed.js → shared-4885670b.js} +1 -1
  141. package/dist/cdn/{shared-fc5ace3b.js → shared-550608b8.js} +1 -1
  142. package/dist/cdn/{shared-467e5b06.js → shared-5758adbc.js} +1 -1
  143. package/dist/cdn/{shared-90cbed56.js → shared-5a18985c.js} +2 -2
  144. package/dist/cdn/{shared-8258443c.js → shared-5e9395ec.js} +1 -1
  145. package/dist/cdn/{shared-a24b2aa7.js → shared-62f3fc5a.js} +1 -1
  146. package/dist/cdn/{shared-5debeb1b.js → shared-66a515e3.js} +1 -1
  147. package/dist/cdn/shared-66d2a0d7.js +1 -0
  148. package/dist/cdn/{shared-584df8a8.js → shared-68aebcc4.js} +1 -1
  149. package/dist/cdn/{shared-1e7639e6.js → shared-6dfb57b1.js} +1 -1
  150. package/dist/cdn/{shared-b900e1b5.js → shared-739a8fe4.js} +1 -1
  151. package/dist/cdn/{shared-cdf873d4.js → shared-7535b32d.js} +1 -1
  152. package/dist/cdn/{shared-25198d9a.js → shared-7c819ebc.js} +1 -1
  153. package/dist/cdn/{shared-285f8cee.js → shared-84215d13.js} +1 -1
  154. package/dist/cdn/{shared-4affec66.js → shared-8452c492.js} +1 -1
  155. package/dist/cdn/{shared-b9ea6d85.js → shared-8540c2c7.js} +1 -1
  156. package/dist/cdn/{shared-540063aa.js → shared-8c5b4c81.js} +1 -1
  157. package/dist/cdn/{shared-6cd4e618.js → shared-8d7e2e2c.js} +1 -1
  158. package/dist/cdn/{shared-f7c60ee0.js → shared-8e59a71e.js} +1 -1
  159. package/dist/cdn/shared-8e75c372.js +1 -0
  160. package/dist/cdn/shared-90ddf541.js +1 -0
  161. package/dist/cdn/{shared-f0fcd613.js → shared-91009494.js} +1 -1
  162. package/dist/cdn/shared-9f5c636a.js +1 -0
  163. package/dist/cdn/{shared-d56a3799.js → shared-a30fcaf6.js} +1 -1
  164. package/dist/cdn/{shared-d222bd1e.js → shared-a33be18f.js} +1 -1
  165. package/dist/cdn/{shared-6b68b3b6.js → shared-a911ab73.js} +1 -1
  166. package/dist/cdn/{shared-9cfef94a.js → shared-b1c7300a.js} +1 -1
  167. package/dist/cdn/{shared-ea5fa631.js → shared-b2ce84fa.js} +1 -1
  168. package/dist/cdn/{shared-bd919e3b.js → shared-b55f1de3.js} +1 -1
  169. package/dist/cdn/{shared-d72e87ee.js → shared-b6c1aa47.js} +1 -1
  170. package/dist/cdn/{shared-bb1d162b.js → shared-b73fd633.js} +1 -1
  171. package/dist/cdn/{shared-ad11b006.js → shared-b99daf13.js} +1 -1
  172. package/dist/cdn/{shared-da2e66a4.js → shared-bac00622.js} +1 -1
  173. package/dist/cdn/{shared-2b5a3c80.js → shared-bd99107c.js} +1 -1
  174. package/dist/cdn/{shared-f4bb452b.js → shared-c0b1a51d.js} +1 -1
  175. package/dist/cdn/shared-c5106605.js +1 -0
  176. package/dist/cdn/{shared-d10d6cba.js → shared-cb732375.js} +1 -1
  177. package/dist/cdn/shared-cd96ff03.js +1 -0
  178. package/dist/cdn/{shared-55630cac.js → shared-da2a367a.js} +1 -1
  179. package/dist/cdn/{shared-122cccac.js → shared-e075ca81.js} +1 -1
  180. package/dist/cdn/{shared-7f60c1c1.js → shared-e10b5dca.js} +1 -1
  181. package/dist/cdn/{shared-0a8161e5.js → shared-e2cbc382.js} +1 -1
  182. package/dist/cdn/{shared-77258081.js → shared-e4403332.js} +1 -1
  183. package/dist/cdn/{shared-75d13e1b.js → shared-e5f6ca48.js} +1 -1
  184. package/dist/cdn/{shared-7ff78b4a.js → shared-e989e47e.js} +2 -2
  185. package/dist/cdn/{shared-6586ffd5.js → shared-ecb7a183.js} +1 -1
  186. package/dist/cdn/{shared-8b521111.js → shared-f090c63a.js} +1 -1
  187. package/dist/cdn/{shared-4c611015.js → shared-f14856e0.js} +2 -2
  188. package/dist/cdn/{shared-ee13d85c.js → shared-f2721fae.js} +3 -3
  189. package/dist/cdn/{shared-62e9c883.js → shared-f548d023.js} +1 -1
  190. package/dist/cdn/{shared-7b2bd917.js → shared-fd95cd52.js} +1 -1
  191. package/dist/cdn/translations/customer/en.json +149 -2
  192. package/dist/cdn/translations/customer-portal/README.md +4 -0
  193. package/dist/cdn/translations/customer-portal/de.json +1063 -113
  194. package/dist/cdn/translations/customer-portal/en.json +151 -5
  195. package/dist/cdn/translations/customer-portal/es.json +1072 -123
  196. package/dist/cdn/translations/customer-portal/fr.json +1084 -134
  197. package/dist/cdn/translations/customer-portal/nl.json +1085 -135
  198. package/dist/cdn/translations/customer-portal/pl.json +1092 -142
  199. package/dist/cdn/translations/customer-portal/sv.json +1173 -0
  200. package/dist/cdn/translations/customer-portal/zh-hk.json +1110 -160
  201. package/dist/cdn/translations/payment-card-embed/en.json +48 -0
  202. package/dist/cdn/translations/payment-method-card/en.json +149 -2
  203. package/dist/cdn/translations/payments-api-payment-method-form/en.json +2 -2
  204. package/dist/cdn/translations/update-payment-method-form/en.json +140 -0
  205. package/dist/elements/internal/InternalForm/InternalForm.js +2 -0
  206. package/dist/elements/internal/InternalForm/InternalForm.js.map +1 -1
  207. package/dist/elements/public/Customer/Customer.d.ts +5 -0
  208. package/dist/elements/public/Customer/Customer.js +13 -6
  209. package/dist/elements/public/Customer/Customer.js.map +1 -1
  210. package/dist/elements/public/Customer/index.d.ts +1 -0
  211. package/dist/elements/public/Customer/index.js +1 -0
  212. package/dist/elements/public/Customer/index.js.map +1 -1
  213. package/dist/elements/public/CustomerPortal/CustomerPortal.d.ts +14 -0
  214. package/dist/elements/public/CustomerPortal/CustomerPortal.js +23 -6
  215. package/dist/elements/public/CustomerPortal/CustomerPortal.js.map +1 -1
  216. package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedInView.d.ts +1 -0
  217. package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedInView.js +7 -2
  218. package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedInView.js.map +1 -1
  219. package/dist/elements/public/DownloadableForm/DownloadableForm.js.map +1 -1
  220. package/dist/elements/public/FormDialog/FormDialog.d.ts +2 -0
  221. package/dist/elements/public/FormDialog/FormDialog.js +8 -4
  222. package/dist/elements/public/FormDialog/FormDialog.js.map +1 -1
  223. package/dist/elements/public/NucleonElement/NucleonElement.js +7 -1
  224. package/dist/elements/public/NucleonElement/NucleonElement.js.map +1 -1
  225. package/dist/elements/public/NucleonElement/UpdateEvent.d.ts +3 -1
  226. package/dist/elements/public/NucleonElement/UpdateEvent.js +2 -0
  227. package/dist/elements/public/NucleonElement/UpdateEvent.js.map +1 -1
  228. package/dist/elements/public/PaymentCardEmbedElement/PaymentCardEmbedElement.d.ts +47 -0
  229. package/dist/elements/public/PaymentCardEmbedElement/PaymentCardEmbedElement.js +198 -0
  230. package/dist/elements/public/PaymentCardEmbedElement/PaymentCardEmbedElement.js.map +1 -0
  231. package/dist/elements/public/PaymentCardEmbedElement/index.d.ts +4 -0
  232. package/dist/elements/public/PaymentCardEmbedElement/index.js +6 -0
  233. package/dist/elements/public/PaymentCardEmbedElement/index.js.map +1 -0
  234. package/dist/elements/public/PaymentMethodCard/PaymentMethodCard.d.ts +14 -4
  235. package/dist/elements/public/PaymentMethodCard/PaymentMethodCard.js +79 -10
  236. package/dist/elements/public/PaymentMethodCard/PaymentMethodCard.js.map +1 -1
  237. package/dist/elements/public/PaymentMethodCard/index.d.ts +2 -0
  238. package/dist/elements/public/PaymentMethodCard/index.js +2 -0
  239. package/dist/elements/public/PaymentMethodCard/index.js.map +1 -1
  240. package/dist/elements/public/PaymentsApiPaymentMethodForm/PaymentsApiPaymentMethodForm.js +66 -56
  241. package/dist/elements/public/PaymentsApiPaymentMethodForm/PaymentsApiPaymentMethodForm.js.map +1 -1
  242. package/dist/elements/public/PaymentsApiPaymentPresetForm/PaymentsApiPaymentPresetForm.js +1 -0
  243. package/dist/elements/public/PaymentsApiPaymentPresetForm/PaymentsApiPaymentPresetForm.js.map +1 -1
  244. package/dist/elements/public/SubscriptionForm/SubscriptionForm.js.map +1 -1
  245. package/dist/elements/public/UpdatePaymentMethodForm/UpdatePaymentMethodForm.d.ts +37 -0
  246. package/dist/elements/public/UpdatePaymentMethodForm/UpdatePaymentMethodForm.js +142 -0
  247. package/dist/elements/public/UpdatePaymentMethodForm/UpdatePaymentMethodForm.js.map +1 -0
  248. package/dist/elements/public/UpdatePaymentMethodForm/index.d.ts +8 -0
  249. package/dist/elements/public/UpdatePaymentMethodForm/index.js +10 -0
  250. package/dist/elements/public/UpdatePaymentMethodForm/index.js.map +1 -0
  251. package/dist/elements/public/UpdatePaymentMethodForm/internal/InternalUpdatePaymentMethodFormCcTokenControl/InternalUpdatePaymentMethodFormCcTokenControl.d.ts +9 -0
  252. package/dist/elements/public/UpdatePaymentMethodForm/internal/InternalUpdatePaymentMethodFormCcTokenControl/InternalUpdatePaymentMethodFormCcTokenControl.js +46 -0
  253. package/dist/elements/public/UpdatePaymentMethodForm/internal/InternalUpdatePaymentMethodFormCcTokenControl/InternalUpdatePaymentMethodFormCcTokenControl.js.map +1 -0
  254. package/dist/elements/public/UpdatePaymentMethodForm/internal/InternalUpdatePaymentMethodFormCcTokenControl/index.d.ts +6 -0
  255. package/dist/elements/public/UpdatePaymentMethodForm/internal/InternalUpdatePaymentMethodFormCcTokenControl/index.js +8 -0
  256. package/dist/elements/public/UpdatePaymentMethodForm/internal/InternalUpdatePaymentMethodFormCcTokenControl/index.js.map +1 -0
  257. package/dist/elements/public/UpdatePaymentMethodForm/types.d.ts +13 -0
  258. package/dist/elements/public/UpdatePaymentMethodForm/types.js +2 -0
  259. package/dist/elements/public/UpdatePaymentMethodForm/types.js.map +1 -0
  260. package/dist/elements/public/index.d.ts +2 -0
  261. package/dist/elements/public/index.defined.d.ts +2 -0
  262. package/dist/elements/public/index.defined.js +2 -0
  263. package/dist/elements/public/index.defined.js.map +1 -1
  264. package/dist/elements/public/index.js +2 -0
  265. package/dist/elements/public/index.js.map +1 -1
  266. package/dist/mixins/themeable.js +45 -0
  267. package/dist/mixins/themeable.js.map +1 -1
  268. package/dist/mixins/translatable.js +89 -79
  269. package/dist/mixins/translatable.js.map +1 -1
  270. package/package.json +2 -2
  271. package/dist/cdn/shared-186e41cf.js +0 -1
  272. package/dist/cdn/shared-18918efe.js +0 -1
  273. package/dist/cdn/shared-3ab0306f.js +0 -1
  274. package/dist/cdn/shared-5875cb66.js +0 -1
  275. package/dist/cdn/shared-79d35787.js +0 -1
  276. package/dist/cdn/shared-851a7db5.js +0 -1
  277. package/dist/cdn/shared-90877857.js +0 -1
  278. package/dist/cdn/shared-fe45779e.js +0 -1
  279. package/dist/cdn/translations/customer-portal/se.json +0 -223
@@ -1 +1 @@
1
- import"./shared-7f60c1c1.js";import"./shared-d222bd1e.js";import"./shared-77258081.js";import{I as e}from"./shared-8a247f48.js";import"./shared-be0fca15.js";import"./foxy-applied-coupon-code-card.js";import"./foxy-applied-coupon-code-form.js";import"./foxy-custom-field-card.js";import"./foxy-custom-field-form.js";import"./foxy-nucleon-element.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-discount-card.js";import"./foxy-item-card.js";import"./foxy-item-form.js";import"./shared-6586ffd5.js";import{a as t}from"./shared-75d13e1b.js";import{_ as o,m as i}from"./shared-b3db7611.js";import{c as r}from"./shared-4e709717.js";import{h as s}from"./shared-dc73b9a5.js";import{R as n,a as l}from"./shared-7ff78b4a.js";import{i as a}from"./shared-9803aa7c.js";import{s as d}from"./shared-fe45779e.js";import"./shared-285f8cee.js";import"./shared-4c611015.js";import"./shared-0a9d860d.js";import"./shared-540063aa.js";import"./shared-6b68b3b6.js";import"./shared-28be347b.js";import"./shared-90cbed56.js";import"./shared-684cd55a.js";import"./shared-651c44fa.js";import"./shared-612ea9ed.js";import"./shared-91c88f14.js";import"./shared-61ade33e.js";import"./shared-2314add3.js";import"./shared-482b2b86.js";import"./shared-343d1fd7.js";import"./shared-25198d9a.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-da2e66a4.js";import"./shared-3cabd589.js";import"./shared-2b5a3c80.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./shared-3ab0306f.js";import"./shared-851a7db5.js";import"./shared-79d35787.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-03673673.js";import"./shared-6cd4e618.js";import"./foxy-pagination.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";import"./shared-90877857.js";import"./shared-8b521111.js";import"./shared-4affec66.js";import"./shared-b9ea6d85.js";import"./shared-ea5fa631.js";import"./shared-51c4a6dd.js";import"./shared-b900e1b5.js";import"./shared-1e7639e6.js";import"./shared-18918efe.js";import"./shared-412c19c2.js";import"./shared-a24b2aa7.js";import"./shared-ad11b006.js";import"./shared-f4bb452b.js";import"./shared-d10d6cba.js";import"./shared-739f24fe.js";import"./shared-f0fcd613.js";import"./shared-bd919e3b.js";import"./shared-f7c60ee0.js";import"./shared-58951f74.js";import"./shared-99e354b1.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-discount-builder.js";import"./shared-8438d4ca.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";let c,f,u=e=>e;customElements.define("foxy-internal-cart-form-view-as-customer-control",class extends t{constructor(){super(...arguments),this.__loader=null}static get properties(){return o(o({},super.properties),{},{__loader:{attribute:!1}})}renderControl(){var e,t;const o=null===(e=this.__loader)||void 0===e?void 0:e.state,i=null===(t=this.__loader)||void 0===t?void 0:t.result;return i?s(c||(c=u` <a target="_blank" class="flex h-m px-m rounded font-medium transition-colors text-body bg-contrast-5 hover-bg-contrast-10 items-center justify-center focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="" key="state_idle"></foxy-i18n> </a> `),i):s(f||(f=u` <div class="${0}"> <foxy-i18n infer="" key="${0}"> </foxy-i18n> </div> `),r({"flex h-m px-m rounded items-center justify-center":!0,"transition-colors bg-contrast-5 font-medium":!0,"text-tertiary":"fail"!==o,"text-error":"fail"===o}),"fail"===o?"state_fail":"state_busy")}updated(e){var t;super.updated(e);const o=this.nucleon,i=null==o?void 0:o.data,r=null!==(t=null==i?void 0:i._links["fx:create_session"].href)&&void 0!==t?t:null;this.__reloadSessionHref(r)}async __reloadSessionHref(e){var t;if((null===(t=this.__loader)||void 0===t?void 0:t.href)===e)return;const o=this.nucleon;if(o)if(e){const t={result:null,state:"busy",href:e},i=new o.constructor.API(this);this.__loader=t;try{const o=await i.fetch(e,{method:"POST"});if(!o.ok)throw new Error;t.result=(await o.json()).cart_link,t.state="idle"}catch(e){t.state="fail"}finally{this.requestUpdate()}}else this.__loader=null}});let p,h,_,m,y,g,x,v,b,$,j,L,S,H=e=>e;const k=n(l(e,"cart-form"));class R extends k{constructor(){super(...arguments),this.itemCategories=null,this.templateSets=null,this.localeCodes=null,this.customers=null,this.countries=null,this.templates={},this.regions=null,this.coupons=null,this.__defaultTemplateSetLoaderId="defaultTemplateSetLoader",this.__localeCodesHelperLoaderId="localeCodesLoader",this.__shippingRegionsLoaderId="shippingRegionsLoader",this.__billingRegionsLoaderId="billingRegionsLoader",this.__templateSetLoaderId="templateSetLoader",this.__countriesHelperLoaderId="countriesHelperLoader",this.__discountsLoaderId="discountsLoader",this.__customerLoaderId="customerLoader",this.__storeLoaderId="storeLoader",this.__customerTypeGetValue=()=>{var e;return this.form.customer_uri?(null===(e=this.__customer)||void 0===e?void 0:e.is_anonymous)?"guest":"regular":"new"},this.__customerTypeSetValue=e=>{this.edit({customer_uri:"",customer_email:""}),this.__isGuestMode="guest"===e},this.__customerTypeOptions=[{label:"option_new",value:"new"},{label:"option_guest",value:"guest"},{label:"option_regular",value:"regular"}],this.__customerGetValue=()=>this.form.customer_uri||this.form.customer_email,this.__customerSetValue=e=>{try{new URL(e);const t={},r=this.data,s=this.form;for(const e in this.form){if("customer_email"===e)continue;const o=i(s,e);i(r,e)!==o&&d(t,e,o)}this.undo(),this.edit(o(o({},t),{},{customer_uri:e}))}catch(t){this.edit({customer_uri:"",customer_email:e})}},this.__isGuestMode=!1}static get properties(){return o(o({},super.properties),{},{itemCategories:{attribute:"item-categories"},templateSets:{attribute:"template-sets"},localeCodes:{attribute:"locale-codes"},customers:{},countries:{},regions:{},coupons:{},__isGuestMode:{attribute:!1}})}static get v8n(){return[({billing_first_name:e})=>!e||e.length<=50||"billing-first-name:v8n_too_long",({billing_last_name:e})=>!e||e.length<=50||"billing-last-name:v8n_too_long",({billing_region:e})=>!e||e.length<=50||"billing-region:v8n_too_long",({billing_city:e})=>!e||e.length<=50||"billing-city:v8n_too_long",({billing_phone:e})=>!e||e.length<=50||"billing-phone:v8n_too_long",({billing_company:e})=>!e||e.length<=50||"billing-company:v8n_too_long",({billing_address2:e})=>!e||e.length<=100||"billing-address-two:v8n_too_long",({billing_address1:e})=>!e||e.length<=100||"billing-address-one:v8n_too_long",({billing_postal_code:e})=>!e||e.length<=50||"billing-postal-code:v8n_too_long",({shipping_first_name:e})=>!e||e.length<=50||"shipping-first-name:v8n_too_long",({shipping_last_name:e})=>!e||e.length<=50||"shipping-last-name:v8n_too_long",({shipping_region:e})=>!e||e.length<=50||"shipping-region:v8n_too_long",({shipping_city:e})=>!e||e.length<=50||"shipping-city:v8n_too_long",({shipping_phone:e})=>!e||e.length<=50||"shipping-phone:v8n_too_long",({shipping_company:e})=>!e||e.length<=50||"shipping-company:v8n_too_long",({shipping_address2:e})=>!e||e.length<=100||"shipping-address-two:v8n_too_long",({shipping_address1:e})=>!e||e.length<=100||"shipping-address-one:v8n_too_long",({shipping_postal_code:e})=>!e||e.length<=50||"shipping-postal-code:v8n_too_long"]}renderBody(){var e,t,o,i,r,n,l,d,c,f,u,g;const x=Object.values(null!==(e=this.__shippingRegions)&&void 0!==e?e:{}),v=Object.values(null!==(t=this.__billingRegions)&&void 0!==t?t:{}),b=Object.values(null!==(o=this.__countriesHelper)&&void 0!==o?o:{}),$=x.map((e=>({label:e.default,value:e.code}))),j=v.map((e=>({label:e.default,value:e.code}))),L=b.map((e=>({label:e.default,value:e.cc2}))),S=null===(i=this.__customer)||void 0===i?void 0:i._links["fx:customer_addresses"].href,k=this.__store,R=k?k.use_international_currency_symbol?"code":"symbol":void 0;let w=null;if(this.form.currency_code)w=this.form.currency_code;else{const e=this.__localeCodesHelper,t=null===(n=null!==(r=this.__templateSet)&&void 0!==r?r:this.__defaultTemplateSet)||void 0===n?void 0:n.locale_code,o=t?null==e?void 0:e.values[t]:void 0;o&&(w=null!==(d=null===(l=/Currency: ([A-Z]{3})/g.exec(o))||void 0===l?void 0:l[1])&&void 0!==d?d:null)}return s(_||(_=H` <div class="grid sm-grid-cols-2 gap-l"> <div class="sm-col-span-2"> <foxy-i18n class="text-l font-medium leading-s block" infer="" key="order_section_title"> </foxy-i18n> <foxy-i18n class="text-s text-secondary leading-s block" infer="" key="order_section_description"> </foxy-i18n> </div> <foxy-internal-select-control infer="customer-type" .getValue="${0}" .setValue="${0}" .options="${0}" @update="${0}"> </foxy-internal-select-control> <foxy-internal-async-combo-box-control item-label-path="email" item-value-path="_links.self.href" item-id-path="_links.self.href" first="${0}" infer="customer" allow-custom-value .selectedItem="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-async-combo-box-control> <foxy-internal-async-combo-box-control item-label-path="description" item-value-path="_links.self.href" item-id-path="_links.self.href" first="${0}" class="sm-col-span-2" infer="template-set-uri" .selectedItem="${0}"> </foxy-internal-async-combo-box-control> <foxy-internal-async-list-control infer="items" class="min-w-0 sm-col-span-2" first="${0}" limit="5" .item="${0}" .form="${0}"> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="applied-coupon-codes" class="min-w-0 sm-col-span-2" first="${0}" limit="5" item="foxy-applied-coupon-code-card" form="${0}" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="custom-fields" class="min-w-0" first="${0}" limit="5" item="foxy-custom-field-card" form="${0}" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" limit="5" item="foxy-attribute-card" form="${0}" alert> </foxy-internal-async-list-control> <div class="grid gap-l"> <div> <foxy-i18n class="text-l font-medium leading-s block" infer="" key="billing_section_title"> </foxy-i18n> <foxy-i18n class="text-s text-secondary leading-s block" infer="" key="billing_section_description"> </foxy-i18n> </div> <div class="grid grid-cols-2 gap-m"> <foxy-internal-text-control infer="billing-first-name"></foxy-internal-text-control> <foxy-internal-text-control infer="billing-last-name"></foxy-internal-text-control> <foxy-internal-text-control infer="billing-company"></foxy-internal-text-control> <foxy-internal-text-control infer="billing-phone"></foxy-internal-text-control> <foxy-internal-text-control property="billing_address1" infer="billing-address-one" class="col-span-2"> </foxy-internal-text-control> <foxy-internal-text-control property="billing_address2" infer="billing-address-two" class="col-span-2"> </foxy-internal-text-control> <foxy-internal-select-control infer="billing-country" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control infer="billing-region" .options="${0}"> </foxy-internal-select-control> <foxy-internal-text-control infer="billing-city"></foxy-internal-text-control> <foxy-internal-text-control infer="billing-postal-code"></foxy-internal-text-control> </div> </div> <div class="grid gap-l"> <div> <foxy-i18n class="text-l font-medium leading-s block" infer="" key="shipping_section_title"> </foxy-i18n> <foxy-i18n class="text-s text-secondary leading-s block" infer="" key="shipping_section_description"> </foxy-i18n> </div> <div class="grid grid-cols-2 gap-m"> <foxy-internal-text-control infer="shipping-first-name"></foxy-internal-text-control> <foxy-internal-text-control infer="shipping-last-name"></foxy-internal-text-control> <foxy-internal-text-control infer="shipping-company"></foxy-internal-text-control> <foxy-internal-text-control infer="shipping-phone"></foxy-internal-text-control> <foxy-internal-text-control property="shipping_address1" infer="shipping-address-one" class="col-span-2"> </foxy-internal-text-control> <foxy-internal-text-control property="shipping_address2" infer="shipping-address-two" class="col-span-2"> </foxy-internal-text-control> <foxy-internal-select-control infer="shipping-country" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control infer="shipping-region" .options="${0}"> </foxy-internal-select-control> <foxy-internal-text-control infer="shipping-city"></foxy-internal-text-control> <foxy-internal-text-control infer="shipping-postal-code"></foxy-internal-text-control> </div> </div> <div class="leading-m sm-col-span-2"> <div class="text-xl font-medium mb-s"> ${0} </div> <div class="border-t border-contrast-10 mb-s"></div> ${0} ${0} </div> ${0} </div> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.__customerTypeGetValue,this.__customerTypeSetValue,this.__customerTypeOptions,(()=>this.requestUpdate()),a(this.__customersHref),this.__customer,this.__customerGetValue,this.__customerSetValue,a(this.templateSets),null!==(c=this.__templateSet)&&void 0!==c?c:null,a(this.__itemsHref),(e=>s(h||(h=H` <foxy-item-card locale-codes="${0}" parent="${0}" infer="" href="${0}" .related="${0}"> </foxy-item-card> `),this.localeCodes,e.parent,e.href,e.related)),this.data?e=>{var t,o,i;return s(p||(p=H` <foxy-item-form customer-addresses="${0}" item-categories="${0}" locale-codes="${0}" coupons="${0}" parent="${0}" href="${0}" infer="" id="form" .related="${0}" @fetch="${0}" @update="${0}"> </foxy-item-form> `),a(null!=S?S:void 0),a(null!==(t=this.itemCategories)&&void 0!==t?t:void 0),a(null!==(o=this.localeCodes)&&void 0!==o?o:void 0),a(null!==(i=this.coupons)&&void 0!==i?i:void 0),e.dialog.parent,e.dialog.href,e.dialog.related,e.handleFetch,e.handleUpdate)}:null,a(null===(f=this.data)||void 0===f?void 0:f._links["fx:applied_coupon_codes"].href),a(this.data?"foxy-applied-coupon-code-form":void 0),a(null===(u=this.data)||void 0===u?void 0:u._links["fx:custom_fields"].href),a(this.data?"foxy-custom-field-form":void 0),a(null===(g=this.data)||void 0===g?void 0:g._links["fx:attributes"].href),a(this.data?"foxy-attribute-form":void 0),L,j,L,$,this.__renderTotalOrder(w,R),this.__renderTotals(w,R),this.__renderDiscounts(w,R),this.data?s(m||(m=H` <div class="grid gap-s sm-grid-cols-2 sm-gap-l sm-col-span-2"> <foxy-internal-cart-form-view-as-customer-control infer="view-as-customer"> </foxy-internal-cart-form-view-as-customer-control> <foxy-internal-delete-control infer="delete"></foxy-internal-delete-control> </div> `)):s(y||(y=H`<foxy-internal-create-control infer="create"></foxy-internal-create-control>`)),a(this.__shippingRegionsHref),this.__shippingRegionsLoaderId,(()=>this.requestUpdate()),a(this.__billingRegionsHref),this.__billingRegionsLoaderId,(()=>this.requestUpdate()),a(this.__countriesHref),this.__countriesHelperLoaderId,(()=>this.requestUpdate()),a(this.__customerHref),this.__customerLoaderId,(()=>this.requestUpdate()),a(this.__discountsHref),this.__discountsLoaderId,(()=>this.requestUpdate()),a(this.__defaultTemplateSetHref),this.__defaultTemplateSetLoaderId,(()=>this.requestUpdate()),a(this.__localeCodesHelperHref),this.__localeCodesHelperLoaderId,(()=>this.requestUpdate()),a(this.__templateSetHref),this.__templateSetLoaderId,(()=>this.requestUpdate()),a(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()))}get __defaultTemplateSetHref(){var e,t,o;if(""===(null===(e=this.data)||void 0===e?void 0:e.template_set_uri))try{const e=new URL(null!==(o=null===(t=this.__store)||void 0===t?void 0:t._links["fx:template_sets"].href)&&void 0!==o?o:"");return e.searchParams.set("code","DEFAULT"),e.toString()}catch(e){}}get __localeCodesHelperHref(){var e;if(this.__defaultTemplateSetHref||this.__templateSetHref)return null!==(e=this.localeCodes)&&void 0!==e?e:void 0}get __shippingRegionsHref(){var e;try{const t=new URL(null!==(e=this.regions)&&void 0!==e?e:""),o=this.form.shipping_country;return o&&t.searchParams.set("country_code",o),t.toString()}catch(e){}}get __billingRegionsHref(){var e;try{const t=new URL(null!==(e=this.regions)&&void 0!==e?e:""),o=this.form.billing_country;return o&&t.searchParams.set("country_code",o),t.toString()}catch(e){}}get __templateSetHref(){return this.form.template_set_uri||void 0}get __customersHref(){var e;try{const t=new URL(null!==(e=this.customers)&&void 0!==e?e:"");return t.searchParams.set("is_anonymous",this.__isGuestMode?"1":"0"),t.toString()}catch(e){}}get __countriesHref(){var e;return null!==(e=this.countries)&&void 0!==e?e:void 0}get __discountsHref(){var e,t;try{const o=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:discounts"].href)&&void 0!==t?t:"");return o.searchParams.set("limit","300"),o.toString()}catch(e){}}get __customerHref(){return this.form.customer_uri||void 0}get __itemsHref(){var e,t;try{const o=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:items"].href)&&void 0!==t?t:"");return o.searchParams.set("zoom","item_options"),o.toString()}catch(e){}}get __storeHref(){var e,t;return null===(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:store"])||void 0===t?void 0:t.href}get __defaultTemplateSet(){var e,t;const o=`#${this.__defaultTemplateSetLoaderId}`,i=this.renderRoot.querySelector(o);return null!==(t=null===(e=null==i?void 0:i.data)||void 0===e?void 0:e._embedded["fx:template_sets"][0])&&void 0!==t?t:null}get __localeCodesHelper(){var e,t;const o=`#${this.__localeCodesHelperLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(o))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __shippingRegions(){var e;const t=this.renderRoot.querySelector(`#${this.__shippingRegionsLoaderId}`);return null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.values}get __billingRegions(){var e;const t=this.renderRoot.querySelector(`#${this.__billingRegionsLoaderId}`);return null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.values}get __templateSet(){var e,t;const o=`#${this.__templateSetLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(o))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __discounts(){return this.renderRoot.querySelector(`#${this.__discountsLoaderId}`)}get __countriesHelper(){var e;const t=this.renderRoot.querySelector(`#${this.__countriesHelperLoaderId}`);return null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.values}get __customer(){var e;return null===(e=this.renderRoot.querySelector(`#${this.__customerLoaderId}`))||void 0===e?void 0:e.data}get __store(){var e,t;const o=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(o))||void 0===e?void 0:e.data)&&void 0!==t?t:null}__renderTotalOrder(e,t){const o=this.data;if(!o||!e||!t)return s(g||(g=H`--`));const i={amount:`${o.total_order} ${e}`,currencyDisplay:t};return s(x||(x=H`<foxy-i18n infer="totals" key="total_order" .options="${0}"></foxy-i18n>`),i)}__renderTotals(e,t){const o=this.data,i=o&&e&&t;return["total_item_price","total_shipping","total_tax"].map((r=>{const n={amount:`${null==o?void 0:o[r]} ${e}`,currencyDisplay:t};return s(v||(v=H` <div data-testid="${0}" class="flex justify-between text-m text-secondary"> <foxy-i18n key="${0}" infer="totals"></foxy-i18n> ${0} </div> `),r,r,i?s(b||(b=H`<foxy-i18n infer="totals" key="price" .options="${0}"></foxy-i18n>`),n):s($||($=H`<span>--</span>`)))}))}__renderDiscounts(e,t){var o,i;const r=null===(i=null===(o=this.__discounts)||void 0===o?void 0:o.data)||void 0===i?void 0:i._embedded["fx:discounts"],n=e&&t;return null==r?void 0:r.map((o=>{const i={amount:`${o.amount} ${e}`,currencyDisplay:t};return s(j||(j=H` <div data-testclass="discount" class="flex justify-between text-m text-secondary"> <span>${0} &bull; ${0}</span> ${0} </div> `),o.name,o.code,n?s(L||(L=H`<foxy-i18n infer="totals" key="price" .options="${0}"></foxy-i18n>`),i):s(S||(S=H`<span>--</span>`)))}))}}customElements.define("foxy-cart-form",R);export{R as CartForm};
1
+ import"./shared-e10b5dca.js";import"./shared-a33be18f.js";import"./shared-e4403332.js";import{I as e}from"./shared-036b25a3.js";import"./shared-292585a0.js";import"./foxy-applied-coupon-code-card.js";import"./foxy-applied-coupon-code-form.js";import"./foxy-custom-field-card.js";import"./foxy-custom-field-form.js";import"./foxy-nucleon-element.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-discount-card.js";import"./foxy-item-card.js";import"./foxy-item-form.js";import"./shared-ecb7a183.js";import{a as t}from"./shared-e5f6ca48.js";import{_ as o,l as i}from"./shared-3c58ddf1.js";import{c as r}from"./shared-4e709717.js";import{h as s}from"./shared-dc73b9a5.js";import{R as n,a as l}from"./shared-e989e47e.js";import{i as a}from"./shared-9803aa7c.js";import{s as d}from"./shared-39fc8fed.js";import"./shared-84215d13.js";import"./shared-f14856e0.js";import"./shared-2f2b5a28.js";import"./shared-8c5b4c81.js";import"./shared-a911ab73.js";import"./shared-41e9ef02.js";import"./shared-5a18985c.js";import"./shared-0062cab1.js";import"./shared-651c44fa.js";import"./shared-4885670b.js";import"./shared-34f4330c.js";import"./shared-61ade33e.js";import"./shared-1ab8b12e.js";import"./shared-37391934.js";import"./shared-343d1fd7.js";import"./shared-7c819ebc.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-bac00622.js";import"./shared-2808f43a.js";import"./shared-bd99107c.js";import"./shared-272e7269.js";import"./shared-cd96ff03.js";import"./shared-12e531b8.js";import"./shared-90ddf541.js";import"./shared-2e2d45c4.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-337f2fe9.js";import"./shared-8d7e2e2c.js";import"./foxy-pagination.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";import"./shared-102dfbe0.js";import"./shared-f090c63a.js";import"./shared-8452c492.js";import"./shared-8540c2c7.js";import"./shared-b2ce84fa.js";import"./shared-51c4a6dd.js";import"./shared-739a8fe4.js";import"./shared-6dfb57b1.js";import"./shared-66d2a0d7.js";import"./shared-30143820.js";import"./shared-62f3fc5a.js";import"./shared-b99daf13.js";import"./shared-c0b1a51d.js";import"./shared-cb732375.js";import"./shared-328e5fdc.js";import"./shared-91009494.js";import"./shared-b55f1de3.js";import"./shared-8e59a71e.js";import"./shared-40cbbbae.js";import"./shared-25fc0ceb.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-discount-builder.js";import"./shared-8438d4ca.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";let c,f,p=e=>e;customElements.define("foxy-internal-cart-form-view-as-customer-control",class extends t{constructor(){super(...arguments),this.__loader=null}static get properties(){return o(o({},super.properties),{},{__loader:{attribute:!1}})}renderControl(){var e,t;const o=null===(e=this.__loader)||void 0===e?void 0:e.state,i=null===(t=this.__loader)||void 0===t?void 0:t.result;return i?s(c||(c=p` <a target="_blank" class="flex h-m px-m rounded font-medium transition-colors text-body bg-contrast-5 hover-bg-contrast-10 items-center justify-center focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="" key="state_idle"></foxy-i18n> </a> `),i):s(f||(f=p` <div class="${0}"> <foxy-i18n infer="" key="${0}"> </foxy-i18n> </div> `),r({"flex h-m px-m rounded items-center justify-center":!0,"transition-colors bg-contrast-5 font-medium":!0,"text-tertiary":"fail"!==o,"text-error":"fail"===o}),"fail"===o?"state_fail":"state_busy")}updated(e){var t;super.updated(e);const o=this.nucleon,i=null==o?void 0:o.data,r=null!==(t=null==i?void 0:i._links["fx:create_session"].href)&&void 0!==t?t:null;this.__reloadSessionHref(r)}async __reloadSessionHref(e){var t;if((null===(t=this.__loader)||void 0===t?void 0:t.href)===e)return;const o=this.nucleon;if(o)if(e){const t={result:null,state:"busy",href:e},i=new o.constructor.API(this);this.__loader=t;try{const o=await i.fetch(e,{method:"POST"});if(!o.ok)throw new Error;t.result=(await o.json()).cart_link,t.state="idle"}catch(e){t.state="fail"}finally{this.requestUpdate()}}else this.__loader=null}});let u,h,_,m,y,g,x,v,b,j,$,L,S,H=e=>e;const k=n(l(e,"cart-form"));class R extends k{constructor(){super(...arguments),this.itemCategories=null,this.templateSets=null,this.localeCodes=null,this.customers=null,this.countries=null,this.templates={},this.regions=null,this.coupons=null,this.__defaultTemplateSetLoaderId="defaultTemplateSetLoader",this.__localeCodesHelperLoaderId="localeCodesLoader",this.__shippingRegionsLoaderId="shippingRegionsLoader",this.__billingRegionsLoaderId="billingRegionsLoader",this.__templateSetLoaderId="templateSetLoader",this.__countriesHelperLoaderId="countriesHelperLoader",this.__discountsLoaderId="discountsLoader",this.__customerLoaderId="customerLoader",this.__storeLoaderId="storeLoader",this.__customerTypeGetValue=()=>{var e;return this.form.customer_uri?(null===(e=this.__customer)||void 0===e?void 0:e.is_anonymous)?"guest":"regular":"new"},this.__customerTypeSetValue=e=>{this.edit({customer_uri:"",customer_email:""}),this.__isGuestMode="guest"===e},this.__customerTypeOptions=[{label:"option_new",value:"new"},{label:"option_guest",value:"guest"},{label:"option_regular",value:"regular"}],this.__customerGetValue=()=>this.form.customer_uri||this.form.customer_email,this.__customerSetValue=e=>{try{new URL(e);const t={},r=this.data,s=this.form;for(const e in this.form){if("customer_email"===e)continue;const o=i(s,e);i(r,e)!==o&&d(t,e,o)}this.undo(),this.edit(o(o({},t),{},{customer_uri:e}))}catch(t){this.edit({customer_uri:"",customer_email:e})}},this.__isGuestMode=!1}static get properties(){return o(o({},super.properties),{},{itemCategories:{attribute:"item-categories"},templateSets:{attribute:"template-sets"},localeCodes:{attribute:"locale-codes"},customers:{},countries:{},regions:{},coupons:{},__isGuestMode:{attribute:!1}})}static get v8n(){return[({billing_first_name:e})=>!e||e.length<=50||"billing-first-name:v8n_too_long",({billing_last_name:e})=>!e||e.length<=50||"billing-last-name:v8n_too_long",({billing_region:e})=>!e||e.length<=50||"billing-region:v8n_too_long",({billing_city:e})=>!e||e.length<=50||"billing-city:v8n_too_long",({billing_phone:e})=>!e||e.length<=50||"billing-phone:v8n_too_long",({billing_company:e})=>!e||e.length<=50||"billing-company:v8n_too_long",({billing_address2:e})=>!e||e.length<=100||"billing-address-two:v8n_too_long",({billing_address1:e})=>!e||e.length<=100||"billing-address-one:v8n_too_long",({billing_postal_code:e})=>!e||e.length<=50||"billing-postal-code:v8n_too_long",({shipping_first_name:e})=>!e||e.length<=50||"shipping-first-name:v8n_too_long",({shipping_last_name:e})=>!e||e.length<=50||"shipping-last-name:v8n_too_long",({shipping_region:e})=>!e||e.length<=50||"shipping-region:v8n_too_long",({shipping_city:e})=>!e||e.length<=50||"shipping-city:v8n_too_long",({shipping_phone:e})=>!e||e.length<=50||"shipping-phone:v8n_too_long",({shipping_company:e})=>!e||e.length<=50||"shipping-company:v8n_too_long",({shipping_address2:e})=>!e||e.length<=100||"shipping-address-two:v8n_too_long",({shipping_address1:e})=>!e||e.length<=100||"shipping-address-one:v8n_too_long",({shipping_postal_code:e})=>!e||e.length<=50||"shipping-postal-code:v8n_too_long"]}renderBody(){var e,t,o,i,r,n,l,d,c,f,p,g;const x=Object.values(null!==(e=this.__shippingRegions)&&void 0!==e?e:{}),v=Object.values(null!==(t=this.__billingRegions)&&void 0!==t?t:{}),b=Object.values(null!==(o=this.__countriesHelper)&&void 0!==o?o:{}),j=x.map((e=>({label:e.default,value:e.code}))),$=v.map((e=>({label:e.default,value:e.code}))),L=b.map((e=>({label:e.default,value:e.cc2}))),S=null===(i=this.__customer)||void 0===i?void 0:i._links["fx:customer_addresses"].href,k=this.__store,R=k?k.use_international_currency_symbol?"code":"symbol":void 0;let w=null;if(this.form.currency_code)w=this.form.currency_code;else{const e=this.__localeCodesHelper,t=null===(n=null!==(r=this.__templateSet)&&void 0!==r?r:this.__defaultTemplateSet)||void 0===n?void 0:n.locale_code,o=t?null==e?void 0:e.values[t]:void 0;o&&(w=null!==(d=null===(l=/Currency: ([A-Z]{3})/g.exec(o))||void 0===l?void 0:l[1])&&void 0!==d?d:null)}return s(_||(_=H` <div class="grid sm-grid-cols-2 gap-l"> <div class="sm-col-span-2"> <foxy-i18n class="text-l font-medium leading-s block" infer="" key="order_section_title"> </foxy-i18n> <foxy-i18n class="text-s text-secondary leading-s block" infer="" key="order_section_description"> </foxy-i18n> </div> <foxy-internal-select-control infer="customer-type" .getValue="${0}" .setValue="${0}" .options="${0}" @update="${0}"> </foxy-internal-select-control> <foxy-internal-async-combo-box-control item-label-path="email" item-value-path="_links.self.href" item-id-path="_links.self.href" first="${0}" infer="customer" allow-custom-value .selectedItem="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-async-combo-box-control> <foxy-internal-async-combo-box-control item-label-path="description" item-value-path="_links.self.href" item-id-path="_links.self.href" first="${0}" class="sm-col-span-2" infer="template-set-uri" .selectedItem="${0}"> </foxy-internal-async-combo-box-control> <foxy-internal-async-list-control infer="items" class="min-w-0 sm-col-span-2" first="${0}" limit="5" .item="${0}" .form="${0}"> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="applied-coupon-codes" class="min-w-0 sm-col-span-2" first="${0}" limit="5" item="foxy-applied-coupon-code-card" form="${0}" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="custom-fields" class="min-w-0" first="${0}" limit="5" item="foxy-custom-field-card" form="${0}" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" limit="5" item="foxy-attribute-card" form="${0}" alert> </foxy-internal-async-list-control> <div class="grid gap-l"> <div> <foxy-i18n class="text-l font-medium leading-s block" infer="" key="billing_section_title"> </foxy-i18n> <foxy-i18n class="text-s text-secondary leading-s block" infer="" key="billing_section_description"> </foxy-i18n> </div> <div class="grid grid-cols-2 gap-m"> <foxy-internal-text-control infer="billing-first-name"></foxy-internal-text-control> <foxy-internal-text-control infer="billing-last-name"></foxy-internal-text-control> <foxy-internal-text-control infer="billing-company"></foxy-internal-text-control> <foxy-internal-text-control infer="billing-phone"></foxy-internal-text-control> <foxy-internal-text-control property="billing_address1" infer="billing-address-one" class="col-span-2"> </foxy-internal-text-control> <foxy-internal-text-control property="billing_address2" infer="billing-address-two" class="col-span-2"> </foxy-internal-text-control> <foxy-internal-select-control infer="billing-country" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control infer="billing-region" .options="${0}"> </foxy-internal-select-control> <foxy-internal-text-control infer="billing-city"></foxy-internal-text-control> <foxy-internal-text-control infer="billing-postal-code"></foxy-internal-text-control> </div> </div> <div class="grid gap-l"> <div> <foxy-i18n class="text-l font-medium leading-s block" infer="" key="shipping_section_title"> </foxy-i18n> <foxy-i18n class="text-s text-secondary leading-s block" infer="" key="shipping_section_description"> </foxy-i18n> </div> <div class="grid grid-cols-2 gap-m"> <foxy-internal-text-control infer="shipping-first-name"></foxy-internal-text-control> <foxy-internal-text-control infer="shipping-last-name"></foxy-internal-text-control> <foxy-internal-text-control infer="shipping-company"></foxy-internal-text-control> <foxy-internal-text-control infer="shipping-phone"></foxy-internal-text-control> <foxy-internal-text-control property="shipping_address1" infer="shipping-address-one" class="col-span-2"> </foxy-internal-text-control> <foxy-internal-text-control property="shipping_address2" infer="shipping-address-two" class="col-span-2"> </foxy-internal-text-control> <foxy-internal-select-control infer="shipping-country" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control infer="shipping-region" .options="${0}"> </foxy-internal-select-control> <foxy-internal-text-control infer="shipping-city"></foxy-internal-text-control> <foxy-internal-text-control infer="shipping-postal-code"></foxy-internal-text-control> </div> </div> <div class="leading-m sm-col-span-2"> <div class="text-xl font-medium mb-s"> ${0} </div> <div class="border-t border-contrast-10 mb-s"></div> ${0} ${0} </div> ${0} </div> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.__customerTypeGetValue,this.__customerTypeSetValue,this.__customerTypeOptions,(()=>this.requestUpdate()),a(this.__customersHref),this.__customer,this.__customerGetValue,this.__customerSetValue,a(this.templateSets),null!==(c=this.__templateSet)&&void 0!==c?c:null,a(this.__itemsHref),(e=>s(h||(h=H` <foxy-item-card locale-codes="${0}" parent="${0}" infer="" href="${0}" .related="${0}"> </foxy-item-card> `),this.localeCodes,e.parent,e.href,e.related)),this.data?e=>{var t,o,i;return s(u||(u=H` <foxy-item-form customer-addresses="${0}" item-categories="${0}" locale-codes="${0}" coupons="${0}" parent="${0}" href="${0}" infer="" id="form" .related="${0}" @fetch="${0}" @update="${0}"> </foxy-item-form> `),a(null!=S?S:void 0),a(null!==(t=this.itemCategories)&&void 0!==t?t:void 0),a(null!==(o=this.localeCodes)&&void 0!==o?o:void 0),a(null!==(i=this.coupons)&&void 0!==i?i:void 0),e.dialog.parent,e.dialog.href,e.dialog.related,e.handleFetch,e.handleUpdate)}:null,a(null===(f=this.data)||void 0===f?void 0:f._links["fx:applied_coupon_codes"].href),a(this.data?"foxy-applied-coupon-code-form":void 0),a(null===(p=this.data)||void 0===p?void 0:p._links["fx:custom_fields"].href),a(this.data?"foxy-custom-field-form":void 0),a(null===(g=this.data)||void 0===g?void 0:g._links["fx:attributes"].href),a(this.data?"foxy-attribute-form":void 0),L,$,L,j,this.__renderTotalOrder(w,R),this.__renderTotals(w,R),this.__renderDiscounts(w,R),this.data?s(m||(m=H` <div class="grid gap-s sm-grid-cols-2 sm-gap-l sm-col-span-2"> <foxy-internal-cart-form-view-as-customer-control infer="view-as-customer"> </foxy-internal-cart-form-view-as-customer-control> <foxy-internal-delete-control infer="delete"></foxy-internal-delete-control> </div> `)):s(y||(y=H`<foxy-internal-create-control infer="create"></foxy-internal-create-control>`)),a(this.__shippingRegionsHref),this.__shippingRegionsLoaderId,(()=>this.requestUpdate()),a(this.__billingRegionsHref),this.__billingRegionsLoaderId,(()=>this.requestUpdate()),a(this.__countriesHref),this.__countriesHelperLoaderId,(()=>this.requestUpdate()),a(this.__customerHref),this.__customerLoaderId,(()=>this.requestUpdate()),a(this.__discountsHref),this.__discountsLoaderId,(()=>this.requestUpdate()),a(this.__defaultTemplateSetHref),this.__defaultTemplateSetLoaderId,(()=>this.requestUpdate()),a(this.__localeCodesHelperHref),this.__localeCodesHelperLoaderId,(()=>this.requestUpdate()),a(this.__templateSetHref),this.__templateSetLoaderId,(()=>this.requestUpdate()),a(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()))}get __defaultTemplateSetHref(){var e,t,o;if(""===(null===(e=this.data)||void 0===e?void 0:e.template_set_uri))try{const e=new URL(null!==(o=null===(t=this.__store)||void 0===t?void 0:t._links["fx:template_sets"].href)&&void 0!==o?o:"");return e.searchParams.set("code","DEFAULT"),e.toString()}catch(e){}}get __localeCodesHelperHref(){var e;if(this.__defaultTemplateSetHref||this.__templateSetHref)return null!==(e=this.localeCodes)&&void 0!==e?e:void 0}get __shippingRegionsHref(){var e;try{const t=new URL(null!==(e=this.regions)&&void 0!==e?e:""),o=this.form.shipping_country;return o&&t.searchParams.set("country_code",o),t.toString()}catch(e){}}get __billingRegionsHref(){var e;try{const t=new URL(null!==(e=this.regions)&&void 0!==e?e:""),o=this.form.billing_country;return o&&t.searchParams.set("country_code",o),t.toString()}catch(e){}}get __templateSetHref(){return this.form.template_set_uri||void 0}get __customersHref(){var e;try{const t=new URL(null!==(e=this.customers)&&void 0!==e?e:"");return t.searchParams.set("is_anonymous",this.__isGuestMode?"1":"0"),t.toString()}catch(e){}}get __countriesHref(){var e;return null!==(e=this.countries)&&void 0!==e?e:void 0}get __discountsHref(){var e,t;try{const o=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:discounts"].href)&&void 0!==t?t:"");return o.searchParams.set("limit","300"),o.toString()}catch(e){}}get __customerHref(){return this.form.customer_uri||void 0}get __itemsHref(){var e,t;try{const o=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:items"].href)&&void 0!==t?t:"");return o.searchParams.set("zoom","item_options"),o.toString()}catch(e){}}get __storeHref(){var e,t;return null===(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:store"])||void 0===t?void 0:t.href}get __defaultTemplateSet(){var e,t;const o=`#${this.__defaultTemplateSetLoaderId}`,i=this.renderRoot.querySelector(o);return null!==(t=null===(e=null==i?void 0:i.data)||void 0===e?void 0:e._embedded["fx:template_sets"][0])&&void 0!==t?t:null}get __localeCodesHelper(){var e,t;const o=`#${this.__localeCodesHelperLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(o))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __shippingRegions(){var e;const t=this.renderRoot.querySelector(`#${this.__shippingRegionsLoaderId}`);return null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.values}get __billingRegions(){var e;const t=this.renderRoot.querySelector(`#${this.__billingRegionsLoaderId}`);return null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.values}get __templateSet(){var e,t;const o=`#${this.__templateSetLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(o))||void 0===e?void 0:e.data)&&void 0!==t?t:null}get __discounts(){return this.renderRoot.querySelector(`#${this.__discountsLoaderId}`)}get __countriesHelper(){var e;const t=this.renderRoot.querySelector(`#${this.__countriesHelperLoaderId}`);return null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.values}get __customer(){var e;return null===(e=this.renderRoot.querySelector(`#${this.__customerLoaderId}`))||void 0===e?void 0:e.data}get __store(){var e,t;const o=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(o))||void 0===e?void 0:e.data)&&void 0!==t?t:null}__renderTotalOrder(e,t){const o=this.data;if(!o||!e||!t)return s(g||(g=H`--`));const i={amount:`${o.total_order} ${e}`,currencyDisplay:t};return s(x||(x=H`<foxy-i18n infer="totals" key="total_order" .options="${0}"></foxy-i18n>`),i)}__renderTotals(e,t){const o=this.data,i=o&&e&&t;return["total_item_price","total_shipping","total_tax"].map((r=>{const n={amount:`${null==o?void 0:o[r]} ${e}`,currencyDisplay:t};return s(v||(v=H` <div data-testid="${0}" class="flex justify-between text-m text-secondary"> <foxy-i18n key="${0}" infer="totals"></foxy-i18n> ${0} </div> `),r,r,i?s(b||(b=H`<foxy-i18n infer="totals" key="price" .options="${0}"></foxy-i18n>`),n):s(j||(j=H`<span>--</span>`)))}))}__renderDiscounts(e,t){var o,i;const r=null===(i=null===(o=this.__discounts)||void 0===o?void 0:o.data)||void 0===i?void 0:i._embedded["fx:discounts"],n=e&&t;return null==r?void 0:r.map((o=>{const i={amount:`${o.amount} ${e}`,currencyDisplay:t};return s($||($=H` <div data-testclass="discount" class="flex justify-between text-m text-secondary"> <span>${0} &bull; ${0}</span> ${0} </div> `),o.name,o.code,n?s(L||(L=H`<foxy-i18n infer="totals" key="price" .options="${0}"></foxy-i18n>`),i):s(S||(S=H`<span>--</span>`)))}))}}customElements.define("foxy-cart-form",R);export{R as CartForm};
@@ -1 +1 @@
1
- import"./shared-90877857.js";import{a as e}from"./shared-7ff78b4a.js";import{I as t}from"./shared-8b521111.js";import{h as r}from"./shared-dc73b9a5.js";import"./foxy-spinner.js";import"./shared-6b68b3b6.js";import"./shared-0a9d860d.js";import"./shared-da2e66a4.js";import"./shared-6586ffd5.js";import"./shared-b3db7611.js";import"./shared-343d1fd7.js";import"./shared-3cabd589.js";import"./shared-fe45779e.js";import"./shared-482b2b86.js";import"./shared-3ab0306f.js";import"./shared-851a7db5.js";import"./shared-79d35787.js";import"./shared-4e709717.js";let i,s,a,o,d=e=>e;const C=e(t,"client-card");class l extends C{static get defaultImageSrc(){return"data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_2168_15479)'%3E%3Crect width='40' height='40' fill='%23E8E8E8'/%3E%3Cpath d='M6.93609 0H0V6.93609L6.93609 0Z' fill='white'/%3E%3Cpath d='M0 8.35031V16.2326L16.2326 0H8.35031L0 8.35031Z' fill='white'/%3E%3Cpath d='M23.4667 20C23.4667 21.9146 21.9146 23.4667 20 23.4667C18.0854 23.4667 16.5333 21.9146 16.5333 20C16.5333 18.0854 18.0854 16.5333 20 16.5333C21.9146 16.5333 23.4667 18.0854 23.4667 20Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M17.6468 0L0 17.6468V25.529L5.75703 19.772C5.9523 19.5767 6.26888 19.5767 6.46414 19.772C6.6594 19.9673 6.6594 20.2839 6.46414 20.4791L0 26.9433V34.8255L7.67907 27.1464C7.87433 26.9512 8.19091 26.9512 8.38617 27.1464C8.58144 27.3417 8.58144 27.6583 8.38617 27.8536L0 36.2397V40H4.12198L12.4755 31.6464C12.6708 31.4512 12.9874 31.4512 13.1826 31.6464C13.3779 31.8417 13.3779 32.1583 13.1826 32.3536L5.5362 40H13.4185L19.8826 33.5359C20.0779 33.3406 20.3944 33.3406 20.5897 33.5359C20.785 33.7311 20.785 34.0477 20.5897 34.243L14.8327 40H22.7149L40 22.7149V14.8327L34.3536 20.4791C34.1583 20.6744 33.8417 20.6744 33.6464 20.4791C33.4512 20.2839 33.4512 19.9673 33.6464 19.772L40 13.4185V5.5362L32.3536 13.1826C32.1583 13.3779 31.8417 13.3779 31.6464 13.1826C31.4512 12.9874 31.4512 12.6708 31.6464 12.4755L40 4.12198V0H36.2397L27.8536 8.38617C27.6583 8.58144 27.3417 8.58144 27.1464 8.38617C26.9512 8.19091 26.9512 7.87433 27.1464 7.67907L34.8255 0H26.9433L20.5897 6.35355C20.3944 6.54882 20.0779 6.54882 19.8826 6.35355C19.6873 6.15829 19.6873 5.84171 19.8826 5.64645L25.529 0H17.6468ZM12.6461 28.5796L11.4204 27.3539C10.7435 26.677 10.7435 25.5795 11.4204 24.9026L11.7742 24.5489C12.0955 24.2275 12.1662 23.7396 11.992 23.3199C11.8178 22.9003 11.421 22.6 10.9668 22.6H10.4667C9.50938 22.6 8.73334 21.824 8.73334 20.8667V19.1333C8.73334 18.176 9.50938 17.4 10.4667 17.4H10.9668C11.421 17.4 11.8178 17.0997 11.992 16.6801C12.1662 16.2604 12.0955 15.7725 11.7742 15.4511L11.4204 15.0974C10.7435 14.4205 10.7435 13.323 11.4204 12.6461L12.6461 11.4204C13.323 10.7435 14.4205 10.7435 15.0974 11.4204L15.4511 11.7742C15.7725 12.0955 16.2604 12.1662 16.6801 11.992C17.0997 11.8178 17.4 11.421 17.4 10.9668V10.4667C17.4 9.50938 18.176 8.73334 19.1333 8.73334H20.8667C21.824 8.73334 22.6 9.50938 22.6 10.4667V10.9668C22.6 11.421 22.9003 11.8178 23.3199 11.992C23.7396 12.1662 24.2275 12.0955 24.5489 11.7742L24.9026 11.4204C25.5795 10.7435 26.677 10.7435 27.3539 11.4204L28.5796 12.6461C29.2565 13.323 29.2565 14.4205 28.5796 15.0974L28.2259 15.4511C27.9045 15.7725 27.8338 16.2604 28.0081 16.6801C28.1822 17.0997 28.579 17.4 29.0333 17.4H29.5333C30.4906 17.4 31.2667 18.176 31.2667 19.1333V20.8667C31.2667 21.824 30.4906 22.6 29.5333 22.6H29.0332C28.579 22.6 28.1822 22.9003 28.0081 23.3199C27.8338 23.7396 27.9045 24.2275 28.2259 24.5489L28.5796 24.9026C29.2565 25.5795 29.2565 26.677 28.5796 27.3539L27.3539 28.5796C26.677 29.2565 25.5795 29.2565 24.9026 28.5796L24.5489 28.2259C24.2275 27.9045 23.7396 27.8338 23.3199 28.0081C22.9003 28.1822 22.6 28.579 22.6 29.0333V29.5333C22.6 30.4906 21.824 31.2667 20.8667 31.2667H19.1333C18.176 31.2667 17.4 30.4906 17.4 29.5333V29.0333C17.4 28.579 17.0997 28.1822 16.6801 28.0081C16.2604 27.8338 15.7725 27.9045 15.4511 28.2259L15.0974 28.5796C14.4205 29.2565 13.323 29.2565 12.6461 28.5796Z' fill='white'/%3E%3Cpath d='M40 24.1291L24.1291 40H32.0114L40 32.0114V24.1291Z' fill='white'/%3E%3Cpath d='M40 33.4256L33.4256 40H40V33.4256Z' fill='white'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_2168_15479'%3E%3Crect width='40' height='40' fill='white'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E%0A"}renderBody(){const e=l.defaultImageSrc,t=this.data;return r(i||(i=d` <figure class="flex" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <img class="relative h-s w-s object-cover rounded-full bg-contrast-20 flex-shrink-0 shadow-xs" src="${0}" alt="${0}" @error="${0}"> <figcaption class="min-w-0 flex-1 leading-s -my-xs"> <p class="text-m truncate text-body font-medium"> ${0} </p> <p class="text-s truncate text-secondary"> ${0} </p> <p class="text-s truncate text-tertiary"> ${0} &bull; ${0} </p> </figcaption> </figure> `),(null==t?void 0:t.company_logo)||e,this.t("image_alt"),(t=>t.currentTarget.src=e),(null==t?void 0:t.project_name.trim())||r(s||(s=d`<foxy-i18n infer="" key="no_project_name"></foxy-i18n>`)),(null==t?void 0:t.project_description.trim())||r(a||(a=d`<foxy-i18n infer="" key="no_project_description"></foxy-i18n>`)),t?new URL(t.redirect_uri).host:"",(null==t?void 0:t.company_name)||r(o||(o=d`<foxy-i18n infer="" key="no_company_name"></foxy-i18n>`)))}}customElements.define("foxy-client-card",l);export{l as ClientCard};
1
+ import"./shared-102dfbe0.js";import{a as e}from"./shared-e989e47e.js";import{I as t}from"./shared-f090c63a.js";import{h as r}from"./shared-dc73b9a5.js";import"./foxy-spinner.js";import"./shared-a911ab73.js";import"./shared-2f2b5a28.js";import"./shared-bac00622.js";import"./shared-ecb7a183.js";import"./shared-3c58ddf1.js";import"./shared-343d1fd7.js";import"./shared-2808f43a.js";import"./shared-272e7269.js";import"./shared-37391934.js";import"./shared-cd96ff03.js";import"./shared-12e531b8.js";import"./shared-90ddf541.js";import"./shared-39fc8fed.js";import"./shared-2e2d45c4.js";import"./shared-4e709717.js";let i,s,a,o,d=e=>e;const C=e(t,"client-card");class l extends C{static get defaultImageSrc(){return"data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_2168_15479)'%3E%3Crect width='40' height='40' fill='%23E8E8E8'/%3E%3Cpath d='M6.93609 0H0V6.93609L6.93609 0Z' fill='white'/%3E%3Cpath d='M0 8.35031V16.2326L16.2326 0H8.35031L0 8.35031Z' fill='white'/%3E%3Cpath d='M23.4667 20C23.4667 21.9146 21.9146 23.4667 20 23.4667C18.0854 23.4667 16.5333 21.9146 16.5333 20C16.5333 18.0854 18.0854 16.5333 20 16.5333C21.9146 16.5333 23.4667 18.0854 23.4667 20Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M17.6468 0L0 17.6468V25.529L5.75703 19.772C5.9523 19.5767 6.26888 19.5767 6.46414 19.772C6.6594 19.9673 6.6594 20.2839 6.46414 20.4791L0 26.9433V34.8255L7.67907 27.1464C7.87433 26.9512 8.19091 26.9512 8.38617 27.1464C8.58144 27.3417 8.58144 27.6583 8.38617 27.8536L0 36.2397V40H4.12198L12.4755 31.6464C12.6708 31.4512 12.9874 31.4512 13.1826 31.6464C13.3779 31.8417 13.3779 32.1583 13.1826 32.3536L5.5362 40H13.4185L19.8826 33.5359C20.0779 33.3406 20.3944 33.3406 20.5897 33.5359C20.785 33.7311 20.785 34.0477 20.5897 34.243L14.8327 40H22.7149L40 22.7149V14.8327L34.3536 20.4791C34.1583 20.6744 33.8417 20.6744 33.6464 20.4791C33.4512 20.2839 33.4512 19.9673 33.6464 19.772L40 13.4185V5.5362L32.3536 13.1826C32.1583 13.3779 31.8417 13.3779 31.6464 13.1826C31.4512 12.9874 31.4512 12.6708 31.6464 12.4755L40 4.12198V0H36.2397L27.8536 8.38617C27.6583 8.58144 27.3417 8.58144 27.1464 8.38617C26.9512 8.19091 26.9512 7.87433 27.1464 7.67907L34.8255 0H26.9433L20.5897 6.35355C20.3944 6.54882 20.0779 6.54882 19.8826 6.35355C19.6873 6.15829 19.6873 5.84171 19.8826 5.64645L25.529 0H17.6468ZM12.6461 28.5796L11.4204 27.3539C10.7435 26.677 10.7435 25.5795 11.4204 24.9026L11.7742 24.5489C12.0955 24.2275 12.1662 23.7396 11.992 23.3199C11.8178 22.9003 11.421 22.6 10.9668 22.6H10.4667C9.50938 22.6 8.73334 21.824 8.73334 20.8667V19.1333C8.73334 18.176 9.50938 17.4 10.4667 17.4H10.9668C11.421 17.4 11.8178 17.0997 11.992 16.6801C12.1662 16.2604 12.0955 15.7725 11.7742 15.4511L11.4204 15.0974C10.7435 14.4205 10.7435 13.323 11.4204 12.6461L12.6461 11.4204C13.323 10.7435 14.4205 10.7435 15.0974 11.4204L15.4511 11.7742C15.7725 12.0955 16.2604 12.1662 16.6801 11.992C17.0997 11.8178 17.4 11.421 17.4 10.9668V10.4667C17.4 9.50938 18.176 8.73334 19.1333 8.73334H20.8667C21.824 8.73334 22.6 9.50938 22.6 10.4667V10.9668C22.6 11.421 22.9003 11.8178 23.3199 11.992C23.7396 12.1662 24.2275 12.0955 24.5489 11.7742L24.9026 11.4204C25.5795 10.7435 26.677 10.7435 27.3539 11.4204L28.5796 12.6461C29.2565 13.323 29.2565 14.4205 28.5796 15.0974L28.2259 15.4511C27.9045 15.7725 27.8338 16.2604 28.0081 16.6801C28.1822 17.0997 28.579 17.4 29.0333 17.4H29.5333C30.4906 17.4 31.2667 18.176 31.2667 19.1333V20.8667C31.2667 21.824 30.4906 22.6 29.5333 22.6H29.0332C28.579 22.6 28.1822 22.9003 28.0081 23.3199C27.8338 23.7396 27.9045 24.2275 28.2259 24.5489L28.5796 24.9026C29.2565 25.5795 29.2565 26.677 28.5796 27.3539L27.3539 28.5796C26.677 29.2565 25.5795 29.2565 24.9026 28.5796L24.5489 28.2259C24.2275 27.9045 23.7396 27.8338 23.3199 28.0081C22.9003 28.1822 22.6 28.579 22.6 29.0333V29.5333C22.6 30.4906 21.824 31.2667 20.8667 31.2667H19.1333C18.176 31.2667 17.4 30.4906 17.4 29.5333V29.0333C17.4 28.579 17.0997 28.1822 16.6801 28.0081C16.2604 27.8338 15.7725 27.9045 15.4511 28.2259L15.0974 28.5796C14.4205 29.2565 13.323 29.2565 12.6461 28.5796Z' fill='white'/%3E%3Cpath d='M40 24.1291L24.1291 40H32.0114L40 32.0114V24.1291Z' fill='white'/%3E%3Cpath d='M40 33.4256L33.4256 40H40V33.4256Z' fill='white'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_2168_15479'%3E%3Crect width='40' height='40' fill='white'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E%0A"}renderBody(){const e=l.defaultImageSrc,t=this.data;return r(i||(i=d` <figure class="flex" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <img class="relative h-s w-s object-cover rounded-full bg-contrast-20 flex-shrink-0 shadow-xs" src="${0}" alt="${0}" @error="${0}"> <figcaption class="min-w-0 flex-1 leading-s -my-xs"> <p class="text-m truncate text-body font-medium"> ${0} </p> <p class="text-s truncate text-secondary"> ${0} </p> <p class="text-s truncate text-tertiary"> ${0} &bull; ${0} </p> </figcaption> </figure> `),(null==t?void 0:t.company_logo)||e,this.t("image_alt"),(t=>t.currentTarget.src=e),(null==t?void 0:t.project_name.trim())||r(s||(s=d`<foxy-i18n infer="" key="no_project_name"></foxy-i18n>`)),(null==t?void 0:t.project_description.trim())||r(a||(a=d`<foxy-i18n infer="" key="no_project_description"></foxy-i18n>`)),t?new URL(t.redirect_uri).host:"",(null==t?void 0:t.company_name)||r(o||(o=d`<foxy-i18n infer="" key="no_company_name"></foxy-i18n>`)))}}customElements.define("foxy-client-card",l);export{l as ClientCard};
@@ -1 +1 @@
1
- import"./shared-d10d6cba.js";import"./shared-be0fca15.js";import{I as t}from"./shared-8a247f48.js";import{R as r,a as e}from"./shared-7ff78b4a.js";import{B as o}from"./shared-b3db7611.js";import{h as n}from"./shared-dc73b9a5.js";import"./shared-739f24fe.js";import"./shared-4c611015.js";import"./shared-0a9d860d.js";import"./shared-612ea9ed.js";import"./shared-91c88f14.js";import"./shared-684cd55a.js";import"./shared-61ade33e.js";import"./shared-75d13e1b.js";import"./shared-51c4a6dd.js";import"./shared-6586ffd5.js";import"./shared-343d1fd7.js";import"./shared-3cabd589.js";import"./shared-2b5a3c80.js";import"./shared-9803aa7c.js";import"./shared-fe45779e.js";import"./shared-482b2b86.js";import"./shared-3ab0306f.js";import"./shared-851a7db5.js";import"./shared-79d35787.js";import"./shared-25198d9a.js";import"./shared-03673673.js";import"./shared-6cd4e618.js";import"./shared-4e709717.js";import"./foxy-copy-to-clipboard.js";import"./shared-da2e66a4.js";import"./shared-6b68b3b6.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let s,a=t=>t;const i=r(e(t,"client-form"));class c extends i{constructor(){super(...arguments),this.templates={}}get readonlySelector(){const t=["client-secret"];return(this.data||this.in({busy:"fetching"}))&&t.push("client-id"),new o(`${t.join(" ")} ${super.readonlySelector.toString()}`)}get hiddenSelector(){const t=[];return this.data||this.in({busy:"fetching"})||t.push("client-secret"),new o(`${t.join(" ")} ${super.hiddenSelector.toString()}`)}renderBody(){return n(s||(s=a` <div class="grid grid-cols-2 gap-m"> <foxy-internal-text-control class="col-span-2" infer="client-id"> </foxy-internal-text-control> <foxy-internal-text-control class="col-span-2" infer="client-secret"> </foxy-internal-text-control> <foxy-internal-text-control class="col-span-2" infer="redirect-uri"> </foxy-internal-text-control> <foxy-internal-text-control class="col-span-2" infer="project-name"> </foxy-internal-text-control> <foxy-internal-text-area-control class="col-span-2" infer="project-description"> </foxy-internal-text-area-control> <foxy-internal-text-control infer="company-name"></foxy-internal-text-control> <foxy-internal-text-control infer="company-url"></foxy-internal-text-control> <foxy-internal-text-control class="col-span-2" infer="company-logo"> </foxy-internal-text-control> <foxy-internal-text-control class="col-span-2" infer="contact-name"> </foxy-internal-text-control> <foxy-internal-text-control infer="contact-email"></foxy-internal-text-control> <foxy-internal-text-control infer="contact-phone"></foxy-internal-text-control> </div> ${0} `),super.renderBody())}}customElements.define("foxy-client-form",c);export{c as ClientForm};
1
+ import"./shared-cb732375.js";import"./shared-292585a0.js";import{I as t}from"./shared-036b25a3.js";import{R as e,a as r}from"./shared-e989e47e.js";import{B as o}from"./shared-3c58ddf1.js";import{h as n}from"./shared-dc73b9a5.js";import"./shared-328e5fdc.js";import"./shared-f14856e0.js";import"./shared-2f2b5a28.js";import"./shared-4885670b.js";import"./shared-34f4330c.js";import"./shared-0062cab1.js";import"./shared-61ade33e.js";import"./shared-e5f6ca48.js";import"./shared-51c4a6dd.js";import"./shared-ecb7a183.js";import"./shared-343d1fd7.js";import"./shared-2808f43a.js";import"./shared-bd99107c.js";import"./shared-9803aa7c.js";import"./shared-272e7269.js";import"./shared-37391934.js";import"./shared-cd96ff03.js";import"./shared-12e531b8.js";import"./shared-90ddf541.js";import"./shared-39fc8fed.js";import"./shared-2e2d45c4.js";import"./shared-7c819ebc.js";import"./shared-337f2fe9.js";import"./shared-8d7e2e2c.js";import"./shared-4e709717.js";import"./foxy-copy-to-clipboard.js";import"./shared-bac00622.js";import"./shared-a911ab73.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let s,a=t=>t;const i=e(r(t,"client-form"));class c extends i{constructor(){super(...arguments),this.templates={}}get readonlySelector(){const t=["client-secret"];return(this.data||this.in({busy:"fetching"}))&&t.push("client-id"),new o(`${t.join(" ")} ${super.readonlySelector.toString()}`)}get hiddenSelector(){const t=[];return this.data||this.in({busy:"fetching"})||t.push("client-secret"),new o(`${t.join(" ")} ${super.hiddenSelector.toString()}`)}renderBody(){return n(s||(s=a` <div class="grid grid-cols-2 gap-m"> <foxy-internal-text-control class="col-span-2" infer="client-id"> </foxy-internal-text-control> <foxy-internal-text-control class="col-span-2" infer="client-secret"> </foxy-internal-text-control> <foxy-internal-text-control class="col-span-2" infer="redirect-uri"> </foxy-internal-text-control> <foxy-internal-text-control class="col-span-2" infer="project-name"> </foxy-internal-text-control> <foxy-internal-text-area-control class="col-span-2" infer="project-description"> </foxy-internal-text-area-control> <foxy-internal-text-control infer="company-name"></foxy-internal-text-control> <foxy-internal-text-control infer="company-url"></foxy-internal-text-control> <foxy-internal-text-control class="col-span-2" infer="company-logo"> </foxy-internal-text-control> <foxy-internal-text-control class="col-span-2" infer="contact-name"> </foxy-internal-text-control> <foxy-internal-text-control infer="contact-email"></foxy-internal-text-control> <foxy-internal-text-control infer="contact-phone"></foxy-internal-text-control> </div> ${0} `),super.renderBody())}}customElements.define("foxy-client-form",c);export{c as ClientForm};
@@ -1 +1 @@
1
- import"./foxy-spinner.js";import{_ as e}from"./shared-b3db7611.js";import{h as t}from"./shared-dc73b9a5.js";import{a as s}from"./shared-7ff78b4a.js";import{C as r}from"./shared-2b5a3c80.js";import{F as i}from"./shared-343d1fd7.js";import{N as n}from"./shared-fe45779e.js";import{r as a}from"./shared-a0c6a159.js";import{s as o}from"./shared-99940888.js";import"./shared-6b68b3b6.js";import"./shared-0a9d860d.js";import"./shared-da2e66a4.js";import"./shared-6586ffd5.js";import"./shared-3cabd589.js";import"./shared-9803aa7c.js";import"./shared-482b2b86.js";import"./shared-3ab0306f.js";import"./shared-851a7db5.js";import"./shared-79d35787.js";let l,d=e=>e;const h=r(s(n));class p extends h{constructor(){super(),this.props={},this.__pageFetchEventHandler=e=>this.__handlePageFetchEvent(e),this.item="foxy-null"}static get properties(){return e(e({},super.properties),{},{props:{type:Object},item:{type:String}})}get item(){return this.__item}set item(e){const t=null!=e?e:"foxy-null";this.__renderItem="string"==typeof t?new Function("ctx",`return ctx.html\`\n <${t}\n disabledcontrols=\${ctx.disabledControls.toString()}\n readonlycontrols=\${ctx.readonlyControls.toString()}\n hiddencontrols=\${ctx.hiddenControls.toString()}\n data-testclass="items"\n related=\${JSON.stringify(ctx.related)}\n parent=\${ctx.parent}\n group=\${ctx.group}\n href=\${ctx.href}\n lang=\${ctx.lang}\n ns="\${ctx.ns} \${customElements.get('${t}')?.defaultNS ?? ''}"\n ?disabled=\${ctx.disabled}\n ?readonly=\${ctx.readonly}\n ?hidden=\${ctx.hidden}\n .simplifyNsLoading=\${ctx.simplifyNsLoading}\n .templates=\${ctx.templates}\n ...=\${ctx.spread(ctx.props)}\n >\n </${t}>\``):t,this.__item=e,this.requestUpdate()}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener("fetch",this.__pageFetchEventHandler)}render(){let e=[];return e=this.in("busy")?[{key:"stalled",href:"foxy://collection-page/stall",data:null}]:this.in("fail")?[{key:"failed",href:"foxy://collection-page/fail",data:null}]:this.in({idle:"template"})||0===this.__items.length?[{key:"empty",href:"",data:null}]:this.__items.map((e=>({key:e._links.self.href,href:e._links.self.href,data:e}))),t(l||(l=d`${0}`),a(e,(e=>e.key),((s,r)=>{var i,n,a,l,d;return null===(i=this.__renderItem)||void 0===i?void 0:i.call(this,{simplifyNsLoading:this.simplifyNsLoading,disabledControls:this.disabledControls,readonlyControls:this.readonlyControls,hiddenControls:this.hiddenControls,templates:this.templates,disabled:this.disabled,readonly:this.readonly,previous:null!==(a=null===(n=e[r-1])||void 0===n?void 0:n.data)&&void 0!==a?a:null,related:this.related,hidden:this.hidden,parent:this.href,spread:o,props:this.props,group:this.group,lang:this.lang,data:s.data,href:s.href,next:null!==(d=null===(l=e[r+1])||void 0===l?void 0:l.data)&&void 0!==d?d:null,ns:this.ns,html:t})})))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("fetch",this.__pageFetchEventHandler)}get __items(){var e,t;return Array.from(Object.values(null!==(t=null===(e=this.form)||void 0===e?void 0:e._embedded)&&void 0!==t?t:{})).reduce(((e,t)=>[...e,...t]),[])}__handlePageFetchEvent(e){if(!(e instanceof i)||e.target===this)return;const{method:t,url:s}=e.request;return"GET"===t?"foxy://collection-page/stall"===s?this.__stallRequest(e):"foxy://collection-page/fail"===s?this.__failRequest(e):void 0:void 0}__stallRequest(e){e.stopImmediatePropagation(),e.respondWith(new Promise((()=>{})))}__failRequest(e){e.stopImmediatePropagation(),e.respondWith(Promise.resolve(new Response(null,{status:500})))}}customElements.define("foxy-collection-page",p);export{p as CollectionPage};
1
+ import"./foxy-spinner.js";import{_ as e}from"./shared-3c58ddf1.js";import{h as t}from"./shared-dc73b9a5.js";import{a as s}from"./shared-e989e47e.js";import{C as r}from"./shared-bd99107c.js";import{F as i}from"./shared-343d1fd7.js";import{N as n}from"./shared-272e7269.js";import{r as a}from"./shared-a0c6a159.js";import{s as o}from"./shared-99940888.js";import"./shared-a911ab73.js";import"./shared-2f2b5a28.js";import"./shared-bac00622.js";import"./shared-ecb7a183.js";import"./shared-2808f43a.js";import"./shared-9803aa7c.js";import"./shared-37391934.js";import"./shared-cd96ff03.js";import"./shared-12e531b8.js";import"./shared-90ddf541.js";import"./shared-39fc8fed.js";import"./shared-2e2d45c4.js";let d,l=e=>e;const h=r(s(n));class p extends h{constructor(){super(),this.props={},this.__pageFetchEventHandler=e=>this.__handlePageFetchEvent(e),this.item="foxy-null"}static get properties(){return e(e({},super.properties),{},{props:{type:Object},item:{type:String}})}get item(){return this.__item}set item(e){const t=null!=e?e:"foxy-null";this.__renderItem="string"==typeof t?new Function("ctx",`return ctx.html\`\n <${t}\n disabledcontrols=\${ctx.disabledControls.toString()}\n readonlycontrols=\${ctx.readonlyControls.toString()}\n hiddencontrols=\${ctx.hiddenControls.toString()}\n data-testclass="items"\n related=\${JSON.stringify(ctx.related)}\n parent=\${ctx.parent}\n group=\${ctx.group}\n href=\${ctx.href}\n lang=\${ctx.lang}\n ns="\${ctx.ns} \${customElements.get('${t}')?.defaultNS ?? ''}"\n ?disabled=\${ctx.disabled}\n ?readonly=\${ctx.readonly}\n ?hidden=\${ctx.hidden}\n .simplifyNsLoading=\${ctx.simplifyNsLoading}\n .templates=\${ctx.templates}\n ...=\${ctx.spread(ctx.props)}\n >\n </${t}>\``):t,this.__item=e,this.requestUpdate()}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener("fetch",this.__pageFetchEventHandler)}render(){let e=[];return e=this.in("busy")?[{key:"stalled",href:"foxy://collection-page/stall",data:null}]:this.in("fail")?[{key:"failed",href:"foxy://collection-page/fail",data:null}]:this.in({idle:"template"})||0===this.__items.length?[{key:"empty",href:"",data:null}]:this.__items.map((e=>({key:e._links.self.href,href:e._links.self.href,data:e}))),t(d||(d=l`${0}`),a(e,(e=>e.key),((s,r)=>{var i,n,a,d,l;return null===(i=this.__renderItem)||void 0===i?void 0:i.call(this,{simplifyNsLoading:this.simplifyNsLoading,disabledControls:this.disabledControls,readonlyControls:this.readonlyControls,hiddenControls:this.hiddenControls,templates:this.templates,disabled:this.disabled,readonly:this.readonly,previous:null!==(a=null===(n=e[r-1])||void 0===n?void 0:n.data)&&void 0!==a?a:null,related:this.related,hidden:this.hidden,parent:this.href,spread:o,props:this.props,group:this.group,lang:this.lang,data:s.data,href:s.href,next:null!==(l=null===(d=e[r+1])||void 0===d?void 0:d.data)&&void 0!==l?l:null,ns:this.ns,html:t})})))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("fetch",this.__pageFetchEventHandler)}get __items(){var e,t;return Array.from(Object.values(null!==(t=null===(e=this.form)||void 0===e?void 0:e._embedded)&&void 0!==t?t:{})).reduce(((e,t)=>[...e,...t]),[])}__handlePageFetchEvent(e){if(!(e instanceof i)||e.target===this)return;const{method:t,url:s}=e.request;return"GET"===t?"foxy://collection-page/stall"===s?this.__stallRequest(e):"foxy://collection-page/fail"===s?this.__failRequest(e):void 0:void 0}__stallRequest(e){e.stopImmediatePropagation(),e.respondWith(new Promise((()=>{})))}__failRequest(e){e.stopImmediatePropagation(),e.respondWith(Promise.resolve(new Response(null,{status:500})))}}customElements.define("foxy-collection-page",p);export{p as CollectionPage};
@@ -1 +1 @@
1
- import"./shared-25198d9a.js";import"./foxy-collection-page.js";import"./shared-6586ffd5.js";import{p as e,aE as t,_ as s,R as r}from"./shared-b3db7611.js";import{h as a,L as i}from"./shared-dc73b9a5.js";import{C as n}from"./shared-2b5a3c80.js";import{F as o}from"./shared-343d1fd7.js";import{N as d,a as l}from"./shared-fe45779e.js";import{r as c}from"./shared-a0c6a159.js";import{I as h}from"./shared-3cabd589.js";import{i as p}from"./shared-79d35787.js";import{s as u}from"./shared-99940888.js";import"./shared-4c611015.js";import"./shared-0a9d860d.js";import"./shared-7ff78b4a.js";import"./shared-61ade33e.js";import"./foxy-spinner.js";import"./shared-6b68b3b6.js";import"./shared-da2e66a4.js";import"./shared-9803aa7c.js";import"./shared-482b2b86.js";import"./shared-3ab0306f.js";import"./shared-851a7db5.js";const _=e({manual:(e,t)=>t.data}),g=e({error:(e,t)=>t.data}),m=e({first:(e,t)=>t.data,pages:[],error:null}),f=e({first:(e,t)=>{var s,r;return null!==(r=null===(s=t.data[0])||void 0===s?void 0:s._links.self.href)&&void 0!==r?r:""},pages:(e,t)=>t.data,error:null}),v=e({pages:(e,t)=>0===t.data.returned_items?e.pages:[...e.pages,t.data]}),y=e=>e.manual,b=t({id:"pages",initial:"idle",context:{first:"",pages:[],error:null,manual:!1},states:{busy:{invoke:{src:"sendGet",onError:{target:"fail",actions:g},onDone:[{target:"idle.empty",cond:(e,t)=>0==t.data.total_items},{target:"idle.end",cond:(e,t)=>t.data.returned_items<t.data.limit,actions:v},{target:"idle.paused.manual",cond:y,actions:v},{target:"idle.paused.auto",actions:v}]},on:{SET_MANUAL:{actions:_}}},fail:{on:{SET_MANUAL:{actions:_}}},idle:{initial:"empty",states:{paused:{states:{auto:{invoke:{src:"observeChildren"}},manual:{}},on:{RESUME:"#pages.busy",SET_MANUAL:[{cond:y,actions:_,target:".manual"},{actions:_,target:".auto"}]}},empty:{on:{SET_MANUAL:{actions:_}}},end:{on:{SET_MANUAL:{actions:_}}}}}},on:{SET_FIRST:[{cond:(e,t)=>0===t.data.trim().length,target:"idle.empty",actions:m},{target:"busy",actions:m}],SET_PAGES:[{cond:(e,t)=>0===t.data.length,target:"idle.empty",actions:f},{target:"idle.paused",actions:f}]}});let x,E,k,S=e=>e;const j=n(h(i));class R extends j{constructor(){var e;super(),e=this,this.props={},this.lang="",this.ns="",this.__group="",this.__fetchEventHandler=e=>this.__handleFetchEvent(e),this.__service=p(b.withConfig({services:{observeChildren:()=>e=>{const t=new IntersectionObserver((t=>{t.some((e=>e.isIntersecting))&&e("RESUME")}));return t.observe(this.renderRoot.children[this.renderRoot.children.length-1]),()=>t.disconnect()},sendGet:async function(t){var s;const r=t.pages[t.pages.length-1],a=null!==(s=null==r?void 0:r._links.next.href)&&void 0!==s?s:t.first,i=await new d.API(e).fetch(a);if(!i.ok)throw i;const n=await i.json();return e.__stopTrackingRumour(),d.Rumour(e.group).share({source:n._links.self.href,data:n}),e.__trackRumour(),n}}})),this.page="foxy-collection-page foxy-null"}static get properties(){return s(s({},super.properties),{},{manual:{type:Boolean,reflect:!0},first:{type:String,noAccessor:!0},pages:{type:Array,noAccessor:!0},group:{type:String},props:{type:Object},lang:{type:String},page:{type:String},ns:{type:String}})}get page(){return this.__page}set page(e){if("string"==typeof e){const t=e.split(" ").pop(),s=t?`item="${t}"`:"";this.__renderPage=new Function("ctx",`return ctx.html\`\n <${e}\n disabledcontrols=\${ctx.disabledControls.toString()}\n readonlycontrols=\${ctx.readonlyControls.toString()}\n hiddencontrols=\${ctx.hiddenControls.toString()}\n group=\${ctx.group}\n href=\${ctx.href}\n lang=\${ctx.lang}\n ns="\${ctx.ns} \${customElements.get('${e}')?.defaultNS ?? ''}"\n ${s}\n ?disabled=\${ctx.disabled}\n ?readonly=\${ctx.readonly}\n ?hidden=\${ctx.hidden}\n .templates=\${ctx.templates}\n ...=\${ctx.spread(ctx.props)}\n >\n </${e}>\``)}else this.__renderPage=e;this.__page=e,this.requestUpdate()}get first(){return this.__service.state.context.first}set first(e){this.__service.send({type:"SET_FIRST",data:e})}get pages(){return this.__service.state.context.pages}set pages(e){this.__service.send({type:"SET_PAGES",data:e})}get group(){return this.__group}set group(e){var t;this.__group=e,null===(t=this.__stopTrackingRumour)||void 0===t||t.call(this),this.__trackRumour()}get manual(){return this.__service.state.context.manual}set manual(e){this.__service.send({type:"SET_MANUAL",data:e})}in(e){return this.__service.state.matches(e)}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener("fetch",this.__fetchEventHandler),this.__createService(),this.__trackRumour()}render(){const e=this.pages.map((e=>({key:e._links.self.href,href:e._links.self.href})));return this.__service.state.matches("busy")?e.push({key:"stalled",href:"foxy://collection-pages/stall"}):this.__service.state.matches("fail")?e.push({key:"failed",href:"foxy://collection-pages/fail"}):this.__service.state.matches({idle:"empty"})&&e.push({key:"empty",href:""}),a(x||(x=S` ${0} ${0} `),c(e,(e=>e.key),((e,t)=>{var s;return this.__renderPage({disabledControls:this.disabledControls,readonlyControls:this.readonlyControls,hiddenControls:this.hiddenControls,templates:this.templates,disabled:this.disabled,readonly:this.readonly,hidden:this.hidden,spread:u,props:this.props,group:this.group,data:null!==(s=this.pages[t])&&void 0!==s?s:null,href:e.href,lang:this.lang,ns:this.ns,html:a})})),this.manual?this.in({idle:"paused"})?a(E||(E=S` <vaadin-button theme="small contrast" @click="${0}"> <foxy-i18n lang="${0}" key="load_more" ns="${0}"></foxy-i18n> </vaadin-button> `),(()=>this.__service.send("RESUME")),this.lang,this.ns):"":a(k||(k=S` <span></span> `)))}updated(e){super.updated(e),this.dispatchEvent(new d.UpdateEvent)}disconnectedCallback(){var e;super.disconnectedCallback(),this.removeEventListener("fetch",this.__fetchEventHandler),this.__service.stop(),null===(e=this.__stopTrackingRumour)||void 0===e||e.call(this)}__trackRumour(){this.__stopTrackingRumour=d.Rumour(this.group).track((e=>{try{0===this.pages.length?e({_links:{self:{href:this.first}}}):this.pages.map((t=>e(t)))}catch(e){if(!(e instanceof r.UpdateError))throw e;this.__service.send({type:"SET_FIRST",data:this.first})}}))}__createService(){this.__service.onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}__handleFetchEvent(e){if(!(e instanceof o)||e.target===this)return;const{method:t,url:s}=e.request;return"GET"===t?"foxy://collection-pages/stall"===s?this.__stallRequest(e):"foxy://collection-pages/fail"===s?this.__failRequest(e):void this.__respondIfPossible(e):void 0}__respondIfPossible(e){const t=l(e.request.url,this.pages);t.ok&&(e.respondWith(Promise.resolve(t)),console.debug(`%c@foxy.io/elements::${this.localName}\n%c200%c GET ${e.request.url}`,"color: gray","background: gray; padding: 0 .2em; border-radius: .2em; color: white;",""))}__stallRequest(e){e.stopImmediatePropagation(),e.respondWith(new Promise((()=>{})))}__failRequest(e){e.stopImmediatePropagation(),e.respondWith(Promise.resolve(this.__service.state.context.error))}}customElements.define("foxy-collection-pages",R);export{R as CollectionPages};
1
+ import"./shared-7c819ebc.js";import"./foxy-collection-page.js";import"./shared-ecb7a183.js";import{o as e,aE as t,_ as s,R as r}from"./shared-3c58ddf1.js";import{h as a,L as i}from"./shared-dc73b9a5.js";import{C as n}from"./shared-bd99107c.js";import{F as o}from"./shared-343d1fd7.js";import{N as d,s as l}from"./shared-272e7269.js";import{r as c}from"./shared-a0c6a159.js";import{I as h}from"./shared-2808f43a.js";import{i as p}from"./shared-2e2d45c4.js";import{s as u}from"./shared-99940888.js";import"./shared-f14856e0.js";import"./shared-2f2b5a28.js";import"./shared-e989e47e.js";import"./shared-61ade33e.js";import"./foxy-spinner.js";import"./shared-a911ab73.js";import"./shared-bac00622.js";import"./shared-9803aa7c.js";import"./shared-37391934.js";import"./shared-cd96ff03.js";import"./shared-12e531b8.js";import"./shared-90ddf541.js";import"./shared-39fc8fed.js";const _=e({manual:(e,t)=>t.data}),g=e({error:(e,t)=>t.data}),m=e({first:(e,t)=>t.data,pages:[],error:null}),f=e({first:(e,t)=>{var s,r;return null!==(r=null===(s=t.data[0])||void 0===s?void 0:s._links.self.href)&&void 0!==r?r:""},pages:(e,t)=>t.data,error:null}),v=e({pages:(e,t)=>0===t.data.returned_items?e.pages:[...e.pages,t.data]}),y=e=>e.manual,b=t({id:"pages",initial:"idle",context:{first:"",pages:[],error:null,manual:!1},states:{busy:{invoke:{src:"sendGet",onError:{target:"fail",actions:g},onDone:[{target:"idle.empty",cond:(e,t)=>0==t.data.total_items},{target:"idle.end",cond:(e,t)=>t.data.returned_items<t.data.limit,actions:v},{target:"idle.paused.manual",cond:y,actions:v},{target:"idle.paused.auto",actions:v}]},on:{SET_MANUAL:{actions:_}}},fail:{on:{SET_MANUAL:{actions:_}}},idle:{initial:"empty",states:{paused:{states:{auto:{invoke:{src:"observeChildren"}},manual:{}},on:{RESUME:"#pages.busy",SET_MANUAL:[{cond:y,actions:_,target:".manual"},{actions:_,target:".auto"}]}},empty:{on:{SET_MANUAL:{actions:_}}},end:{on:{SET_MANUAL:{actions:_}}}}}},on:{SET_FIRST:[{cond:(e,t)=>0===t.data.trim().length,target:"idle.empty",actions:m},{target:"busy",actions:m}],SET_PAGES:[{cond:(e,t)=>0===t.data.length,target:"idle.empty",actions:f},{target:"idle.paused",actions:f}]}});let x,E,k,S=e=>e;const j=n(h(i));class R extends j{constructor(){var e;super(),e=this,this.props={},this.lang="",this.ns="",this.__group="",this.__fetchEventHandler=e=>this.__handleFetchEvent(e),this.__service=p(b.withConfig({services:{observeChildren:()=>e=>{const t=new IntersectionObserver((t=>{t.some((e=>e.isIntersecting))&&e("RESUME")}));return t.observe(this.renderRoot.children[this.renderRoot.children.length-1]),()=>t.disconnect()},sendGet:async function(t){var s;const r=t.pages[t.pages.length-1],a=null!==(s=null==r?void 0:r._links.next.href)&&void 0!==s?s:t.first,i=await new d.API(e).fetch(a);if(!i.ok)throw i;const n=await i.json();return e.__stopTrackingRumour(),d.Rumour(e.group).share({source:n._links.self.href,data:n}),e.__trackRumour(),n}}})),this.page="foxy-collection-page foxy-null"}static get properties(){return s(s({},super.properties),{},{manual:{type:Boolean,reflect:!0},first:{type:String,noAccessor:!0},pages:{type:Array,noAccessor:!0},group:{type:String},props:{type:Object},lang:{type:String},page:{type:String},ns:{type:String}})}get page(){return this.__page}set page(e){if("string"==typeof e){const t=e.split(" ").pop(),s=t?`item="${t}"`:"";this.__renderPage=new Function("ctx",`return ctx.html\`\n <${e}\n disabledcontrols=\${ctx.disabledControls.toString()}\n readonlycontrols=\${ctx.readonlyControls.toString()}\n hiddencontrols=\${ctx.hiddenControls.toString()}\n group=\${ctx.group}\n href=\${ctx.href}\n lang=\${ctx.lang}\n ns="\${ctx.ns} \${customElements.get('${e}')?.defaultNS ?? ''}"\n ${s}\n ?disabled=\${ctx.disabled}\n ?readonly=\${ctx.readonly}\n ?hidden=\${ctx.hidden}\n .templates=\${ctx.templates}\n ...=\${ctx.spread(ctx.props)}\n >\n </${e}>\``)}else this.__renderPage=e;this.__page=e,this.requestUpdate()}get first(){return this.__service.state.context.first}set first(e){this.__service.send({type:"SET_FIRST",data:e})}get pages(){return this.__service.state.context.pages}set pages(e){this.__service.send({type:"SET_PAGES",data:e})}get group(){return this.__group}set group(e){var t;this.__group=e,null===(t=this.__stopTrackingRumour)||void 0===t||t.call(this),this.__trackRumour()}get manual(){return this.__service.state.context.manual}set manual(e){this.__service.send({type:"SET_MANUAL",data:e})}in(e){return this.__service.state.matches(e)}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener("fetch",this.__fetchEventHandler),this.__createService(),this.__trackRumour()}render(){const e=this.pages.map((e=>({key:e._links.self.href,href:e._links.self.href})));return this.__service.state.matches("busy")?e.push({key:"stalled",href:"foxy://collection-pages/stall"}):this.__service.state.matches("fail")?e.push({key:"failed",href:"foxy://collection-pages/fail"}):this.__service.state.matches({idle:"empty"})&&e.push({key:"empty",href:""}),a(x||(x=S` ${0} ${0} `),c(e,(e=>e.key),((e,t)=>{var s;return this.__renderPage({disabledControls:this.disabledControls,readonlyControls:this.readonlyControls,hiddenControls:this.hiddenControls,templates:this.templates,disabled:this.disabled,readonly:this.readonly,hidden:this.hidden,spread:u,props:this.props,group:this.group,data:null!==(s=this.pages[t])&&void 0!==s?s:null,href:e.href,lang:this.lang,ns:this.ns,html:a})})),this.manual?this.in({idle:"paused"})?a(E||(E=S` <vaadin-button theme="small contrast" @click="${0}"> <foxy-i18n lang="${0}" key="load_more" ns="${0}"></foxy-i18n> </vaadin-button> `),(()=>this.__service.send("RESUME")),this.lang,this.ns):"":a(k||(k=S` <span></span> `)))}updated(e){super.updated(e),this.dispatchEvent(new d.UpdateEvent)}disconnectedCallback(){var e;super.disconnectedCallback(),this.removeEventListener("fetch",this.__fetchEventHandler),this.__service.stop(),null===(e=this.__stopTrackingRumour)||void 0===e||e.call(this)}__trackRumour(){this.__stopTrackingRumour=d.Rumour(this.group).track((e=>{try{0===this.pages.length?e({_links:{self:{href:this.first}}}):this.pages.map((t=>e(t)))}catch(e){if(!(e instanceof r.UpdateError))throw e;this.__service.send({type:"SET_FIRST",data:this.first})}}))}__createService(){this.__service.onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}__handleFetchEvent(e){if(!(e instanceof o)||e.target===this)return;const{method:t,url:s}=e.request;return"GET"===t?"foxy://collection-pages/stall"===s?this.__stallRequest(e):"foxy://collection-pages/fail"===s?this.__failRequest(e):void this.__respondIfPossible(e):void 0}__respondIfPossible(e){const t=l(e.request.url,this.pages);t.ok&&(e.respondWith(Promise.resolve(t)),console.debug(`%c@foxy.io/elements::${this.localName}\n%c200%c GET ${e.request.url}`,"color: gray","background: gray; padding: 0 .2em; border-radius: .2em; color: white;",""))}__stallRequest(e){e.stopImmediatePropagation(),e.respondWith(new Promise((()=>{})))}__failRequest(e){e.stopImmediatePropagation(),e.respondWith(Promise.resolve(this.__service.state.context.error))}}customElements.define("foxy-collection-pages",R);export{R as CollectionPages};
@@ -1 +1 @@
1
- import"./shared-da2e66a4.js";import"./shared-6b68b3b6.js";import"./shared-6586ffd5.js";import{_ as t}from"./shared-b3db7611.js";import{c as e,h as o,L as r}from"./shared-dc73b9a5.js";import{C as i}from"./shared-2b5a3c80.js";import{I as s}from"./shared-3cabd589.js";import{a}from"./shared-7ff78b4a.js";import"./shared-0a9d860d.js";import"./shared-343d1fd7.js";import"./shared-9803aa7c.js";let n,d,c=t=>t;const h=i(a(s(r),"copy-to-clipboard"));class l extends h{constructor(){super(...arguments),this.text=null,this.__state="idle"}static get properties(){return t(t({},super.properties),{},{text:{type:String},__state:{attribute:!1}})}static get styles(){return e(n||(n=c`button{position:relative;appearance:none;background:0 0;border:none;border-radius:var(--lumo-border-radius-s);color:inherit;font-size:inherit;padding:0;width:1.5em;height:1.5em;display:flex;justify-content:center;align-items:center}button::before{position:absolute;inset:0;content:' ';display:block;background:currentColor;opacity:.08;transition:opacity .15s ease;border-radius:var(--lumo-border-radius-s)}button:focus{outline:0;box-shadow:0 0 0 2px currentColor}button:disabled{opacity:.5;cursor:default}@media (hover:hover){button:not(:disabled):hover{cursor:pointer}button:not(:disabled):hover::before{opacity:.16}}iron-icon{--iron-icon-height:1em;--iron-icon-width:1em}`))}render(){let t="",e="";return"busy"===this.__state?(t="copying",e="icons:hourglass-empty"):"fail"===this.__state?(t="failed_to_copy",e="icons:error-outline"):"done"===this.__state?(t="done",e="icons:done"):(t="click_to_copy",e="icons:content-copy"),o(d||(d=c` <button title="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="${0}"></iron-icon> </button> `),this.t(t),this.disabled,(()=>{var t;"idle"===this.__state&&(this.__state="busy",navigator.clipboard.writeText(null!==(t=this.text)&&void 0!==t?t:"").then((()=>this.__state="done")).catch((()=>this.__state="fail")).then((()=>setTimeout((()=>this.__state="idle"),2e3))))}),e)}}customElements.define("foxy-copy-to-clipboard",l);export{l as CopyToClipboard};
1
+ import"./shared-bac00622.js";import"./shared-a911ab73.js";import"./shared-ecb7a183.js";import{_ as t}from"./shared-3c58ddf1.js";import{c as e,h as o,L as r}from"./shared-dc73b9a5.js";import{C as i}from"./shared-bd99107c.js";import{I as s}from"./shared-2808f43a.js";import{a}from"./shared-e989e47e.js";import"./shared-2f2b5a28.js";import"./shared-343d1fd7.js";import"./shared-9803aa7c.js";let n,d,c=t=>t;const h=i(a(s(r),"copy-to-clipboard"));class l extends h{constructor(){super(...arguments),this.text=null,this.__state="idle"}static get properties(){return t(t({},super.properties),{},{text:{type:String},__state:{attribute:!1}})}static get styles(){return e(n||(n=c`button{position:relative;appearance:none;background:0 0;border:none;border-radius:var(--lumo-border-radius-s);color:inherit;font-size:inherit;padding:0;width:1.5em;height:1.5em;display:flex;justify-content:center;align-items:center}button::before{position:absolute;inset:0;content:' ';display:block;background:currentColor;opacity:.08;transition:opacity .15s ease;border-radius:var(--lumo-border-radius-s)}button:focus{outline:0;box-shadow:0 0 0 2px currentColor}button:disabled{opacity:.5;cursor:default}@media (hover:hover){button:not(:disabled):hover{cursor:pointer}button:not(:disabled):hover::before{opacity:.16}}iron-icon{--iron-icon-height:1em;--iron-icon-width:1em}`))}render(){let t="",e="";return"busy"===this.__state?(t="copying",e="icons:hourglass-empty"):"fail"===this.__state?(t="failed_to_copy",e="icons:error-outline"):"done"===this.__state?(t="done",e="icons:done"):(t="click_to_copy",e="icons:content-copy"),o(d||(d=c` <button title="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="${0}"></iron-icon> </button> `),this.t(t),this.disabled,(()=>{var t;"idle"===this.__state&&(this.__state="busy",navigator.clipboard.writeText(null!==(t=this.text)&&void 0!==t?t:"").then((()=>this.__state="done")).catch((()=>this.__state="fail")).then((()=>setTimeout((()=>this.__state="idle"),2e3))))}),e)}}customElements.define("foxy-copy-to-clipboard",l);export{l as CopyToClipboard};
@@ -1 +1 @@
1
- import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-6586ffd5.js";import{h as t}from"./shared-dc73b9a5.js";import{C as s}from"./shared-2b5a3c80.js";import{N as e}from"./shared-fe45779e.js";import{T as i,a}from"./shared-7ff78b4a.js";import{c as r}from"./shared-4e709717.js";import"./shared-6b68b3b6.js";import"./shared-0a9d860d.js";import"./shared-da2e66a4.js";import"./shared-b3db7611.js";import"./shared-3cabd589.js";import"./shared-343d1fd7.js";import"./shared-9803aa7c.js";import"./shared-482b2b86.js";import"./shared-3ab0306f.js";import"./shared-851a7db5.js";import"./shared-79d35787.js";let n,o,d,l,c,p,h,m=t=>t;const u=i(s(a(e,"coupon-card")));class f extends u{constructor(){super(...arguments),this.templates={}}render(){var s,e;const i=this.hiddenSelector;return t(n||(n=m` <div aria-busy="${0}" aria-live="polite" class="relative leading-m font-lumo text-m"> <div class="${0}"> ${0} ${0} ${0} </div> <div class="${0}"> <foxy-spinner data-testid="spinner" state="${0}" class="m-auto" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.in("busy"),r({"transition-opacity":!0,"opacity-0":!this.data}),i.matches("title",!0)?"":this.__renderTitle(),i.matches("description",!0)?"":this.__renderDescription(),i.matches("status",!0)?"":this.__renderStatus(),r({"pointer-events-none absolute inset-0 flex transition-opacity":!0,"opacity-0":!!this.data}),this.in("fail")?"error":this.in({idle:"template"})?"empty":"busy",this.lang,this.ns,null!==(e=null===(s=customElements.get("foxy-spinner"))||void 0===s?void 0:s.defaultNS)&&void 0!==e?e:"")}__renderTitle(){var s,e,i,a,r,n;const l=null!==(e=null===(s=this.data)||void 0===s?void 0:s.number_of_uses_to_date)&&void 0!==e?e:0,c=null!==(a=null===(i=this.data)||void 0===i?void 0:i.number_of_uses_allowed)&&void 0!==a?a:0;return t(o||(o=m` <div data-testid="title"> ${0} <div class="flex items-center justify-between"> <div class="font-medium truncate">${0}</div> <foxy-i18n options="${0}" class="text-tertiary text-s flex-shrink-0" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> </div> ${0} </div> `),this.renderTemplateOrSlot("title:before"),null!==(n=null===(r=this.data)||void 0===r?void 0:r.name)&&void 0!==n?n:t(d||(d=m`&ZeroWidthSpace;`)),JSON.stringify({count:l,total:c}),this.lang,0===c?"uses_count":"uses_to_total_count",this.ns,this.renderTemplateOrSlot("title:after"))}__renderDescription(){let s=null;if(this.data){const e=this.data.coupon_discount_details,i=this.data.coupon_discount_type,a=this.ns;s=t(l||(l=m` <foxy-i18n options="${0}" lang="${0}" key="discount_summary" ns="${0}"> </foxy-i18n> `),JSON.stringify({params:{details:e,type:i,ns:a}}),this.lang,this.ns)}return t(c||(c=m` <div data-testid="description"> ${0} <div class="truncate text-s text-secondary">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("description:before"),null!=s?s:t(p||(p=m`&ZeroWidthSpace;`)),this.renderTemplateOrSlot("description:after"))}__renderStatus(){var s;const{start_date:e,end_date:i}=null!==(s=this.data)&&void 0!==s?s:{},a=e&&i?"complete":e?"from":i?"until":"any";return t(h||(h=m` <div data-testid="status"> ${0} <foxy-i18n options="${0}" class="block truncate text-s text-tertiary" lang="${0}" key="date_range_${0}" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("status:before"),JSON.stringify({start:e,end:i}),this.lang,a,this.ns,this.renderTemplateOrSlot("status:after"))}}customElements.define("foxy-coupon-card",f);export{f as CouponCard};
1
+ import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-ecb7a183.js";import{h as t}from"./shared-dc73b9a5.js";import{C as e}from"./shared-bd99107c.js";import{N as s}from"./shared-272e7269.js";import{T as i,a}from"./shared-e989e47e.js";import{c as r}from"./shared-4e709717.js";import"./shared-a911ab73.js";import"./shared-2f2b5a28.js";import"./shared-bac00622.js";import"./shared-3c58ddf1.js";import"./shared-2808f43a.js";import"./shared-343d1fd7.js";import"./shared-9803aa7c.js";import"./shared-37391934.js";import"./shared-cd96ff03.js";import"./shared-12e531b8.js";import"./shared-90ddf541.js";import"./shared-39fc8fed.js";import"./shared-2e2d45c4.js";let n,o,d,l,c,p,h,m=t=>t;const u=i(e(a(s,"coupon-card")));class f extends u{constructor(){super(...arguments),this.templates={}}render(){var e,s;const i=this.hiddenSelector;return t(n||(n=m` <div aria-busy="${0}" aria-live="polite" class="relative leading-m font-lumo text-m"> <div class="${0}"> ${0} ${0} ${0} </div> <div class="${0}"> <foxy-spinner data-testid="spinner" state="${0}" class="m-auto" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.in("busy"),r({"transition-opacity":!0,"opacity-0":!this.data}),i.matches("title",!0)?"":this.__renderTitle(),i.matches("description",!0)?"":this.__renderDescription(),i.matches("status",!0)?"":this.__renderStatus(),r({"pointer-events-none absolute inset-0 flex transition-opacity":!0,"opacity-0":!!this.data}),this.in("fail")?"error":this.in({idle:"template"})?"empty":"busy",this.lang,this.ns,null!==(s=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==s?s:"")}__renderTitle(){var e,s,i,a,r,n;const l=null!==(s=null===(e=this.data)||void 0===e?void 0:e.number_of_uses_to_date)&&void 0!==s?s:0,c=null!==(a=null===(i=this.data)||void 0===i?void 0:i.number_of_uses_allowed)&&void 0!==a?a:0;return t(o||(o=m` <div data-testid="title"> ${0} <div class="flex items-center justify-between"> <div class="font-medium truncate">${0}</div> <foxy-i18n options="${0}" class="text-tertiary text-s flex-shrink-0" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> </div> ${0} </div> `),this.renderTemplateOrSlot("title:before"),null!==(n=null===(r=this.data)||void 0===r?void 0:r.name)&&void 0!==n?n:t(d||(d=m`&ZeroWidthSpace;`)),JSON.stringify({count:l,total:c}),this.lang,0===c?"uses_count":"uses_to_total_count",this.ns,this.renderTemplateOrSlot("title:after"))}__renderDescription(){let e=null;if(this.data){const s=this.data.coupon_discount_details,i=this.data.coupon_discount_type,a=this.ns;e=t(l||(l=m` <foxy-i18n options="${0}" lang="${0}" key="discount_summary" ns="${0}"> </foxy-i18n> `),JSON.stringify({params:{details:s,type:i,ns:a}}),this.lang,this.ns)}return t(c||(c=m` <div data-testid="description"> ${0} <div class="truncate text-s text-secondary">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("description:before"),null!=e?e:t(p||(p=m`&ZeroWidthSpace;`)),this.renderTemplateOrSlot("description:after"))}__renderStatus(){var e;const{start_date:s,end_date:i}=null!==(e=this.data)&&void 0!==e?e:{},a=s&&i?"complete":s?"from":i?"until":"any";return t(h||(h=m` <div data-testid="status"> ${0} <foxy-i18n options="${0}" class="block truncate text-s text-tertiary" lang="${0}" key="date_range_${0}" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("status:before"),JSON.stringify({start:s,end:i}),this.lang,a,this.ns,this.renderTemplateOrSlot("status:after"))}}customElements.define("foxy-coupon-card",f);export{f as CouponCard};
@@ -1 +1 @@
1
- import"./shared-90877857.js";import"./shared-6586ffd5.js";import{a as s}from"./shared-7ff78b4a.js";import{I as e}from"./shared-8b521111.js";import{h as t}from"./shared-dc73b9a5.js";import"./foxy-spinner.js";import"./shared-6b68b3b6.js";import"./shared-0a9d860d.js";import"./shared-da2e66a4.js";import"./shared-b3db7611.js";import"./shared-3cabd589.js";import"./shared-343d1fd7.js";import"./shared-fe45779e.js";import"./shared-482b2b86.js";import"./shared-3ab0306f.js";import"./shared-851a7db5.js";import"./shared-79d35787.js";import"./shared-4e709717.js";let o,r=s=>s;const a=s(e,"coupon-code-card");class i extends a{renderBody(){var s;return t(o||(o=r` <section class="h-s flex flex-col justify-center leading-xs"> <p class="flex items-center justify-between min-w-0"> <foxy-i18n infer="" class="block truncate text-m font-medium" key="line_1" .options="${0}"> </foxy-i18n> <foxy-i18n infer="" class="text-s text-tertiary" key="uses_count" .options="${0}"> </foxy-i18n> </p> <p class="text-s text-secondary min-w-0"> <foxy-i18n infer="" class="block truncate" key="line_2" .options="${0}"> </foxy-i18n> </p> </section> `),this.data,{count:null===(s=this.data)||void 0===s?void 0:s.number_of_uses_to_date},this.data)}}customElements.define("foxy-coupon-code-card",i);export{i as CouponCodeCard};
1
+ import"./shared-102dfbe0.js";import"./shared-ecb7a183.js";import{a as s}from"./shared-e989e47e.js";import{I as e}from"./shared-f090c63a.js";import{h as t}from"./shared-dc73b9a5.js";import"./foxy-spinner.js";import"./shared-a911ab73.js";import"./shared-2f2b5a28.js";import"./shared-bac00622.js";import"./shared-3c58ddf1.js";import"./shared-2808f43a.js";import"./shared-343d1fd7.js";import"./shared-272e7269.js";import"./shared-37391934.js";import"./shared-cd96ff03.js";import"./shared-12e531b8.js";import"./shared-90ddf541.js";import"./shared-39fc8fed.js";import"./shared-2e2d45c4.js";import"./shared-4e709717.js";let r,o=s=>s;const a=s(e,"coupon-code-card");class i extends a{renderBody(){var s;return t(r||(r=o` <section class="h-s flex flex-col justify-center leading-xs"> <p class="flex items-center justify-between min-w-0"> <foxy-i18n infer="" class="block truncate text-m font-medium" key="line_1" .options="${0}"> </foxy-i18n> <foxy-i18n infer="" class="text-s text-tertiary" key="uses_count" .options="${0}"> </foxy-i18n> </p> <p class="text-s text-secondary min-w-0"> <foxy-i18n infer="" class="block truncate" key="line_2" .options="${0}"> </foxy-i18n> </p> </section> `),this.data,{count:null===(s=this.data)||void 0===s?void 0:s.number_of_uses_to_date},this.data)}}customElements.define("foxy-coupon-code-card",i);export{i as CouponCodeCard};
@@ -1 +1 @@
1
- import"./shared-d222bd1e.js";import"./shared-f0fcd613.js";import"./shared-be0fca15.js";import{I as r}from"./shared-8a247f48.js";import"./foxy-transaction-card.js";import{_ as e,B as s}from"./shared-b3db7611.js";import{a as t}from"./shared-7ff78b4a.js";import{i as o}from"./shared-9803aa7c.js";import{h as a}from"./shared-dc73b9a5.js";import"./shared-540063aa.js";import"./shared-4c611015.js";import"./shared-0a9d860d.js";import"./shared-6b68b3b6.js";import"./shared-28be347b.js";import"./shared-25198d9a.js";import"./shared-61ade33e.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-da2e66a4.js";import"./shared-6586ffd5.js";import"./shared-343d1fd7.js";import"./shared-3cabd589.js";import"./shared-2b5a3c80.js";import"./shared-fe45779e.js";import"./shared-482b2b86.js";import"./shared-3ab0306f.js";import"./shared-851a7db5.js";import"./shared-79d35787.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-03673673.js";import"./shared-6cd4e618.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-75d13e1b.js";import"./shared-51c4a6dd.js";import"./shared-a24b2aa7.js";import"./shared-684cd55a.js";import"./shared-612ea9ed.js";import"./shared-91c88f14.js";import"./shared-ad11b006.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";import"./shared-0f59fd6a.js";import"./shared-4c7a8fcc.js";import"./shared-90877857.js";import"./shared-8b521111.js";let i,d=r=>r;const n=t(r,"coupon-code-form");class c extends n{constructor(){super(...arguments),this.getTransactionPageHref=null,this.templates={}}static get properties(){return e(e({},super.properties),{},{getTransactionPageHref:{attribute:!1}})}static get v8n(){return[({code:r})=>!!r||"code:v8n_required",({code:r})=>!r||r.length<=50||"code:v8n_too_long",({code:r})=>!(null==r?void 0:r.includes(" "))||"code:v8n_has_spaces"]}get readonlySelector(){return new s(`number-of-uses-to-date ${super.readonlySelector}`.trim())}get hiddenSelector(){const r=[super.hiddenSelector.toString()];return this.href||r.unshift("transactions","number-of-uses-to-date"),new s(r.join(" ").trim())}renderBody(){var r,e;let s;try{const t=new URL(null!==(e=null===(r=this.data)||void 0===r?void 0:r._links["fx:coupon_code_transactions"].href)&&void 0!==e?e:"");t.searchParams.set("zoom","items"),s=t.toString()}catch(r){s=void 0}return a(i||(i=d` <foxy-internal-text-control infer="code"></foxy-internal-text-control> <foxy-internal-integer-control infer="number-of-uses-to-date"></foxy-internal-integer-control> <foxy-internal-async-list-control first="${0}" infer="transactions" limit="5" item="foxy-transaction-card" .getPageHref="${0}" hide-delete-button> </foxy-internal-async-list-control> ${0} `),o(s),this.getTransactionPageHref,super.renderBody())}}customElements.define("foxy-coupon-code-form",c);export{c as CouponCodeForm};
1
+ import"./shared-a33be18f.js";import"./shared-91009494.js";import"./shared-292585a0.js";import{I as r}from"./shared-036b25a3.js";import"./foxy-transaction-card.js";import{_ as e,B as s}from"./shared-3c58ddf1.js";import{a as t}from"./shared-e989e47e.js";import{i as o}from"./shared-9803aa7c.js";import{h as a}from"./shared-dc73b9a5.js";import"./shared-8c5b4c81.js";import"./shared-f14856e0.js";import"./shared-2f2b5a28.js";import"./shared-a911ab73.js";import"./shared-41e9ef02.js";import"./shared-7c819ebc.js";import"./shared-61ade33e.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-bac00622.js";import"./shared-ecb7a183.js";import"./shared-343d1fd7.js";import"./shared-2808f43a.js";import"./shared-bd99107c.js";import"./shared-272e7269.js";import"./shared-37391934.js";import"./shared-cd96ff03.js";import"./shared-12e531b8.js";import"./shared-90ddf541.js";import"./shared-39fc8fed.js";import"./shared-2e2d45c4.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-337f2fe9.js";import"./shared-8d7e2e2c.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-e5f6ca48.js";import"./shared-51c4a6dd.js";import"./shared-62f3fc5a.js";import"./shared-0062cab1.js";import"./shared-4885670b.js";import"./shared-34f4330c.js";import"./shared-b99daf13.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";import"./shared-432d66f4.js";import"./shared-1d12db26.js";import"./shared-102dfbe0.js";import"./shared-f090c63a.js";let i,d=r=>r;const n=t(r,"coupon-code-form");class c extends n{constructor(){super(...arguments),this.getTransactionPageHref=null,this.templates={}}static get properties(){return e(e({},super.properties),{},{getTransactionPageHref:{attribute:!1}})}static get v8n(){return[({code:r})=>!!r||"code:v8n_required",({code:r})=>!r||r.length<=50||"code:v8n_too_long",({code:r})=>!(null==r?void 0:r.includes(" "))||"code:v8n_has_spaces"]}get readonlySelector(){return new s(`number-of-uses-to-date ${super.readonlySelector}`.trim())}get hiddenSelector(){const r=[super.hiddenSelector.toString()];return this.href||r.unshift("transactions","number-of-uses-to-date"),new s(r.join(" ").trim())}renderBody(){var r,e;let s;try{const t=new URL(null!==(e=null===(r=this.data)||void 0===r?void 0:r._links["fx:coupon_code_transactions"].href)&&void 0!==e?e:"");t.searchParams.set("zoom","items"),s=t.toString()}catch(r){s=void 0}return a(i||(i=d` <foxy-internal-text-control infer="code"></foxy-internal-text-control> <foxy-internal-integer-control infer="number-of-uses-to-date"></foxy-internal-integer-control> <foxy-internal-async-list-control first="${0}" infer="transactions" limit="5" item="foxy-transaction-card" .getPageHref="${0}" hide-delete-button> </foxy-internal-async-list-control> ${0} `),o(s),this.getTransactionPageHref,super.renderBody())}}customElements.define("foxy-coupon-code-form",c);export{c as CouponCodeForm};
@@ -1 +1 @@
1
- import"./shared-5debeb1b.js";import{I as e}from"./shared-8a247f48.js";import{a as s}from"./shared-7ff78b4a.js";import{B as r}from"./shared-b3db7611.js";import{h as o}from"./shared-dc73b9a5.js";import"./shared-6b68b3b6.js";import"./shared-0a9d860d.js";import"./shared-75d13e1b.js";import"./shared-51c4a6dd.js";import"./shared-6586ffd5.js";import"./shared-343d1fd7.js";import"./shared-3cabd589.js";import"./shared-2b5a3c80.js";import"./shared-9803aa7c.js";import"./shared-fe45779e.js";import"./shared-482b2b86.js";import"./shared-3ab0306f.js";import"./shared-851a7db5.js";import"./shared-79d35787.js";import"./shared-4e709717.js";import"./shared-a0c6a159.js";import"./shared-22ba9566.js";import"./shared-99940888.js";import"./shared-25198d9a.js";import"./shared-4c611015.js";import"./shared-61ade33e.js";import"./shared-03673673.js";import"./shared-6cd4e618.js";import"./foxy-copy-to-clipboard.js";import"./shared-da2e66a4.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let t,d=e=>e;const a=s(e,"coupon-codes-form");class i extends a{constructor(){super(...arguments),this.templates={},this.__couponCodesGetValue=()=>{var e,s;return null!==(s=null===(e=this.form.coupon_codes)||void 0===e?void 0:e.map((e=>({value:e}))))&&void 0!==s?s:[]},this.__couponCodesSetValue=e=>{this.edit({coupon_codes:e.map((({value:e})=>e.split(" ").map((e=>e.trim())))).flat().filter(((e,s,r)=>r.indexOf(e)===s))})}}static get v8n(){return[({coupon_codes:e})=>e&&e.length>0||"coupon-codes:v8n_required"]}get readonlySelector(){const e=[super.readonlySelector.toString()];return this.href&&e.push("coupon-codes"),new r(e.join(" ").trim())}get hiddenSelector(){const e=["delete timestamps",super.hiddenSelector.toString()];return new r(e.join(" ").trim())}renderBody(){return o(t||(t=d` <foxy-internal-editable-list-control infer="coupon-codes" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> ${0} `),this.__couponCodesGetValue,this.__couponCodesSetValue,super.renderBody())}async _sendPost(e){const s=JSON.stringify(e),r=await this._fetch(this.parent,{body:s,method:"POST"});return this.status={key:"success"},r}}customElements.define("foxy-coupon-codes-form",i);export{i as CouponCodesForm};
1
+ import"./shared-66a515e3.js";import{I as e}from"./shared-036b25a3.js";import{a as s}from"./shared-e989e47e.js";import{B as r}from"./shared-3c58ddf1.js";import{h as o}from"./shared-dc73b9a5.js";import"./shared-a911ab73.js";import"./shared-2f2b5a28.js";import"./shared-e5f6ca48.js";import"./shared-51c4a6dd.js";import"./shared-ecb7a183.js";import"./shared-343d1fd7.js";import"./shared-2808f43a.js";import"./shared-bd99107c.js";import"./shared-9803aa7c.js";import"./shared-272e7269.js";import"./shared-37391934.js";import"./shared-cd96ff03.js";import"./shared-12e531b8.js";import"./shared-90ddf541.js";import"./shared-39fc8fed.js";import"./shared-2e2d45c4.js";import"./shared-4e709717.js";import"./shared-a0c6a159.js";import"./shared-22ba9566.js";import"./shared-99940888.js";import"./shared-7c819ebc.js";import"./shared-f14856e0.js";import"./shared-61ade33e.js";import"./shared-337f2fe9.js";import"./shared-8d7e2e2c.js";import"./foxy-copy-to-clipboard.js";import"./shared-bac00622.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let t,a=e=>e;const d=s(e,"coupon-codes-form");class i extends d{constructor(){super(...arguments),this.templates={},this.__couponCodesGetValue=()=>{var e,s;return null!==(s=null===(e=this.form.coupon_codes)||void 0===e?void 0:e.map((e=>({value:e}))))&&void 0!==s?s:[]},this.__couponCodesSetValue=e=>{this.edit({coupon_codes:e.map((({value:e})=>e.split(" ").map((e=>e.trim())))).flat().filter(((e,s,r)=>r.indexOf(e)===s))})}}static get v8n(){return[({coupon_codes:e})=>e&&e.length>0||"coupon-codes:v8n_required"]}get readonlySelector(){const e=[super.readonlySelector.toString()];return this.href&&e.push("coupon-codes"),new r(e.join(" ").trim())}get hiddenSelector(){const e=["delete timestamps",super.hiddenSelector.toString()];return new r(e.join(" ").trim())}renderBody(){return o(t||(t=a` <foxy-internal-editable-list-control infer="coupon-codes" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> ${0} `),this.__couponCodesGetValue,this.__couponCodesSetValue,super.renderBody())}async _sendPost(e){const s=JSON.stringify(e),r=await this._fetch(this.parent,{body:s,method:"POST"});return this.status={key:"success"},r}}customElements.define("foxy-coupon-codes-form",i);export{i as CouponCodesForm};
@@ -1 +1 @@
1
- import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-6586ffd5.js";import{h as r}from"./shared-dc73b9a5.js";import{a as s}from"./shared-7ff78b4a.js";import{T as e}from"./shared-4affec66.js";import"./shared-6b68b3b6.js";import"./shared-0a9d860d.js";import"./shared-da2e66a4.js";import"./shared-b3db7611.js";import"./shared-3cabd589.js";import"./shared-343d1fd7.js";import"./shared-2b5a3c80.js";import"./shared-9803aa7c.js";import"./shared-8b521111.js";import"./shared-fe45779e.js";import"./shared-482b2b86.js";import"./shared-3ab0306f.js";import"./shared-851a7db5.js";import"./shared-79d35787.js";import"./shared-4e709717.js";let t,a,i=r=>r;const o=s(e,"coupon-detail-card");class c extends o{constructor(){super(...arguments),this.__currencyDisplay="",this.__currency=""}renderBody(){return super.renderBody({title:s=>r(t||(t=i`${0} &bull; ${0}`),s.name,s.code),subtitle:s=>{let e;try{e=Math.abs(s.amount_per).toLocaleString(this.lang||"en",{maximumFractionDigits:2,minimumFractionDigits:2,currencyDisplay:this.__currencyDisplay,currency:this.__currency,style:"currency"})}catch(r){e="--"}return r(a||(a=i` <span class="${0}">${0}</span> `),s.amount_per>0?"text-success":"text-error",e)}})}async _sendGet(){const r=await super._sendGet(),[s,e]=await Promise.all([super._fetch(r._links["fx:transaction"].href),super._fetch(r._links["fx:store"].href)]);return this.__currency=s.currency_code,this.__currencyDisplay=e.use_international_currency_symbol?"code":"symbol",r}}customElements.define("foxy-coupon-detail-card",c);export{c as CouponDetailCard};
1
+ import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-ecb7a183.js";import{h as r}from"./shared-dc73b9a5.js";import{a as s}from"./shared-e989e47e.js";import{T as e}from"./shared-8452c492.js";import"./shared-a911ab73.js";import"./shared-2f2b5a28.js";import"./shared-bac00622.js";import"./shared-3c58ddf1.js";import"./shared-2808f43a.js";import"./shared-343d1fd7.js";import"./shared-bd99107c.js";import"./shared-9803aa7c.js";import"./shared-f090c63a.js";import"./shared-272e7269.js";import"./shared-37391934.js";import"./shared-cd96ff03.js";import"./shared-12e531b8.js";import"./shared-90ddf541.js";import"./shared-39fc8fed.js";import"./shared-2e2d45c4.js";import"./shared-4e709717.js";let t,a,c=r=>r;const i=s(e,"coupon-detail-card");class o extends i{constructor(){super(...arguments),this.__currencyDisplay="",this.__currency=""}renderBody(){return super.renderBody({title:s=>r(t||(t=c`${0} &bull; ${0}`),s.name,s.code),subtitle:s=>{let e;try{e=Math.abs(s.amount_per).toLocaleString(this.lang||"en",{maximumFractionDigits:2,minimumFractionDigits:2,currencyDisplay:this.__currencyDisplay,currency:this.__currency,style:"currency"})}catch(r){e="--"}return r(a||(a=c` <span class="${0}">${0}</span> `),s.amount_per>0?"text-success":"text-error",e)}})}async _sendGet(){const r=await super._sendGet(),[s,e]=await Promise.all([super._fetch(r._links["fx:transaction"].href),super._fetch(r._links["fx:store"].href)]);return this.__currency=s.currency_code,this.__currencyDisplay=e.use_international_currency_symbol?"code":"symbol",r}}customElements.define("foxy-coupon-detail-card",o);export{o as CouponDetailCard};
@@ -1 +1 @@
1
- import"./shared-467e5b06.js";import"./shared-b9ea6d85.js";import"./shared-5debeb1b.js";import{I as e}from"./shared-75d13e1b.js";import"./foxy-query-builder.js";import{_ as t,B as o}from"./shared-b3db7611.js";import{O as s,T as i}from"./shared-8874ec69.js";import{c as r}from"./shared-4e709717.js";import{h as n}from"./shared-dc73b9a5.js";import"./shared-f0fcd613.js";import"./shared-bd919e3b.js";import"./shared-be0fca15.js";import"./shared-f7c60ee0.js";import{I as a}from"./shared-8a247f48.js";import"./foxy-generate-codes-form.js";import"./foxy-item-category-card.js";import"./foxy-coupon-codes-form.js";import"./foxy-coupon-code-card.js";import"./foxy-coupon-code-form.js";import"./foxy-nucleon-element.js";import"./foxy-attribute-form.js";import"./foxy-attribute-card.js";import"./foxy-copy-to-clipboard.js";import"./foxy-discount-builder.js";import"./shared-6586ffd5.js";import{R as l,a as d}from"./shared-7ff78b4a.js";import{i as c}from"./shared-9803aa7c.js";import"./shared-ea5fa631.js";import"./shared-4c611015.js";import"./shared-0a9d860d.js";import"./shared-61ade33e.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-6b68b3b6.js";import"./shared-da2e66a4.js";import"./shared-3cabd589.js";import"./shared-343d1fd7.js";import"./shared-2b5a3c80.js";import"./shared-fe45779e.js";import"./shared-482b2b86.js";import"./shared-3ab0306f.js";import"./shared-851a7db5.js";import"./shared-79d35787.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-pagination.js";import"./shared-25198d9a.js";import"./shared-bab2ea2c.js";import"./foxy-form-dialog.js";import"./shared-03673673.js";import"./shared-6cd4e618.js";import"./shared-91c88f14.js";import"./shared-22ba9566.js";import"./shared-51c4a6dd.js";import"./shared-8438d4ca.js";import"./shared-79d0699c.js";import"./shared-a24b2aa7.js";import"./shared-684cd55a.js";import"./shared-612ea9ed.js";import"./shared-ad11b006.js";import"./shared-58951f74.js";import"./shared-90cbed56.js";import"./shared-540063aa.js";import"./shared-28be347b.js";import"./shared-99e354b1.js";import"./shared-2314add3.js";import"./shared-43e2c3f6.js";import"./shared-b900e1b5.js";import"./shared-4affec66.js";import"./shared-8b521111.js";import"./shared-90877857.js";import"./shared-d222bd1e.js";import"./foxy-swipe-actions.js";import"./foxy-transaction-card.js";import"./shared-0f59fd6a.js";import"./shared-4c7a8fcc.js";import"./shared-1e7639e6.js";let u,p,_,m,f=e=>e;customElements.define("foxy-internal-query-builder-control",class extends e{constructor(){super(...arguments),this.operators=Object.values(s),this.disableOr=!1}static get properties(){return t(t({},super.properties),{},{operators:{type:Array},disableOr:{type:Boolean,attribute:"disable-or"}})}renderControl(){const{label:e,helperText:t,_errorMessage:o}=this,s=o&&!this.disabled&&!this.readonly;return n(u||(u=f` <section class="${0}"> ${0} <foxy-query-builder infer="query-builder" .operators="${0}" .value="${0}" ?disable-or="${0}" @change="${0}"> </foxy-query-builder> ${0} ${0} </section> `),r({"grid gap-xs leading-xs transition-colors":!0,"text-secondary hover-text-body":!this.disabled&&!this.readonly,"text-disabled":this.disabled,"text-body":this.readonly}),e?n(p||(p=f`<p class="text-s font-medium">${0}</p>`),e):"",this.operators,this._value,this.disableOr,(e=>{var t;const o=e.currentTarget;this._value=null!==(t=o.value)&&void 0!==t?t:""}),t?n(_||(_=f`<p class="text-xs">${0}</p>`),t):"",s?n(m||(m=f`<p class="text-xs text-error">${0}</p>`),o):"")}});let h,y,b,x,g,v=e=>e;customElements.define("foxy-internal-coupon-form-rules-control",class extends e{renderControl(){var e,t;const o=this.nucleon,s=null!==(e=null==o?void 0:o.form.coupon_discount_details)&&void 0!==e?e:"",i=null!==(t=null==o?void 0:o.form.coupon_discount_type)&&void 0!==t?t:"quantity_amount",a=this.helperText,l=this.__renderRulesDescription(),d=this._errorMessage;return n(h||(h=v` <section> <p class="leading-xs flex items-center justify-between space-x-m text-s mb-xs"> <span class="${0}"> ${0} </span> <span class="min-w-0">${0}</span> </p> <foxy-discount-builder infer="discount-builder" .parsedValue="${0}" @change="${0}"> </foxy-discount-builder> ${0} ${0} </section> `),r({"transition-colors font-medium flex-1":!0,"text-secondary":!this.disabled,"text-disabled":this.disabled}),this.label,this.__renderPreset(),{details:s,type:i,name:"Rules"},(e=>{const t=e.currentTarget.parsedValue,o=this.nucleon;null==o||o.edit({coupon_discount_details:t.details,coupon_discount_type:t.type})}),a||l?n(y||(y=v` <p class="${0}"> ${0} </p> `),r({"text-xs mt-xs leading-xs transition-colors":!0,"text-secondary":!this.disabled&&!this.readonly,"text-disabled":this.disabled,"text-body":this.readonly}),l||a):"",!d||this.disabled||this.readonly?"":n(b||(b=v`<p class="mt-xs text-xs leading-xs text-error">${0}</p>`),this._errorMessage))}__renderRulesDescription(){var e,t;const o=this.nucleon,s=null!==(e=null==o?void 0:o.form.coupon_discount_type)&&void 0!==e?e:"quantity_amount",i=null!==(t=null==o?void 0:o.form.coupon_discount_details)&&void 0!==t?t:"";return i?this.t("discount_summary",{params:{details:i,type:s,ns:this.ns}}):null}__renderPreset(){const e=this.nucleon,o=null==e?void 0:e.form.coupon_discount_details,s=null==e?void 0:e.form.coupon_discount_type,i=[{type:"quantity_amount",details:"allunits|2-2"},{type:"quantity_percentage",details:"allunits|5-10|10-20"},{type:"quantity_amount",details:"incremental|3-5"},{type:"quantity_percentage",details:"incremental|11-10|51-15|101-20"},{type:"quantity_percentage",details:"repeat|2-100"},{type:"quantity_percentage",details:"repeat|4-50"},{type:"quantity_amount",details:"single|5-10"},{type:"price_percentage",details:"single|99.99-10"}],a=i.find((e=>e.details===o&&e.type===s));return n(x||(x=v` <label data-testid="rules:preset" class="${0}"> <foxy-i18n class="sr-only" infer="" key="preset"></foxy-i18n> <span class="relative font-medium flex items-center"> <span class="truncate"> ${0} </span> <iron-icon class="icon-inline text-xl ml-xs -mr-xs" icon="icons:expand-more"></iron-icon> <select data-testclass="interactive editable" data-testid="rules:preset:select" class="opacity-0 absolute inset-0 focus-outline-none" ?disabled="${0}" @change="${0}"> ${0} <option value="custom" ?selected="${0}"> ${0} </option> </select> </span> </label> `),r({"whitespace-nowrap block ring-primary-50 rounded px-xs -mx-xs transition-colors":!0,"text-body hover-text-primary focus-within-ring-2":!this.disabled&&!this.readonly,"text-secondary":this.readonly,"text-disabled":this.disabled}),a?this.t("discount_summary",{params:t(t({},a),{},{ns:this.ns})}):this.t("custom_discount"),this.disabled||this.readonly,(e=>{var t,o;const s=e.currentTarget,r=i[s.selectedIndex],n=this.nucleon;null==n||n.edit({coupon_discount_details:null!==(t=null==r?void 0:r.details)&&void 0!==t?t:"",coupon_discount_type:null!==(o=null==r?void 0:r.type)&&void 0!==o?o:"quantity_amount"})}),i.map((e=>n(g||(g=v` <option value="${0}" ?selected="${0}"> ${0} </option> `),e.details,e===a,this.t("discount_summary",{params:t(t({},e),{},{ns:this.ns})})))),!a&&!!o&&!!s,this.t("custom_discount"))}});let j,$,w=e=>e;const k=l(d(a,"coupon-form"));class V extends k{constructor(){var e;super(...arguments),e=this,this.getTransactionPageHref=null,this.__customerSubscriptionRestrictionsGetValue=()=>{var e;const t=null===(e=this.form.customer_subscription_restrictions)||void 0===e?void 0:e.split(",").map((e=>e.trim())).filter(((e,t,o)=>!!e&&o.indexOf(e)===t)).map((e=>({value:e})));return null!=t?t:[]},this.__customerSubscriptionRestrictionsSetValue=e=>{this.edit({customer_subscription_restrictions:e.map((({value:e})=>e.trim())).filter(((e,t,o)=>!!e&&o.indexOf(e)===t)).join()}),this.edit({customer_auto_apply:!!this.form.customer_subscription_restrictions||!!this.form.customer_attribute_restrictions})},this.__productCodeRestrictionsGetValue=()=>{var e;return null===(e=this.form.product_code_restrictions)||void 0===e?void 0:e.split(",").filter((e=>!!e.trim())).map((e=>({value:e,label:e.startsWith("-")?this.t("product-code-restrictions.label_block",{value:e.substring(1)}):this.t("product-code-restrictions.label_allow",{value:e})})))},this.__productCodeRestrictionsSetValue=e=>{this.edit({product_code_restrictions:e.map((({value:e,unit:t})=>"block"===t?`-${e}`:e)).filter(((e,t,o)=>!!e&&o.indexOf(e)===t)).join(",")})},this.__itemOptionRestrictionsOperators=[s.In],this.__itemOptionRestrictionsGetValue=()=>{var e;const t=new URLSearchParams,o=null!==(e=this.form.item_option_restrictions)&&void 0!==e?e:{};for(const e in o)t.set(`${e}:in`,o[e].join(","));return t.toString()},this.__itemOptionRestrictionsSetValue=e=>{const t=Object.fromEntries(Array.from(new URLSearchParams(e).entries()).map((([e,t])=>[e.replace(":in",""),t.split(",").filter((e=>!!e.trim()))])));this.edit({item_option_restrictions:t})},this.__optionsGetValue=()=>{const e=[];return this.form.multiple_codes_allowed&&e.push("multiple_codes_allowed"),this.form.combinable&&e.push("combinable"),this.form.exclude_category_discounts&&e.push("exclude_category_discounts"),this.form.exclude_line_item_discounts&&e.push("exclude_line_item_discounts"),this.form.is_taxable&&e.push("is_taxable"),this.form.shared_codes_allowed&&e.push("shared_codes_allowed"),this.form.customer_auto_apply&&e.push("customer_auto_apply"),e},this.__optionsSetValue=e=>{this.edit({multiple_codes_allowed:e.includes("multiple_codes_allowed"),combinable:e.includes("combinable"),exclude_category_discounts:e.includes("exclude_category_discounts"),exclude_line_item_discounts:e.includes("exclude_line_item_discounts"),is_taxable:e.includes("is_taxable"),shared_codes_allowed:e.includes("shared_codes_allowed"),customer_auto_apply:e.includes("customer_auto_apply")})},this.__optionsOptions=[{value:"multiple_codes_allowed",label:"option_multiple_codes_allowed"},{value:"combinable",label:"option_combinable"},{value:"exclude_category_discounts",label:"option_exclude_category_discounts"},{value:"exclude_line_item_discounts",label:"option_exclude_line_item_discounts"},{value:"is_taxable",label:"option_is_taxable"},{value:"shared_codes_allowed",label:"option_shared_codes_allowed"},{value:"customer_auto_apply",label:"option_customer_auto_apply"}],this.__storeLoaderId="storeLoader",this.__codesFilters=[{label:"code",path:"code",type:i.String},{label:"used_codes",path:"number_of_uses_to_date",type:i.Number},{label:"date_created",path:"date_created",type:i.Date},{label:"date_modified",path:"date_modified",type:i.Date}],this.__couponCodesActions=[{theme:"contrast",state:"idle",text:"copy_button_text",onClick:async function(t){e.__couponCodesActions[0].state="busy",e.__couponCodesActions=[...e.__couponCodesActions];try{await navigator.clipboard.writeText(t.code),e.__couponCodesActions[0].state="end"}catch(t){e.__couponCodesActions[0].state="error"}finally{e.__couponCodesActions=[...e.__couponCodesActions],setTimeout((()=>{e.__couponCodesActions[0].state="idle",e.__couponCodesActions=[...e.__couponCodesActions]}),1e3)}}}]}static get properties(){return t(t({},super.properties),{},{getTransactionPageHref:{attribute:!1},__couponCodesActions:{type:Array}})}static get v8n(){return[({name:e})=>!!e||"name:v8n_required",({name:e})=>!e||e.length<=50||"name:v8n_too_long",({inclusive_tax_rate:e})=>!e||e>=0||"inclusive-tax-rate:v8n_too_small",({inclusive_tax_rate:e})=>!e||e<=1||"inclusive-tax-rate:v8n_too_big",({number_of_uses_allowed:e})=>!e||e>=0||"number-of-uses-allowed:v8n_too_small",({coupon_discount_details:e})=>!!e||"rules:v8n_required",({coupon_discount_details:e})=>!e||e.length<=200||"rules:v8n_too_long",({item_option_restrictions:e})=>!e||JSON.stringify(e).length<=6e3||"item-option-restrictions:v8n_too_long",({product_code_restrictions:e})=>!e||e.length<=5e3||"product-code-restrictions:v8n_too_long",({customer_attribute_restrictions:e})=>!e||e.length<=2e3||"customer-attribute-restrictions:v8n_too_long",({number_of_uses_allowed_per_code:e})=>!e||e>=0||"number-of-uses-allowed-per-code:v8n_too_small",({customer_subscription_restrictions:e})=>!e||e.length<=200||"customer-subscription-restrictions:v8n_too_long",({number_of_uses_allowed_per_customer:e})=>!e||e>=0||"number-of-uses-allowed-per-customer:v8n_too_small"]}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.data||e.push("coupon-codes","category-restrictions","attributes"),this.form.customer_auto_apply||e.push("customer-attribute-restrictions","customer-subscription-restrictions"),new o(e.join(" ").trim())}renderHeaderActions(e){return n(j||(j=w` <foxy-internal-bulk-add-action-control parent="${0}" infer="generate" form="foxy-generate-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> <foxy-internal-bulk-add-action-control parent="${0}" infer="import" form="foxy-coupon-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> ${0} `),e._links["fx:generate_codes"].href,[e._links["fx:coupon_codes"].href],e._links["fx:coupon_codes"].href,[e._links["fx:coupon_codes"].href],super.renderHeaderActions(e))}renderBody(){var e,t,o,s,i,r,a,l;let d;try{const o=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:coupon_codes"].href)&&void 0!==t?t:"");o.searchParams.set("order","date_created desc"),d=o.toString()}catch(e){d=void 0}return n($||($=w` ${0} <foxy-internal-text-control infer="name"></foxy-internal-text-control> <foxy-internal-coupon-form-rules-control infer="rules"> </foxy-internal-coupon-form-rules-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="coupon-codes" item="foxy-coupon-code-card" form="foxy-coupon-code-form" alert .formProps="${0}" .actions="${0}" .filters="${0}"> </foxy-internal-async-list-control> <foxy-internal-query-builder-control infer="item-option-restrictions" disable-or .operators="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-query-builder-control> <foxy-internal-editable-list-control infer="product-code-restrictions" .getValue="${0}" .setValue="${0}" .units="${0}"> </foxy-internal-editable-list-control> <foxy-internal-async-resource-link-list-control foreign-key-for-uri="item_category_uri" foreign-key-for-id="item_category_id" own-key-for-uri="coupon_uri" own-uri="${0}" embed-key="fx:coupon_item_categories" options-href="${0}" links-href="${0}" infer="category-restrictions" limit="5" item="foxy-item-category-card"> </foxy-internal-async-resource-link-list-control> <div class="grid gap-l sm-grid-cols-3"> <foxy-internal-integer-control infer="number-of-uses-allowed" min="0" show-controls> </foxy-internal-integer-control> <foxy-internal-integer-control infer="number-of-uses-allowed-per-customer" min="0" show-controls> </foxy-internal-integer-control> <foxy-internal-integer-control infer="number-of-uses-allowed-per-code" min="0" show-controls> </foxy-internal-integer-control> </div> <div class="grid gap-l sm-grid-cols-2"> <foxy-internal-date-control infer="start-date"></foxy-internal-date-control> <foxy-internal-date-control infer="end-date"></foxy-internal-date-control> </div> <foxy-internal-number-control min="0" max="1" infer="inclusive-tax-rate"> </foxy-internal-number-control> <foxy-internal-checkbox-group-control infer="options" theme="vertical" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-editable-list-control infer="customer-subscription-restrictions" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-query-builder-control infer="customer-attribute-restrictions"> </foxy-internal-query-builder-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="attributes" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> ${0} <foxy-nucleon infer="" class="hidden" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),d,{".getTransactionPageHref":this.getTransactionPageHref},this.__couponCodesActions,this.__codesFilters,this.__itemOptionRestrictionsOperators,this.__itemOptionRestrictionsGetValue,this.__itemOptionRestrictionsSetValue,this.__productCodeRestrictionsGetValue,this.__productCodeRestrictionsSetValue,[{label:this.t("product-code-restrictions.unit_allow"),value:"allow"},{label:this.t("product-code-restrictions.unit_block"),value:"block"}],c(null===(o=this.data)||void 0===o?void 0:o._links.self.href),c(null===(i=null===(s=this.__storeLoader)||void 0===s?void 0:s.data)||void 0===i?void 0:i._links["fx:item_categories"].href),c(null===(r=this.data)||void 0===r?void 0:r._links["fx:coupon_item_categories"].href),this.__optionsGetValue,this.__optionsSetValue,this.__optionsOptions,this.__customerSubscriptionRestrictionsGetValue,this.__customerSubscriptionRestrictionsSetValue,c(null===(a=this.data)||void 0===a?void 0:a._links["fx:attributes"].href),super.renderBody(),c(null===(l=this.data)||void 0===l?void 0:l._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-coupon-form",V);export{V as CouponForm};
1
+ import"./shared-5758adbc.js";import"./shared-8540c2c7.js";import"./shared-66a515e3.js";import{I as e}from"./shared-e5f6ca48.js";import"./foxy-query-builder.js";import{_ as t,B as o}from"./shared-3c58ddf1.js";import{O as s,T as r}from"./shared-8874ec69.js";import{c as i}from"./shared-4e709717.js";import{h as n}from"./shared-dc73b9a5.js";import"./shared-91009494.js";import"./shared-b55f1de3.js";import"./shared-292585a0.js";import"./shared-8e59a71e.js";import{I as a}from"./shared-036b25a3.js";import"./foxy-generate-codes-form.js";import"./foxy-item-category-card.js";import"./foxy-coupon-codes-form.js";import"./foxy-coupon-code-card.js";import"./foxy-coupon-code-form.js";import"./foxy-nucleon-element.js";import"./foxy-attribute-form.js";import"./foxy-attribute-card.js";import"./foxy-copy-to-clipboard.js";import"./foxy-discount-builder.js";import"./shared-ecb7a183.js";import{R as l,a as c}from"./shared-e989e47e.js";import{i as d}from"./shared-9803aa7c.js";import"./shared-b2ce84fa.js";import"./shared-f14856e0.js";import"./shared-2f2b5a28.js";import"./shared-61ade33e.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-a911ab73.js";import"./shared-bac00622.js";import"./shared-2808f43a.js";import"./shared-343d1fd7.js";import"./shared-bd99107c.js";import"./shared-272e7269.js";import"./shared-37391934.js";import"./shared-cd96ff03.js";import"./shared-12e531b8.js";import"./shared-90ddf541.js";import"./shared-39fc8fed.js";import"./shared-2e2d45c4.js";import"./shared-a0c6a159.js";import"./shared-99940888.js";import"./foxy-pagination.js";import"./shared-7c819ebc.js";import"./shared-bab2ea2c.js";import"./foxy-form-dialog.js";import"./shared-337f2fe9.js";import"./shared-8d7e2e2c.js";import"./shared-34f4330c.js";import"./shared-22ba9566.js";import"./shared-51c4a6dd.js";import"./shared-8438d4ca.js";import"./shared-79d0699c.js";import"./shared-62f3fc5a.js";import"./shared-0062cab1.js";import"./shared-4885670b.js";import"./shared-b99daf13.js";import"./shared-40cbbbae.js";import"./shared-5a18985c.js";import"./shared-8c5b4c81.js";import"./shared-41e9ef02.js";import"./shared-25fc0ceb.js";import"./shared-1ab8b12e.js";import"./shared-43e2c3f6.js";import"./shared-739a8fe4.js";import"./shared-8452c492.js";import"./shared-f090c63a.js";import"./shared-102dfbe0.js";import"./shared-a33be18f.js";import"./foxy-swipe-actions.js";import"./foxy-transaction-card.js";import"./shared-432d66f4.js";import"./shared-1d12db26.js";import"./shared-6dfb57b1.js";let u,p,_,m,f=e=>e;customElements.define("foxy-internal-query-builder-control",class extends e{constructor(){super(...arguments),this.operators=Object.values(s),this.disableOr=!1}static get properties(){return t(t({},super.properties),{},{operators:{type:Array},disableOr:{type:Boolean,attribute:"disable-or"}})}renderControl(){const{label:e,helperText:t,_errorMessage:o}=this,s=o&&!this.disabled&&!this.readonly;return n(u||(u=f` <section class="${0}"> ${0} <foxy-query-builder infer="query-builder" .operators="${0}" .value="${0}" ?disable-or="${0}" @change="${0}"> </foxy-query-builder> ${0} ${0} </section> `),i({"grid gap-xs leading-xs transition-colors":!0,"text-secondary hover-text-body":!this.disabled&&!this.readonly,"text-disabled":this.disabled,"text-body":this.readonly}),e?n(p||(p=f`<p class="text-s font-medium">${0}</p>`),e):"",this.operators,this._value,this.disableOr,(e=>{var t;const o=e.currentTarget;this._value=null!==(t=o.value)&&void 0!==t?t:""}),t?n(_||(_=f`<p class="text-xs">${0}</p>`),t):"",s?n(m||(m=f`<p class="text-xs text-error">${0}</p>`),o):"")}});let h,y,b,x,g,v=e=>e;customElements.define("foxy-internal-coupon-form-rules-control",class extends e{renderControl(){var e,t;const o=this.nucleon,s=null!==(e=null==o?void 0:o.form.coupon_discount_details)&&void 0!==e?e:"",r=null!==(t=null==o?void 0:o.form.coupon_discount_type)&&void 0!==t?t:"quantity_amount",a=this.helperText,l=this.__renderRulesDescription(),c=this._errorMessage;return n(h||(h=v` <section> <p class="leading-xs flex items-center justify-between space-x-m text-s mb-xs"> <span class="${0}"> ${0} </span> <span class="min-w-0">${0}</span> </p> <foxy-discount-builder infer="discount-builder" .parsedValue="${0}" @change="${0}"> </foxy-discount-builder> ${0} ${0} </section> `),i({"transition-colors font-medium flex-1":!0,"text-secondary":!this.disabled,"text-disabled":this.disabled}),this.label,this.__renderPreset(),{details:s,type:r,name:"Rules"},(e=>{const t=e.currentTarget.parsedValue,o=this.nucleon;null==o||o.edit({coupon_discount_details:t.details,coupon_discount_type:t.type})}),a||l?n(y||(y=v` <p class="${0}"> ${0} </p> `),i({"text-xs mt-xs leading-xs transition-colors":!0,"text-secondary":!this.disabled&&!this.readonly,"text-disabled":this.disabled,"text-body":this.readonly}),l||a):"",!c||this.disabled||this.readonly?"":n(b||(b=v`<p class="mt-xs text-xs leading-xs text-error">${0}</p>`),this._errorMessage))}__renderRulesDescription(){var e,t;const o=this.nucleon,s=null!==(e=null==o?void 0:o.form.coupon_discount_type)&&void 0!==e?e:"quantity_amount",r=null!==(t=null==o?void 0:o.form.coupon_discount_details)&&void 0!==t?t:"";return r?this.t("discount_summary",{params:{details:r,type:s,ns:this.ns}}):null}__renderPreset(){const e=this.nucleon,o=null==e?void 0:e.form.coupon_discount_details,s=null==e?void 0:e.form.coupon_discount_type,r=[{type:"quantity_amount",details:"allunits|2-2"},{type:"quantity_percentage",details:"allunits|5-10|10-20"},{type:"quantity_amount",details:"incremental|3-5"},{type:"quantity_percentage",details:"incremental|11-10|51-15|101-20"},{type:"quantity_percentage",details:"repeat|2-100"},{type:"quantity_percentage",details:"repeat|4-50"},{type:"quantity_amount",details:"single|5-10"},{type:"price_percentage",details:"single|99.99-10"}],a=r.find((e=>e.details===o&&e.type===s));return n(x||(x=v` <label data-testid="rules:preset" class="${0}"> <foxy-i18n class="sr-only" infer="" key="preset"></foxy-i18n> <span class="relative font-medium flex items-center"> <span class="truncate"> ${0} </span> <iron-icon class="icon-inline text-xl ml-xs -mr-xs" icon="icons:expand-more"></iron-icon> <select data-testclass="interactive editable" data-testid="rules:preset:select" class="opacity-0 absolute inset-0 focus-outline-none" ?disabled="${0}" @change="${0}"> ${0} <option value="custom" ?selected="${0}"> ${0} </option> </select> </span> </label> `),i({"whitespace-nowrap block ring-primary-50 rounded px-xs -mx-xs transition-colors":!0,"text-body hover-text-primary focus-within-ring-2":!this.disabled&&!this.readonly,"text-secondary":this.readonly,"text-disabled":this.disabled}),a?this.t("discount_summary",{params:t(t({},a),{},{ns:this.ns})}):this.t("custom_discount"),this.disabled||this.readonly,(e=>{var t,o;const s=e.currentTarget,i=r[s.selectedIndex],n=this.nucleon;null==n||n.edit({coupon_discount_details:null!==(t=null==i?void 0:i.details)&&void 0!==t?t:"",coupon_discount_type:null!==(o=null==i?void 0:i.type)&&void 0!==o?o:"quantity_amount"})}),r.map((e=>n(g||(g=v` <option value="${0}" ?selected="${0}"> ${0} </option> `),e.details,e===a,this.t("discount_summary",{params:t(t({},e),{},{ns:this.ns})})))),!a&&!!o&&!!s,this.t("custom_discount"))}});let j,$,w=e=>e;const k=l(c(a,"coupon-form"));class V extends k{constructor(){var e;super(...arguments),e=this,this.getTransactionPageHref=null,this.__customerSubscriptionRestrictionsGetValue=()=>{var e;const t=null===(e=this.form.customer_subscription_restrictions)||void 0===e?void 0:e.split(",").map((e=>e.trim())).filter(((e,t,o)=>!!e&&o.indexOf(e)===t)).map((e=>({value:e})));return null!=t?t:[]},this.__customerSubscriptionRestrictionsSetValue=e=>{this.edit({customer_subscription_restrictions:e.map((({value:e})=>e.trim())).filter(((e,t,o)=>!!e&&o.indexOf(e)===t)).join()}),this.edit({customer_auto_apply:!!this.form.customer_subscription_restrictions||!!this.form.customer_attribute_restrictions})},this.__productCodeRestrictionsGetValue=()=>{var e;return null===(e=this.form.product_code_restrictions)||void 0===e?void 0:e.split(",").filter((e=>!!e.trim())).map((e=>({value:e,label:e.startsWith("-")?this.t("product-code-restrictions.label_block",{value:e.substring(1)}):this.t("product-code-restrictions.label_allow",{value:e})})))},this.__productCodeRestrictionsSetValue=e=>{this.edit({product_code_restrictions:e.map((({value:e,unit:t})=>"block"===t?`-${e}`:e)).filter(((e,t,o)=>!!e&&o.indexOf(e)===t)).join(",")})},this.__itemOptionRestrictionsOperators=[s.In],this.__itemOptionRestrictionsGetValue=()=>{var e;const t=new URLSearchParams,o=null!==(e=this.form.item_option_restrictions)&&void 0!==e?e:{};for(const e in o)t.set(`${e}:in`,o[e].join(","));return t.toString()},this.__itemOptionRestrictionsSetValue=e=>{const t=Object.fromEntries(Array.from(new URLSearchParams(e).entries()).map((([e,t])=>[e.replace(":in",""),t.split(",").filter((e=>!!e.trim()))])));this.edit({item_option_restrictions:t})},this.__optionsGetValue=()=>{const e=[];return this.form.multiple_codes_allowed&&e.push("multiple_codes_allowed"),this.form.combinable&&e.push("combinable"),this.form.exclude_category_discounts&&e.push("exclude_category_discounts"),this.form.exclude_line_item_discounts&&e.push("exclude_line_item_discounts"),this.form.is_taxable&&e.push("is_taxable"),this.form.shared_codes_allowed&&e.push("shared_codes_allowed"),this.form.customer_auto_apply&&e.push("customer_auto_apply"),e},this.__optionsSetValue=e=>{this.edit({multiple_codes_allowed:e.includes("multiple_codes_allowed"),combinable:e.includes("combinable"),exclude_category_discounts:e.includes("exclude_category_discounts"),exclude_line_item_discounts:e.includes("exclude_line_item_discounts"),is_taxable:e.includes("is_taxable"),shared_codes_allowed:e.includes("shared_codes_allowed"),customer_auto_apply:e.includes("customer_auto_apply")})},this.__optionsOptions=[{value:"multiple_codes_allowed",label:"option_multiple_codes_allowed"},{value:"combinable",label:"option_combinable"},{value:"exclude_category_discounts",label:"option_exclude_category_discounts"},{value:"exclude_line_item_discounts",label:"option_exclude_line_item_discounts"},{value:"is_taxable",label:"option_is_taxable"},{value:"shared_codes_allowed",label:"option_shared_codes_allowed"},{value:"customer_auto_apply",label:"option_customer_auto_apply"}],this.__storeLoaderId="storeLoader",this.__codesFilters=[{label:"code",path:"code",type:r.String},{label:"used_codes",path:"number_of_uses_to_date",type:r.Number},{label:"date_created",path:"date_created",type:r.Date},{label:"date_modified",path:"date_modified",type:r.Date}],this.__couponCodesActions=[{theme:"contrast",state:"idle",text:"copy_button_text",onClick:async function(t){e.__couponCodesActions[0].state="busy",e.__couponCodesActions=[...e.__couponCodesActions];try{await navigator.clipboard.writeText(t.code),e.__couponCodesActions[0].state="end"}catch(t){e.__couponCodesActions[0].state="error"}finally{e.__couponCodesActions=[...e.__couponCodesActions],setTimeout((()=>{e.__couponCodesActions[0].state="idle",e.__couponCodesActions=[...e.__couponCodesActions]}),1e3)}}}]}static get properties(){return t(t({},super.properties),{},{getTransactionPageHref:{attribute:!1},__couponCodesActions:{type:Array}})}static get v8n(){return[({name:e})=>!!e||"name:v8n_required",({name:e})=>!e||e.length<=50||"name:v8n_too_long",({inclusive_tax_rate:e})=>!e||e>=0||"inclusive-tax-rate:v8n_too_small",({inclusive_tax_rate:e})=>!e||e<=1||"inclusive-tax-rate:v8n_too_big",({number_of_uses_allowed:e})=>!e||e>=0||"number-of-uses-allowed:v8n_too_small",({coupon_discount_details:e})=>!!e||"rules:v8n_required",({coupon_discount_details:e})=>!e||e.length<=200||"rules:v8n_too_long",({item_option_restrictions:e})=>!e||JSON.stringify(e).length<=6e3||"item-option-restrictions:v8n_too_long",({product_code_restrictions:e})=>!e||e.length<=5e3||"product-code-restrictions:v8n_too_long",({customer_attribute_restrictions:e})=>!e||e.length<=2e3||"customer-attribute-restrictions:v8n_too_long",({number_of_uses_allowed_per_code:e})=>!e||e>=0||"number-of-uses-allowed-per-code:v8n_too_small",({customer_subscription_restrictions:e})=>!e||e.length<=200||"customer-subscription-restrictions:v8n_too_long",({number_of_uses_allowed_per_customer:e})=>!e||e>=0||"number-of-uses-allowed-per-customer:v8n_too_small"]}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.data||e.push("coupon-codes","category-restrictions","attributes"),this.form.customer_auto_apply||e.push("customer-attribute-restrictions","customer-subscription-restrictions"),new o(e.join(" ").trim())}renderHeaderActions(e){return n(j||(j=w` <foxy-internal-bulk-add-action-control parent="${0}" infer="generate" form="foxy-generate-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> <foxy-internal-bulk-add-action-control parent="${0}" infer="import" form="foxy-coupon-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> ${0} `),e._links["fx:generate_codes"].href,[e._links["fx:coupon_codes"].href],e._links["fx:coupon_codes"].href,[e._links["fx:coupon_codes"].href],super.renderHeaderActions(e))}renderBody(){var e,t,o,s,r,i,a,l;let c;try{const o=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:coupon_codes"].href)&&void 0!==t?t:"");o.searchParams.set("order","date_created desc"),c=o.toString()}catch(e){c=void 0}return n($||($=w` ${0} <foxy-internal-text-control infer="name"></foxy-internal-text-control> <foxy-internal-coupon-form-rules-control infer="rules"> </foxy-internal-coupon-form-rules-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="coupon-codes" item="foxy-coupon-code-card" form="foxy-coupon-code-form" alert .formProps="${0}" .actions="${0}" .filters="${0}"> </foxy-internal-async-list-control> <foxy-internal-query-builder-control infer="item-option-restrictions" disable-or .operators="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-query-builder-control> <foxy-internal-editable-list-control infer="product-code-restrictions" .getValue="${0}" .setValue="${0}" .units="${0}"> </foxy-internal-editable-list-control> <foxy-internal-async-resource-link-list-control foreign-key-for-uri="item_category_uri" foreign-key-for-id="item_category_id" own-key-for-uri="coupon_uri" own-uri="${0}" embed-key="fx:coupon_item_categories" options-href="${0}" links-href="${0}" infer="category-restrictions" limit="5" item="foxy-item-category-card"> </foxy-internal-async-resource-link-list-control> <div class="grid gap-l sm-grid-cols-3"> <foxy-internal-integer-control infer="number-of-uses-allowed" min="0" show-controls> </foxy-internal-integer-control> <foxy-internal-integer-control infer="number-of-uses-allowed-per-customer" min="0" show-controls> </foxy-internal-integer-control> <foxy-internal-integer-control infer="number-of-uses-allowed-per-code" min="0" show-controls> </foxy-internal-integer-control> </div> <div class="grid gap-l sm-grid-cols-2"> <foxy-internal-date-control infer="start-date"></foxy-internal-date-control> <foxy-internal-date-control infer="end-date"></foxy-internal-date-control> </div> <foxy-internal-number-control min="0" max="1" infer="inclusive-tax-rate"> </foxy-internal-number-control> <foxy-internal-checkbox-group-control infer="options" theme="vertical" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-editable-list-control infer="customer-subscription-restrictions" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-query-builder-control infer="customer-attribute-restrictions"> </foxy-internal-query-builder-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="attributes" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> ${0} <foxy-nucleon infer="" class="hidden" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),c,{".getTransactionPageHref":this.getTransactionPageHref},this.__couponCodesActions,this.__codesFilters,this.__itemOptionRestrictionsOperators,this.__itemOptionRestrictionsGetValue,this.__itemOptionRestrictionsSetValue,this.__productCodeRestrictionsGetValue,this.__productCodeRestrictionsSetValue,[{label:this.t("product-code-restrictions.unit_allow"),value:"allow"},{label:this.t("product-code-restrictions.unit_block"),value:"block"}],d(null===(o=this.data)||void 0===o?void 0:o._links.self.href),d(null===(r=null===(s=this.__storeLoader)||void 0===s?void 0:s.data)||void 0===r?void 0:r._links["fx:item_categories"].href),d(null===(i=this.data)||void 0===i?void 0:i._links["fx:coupon_item_categories"].href),this.__optionsGetValue,this.__optionsSetValue,this.__optionsOptions,this.__customerSubscriptionRestrictionsGetValue,this.__customerSubscriptionRestrictionsSetValue,d(null===(a=this.data)||void 0===a?void 0:a._links["fx:attributes"].href),super.renderBody(),d(null===(l=this.data)||void 0===l?void 0:l._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-coupon-form",V);export{V as CouponForm};
@@ -1 +1 @@
1
- import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import{h as r}from"./shared-dc73b9a5.js";import{a as s}from"./shared-7ff78b4a.js";import{T as e}from"./shared-4affec66.js";import"./shared-6b68b3b6.js";import"./shared-0a9d860d.js";import"./shared-da2e66a4.js";import"./shared-6586ffd5.js";import"./shared-b3db7611.js";import"./shared-343d1fd7.js";import"./shared-3cabd589.js";import"./shared-2b5a3c80.js";import"./shared-9803aa7c.js";import"./shared-8b521111.js";import"./shared-fe45779e.js";import"./shared-482b2b86.js";import"./shared-3ab0306f.js";import"./shared-851a7db5.js";import"./shared-79d35787.js";import"./shared-4e709717.js";let d,a,t=r=>r;class o extends(s(e,"custom-field-card")){renderBody(){return super.renderBody({title:s=>r(d||(d=t`${0}`),s.name),subtitle:s=>r(a||(a=t`${0}`),s.value)})}}customElements.define("foxy-custom-field-card",o);export{o as CustomFieldCard};
1
+ import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import{h as r}from"./shared-dc73b9a5.js";import{a as s}from"./shared-e989e47e.js";import{T as e}from"./shared-8452c492.js";import"./shared-a911ab73.js";import"./shared-2f2b5a28.js";import"./shared-bac00622.js";import"./shared-ecb7a183.js";import"./shared-3c58ddf1.js";import"./shared-343d1fd7.js";import"./shared-2808f43a.js";import"./shared-bd99107c.js";import"./shared-9803aa7c.js";import"./shared-f090c63a.js";import"./shared-272e7269.js";import"./shared-37391934.js";import"./shared-cd96ff03.js";import"./shared-12e531b8.js";import"./shared-90ddf541.js";import"./shared-39fc8fed.js";import"./shared-2e2d45c4.js";import"./shared-4e709717.js";let d,a,t=r=>r;class o extends(s(e,"custom-field-card")){renderBody(){return super.renderBody({title:s=>r(d||(d=t`${0}`),s.name),subtitle:s=>r(a||(a=t`${0}`),s.value)})}}customElements.define("foxy-custom-field-card",o);export{o as CustomFieldCard};
@@ -1 +1 @@
1
- import"./shared-b9ea6d85.js";import"./shared-b900e1b5.js";import{I as e}from"./shared-8a247f48.js";import{a as r}from"./shared-7ff78b4a.js";import{h as s}from"./shared-dc73b9a5.js";import"./shared-ea5fa631.js";import"./shared-4c611015.js";import"./shared-0a9d860d.js";import"./shared-61ade33e.js";import"./shared-91c88f14.js";import"./shared-6b68b3b6.js";import"./shared-75d13e1b.js";import"./shared-51c4a6dd.js";import"./shared-6586ffd5.js";import"./shared-b3db7611.js";import"./shared-343d1fd7.js";import"./shared-3cabd589.js";import"./shared-2b5a3c80.js";import"./shared-9803aa7c.js";import"./shared-fe45779e.js";import"./shared-482b2b86.js";import"./shared-3ab0306f.js";import"./shared-851a7db5.js";import"./shared-79d35787.js";import"./shared-a0c6a159.js";import"./shared-25198d9a.js";import"./shared-03673673.js";import"./shared-6cd4e618.js";import"./shared-4e709717.js";import"./foxy-copy-to-clipboard.js";import"./shared-da2e66a4.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let i,t=e=>e;const o=r(e,"custom-field-form");class a extends o{constructor(){super(...arguments),this.templates={},this.__visibilityGetValue=()=>this.form.is_hidden?["hidden"]:[],this.__visibilitySetValue=e=>{this.edit({is_hidden:e.includes("hidden")})},this.__visibilityOptions=[{label:"option_hidden",value:"hidden"}]}static get v8n(){return[({value:e})=>e&&e.length>0||"value:v8n_required",({value:e})=>!e||e.length<=700||"value:v8n_too_long",({name:e})=>e&&e.length>0||"name:v8n_required",({name:e})=>!e||e.length<=100||"name:v8n_too_long"]}renderBody(){return s(i||(i=t` <foxy-internal-source-control infer="name"></foxy-internal-source-control> <foxy-internal-source-control infer="value"></foxy-internal-source-control> <foxy-internal-checkbox-group-control infer="visibility" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} `),this.__visibilityGetValue,this.__visibilitySetValue,this.__visibilityOptions,super.renderBody())}}customElements.define("foxy-custom-field-form",a);export{a as CustomFieldForm};
1
+ import"./shared-8540c2c7.js";import"./shared-739a8fe4.js";import{I as e}from"./shared-036b25a3.js";import{a as r}from"./shared-e989e47e.js";import{h as s}from"./shared-dc73b9a5.js";import"./shared-b2ce84fa.js";import"./shared-f14856e0.js";import"./shared-2f2b5a28.js";import"./shared-61ade33e.js";import"./shared-34f4330c.js";import"./shared-a911ab73.js";import"./shared-e5f6ca48.js";import"./shared-51c4a6dd.js";import"./shared-ecb7a183.js";import"./shared-3c58ddf1.js";import"./shared-343d1fd7.js";import"./shared-2808f43a.js";import"./shared-bd99107c.js";import"./shared-9803aa7c.js";import"./shared-272e7269.js";import"./shared-37391934.js";import"./shared-cd96ff03.js";import"./shared-12e531b8.js";import"./shared-90ddf541.js";import"./shared-39fc8fed.js";import"./shared-2e2d45c4.js";import"./shared-a0c6a159.js";import"./shared-7c819ebc.js";import"./shared-337f2fe9.js";import"./shared-8d7e2e2c.js";import"./shared-4e709717.js";import"./foxy-copy-to-clipboard.js";import"./shared-bac00622.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let i,t=e=>e;const o=r(e,"custom-field-form");class a extends o{constructor(){super(...arguments),this.templates={},this.__visibilityGetValue=()=>this.form.is_hidden?["hidden"]:[],this.__visibilitySetValue=e=>{this.edit({is_hidden:e.includes("hidden")})},this.__visibilityOptions=[{label:"option_hidden",value:"hidden"}]}static get v8n(){return[({value:e})=>e&&e.length>0||"value:v8n_required",({value:e})=>!e||e.length<=700||"value:v8n_too_long",({name:e})=>e&&e.length>0||"name:v8n_required",({name:e})=>!e||e.length<=100||"name:v8n_too_long"]}renderBody(){return s(i||(i=t` <foxy-internal-source-control infer="name"></foxy-internal-source-control> <foxy-internal-source-control infer="value"></foxy-internal-source-control> <foxy-internal-checkbox-group-control infer="visibility" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> ${0} `),this.__visibilityGetValue,this.__visibilitySetValue,this.__visibilityOptions,super.renderBody())}}customElements.define("foxy-custom-field-form",a);export{a as CustomFieldForm};
@@ -1 +1 @@
1
- import{C as s}from"./shared-07e7d118.js";export{C as CustomerApi}from"./shared-07e7d118.js";import"./shared-b3db7611.js";import"./shared-dc73b9a5.js";import"./shared-186e41cf.js";import"./shared-8258443c.js";import"./shared-2b5a3c80.js";import"./shared-9803aa7c.js";import"./shared-343d1fd7.js";import"./shared-3cabd589.js";customElements.define("foxy-customer-api",s);
1
+ import{C as s}from"./shared-0aa511d0.js";export{C as CustomerApi}from"./shared-0aa511d0.js";import"./shared-3c58ddf1.js";import"./shared-dc73b9a5.js";import"./shared-8e75c372.js";import"./shared-5e9395ec.js";import"./shared-bd99107c.js";import"./shared-9803aa7c.js";import"./shared-343d1fd7.js";import"./shared-2808f43a.js";customElements.define("foxy-customer-api",s);
@@ -1 +1 @@
1
- import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-6586ffd5.js";import{h as e}from"./shared-dc73b9a5.js";import{C as t}from"./shared-2b5a3c80.js";import{N as a}from"./shared-fe45779e.js";import{T as s,a as i}from"./shared-7ff78b4a.js";import{c as r}from"./shared-4e709717.js";import"./shared-6b68b3b6.js";import"./shared-0a9d860d.js";import"./shared-da2e66a4.js";import"./shared-b3db7611.js";import"./shared-3cabd589.js";import"./shared-343d1fd7.js";import"./shared-9803aa7c.js";import"./shared-482b2b86.js";import"./shared-3ab0306f.js";import"./shared-851a7db5.js";import"./shared-79d35787.js";let d,o,n,l,m,p,h,c=e=>e;const v=s(t(i(a,"customer-card")));class f extends v{constructor(){super(...arguments),this.templates={}}render(){var t,a;const s=this.hiddenSelector;return e(d||(d=c` <div aria-busy="${0}" aria-live="polite" class="relative leading-m font-lumo text-m"> <div class="${0}"> ${0} ${0} </div> <div class="${0}"> <foxy-spinner data-testid="spinner" state="${0}" class="m-auto" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.in("busy"),r({"leading-xs transition-opacity":!0,"opacity-0":!this.data}),s.matches("name",!0)?"":this.__renderName(),s.matches("email",!0)?"":this.__renderEmail(),r({"pointer-events-none absolute inset-0 flex transition-opacity":!0,"opacity-0":!!this.data}),this.in("fail")?"error":this.in({idle:"template"})?"empty":"busy",this.lang,this.ns,null!==(a=null===(t=customElements.get("foxy-spinner"))||void 0===t?void 0:t.defaultNS)&&void 0!==a?a:"")}__renderName(){var t,a,s,i,r;const d=this.data,m=`${null!==(t=null==d?void 0:d.first_name)&&void 0!==t?t:""} ${null!==(a=null==d?void 0:d.last_name)&&void 0!==a?a:""}`.trim()||"–",p=d?e(o||(o=c`${0}`),m):e(n||(n=c`&ZeroWidthSpace;`));let h;try{h=null!==(r=new URL(null!==(i=null===(s=this.data)||void 0===s?void 0:s._links.self.href)&&void 0!==i?i:"").pathname.split("/").pop())&&void 0!==r?r:""}catch(e){h=""}return e(l||(l=c` <div data-testid="name"> ${0} <div class="flex items-center gap-m"> <div class="font-medium text-body truncate mr-auto">${0}</div> <div class="text-tertiary text-s">ID ${0}</div> </div> ${0} </div> `),this.renderTemplateOrSlot("name:before"),p,h,this.renderTemplateOrSlot("name:after"))}__renderEmail(){var t;const a=this.data,s=`${null!==(t=null==a?void 0:a.email)&&void 0!==t?t:""}`.trim()||"–",i=a?e(m||(m=c`${0}`),s):e(p||(p=c`&ZeroWidthSpace;`));return e(h||(h=c` <div data-testid="email"> ${0} <div class="text-secondary truncate text-s">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("email:before"),i,this.renderTemplateOrSlot("email:after"))}}customElements.define("foxy-customer-card",f);export{f as CustomerCard};
1
+ import"./shared-51c4a6dd.js";import"./foxy-spinner.js";import"./shared-ecb7a183.js";import{h as e}from"./shared-dc73b9a5.js";import{C as t}from"./shared-bd99107c.js";import{N as s}from"./shared-272e7269.js";import{T as a,a as i}from"./shared-e989e47e.js";import{c as r}from"./shared-4e709717.js";import"./shared-a911ab73.js";import"./shared-2f2b5a28.js";import"./shared-bac00622.js";import"./shared-3c58ddf1.js";import"./shared-2808f43a.js";import"./shared-343d1fd7.js";import"./shared-9803aa7c.js";import"./shared-37391934.js";import"./shared-cd96ff03.js";import"./shared-12e531b8.js";import"./shared-90ddf541.js";import"./shared-39fc8fed.js";import"./shared-2e2d45c4.js";let d,o,n,l,m,p,c,h=e=>e;const v=a(t(i(s,"customer-card")));class f extends v{constructor(){super(...arguments),this.templates={}}render(){var t,s;const a=this.hiddenSelector;return e(d||(d=h` <div aria-busy="${0}" aria-live="polite" class="relative leading-m font-lumo text-m"> <div class="${0}"> ${0} ${0} </div> <div class="${0}"> <foxy-spinner data-testid="spinner" state="${0}" class="m-auto" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),this.in("busy"),r({"leading-xs transition-opacity":!0,"opacity-0":!this.data}),a.matches("name",!0)?"":this.__renderName(),a.matches("email",!0)?"":this.__renderEmail(),r({"pointer-events-none absolute inset-0 flex transition-opacity":!0,"opacity-0":!!this.data}),this.in("fail")?"error":this.in({idle:"template"})?"empty":"busy",this.lang,this.ns,null!==(s=null===(t=customElements.get("foxy-spinner"))||void 0===t?void 0:t.defaultNS)&&void 0!==s?s:"")}__renderName(){var t,s,a,i,r;const d=this.data,m=`${null!==(t=null==d?void 0:d.first_name)&&void 0!==t?t:""} ${null!==(s=null==d?void 0:d.last_name)&&void 0!==s?s:""}`.trim()||"–",p=d?e(o||(o=h`${0}`),m):e(n||(n=h`&ZeroWidthSpace;`));let c;try{c=null!==(r=new URL(null!==(i=null===(a=this.data)||void 0===a?void 0:a._links.self.href)&&void 0!==i?i:"").pathname.split("/").pop())&&void 0!==r?r:""}catch(e){c=""}return e(l||(l=h` <div data-testid="name"> ${0} <div class="flex items-center gap-m"> <div class="font-medium text-body truncate mr-auto">${0}</div> <div class="text-tertiary text-s">ID ${0}</div> </div> ${0} </div> `),this.renderTemplateOrSlot("name:before"),p,c,this.renderTemplateOrSlot("name:after"))}__renderEmail(){var t;const s=this.data,a=`${null!==(t=null==s?void 0:s.email)&&void 0!==t?t:""}`.trim()||"–",i=s?e(m||(m=h`${0}`),a):e(p||(p=h`&ZeroWidthSpace;`));return e(c||(c=h` <div data-testid="email"> ${0} <div class="text-secondary truncate text-s">${0}</div> ${0} </div> `),this.renderTemplateOrSlot("email:before"),i,this.renderTemplateOrSlot("email:after"))}}customElements.define("foxy-customer-card",f);export{f as CustomerCard};