@foxy.io/elements 1.24.0-beta.3 → 1.24.0-beta.5

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 (228) hide show
  1. package/dist/cdn/foxy-access-recovery-form.js +1 -1
  2. package/dist/cdn/foxy-address-card.js +1 -1
  3. package/dist/cdn/foxy-address-form.js +1 -1
  4. package/dist/cdn/foxy-admin-subscription-card.js +1 -1
  5. package/dist/cdn/foxy-api-browser.js +1 -1
  6. package/dist/cdn/foxy-applied-coupon-code-card.js +1 -1
  7. package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
  8. package/dist/cdn/foxy-applied-tax-card.js +1 -1
  9. package/dist/cdn/foxy-attribute-card.js +1 -1
  10. package/dist/cdn/foxy-attribute-form.js +1 -1
  11. package/dist/cdn/foxy-cancellation-form.js +1 -1
  12. package/dist/cdn/foxy-cart-card.js +1 -1
  13. package/dist/cdn/foxy-cart-form.js +1 -1
  14. package/dist/cdn/foxy-client-card.js +1 -1
  15. package/dist/cdn/foxy-client-form.js +1 -1
  16. package/dist/cdn/foxy-collection-page.js +1 -1
  17. package/dist/cdn/foxy-collection-pages.js +1 -1
  18. package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
  19. package/dist/cdn/foxy-coupon-card.js +1 -1
  20. package/dist/cdn/foxy-coupon-code-form.js +1 -1
  21. package/dist/cdn/foxy-coupon-codes-form.js +1 -1
  22. package/dist/cdn/foxy-coupon-detail-card.js +1 -1
  23. package/dist/cdn/foxy-coupon-form.js +1 -1
  24. package/dist/cdn/foxy-custom-field-card.js +1 -1
  25. package/dist/cdn/foxy-custom-field-form.js +1 -1
  26. package/dist/cdn/foxy-customer-api.js +1 -1
  27. package/dist/cdn/foxy-customer-card.js +1 -1
  28. package/dist/cdn/foxy-customer-form.js +1 -1
  29. package/dist/cdn/foxy-customer-portal-settings.js +1 -1
  30. package/dist/cdn/foxy-customer-portal.js +2 -2
  31. package/dist/cdn/foxy-customer.js +1 -1
  32. package/dist/cdn/foxy-customers-table.js +1 -1
  33. package/dist/cdn/foxy-discount-builder.js +1 -1
  34. package/dist/cdn/foxy-discount-card.js +1 -1
  35. package/dist/cdn/foxy-discount-detail-card.js +1 -1
  36. package/dist/cdn/foxy-donation.js +1 -1
  37. package/dist/cdn/foxy-downloadable-card.js +1 -1
  38. package/dist/cdn/foxy-downloadable-form.js +1 -1
  39. package/dist/cdn/foxy-email-template-card.js +1 -1
  40. package/dist/cdn/foxy-email-template-form.js +1 -1
  41. package/dist/cdn/foxy-error-entry-card.js +1 -1
  42. package/dist/cdn/foxy-filter-attribute-card.js +1 -1
  43. package/dist/cdn/foxy-filter-attribute-form.js +1 -1
  44. package/dist/cdn/foxy-form-dialog.js +1 -1
  45. package/dist/cdn/foxy-generate-codes-form.js +1 -1
  46. package/dist/cdn/foxy-gift-card-card.js +1 -1
  47. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  48. package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
  49. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  50. package/dist/cdn/foxy-gift-card-form.js +1 -1
  51. package/dist/cdn/foxy-i18n-editor.js +2 -2
  52. package/dist/cdn/foxy-i18n.js +1 -1
  53. package/dist/cdn/foxy-integration-card.js +1 -1
  54. package/dist/cdn/foxy-integration-form.js +1 -1
  55. package/dist/cdn/foxy-item-card.js +1 -1
  56. package/dist/cdn/foxy-item-category-card.js +1 -1
  57. package/dist/cdn/foxy-item-category-form.js +1 -1
  58. package/dist/cdn/foxy-item-form.js +1 -1
  59. package/dist/cdn/foxy-item-option-card.js +1 -1
  60. package/dist/cdn/foxy-item-option-form.js +1 -1
  61. package/dist/cdn/foxy-items-form.js +1 -1
  62. package/dist/cdn/foxy-nucleon-element.js +1 -1
  63. package/dist/cdn/foxy-pagination.js +1 -1
  64. package/dist/cdn/foxy-passkey-card.js +1 -1
  65. package/dist/cdn/foxy-passkey-form.js +1 -1
  66. package/dist/cdn/foxy-payment-card.js +1 -1
  67. package/dist/cdn/foxy-payment-method-card.js +1 -1
  68. package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
  69. package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
  70. package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
  71. package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
  72. package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
  73. package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
  74. package/dist/cdn/foxy-payments-api.js +1 -1
  75. package/dist/cdn/foxy-query-builder.js +1 -1
  76. package/dist/cdn/foxy-report-form.js +4 -4
  77. package/dist/cdn/foxy-reports-table.js +1 -1
  78. package/dist/cdn/foxy-shipment-card.js +1 -1
  79. package/dist/cdn/foxy-shipping-method-card.js +1 -1
  80. package/dist/cdn/foxy-sign-in-form.js +1 -1
  81. package/dist/cdn/foxy-spinner.js +2 -2
  82. package/dist/cdn/foxy-store-card.js +1 -1
  83. package/dist/cdn/foxy-store-form.js +1 -1
  84. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  85. package/dist/cdn/foxy-subscription-card.js +1 -1
  86. package/dist/cdn/foxy-subscription-form.js +2 -2
  87. package/dist/cdn/foxy-subscription-settings-form.js +1 -1
  88. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  89. package/dist/cdn/foxy-table.js +1 -1
  90. package/dist/cdn/foxy-tax-card.js +1 -1
  91. package/dist/cdn/foxy-tax-form.js +1 -1
  92. package/dist/cdn/foxy-template-config-form.js +1 -1
  93. package/dist/cdn/foxy-template-form.js +1 -1
  94. package/dist/cdn/foxy-template-set-card.js +1 -1
  95. package/dist/cdn/foxy-template-set-form.js +1 -1
  96. package/dist/cdn/foxy-transaction-card.js +1 -1
  97. package/dist/cdn/foxy-transaction.js +1 -1
  98. package/dist/cdn/foxy-transactions-table.js +1 -1
  99. package/dist/cdn/foxy-user-card.js +1 -1
  100. package/dist/cdn/foxy-user-form.js +1 -1
  101. package/dist/cdn/foxy-users-table.js +1 -1
  102. package/dist/cdn/foxy-webhook-card.js +1 -1
  103. package/dist/cdn/foxy-webhook-form.js +1 -1
  104. package/dist/cdn/foxy-webhook-log-card.js +1 -1
  105. package/dist/cdn/foxy-webhook-status-card.js +1 -1
  106. package/dist/cdn/{shared-9caffb4d.js → shared-017ab35f.js} +1 -1
  107. package/dist/cdn/{shared-e6828dbf.js → shared-0689b25a.js} +5 -5
  108. package/dist/cdn/shared-0dabe195.js +15 -0
  109. package/dist/cdn/{shared-1b060170.js → shared-125d1a00.js} +1 -1
  110. package/dist/cdn/shared-13cc4ed4.js +9 -0
  111. package/dist/cdn/{shared-ff992ead.js → shared-15fe0f50.js} +1 -1
  112. package/dist/cdn/{shared-379b37e6.js → shared-19c9fe00.js} +7 -11
  113. package/dist/cdn/shared-1b2e0709.js +1 -0
  114. package/dist/cdn/shared-1e43b4db.js +1 -0
  115. package/dist/cdn/{shared-c7f2f1ab.js → shared-1fd59009.js} +1 -1
  116. package/dist/cdn/{shared-31651a9c.js → shared-2fa6a5a0.js} +1 -1
  117. package/dist/cdn/{shared-65318cc1.js → shared-3164d0c3.js} +1 -1
  118. package/dist/cdn/{shared-e10052d0.js → shared-31a891e8.js} +3 -3
  119. package/dist/cdn/{shared-b3ac59eb.js → shared-403af08d.js} +2 -2
  120. package/dist/cdn/{shared-a92ae606.js → shared-421e46e9.js} +1 -1
  121. package/dist/cdn/{shared-dccf0420.js → shared-42adf053.js} +1 -1
  122. package/dist/cdn/{shared-77a4d8e8.js → shared-46f3f71c.js} +1 -1
  123. package/dist/cdn/{shared-e84fa0ea.js → shared-4966b3e4.js} +1 -1
  124. package/dist/cdn/{shared-b48a83b0.js → shared-4a0298cb.js} +1 -1
  125. package/dist/cdn/{shared-17d0db7f.js → shared-4bd1efd7.js} +3 -3
  126. package/dist/cdn/{shared-51d28e6d.js → shared-527abf31.js} +1 -1
  127. package/dist/cdn/{shared-fe54babe.js → shared-53532131.js} +1 -1
  128. package/dist/cdn/{shared-9c626d58.js → shared-5616a12f.js} +1 -1
  129. package/dist/cdn/{shared-c97e0d6e.js → shared-57922341.js} +1 -1
  130. package/dist/cdn/shared-619bcf83.js +1 -0
  131. package/dist/cdn/{shared-ba658670.js → shared-6273b7e1.js} +1 -1
  132. package/dist/cdn/{shared-4904bca4.js → shared-639dda4b.js} +1 -1
  133. package/dist/cdn/{shared-d14c2060.js → shared-6b0498b2.js} +3 -3
  134. package/dist/cdn/{shared-6f84ac3e.js → shared-6b3be508.js} +1 -1
  135. package/dist/cdn/{shared-c6c6ba69.js → shared-6dffe67d.js} +1 -1
  136. package/dist/cdn/{shared-4c956a8e.js → shared-72a13fda.js} +1 -1
  137. package/dist/cdn/{shared-4b67d699.js → shared-763a6797.js} +1 -1
  138. package/dist/cdn/shared-7680d300.js +122 -0
  139. package/dist/cdn/shared-79d01877.js +1 -0
  140. package/dist/cdn/{shared-6abdfcf2.js → shared-7bf6e728.js} +1 -1
  141. package/dist/cdn/{shared-69a21b9d.js → shared-7d4e0011.js} +1 -1
  142. package/dist/cdn/shared-7e887e5b.js +1 -0
  143. package/dist/cdn/{shared-8474bc4a.js → shared-7ead930c.js} +1 -1
  144. package/dist/cdn/shared-7f33a83a.js +12 -12
  145. package/dist/cdn/{shared-6dc64a17.js → shared-8128b5e3.js} +1 -1
  146. package/dist/cdn/{shared-984fcdf5.js → shared-8134d8a7.js} +3 -3
  147. package/dist/cdn/{shared-c4240bc6.js → shared-8465a37a.js} +1 -1
  148. package/dist/cdn/{shared-e7c3b7b6.js → shared-848813a4.js} +1 -1
  149. package/dist/cdn/shared-8528906b.js +1 -0
  150. package/dist/cdn/{shared-a3c73e91.js → shared-897ab5e6.js} +1 -1
  151. package/dist/cdn/{shared-4bbd600d.js → shared-8fbab85c.js} +1 -1
  152. package/dist/cdn/{shared-4dc58b73.js → shared-90be9ac7.js} +1 -1
  153. package/dist/cdn/{shared-0a248c0d.js → shared-91eb066c.js} +1 -1
  154. package/dist/cdn/{shared-1d28220a.js → shared-9765be8f.js} +1 -1
  155. package/dist/cdn/{shared-e6997950.js → shared-9bdd5400.js} +1 -1
  156. package/dist/cdn/{shared-dfe2602a.js → shared-a134d313.js} +1 -1
  157. package/dist/cdn/shared-a6517170.js +1 -0
  158. package/dist/cdn/shared-a7475f62.js +212 -0
  159. package/dist/cdn/shared-a88c5cf1.js +29 -0
  160. package/dist/cdn/{shared-479ad951.js → shared-a96a2154.js} +1 -1
  161. package/dist/cdn/shared-aa22ee61.js +1 -0
  162. package/dist/cdn/shared-aa569a99.js +804 -0
  163. package/dist/cdn/{shared-e8e92fe3.js → shared-ad0256d0.js} +2 -2
  164. package/dist/cdn/{shared-25f64060.js → shared-b334c8b6.js} +1 -1
  165. package/dist/cdn/{shared-1d08a5ad.js → shared-bbbb8894.js} +1 -1
  166. package/dist/cdn/{shared-bafcab47.js → shared-bf2113a4.js} +3 -3
  167. package/dist/cdn/{shared-88e36564.js → shared-c541c9e9.js} +26 -27
  168. package/dist/cdn/{shared-36725fe3.js → shared-c758220c.js} +1 -1
  169. package/dist/cdn/{shared-4674063d.js → shared-c97f7178.js} +27 -27
  170. package/dist/cdn/shared-d2222c8d.js +1 -0
  171. package/dist/cdn/{shared-64f98a0f.js → shared-db06114b.js} +7 -2
  172. package/dist/cdn/{shared-665d6cc4.js → shared-e5786b8b.js} +1 -1
  173. package/dist/cdn/shared-e640e9fa.js +1 -0
  174. package/dist/cdn/{shared-7995407d.js → shared-eb232194.js} +3 -3
  175. package/dist/cdn/{shared-bdb51db9.js → shared-f4822b9e.js} +1 -1
  176. package/dist/cdn/{shared-db21f6db.js → shared-fa5f0117.js} +2 -2
  177. package/dist/cdn/shared-fc77174e.js +1 -0
  178. package/dist/cdn/shared-fec6fd04.js +1 -0
  179. package/dist/cdn/translations/address-form/en.json +577 -0
  180. package/dist/cdn/translations/customer/en.json +577 -0
  181. package/dist/cdn/translations/customer-portal/en.json +579 -1
  182. package/dist/cdn/translations/error-entry-card/en.json +4 -0
  183. package/dist/cdn/translations/webhook-form/en.json +1 -1
  184. package/dist/elements/internal/InternalRadioGroupControl/InternalRadioGroupControl.js +2 -1
  185. package/dist/elements/internal/InternalRadioGroupControl/InternalRadioGroupControl.js.map +1 -1
  186. package/dist/elements/public/AddressForm/AddressForm.d.ts +2 -1
  187. package/dist/elements/public/AddressForm/AddressForm.js +53 -17
  188. package/dist/elements/public/AddressForm/AddressForm.js.map +1 -1
  189. package/dist/elements/public/AddressForm/countries.d.ts +1 -1
  190. package/dist/elements/public/AddressForm/countries.js +554 -251
  191. package/dist/elements/public/AddressForm/countries.js.map +1 -1
  192. package/dist/elements/public/ErrorEntryCard/ErrorEntryCard.d.ts +0 -1
  193. package/dist/elements/public/ErrorEntryCard/ErrorEntryCard.js +34 -30
  194. package/dist/elements/public/ErrorEntryCard/ErrorEntryCard.js.map +1 -1
  195. package/dist/elements/public/ErrorEntryCard/ResourceViewer.js +9 -0
  196. package/dist/elements/public/ErrorEntryCard/ResourceViewer.js.map +1 -1
  197. package/dist/elements/public/ItemCategoryForm/ItemCategoryForm.js +3 -0
  198. package/dist/elements/public/ItemCategoryForm/ItemCategoryForm.js.map +1 -1
  199. package/dist/elements/public/WebhookForm/WebhookForm.d.ts +2 -0
  200. package/dist/elements/public/WebhookForm/WebhookForm.js +7 -0
  201. package/dist/elements/public/WebhookForm/WebhookForm.js.map +1 -1
  202. package/package.json +10 -10
  203. package/dist/cdn/shared-09d4fbb8.js +0 -29
  204. package/dist/cdn/shared-1eac92fa.js +0 -1
  205. package/dist/cdn/shared-307262a1.js +0 -15
  206. package/dist/cdn/shared-332f2997.js +0 -1
  207. package/dist/cdn/shared-39f3b48d.js +0 -1
  208. package/dist/cdn/shared-432c5183.js +0 -9
  209. package/dist/cdn/shared-4dee79d4.js +0 -1
  210. package/dist/cdn/shared-53061389.js +0 -1
  211. package/dist/cdn/shared-59042137.js +0 -201
  212. package/dist/cdn/shared-65ba8b39.js +0 -1
  213. package/dist/cdn/shared-7f5618ba.js +0 -1
  214. package/dist/cdn/shared-92f27a38.js +0 -1
  215. package/dist/cdn/shared-b0f534ef.js +0 -1
  216. package/dist/cdn/shared-be24dd36.js +0 -804
  217. package/dist/cdn/shared-bf62a65b.js +0 -1
  218. package/dist/cdn/shared-c2d3b32b.js +0 -1
  219. package/dist/cdn/shared-cf269a17.js +0 -1
  220. package/dist/cdn/shared-fef9ecc1.js +0 -122
  221. package/dist/elements/public/AddressForm/regions.d.ts +0 -1
  222. package/dist/elements/public/AddressForm/regions.js +0 -67
  223. package/dist/elements/public/AddressForm/regions.js.map +0 -1
  224. /package/dist/cdn/{shared-64657919.js → shared-343d1fd7.js} +0 -0
  225. /package/dist/cdn/{shared-d6276c83.js → shared-3ab0306f.js} +0 -0
  226. /package/dist/cdn/{shared-e6f3e9f0.js → shared-bb05cfed.js} +0 -0
  227. /package/dist/cdn/{shared-99065f2a.js → shared-d7be11de.js} +0 -0
  228. /package/dist/cdn/{shared-0479553e.js → shared-f9180815.js} +0 -0
@@ -1 +1 @@
1
- import{e,an as t,ai as s,ak as i,ao as a,_ as n,ap as l,aq as r}from"./shared-307262a1.js";import"./shared-4674063d.js";import{B as o}from"./shared-e6997950.js";import{E as d,F as h}from"./shared-9c626d58.js";import"./shared-17d0db7f.js";import"./shared-479ad951.js";import{L as u,h as c,c as _}from"./shared-7f33a83a.js";import{z as g,w as p,x as m,A as v}from"./shared-09d4fbb8.js";import{D as x,a as y,C as $,b as f}from"./shared-b0f534ef.js";import"./shared-36725fe3.js";import{a as b,I as w,D as k,S as E,M as C,W as S,c as R,t as I}from"./shared-379b37e6.js";import"./shared-fef9ecc1.js";import"./shared-e6828dbf.js";import{I as j}from"./shared-432c5183.js";import{C as V}from"./shared-64f98a0f.js";import"./shared-88e36564.js";import{p as M}from"./shared-77a4d8e8.js";import"./shared-31651a9c.js";import{c as q}from"./shared-4e709717.js";import"./shared-c6c6ba69.js";import{P as N}from"./shared-e8e92fe3.js";import{G as T}from"./shared-4904bca4.js";import{j as D}from"./shared-39f3b48d.js";import{p as A,W as O}from"./shared-665d6cc4.js";import{D as F}from"./shared-be24dd36.js";import{c as L}from"./shared-53061389.js";import{i as U}from"./shared-332f2997.js";import"./shared-59042137.js";import"./shared-984fcdf5.js";import"./shared-4b67d699.js";import"./shared-11c2efc8.js";import"./shared-1d08a5ad.js";import"./shared-64657919.js";import"./shared-c7f2f1ab.js";import"./shared-d3bf9ac0.js";import"./shared-bdb51db9.js";import"./shared-d14c2060.js";import"./shared-fe54babe.js";function B(e){return e?Infinity===(e=g(e))||-Infinity===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function P(e){return e}var z=Math.floor,Q=Math.random;var J=parseFloat,H=Math.min,W=Math.random;function Y(a,n,l){if(l&&"boolean"!=typeof l&&function(a,n,l){if(!e(l))return!1;var r=typeof n;return!!("number"==r?t(l)&&s(n,l.length):"string"==r&&n in l)&&i(l[n],a)}(a,n,l)&&(n=l=void 0),void 0===l&&("boolean"==typeof n?(l=n,n=void 0):"boolean"==typeof a&&(l=a,a=void 0)),void 0===a&&void 0===n?(a=0,n=1):(a=B(a),void 0===n?(n=a,a=0):n=B(n)),a>n){var r=a;a=n,n=r}if(l||a%1||n%1){var o=W();return H(a+o*(n-a+J("1e-"+((o+"").length-1))),n)}return function(e,t){return e+z(Q()*(t-e+1))}(a,n)}var G=Math.min;function X(e,t){if(e=function(e){var t=B(e),s=t%1;return t==t?s?t-s:t:0}(e),e<1||e>9007199254740991)return[];var s,i=4294967295,n=G(e,4294967295);e-=4294967295;for(var l=a(n,t="function"==typeof(s=t)?s:P);++i<e;)t(i);return l}class K extends CustomEvent{constructor(e){super("change",{detail:e})}}let Z,ee,te=e=>e;class se extends u{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.getText=e=>e}static get properties(){return n(n({},super.properties),{},{value:{type:Array},disabled:{type:Boolean},getText:{type:Object}})}static get styles(){return p.styles}render(){return c(Z||(Z=te` <div class="font-lumo text-m w-full"> <ul> ${0} </ul> <div class="p-m"> <slot></slot> </div> </div> `),this.value.map(((e,t)=>c(ee||(ee=te` <li class="${0}"> <slot name="${0}">${0}</slot> <button ?disabled="${0}" class="w-l h-l rounded text-tertiary transition duration-150 hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </li> `),"ml-m h-l text-body flex justify-between items-center"+(t>0?" border-t border-contrast-10":""),t,this.getText(e),this.disabled,(()=>this.__remove(t))))))}__remove(e){this.value=this.value.filter(((t,s)=>s!==e)),this.dispatchEvent(new K(this.value))}}let ie,ae,ne=e=>e;class le extends u{static get styles(){return[p.styles,_(ie||(ie=ne`:host{position:absolute;top:0;right:0;bottom:0;left:0}.top-center{top:calc(50% - (var(--lumo-size-xl)/ 2))}@keyframes dash0{from{transform:translate(0,0)}to{transform:translate(5.681301px,3.368302px)}}@keyframes dash1{from{transform:translate(0,0)}to{transform:translate(5.677051px,3.457428px)}}@keyframes dash2{from{transform:translate(0,0)}to{transform:translate(5.686002px,3.127455px)}}@keyframes dash3{from{transform:translate(-5.6842px,-3.404556px)}to{transform:translate(0,0)}}`))]}render(){return c(ae||(ae=ne` <div class="h-full bg-base text-primary"> <svg xmlns="http://www.w3.org/2000/svg" class="fill-current w-xl h-xl mx-auto sticky top-center" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" viewBox="0 0 64 64"> <path id="ew5fy7afo2w2" fill-rule="evenodd" stroke="none" stroke-width="1" d="M41.93 49.46c0 .18-.2.3-.36.2l-1.78-1.07-22.73-13.76a1.5 1.5 0 01-.7-1.3V11.08c0-.18.2-.3.36-.2l1.75 1.04c.44.25.74.75.74 1.32v19.27c0 .08.05.16.12.2L41.22 46c.47.28.73.8.72 1.32v2.15z" clip-rule="evenodd"/> <path id="ew5fy7afo2w3" fill-rule="evenodd" stroke="none" stroke-width="1" d="M47.64 52.9c0 .2-.2.3-.36.21l-1.8-1.08c-.42-.26-.7-.74-.7-1.3v-19.3a.24.24 0 00-.12-.2L25.27 19.47a.24.24 0 00-.37.21v12.55c0 .19-.21.3-.37.2l-1.76-1.06a1.46 1.46 0 01-.71-1.28V16.7c0-.54.27-1.03.71-1.3.45-.27 1-.26 1.44 0l22.72 13.77c.44.26.7.76.7 1.3v20.27l.01 2.17z" clip-rule="evenodd"/> <g style="animation:dash0 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w4" fill-rule="evenodd" stroke="none" stroke-width="1" d="M30.59 35.68c0 .2-.21.3-.37.21l-1.8-1.1c-.41-.27-.68-.74-.68-1.28V27v-2.15c0-.2.2-.3.37-.21l1.78 1.06c.42.26.7.74.7 1.3v8.68z" clip-rule="evenodd"/> </g> <g style="animation:dash1 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w5" fill-rule="evenodd" stroke="none" stroke-width="1" d="M36.28 39.13c0 .2-.2.3-.37.21l-1.79-1.1c-.41-.25-.69-.73-.69-1.28v-6.51-2.16c0-.2.2-.31.37-.21l1.76 1.06c.44.26.73.75.73 1.3v8.69z" clip-rule="evenodd"/> </g> <g style="animation:dash2 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w6" fill-rule="evenodd" stroke="none" stroke-width="1" d="M41.96 42.57c0 .2-.2.3-.37.21L39.8 41.7a1.52 1.52 0 01-.71-1.3v-6.51-2.17c0-.2.2-.31.37-.21l1.74 1.06c.45.25.75.75.75 1.32v8.68z" clip-rule="evenodd"/> </g> <g transform="translate(-5.68 -3.4)" style="animation:dash3 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w7" fill-rule="evenodd" stroke="none" stroke-width="1" d="M30.59 35.68c0 .2-.21.3-.37.21l-1.8-1.1c-.41-.27-.68-.74-.68-1.28V27v-2.15c0-.2.2-.3.37-.21l1.78 1.06c.42.26.7.74.7 1.3v8.68z" clip-rule="evenodd"/> </g> </svg> </div> `))}}let re,oe,de=e=>e;class he extends u{static get styles(){return[p.styles,_(re||(re=de`::slotted(:not([slot])){margin-top:var(--lumo-space-xl)}`))]}render(){return c(oe||(oe=de` <article class="relative antialiased font-lumo"> <header class="space-y-xs leading-s"> <h1 class="font-medium text-header text-xl border-b border-contrast-10 pb-s mb-s"> <slot name="title"></slot> </h1> <p class="text-l text-secondary"> <slot name="subtitle"></slot> </p> </header> <slot></slot> </article> `))}}let ue,ce,_e=e=>e;class ge extends he{static get styles(){return[super.styles,_(ue||(ue=_e`::slotted(:not([slot])){margin-top:var(--lumo-space-m)}`))]}render(){return c(ce||(ce=_e` <section class="leading-s antialiased font-lumo"> <header> <h2 class="text-header font-medium text-l"> <slot name="title"></slot> </h2> <p class="text-secondary text-m"> <slot name="subtitle"></slot> </p> </header> <slot></slot> </section> `))}}let pe,me=e=>e;class ve extends CustomEvent{constructor(e){super("change",{detail:e})}}class xe extends u{constructor(){super(...arguments),this.disabled=!1,this.checked=!1}static get properties(){return n(n({},super.properties),{},{disabled:{attribute:!1},checked:{attribute:!1}})}static get styles(){return p.styles}render(){return c(pe||(pe=me` <label class="${0}"> <span class="text-body font-medium text-m mr-m"> <slot></slot> </span> <span style="border-radius:var(--lumo-size-xl);width:calc((var(--lumo-space-l) * 2) + (var(--lumo-space-xs) * 2))" class="${0}"> <span style="width:var(--lumo-space-l);height:var(--lumo-space-l)" class="${0}"></span> <input type="checkbox" class="opacity-0 absolute inset-0" .checked="${0}" .disabled="${0}" @change="${0}"> </span> </label> `),q({"transition duration-200 flex justify-between items-center group":!0,"cursor-pointer":!this.disabled}),q({"transition duration-150 relative flex flex-shrink-0 items-center":!0,"bg-success focus-within-shadow-outline-success":!this.disabled&&this.checked,"bg-contrast-10 focus-within-shadow-outline":this.disabled||!this.checked,"bg-contrast-20":!this.disabled&&!this.checked}),q({"bg-tint transition duration-200 transform block rounded-full m-xs":!0,"translate-x-l":this.checked,"translate-x-0":!this.checked,"shadow-xs group-hover-shadow-s group-hover-scale-110":!this.disabled}),this.checked,this.disabled,(()=>{this.checked=!this.checked,this.dispatchEvent(new ve(this.checked))}))}}class ye extends Error{constructor(){super("Unhandled request detected. Please add a request handler to connect this component to a backend.")}}class $e extends CustomEvent{static emit(e){return new Promise(((t,s)=>{const i=new $e(n({resolve:t,reject:s},e));e.source.dispatchEvent(i)&&s(new ye)}))}constructor({source:e,resolve:t,reject:s,init:i}){var a;super("request",{cancelable:!0,composed:!0,bubbles:!0,detail:{source:e,handle:async function(e){a.stopImmediatePropagation(),a.preventDefault();try{t(await e(...i))}catch(e){s(e)}}}}),a=this}}let fe,be=e=>e;class we extends CustomEvent{constructor(e){super("change",{detail:e})}}class ke extends m{constructor(){super(...arguments),this.disabled=!1,this.value=1,this.__errorMessage=null,this.__customFieldI18n={formatValue:e=>{const t=parseInt(e[0]);if(isNaN(t))return"0";const s=e[1];return"w"===s?(10080*t).toFixed(0):"d"===s?(1440*t).toFixed(0):"h"===s?(60*t).toFixed(0):t.toFixed(0)},parseValue:e=>{const t=parseInt(e);return t%10080==0?[(t/10080).toFixed(0),"w"]:t%1440==0?[(t/1440).toFixed(0),"d"]:t%60==0?[(t/60).toFixed(0),"h"]:[t.toFixed(0),"m"]}},this.__renderer=this.__renderItems.bind(this)}static get scopedElements(){return{"vaadin-integer-field":j,"vaadin-custom-field":V,"vaadin-select":b,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{attribute:!1},value:{attribute:!1}})}render(){var e;return c(fe||(fe=be` <div class="text-xs text-tertiary font-lumo"> <vaadin-custom-field ?disabled="${0}" .label="${0}" .value="${0}" .i18n="${0}" data-testid="field" id="field" @change="${0}"> <vaadin-integer-field .disabled="${0}" .min="${0}" data-testid="count" has-controls> </vaadin-integer-field> <vaadin-select .disabled="${0}" .renderer="${0}" data-testid="units"> </vaadin-select> </vaadin-custom-field> <br> <x-i18n .lang="${0}" .ns="${0}" .key="${0}" data-testid="error" class="${0}"> </x-i18n> </div> `),this.disabled||!this._isI18nReady,this._isI18nReady?this._t("session.title").toString():"---",this._isI18nReady?this.value.toString():"",this.__customFieldI18n,this.__handleChange,this.disabled||!this._isI18nReady,1,this.disabled||!this._isI18nReady,this._isI18nReady?this.__renderer:null,this.lang,this.ns,this._t(`session.${null!==(e=this.__errorMessage)&&void 0!==e?e:"subtitle"}`).toString(),q({"text-error":null!==this.__errorMessage&&!this.disabled}))}firstUpdated(){this.shadowRoot.getElementById("field").value=this.value.toString()}updated(e){e.has("value")&&this.__reportValidity()}__renderItems(e){let t=e.querySelector("vaadin-list-box");null===t&&(t=document.createElement("vaadin-list-box"),e.appendChild(t));const s=["m","h","d","w"],i=["minute_plural","hour_plural","d_plural","w_plural"],a=t.querySelectorAll("vaadin-item");for(let e=0;e<Math.max(s.length,a.length);++e)if(s[e]){let n;a[e]?n=a[e]:(n=document.createElement("vaadin-item"),t.appendChild(n)),n.value=s[e],n.textContent=this._t(i[e])}else a[e].remove()}__handleChange(e){e.stopPropagation(),this.value=parseInt(e.target.value),this.dispatchEvent(new we({value:this.value,invalid:!this.__reportValidity()}))}__reportValidity(){return this.__errorMessage=this.value<1?"too_short":this.value>40320?"too_long":null,this.requestUpdate(),null===this.__errorMessage}}let Ee,Ce=e=>e;class Se extends CustomEvent{constructor(e){super("change",{detail:e})}}class Re extends m{constructor(){super(...arguments),this.disabled=!1,this.value="",this.__errorMessage=""}static get scopedElements(){return{"vaadin-password-field":N,"vaadin-button":o,"iron-icon":customElements.get("iron-icon"),"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{attribute:!1},value:{attribute:!1}})}render(){const e=""!==this.__errorMessage&&!this.disabled,t=e?this._t(`jwt.${this.__errorMessage}`).toString():"";return c(Ee||(Ee=Ce` <div class="space-y-xs"> <div class="flex items-start"> <vaadin-password-field .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" .label="${0}" data-testid="input" class="w-full" @change="${0}" @input="${0}"> </vaadin-password-field> <vaadin-button class="flex-shrink-0 ml-s" style="margin-top:calc(var(--lumo-font-size-s) * 1.5)" theme="error" data-testid="button" .disabled="${0}" @click="${0}"> <x-i18n .lang="${0}" .ns="${0}" key="jwt.refresh"></x-i18n> <iron-icon icon="icons:refresh" slot="suffix"></iron-icon> </vaadin-button> </div> <x-i18n .lang="${0}" .ns="${0}" key="jwt.subtitle" class="text-xs text-tertiary font-lumo"> </x-i18n> </div> `),t,this.disabled||!this._isI18nReady,e,this._isI18nReady?this.value:"",this._isI18nReady?this._t("jwt.title").toString():"---",(e=>e.stopPropagation()),this.__handleInput,this.disabled||!this._isI18nReady,this.__regenerateValue,this.lang,this.ns,this.lang,this.ns)}updated(e){e.has("value")&&this.__reportValidity()}__regenerateValue(){this.__errorMessage="",this.value=X(72,(()=>Y(35).toString(36))).join(""),this.dispatchEvent(new Se({value:this.value,invalid:!1}))}__handleInput(e){this.value=e.target.value,this.dispatchEvent(new Se({value:this.value,invalid:!this.__reportValidity()}))}__reportValidity(){var e;return this.__errorMessage=0===this.value.length?"required":this.value.length<40?"too_short":this.value.length>100?"too_long":(e=this.value,/^[a-z0-9-]+$/i.test(e)?"":"invalid"),this.requestUpdate(),""===this.__errorMessage}}function Ie(e){return t=>{t.preventDefault(),e(t)}}class je extends x{}let Ve,Me=e=>e;class qe extends m{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=qe.defaultValue,this.__items=["y","m","w","d"]}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"vaadin-button":customElements.get("vaadin-button"),"x-dropdown":k}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:String}})}render(){return c(Ve||(Ve=Me` <div class="grid grid-cols-2 gap-s"> <vaadin-integer-field data-testid="value" class="w-full" min="1" has-controls .value="${0}" .disabled="${0}" @change="${0}"> </vaadin-integer-field> <x-dropdown data-testid="units" .disabled="${0}" .getText="${0}" .items="${0}" .value="${0}" @change="${0}"> </x-dropdown> </div> `),this._isI18nReady?this.__numericValue:"",this.disabled,this.__handleNumberChange,this.disabled,(e=>this._isI18nReady?this._t(`${e}_plural`):""),this.__items,this._isI18nReady?this.__unitsValue:"",this.__handleUnitsChange)}get __numericValue(){var e;return M(null!==(e=this.value)&&void 0!==e?e:"").count}get __unitsValue(){var e;return M(null!==(e=this.value)&&void 0!==e?e:"").units}__handleNumberChange(e){e.stopPropagation();const t=e.target.value;this.value=this.value.replace(String(this.__numericValue),t),this.__sendChange()}__handleUnitsChange(e){this.value=this.value.replace(String(this.__unitsValue),e.detail),this.__sendChange()}__sendChange(){this.dispatchEvent(new je(this.value))}}qe.defaultValue="1w";class Ne extends K{}let Te,De,Ae,Oe,Fe=e=>e;class Le extends m{constructor(){super("customer-portal-settings"),this.value=[],this.disabled=!1,this.__newValue=qe.defaultValue}static get scopedElements(){return{"iron-icon":customElements.get("iron-icon"),"vaadin-button":customElements.get("vaadin-button"),"x-frequency-input":qe,"x-skeleton":E,"x-list":se,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const e=this.disabled||!this._isI18nReady||this.value.length>=20;return c(Te||(Te=Fe` <x-list data-testid="list" .value="${0}" .disabled="${0}" @change="${0}"> ${0} <div class="w-full md-flex"> <x-frequency-input data-testid="input" class="mb-s md-mb-0 md-mr-s" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-input> <vaadin-button data-testid="button" class="w-full md-w-auto" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_option"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> </div> ${0} </x-list> `),this.value,this.disabled||!this._isI18nReady,this.__handleListChange,this.value.map(((e,t)=>this._isI18nReady?c(De||(De=Fe`<span slot="${0}">${0}</span>`),t,this.__getText(e)):c(Ae||(Ae=Fe`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this.lang,this.__newValue,e,this.__handleNewValueChange,e,this.__handleSubmit,this.ns,this.lang,this.value.length>0?c(Oe||(Oe=Fe` <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_option_hint" class="${0}"> </x-i18n> `),this.ns,this.lang,q({"block text-xs mt-xs text-center md-text-left":!0,"text-tertiary":this.value.length<20,"text-primary":this.value.length>=20})):"")}__handleNewValueChange(e){this.__newValue=e.detail}__handleListChange(e){this.value=e.detail,this.__sendChange()}__handleSubmit(){this.value=[...this.value,this.__newValue],this.__newValue=qe.defaultValue,this.__sendChange()}__sendChange(){this.dispatchEvent(new Ne(this.value))}__getText(e){const t=e[e.length-1],s=parseInt(e.replace(t,""));return this._t("duration",{count:s,units:this._t(t,{count:s})})}}class Ue extends y{}let Be,Pe,ze=e=>e;class Qe extends m{constructor(){super(...arguments),this.disabled=!1,this.value="*",this.__errorMessage="",this.__items=["all","some"],this.__handleNewValueChange=v((e=>{try{D(e).evaluate({}),this.value=e,this.__errorMessage="",this.__sendChange()}catch(e){this.__errorMessage=e.message}this.requestUpdate()}),275)}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"iron-icon":customElements.get("iron-icon"),"x-choice":$,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:String}})}render(){const e="pl-xs text-primary rounded font-medium cursor-pointer transition duration-200 focus-outline-none focus-shadow-outline hover-underline";return c(Be||(Be=ze` <x-choice data-testid="choice" .disabled="${0}" .value="${0}" .items="${0}" @change="${0}"> <x-i18n slot="all-label" .ns="${0}" .lang="${0}" key="jsonata.all"></x-i18n> <x-i18n slot="some-label" .ns="${0}" .lang="${0}" key="jsonata.some"></x-i18n> ${0} </x-choice> `),this.disabled||!this._isI18nReady,this.__choice,this.__items,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.__choice===this.__items[1]?c(Pe||(Pe=ze` <div slot="${0}" class="space-y-s pb-m"> <x-i18n .ns="${0}" .lang="${0}" key="jsonata.hint" class="block font-lumo text-s text-tertiary leading-s"> <a target="_blank" class="${0}" href="https://docs.jsonata.org" rel="noopener noreferrer"> JSONata <iron-icon icon="icons:open-in-new" class="icon-inline"></iron-icon> </a> <a target="_blank" class="${0}" href="https://api.foxycart.com/rels/subscription" rel="noopener noreferrer"> hAPI subscription <iron-icon icon="icons:open-in-new" class="icon-inline"></iron-icon> </a> </x-i18n> <vaadin-text-field class="w-full" data-testid="input" .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" @keydown="${0}" @change="${0}" @input="${0}"> </vaadin-text-field> </div> `),this.__items[1],this.ns,this.lang,e,e,this.__errorMessage,this.disabled||!this._isI18nReady,this.__errorMessage.length>0,this._isI18nReady?this.value:"",this.__stopNavigation,(e=>e.stopPropagation()),(e=>this.__handleNewValueChange(e.target.value))):"")}get __choice(){return this.__items["*"===this.value?0:1]}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?"*":'$contains(frequency, "w")',this.__sendChange()}__stopNavigation(e){e.key.startsWith("Arrow")&&e.stopPropagation()}__sendChange(){this.dispatchEvent(new Ue(this.value))}}class Je extends CustomEvent{constructor(e){super("change",{detail:e})}}class He extends CustomEvent{constructor(){super("remove")}}let We,Ye,Ge=e=>e;class Xe extends m{constructor(){super(...arguments),this.open=!1,this.value={jsonataQuery:"*",values:[]},this.disabled=!1}static get scopedElements(){return{"x-frequency-list":Le,"x-jsonata-input":Qe,"iron-icon":customElements.get("iron-icon"),"x-group":T,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{open:{attribute:!1},value:{attribute:!1},disabled:{attribute:!1}})}render(){const{jsonataQuery:e,values:t}=this.value,s=this.open?"":"rounded-b-l";return c(We||(We=Ge` <x-group frame> <details data-testid="details" class="${0}" ?open="${0}" @toggle="${0}"> <summary class="${0} cursor-pointer relative leading-s rounded-t-l focus-outline-none focus-shadow-outline"> <div class="p-m space-y-xs mr-xl"> <x-i18n .ns="${0}" .lang="${0}" .key="${0}" class="block text-m text-header font-medium"> ${0} </x-i18n> <x-i18n .ns="${0}" .lang="${0}" class="block text-s text-tertiary" key="fmod.valuesLabel"> <x-i18n .ns="${0}" .key="${0}" .lang="${0}" .opts="${0}" class="text-secondary"> </x-i18n> </x-i18n> </div> <button data-testid="remove" .disabled="${0}" class="flex items-center justify-center rounded absolute top-0 right-0 text-tertiary hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" style="width:54px;height:54px" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </summary> <div class="space-y-l pt-m" slot="content"> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="fmod.match"></x-i18n> <x-jsonata-input data-testid="jsonata" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-jsonata-input> </x-group> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="fmod.options"> </x-i18n> <x-frequency-list data-testid="frequency" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-list> </x-group> </div> </details> </x-group> `),q({"font-lumo":!0,"pointer-events-none":!this._isI18nReady}),this.open,(()=>this.open=!this.open),s,this.ns,this.lang,`fmod.${"*"===e?"all":"some"}Title`,"*"!==e?this.__renderJSONataSummary(e):"",this.ns,this.lang,this.ns,"fmod.valuesList"+(0===t.length?"Empty":""),this.lang,{values:t.map((e=>this.__translateFrequency(e)))},this.disabled||!this._isI18nReady,Ie((()=>{this.dispatchEvent(new He)})),this.ns,this.lang,this.ns,this.lang,this.value.jsonataQuery,this.disabled||!this._isI18nReady,this.__handleQueryChange,this.ns,this.lang,this.lang,this.value.values,this.disabled||!this._isI18nReady,this.__handleValuesChange)}__translateFrequency(e){if(".5m"===e)return this._t("frequency_0_5m");const{count:t,units:s}=M(e);return this._t("frequency",{units:this._t(s,{count:t}),count:t})}__renderJSONataSummary(e){return c(Ye||(Ye=Ge` <code class="inline-block rounded bg-success-10 text-success px-xs text-xs leading-s"> ${0} </code> `),e)}__handleQueryChange(e){this.value=n(n({},this.value),{},{jsonataQuery:e.detail}),this.__sendChange()}__handleValuesChange(e){this.value=n(n({},this.value),{},{values:e.detail}),this.__sendChange()}__sendChange(){this.dispatchEvent(new Je(this.value))}}class Ke extends CustomEvent{constructor(e){super("change",{detail:e})}}let Ze,et,tt=e=>e;class st extends m{constructor(){super(...arguments),this.value=[],this.disabled=!1}static get scopedElements(){return{"x-frequency-modification-rule":Xe,"vaadin-button":customElements.get("vaadin-button"),"x-section":ge,"iron-icon":customElements.get("iron-icon"),"x-group":T,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const{ns:e,lang:t}=this;return c(Ze||(Ze=tt` <x-section> <x-i18n .ns="${0}" .lang="${0}" key="fmod.title" slot="title" class="text-l"></x-i18n> <x-i18n .ns="${0}" .lang="${0}" key="fmod.subtitle" slot="subtitle" class="mr-xl"></x-i18n> ${0} <div class="mt-m sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="add" theme="primary" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_rule"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="fmod.add_rule_hint" class="${0}"> </x-i18n> </div> </x-section> `),e,t,e,t,this.value.map(((e,t,s)=>c(et||(et=tt` <x-frequency-modification-rule data-testid="rule" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @remove="${0}" @change="${0}"> </x-frequency-modification-rule> `),this.disabled,e,this.lang,this.ns,(()=>{this.value=s.filter(((e,s)=>s!==t)),this.__sendChange()}),(e=>{this.value=s.map(((s,i)=>i===t?e.detail:s)),this.__sendChange()})))),this.disabled||this.value.length>=10||!this._isI18nReady,this.__addRule,this.ns,this.lang,this.lang,this.ns,q({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":this.value.length<10,"text-primary":this.value.length>=10,hidden:0===this.value.length}))}__addRule(){this.value=[...this.value,{jsonataQuery:"*",values:[]}],this.__sendChange()}__sendChange(){this.dispatchEvent(new Ke(this.value))}}function it(e,t){const s=(new Date).getFullYear(),i={month:"long",day:"numeric"};return e.split("..").map((e=>{const a=A(e),l=(null==a?void 0:a.getFullYear())===s?void 0:"numeric";return null==a?void 0:a.toLocaleDateString(t,n({year:l},i))})).join(" – ")}class at extends CustomEvent{constructor(e){super("change",{detail:e})}}let nt,lt,rt,ot=e=>e;class dt extends m{constructor(){super("customer-portal-settings"),this.disabled=!1,this.__items=["all","month","day"]}static get scopedElements(){return{"x-monthday-picker":C,"x-weekday-picker":S,"x-choice":$,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Object}})}render(){var e,t,s,i;return c(nt||(nt=ot` <x-choice data-testid="choice" .value="${0}" .items="${0}" .disabled="${0}" @change="${0}"> <x-i18n slot="all-label" key="ndmod.all" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="month-label" key="ndmod.month" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="day-label" key="ndmod.day" .ns="${0}" .lang="${0}"></x-i18n> ${0} </x-choice> `),null!==(t=null===(e=this.value)||void 0===e?void 0:e.type)&&void 0!==t?t:"all",this.__items,this.disabled,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,"month"===(null===(s=this.value)||void 0===s?void 0:s.type)?c(lt||(lt=ot` <x-monthday-picker slot="month" class="mb-m" data-testid="monthday-picker" .lang="${0}" .disabled="${0}" .value="${0}" @change="${0}"> </x-monthday-picker> `),this.lang,this.disabled||!this._isI18nReady,this.value.days,this.__handleNewValueChange):"day"===(null===(i=this.value)||void 0===i?void 0:i.type)?c(rt||(rt=ot` <x-weekday-picker slot="day" class="mb-m" data-testid="weekday-picker" .lang="${0}" .disabled="${0}" .value="${0}" @change="${0}"> </x-weekday-picker> `),this.lang,this.disabled||!this._isI18nReady,this.value.days,this.__handleNewValueChange):"")}__handleNewValueChange(e){this.value.days=e.detail,this.__sendChange()}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?void 0:e.detail===this.__items[1]?{type:"month",days:[]}:{type:"day",days:[]},this.__sendChange()}__sendChange(){this.dispatchEvent(new at(this.value))}}class ht extends K{}let ut,ct,_t,gt,pt=e=>e;class mt extends m{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.__startValue="",this.__endValue=""}static get scopedElements(){return{"vaadin-date-picker":F,"vaadin-button":o,"x-skeleton":E,"iron-icon":customElements.get("iron-icon"),"x-i18n":w,"x-list":se}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const e=this.value.length>=20||this.disabled||!this._isI18nReady;return c(ut||(ut=pt` <x-list data-testid="list" .value="${0}" .disabled="${0}" @change="${0}"> ${0} <div class="sm-flex sm-items-end"> <div class="grid grid-cols-2 gap-s"> <vaadin-date-picker data-testid="start" .label="${0}" .value="${0}" .disabled="${0}" .placeholder="${0}" @change="${0}"> </vaadin-date-picker> <vaadin-date-picker data-testid="end" .min="${0}" .label="${0}" .value="${0}" .disabled="${0}" .placeholder="${0}" clear-button-visible @change="${0}"> </vaadin-date-picker> </div> <vaadin-button .disabled="${0}" data-testid="submit" class="w-full mt-s sm-mt-0 sm-w-auto sm-ml-s" @click="${0}"> <x-i18n .lang="${0}" .key="ndmod.add_${0}" .ns="${0}"> </x-i18n> <iron-icon icon="icons:add" slot="suffix"></iron-icon> </vaadin-button> </div> ${0} </x-list> `),this.value,this.disabled||!this._isI18nReady,this.__handleListChange,this.value.map(((e,t)=>this._isI18nReady?c(ct||(ct=pt`<span slot="${0}" class="truncate">${0}</span>`),t,it(e,this.lang)):c(_t||(_t=pt`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this._t("ndmod.range_start").toString(),this.__startValue,e,this._isI18nReady?this._t("ndmod.select").toString():"",this.__handleStartValueChange,this.__startValue,this._t("ndmod.range_end").toString(),this.__endValue,e||!this.__startValue,this._isI18nReady?this._t("ndmod.select").toString():"",this.__handleEndValueChange,e||!this.__startValue,this.__submit,this.lang,this.__endValue?"range":"single",this.ns,this.value.length>0?c(gt||(gt=pt` <x-i18n .ns="${0}" .lang="${0}" key="ndmod.add_range_hint" class="${0}"> </x-i18n> `),this.ns,this.lang,q({"block text-xs mt-xs text-center sm-text-left":!0,"text-tertiary":this.value.length<20,"text-primary":this.value.length>=20})):"")}updated(){const e=this.constructor.getScopedTagName("vaadin-date-picker"),t=this.shadowRoot.querySelectorAll(e);Array.from(t).forEach((e=>e.validate()))}__handleStartValueChange(e){e.stopPropagation(),this.__startValue=e.target.value;const t=A(this.__endValue),s=A(this.__startValue);t&&t.getTime()<s.getTime()&&(this.__endValue=""),this.requestUpdate()}__handleEndValueChange(e){e.stopPropagation(),this.__endValue=e.target.value,this.requestUpdate()}__submit(){this.__startValue&&this.__endValue?this.value=[...this.value,[this.__startValue,this.__endValue].join("..")]:this.value=[...this.value,this.__startValue],this.__sendChange(),this.__startValue="",this.__endValue=""}__handleListChange(e){this.value=e.detail,this.__sendChange()}__sendChange(){this.dispatchEvent(new ht(this.value))}}class vt extends CustomEvent{constructor(e){super("change",{detail:e})}}let xt,yt,$t=e=>e;class ft extends m{constructor(){super("customer-portal-settings"),this.disabled=!1,this.type="min",this.__items=["none","custom"]}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"x-frequency-input":qe,"x-choice":$,"x-group":T,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:String},type:{type:String}})}render(){return c(xt||(xt=$t` <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="${0}"> </x-i18n> <x-choice data-testid="choice" .disabled="${0}" .value="${0}" .items="${0}" @change="${0}"> <x-i18n slot="none-label" .ns="${0}" .lang="${0}" key="ndmod.none"></x-i18n> <x-i18n slot="custom-label" .ns="${0}" .lang="${0}" key="ndmod.custom"></x-i18n> ${0} </x-choice> </x-group> `),this.ns,this.lang,`ndmod.${this.type}`,this.disabled,this.__choice,this.__items,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.__choice===this.__items[1]?c(yt||(yt=$t` <div slot="${0}" class="space-y-s"> <x-frequency-input data-testid="input" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-input> <p class="text-s text-tertiary leading-s">${0}</p> </div> `),this.__items[1],this.value,this.disabled,this.__handleNewValueChange,this.__hint):"")}get __choice(){return this.__items[this.value?1:0]}get __hint(){var e;if(!this._isI18nReady)return"";const{count:t,units:s}=M(null!==(e=this.value)&&void 0!==e?e:"");return this._t(`ndmod.${this.type}Hint`,{duration:this._t("duration",{count:t,units:this._t(null!=s?s:"",{count:t})})})}__handleNewValueChange(e){this.value=e.detail,this.__sendChange()}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?void 0:"1w",this.__sendChange()}__sendChange(){this.dispatchEvent(new vt(this.value))}}class bt extends CustomEvent{constructor(e){super("change",{detail:e})}}class wt extends CustomEvent{constructor(){super("remove")}}let kt,Et,Ct,St,Rt,It,jt,Vt,Mt,qt=e=>e;class Nt extends m{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value={jsonataQuery:"*"},this.open=!1}static get scopedElements(){return{"x-disallowed-dates":mt,"x-jsonata-input":Qe,"x-offset-input":ft,"x-allowed-days":dt,"iron-icon":customElements.get("iron-icon"),"x-warning":O,"x-group":T,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Object},open:{type:Boolean}})}render(){const{min:e,max:t,allowedDays:s,jsonataQuery:i,disallowedDates:a}=this.value,l=e||t,r=s&&s.days.length>0,o=a&&a.length>0,d=this.open?"":"rounded-b-l";return c(kt||(kt=qt` <x-group frame> <details data-testid="details" class="${0}" ?open="${0}" @toggle="${0}"> <summary class="${0} cursor-pointer relative leading-s rounded-t-l focus-outline-none focus-shadow-outline"> <div class="p-m mr-xl text-m text-header font-medium space-y-s"> <div> <x-i18n .ns="${0}" .lang="${0}" key="${0}"> ${0} </x-i18n> </div> ${0} </div> <button data-testid="remove" .disabled="${0}" class="flex items-center justify-center rounded absolute top-0 right-0 text-tertiary hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" style="width:54px;height:54px" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </summary> <article class="space-y-l"> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.match"> </x-i18n> <x-jsonata-input data-testid="jsonata" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-jsonata-input> </x-group> <div class="flex flex-col md-flex-row"> <div class="mb-l md-mb-0 md-w-1-2 md-border-r md-border-contrast-10"> <x-offset-input data-testid="min" type="min" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-offset-input> </div> <div class="md-w-1-2"> <x-offset-input data-testid="max" type="max" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-offset-input> </div> </div> ${0} <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.allowed"> </x-i18n> <x-allowed-days data-testid="allowed" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-allowed-days> </x-group> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.excluded"> </x-i18n> <x-disallowed-dates data-testid="disallowed" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-disallowed-dates> </x-group> </article> </details> </x-group> `),q({"font-lumo":!0,"pointer-events-none":!this._isI18nReady}),this.open,(()=>this.open=!this.open),d,this.ns,this.lang,`ndmod.${"*"===i?"all":"some"}Title`,"*"!==i?this.__renderJSONataSummary(i):"",l||r||o?c(Et||(Et=qt` <div> ${0} </div> `),R(l&&this.__renderMinMaxSummary(e,t),r&&this.__renderAllowedSummary(s),o&&this.__renderDisallowedSummary(a))):"",this.disabled||!this._isI18nReady,Ie((()=>this.dispatchEvent(new wt))),this.ns,this.lang,this.ns,this.lang,i,this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{jsonataQuery:e.detail}),this.__sendUpdate()}),this.lang,e,this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{min:e.detail}),this.__sendUpdate()}),this.lang,t,this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{max:e.detail}),this.__sendUpdate()}),-1===this.__compareDurations(e,t)?c(Ct||(Ct=qt` <x-warning class="mx-m" data-testid="warning"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.minWarning"> </x-i18n> </x-warning> `),this.ns,this.lang):"",this.ns,this.lang,this.lang,s,this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{allowedDays:e.detail}),this.__sendUpdate()}),this.ns,this.lang,this.ns,this.lang,null!=a?a:[],this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{disallowedDates:e.detail}),this.__sendUpdate()}))}__sendUpdate(){this.dispatchEvent(new bt(this.value))}__getEstimatedDaysFrom(e){const{count:t,units:s}=M(e);return t*{y:365,m:31,w:7,d:1}[s]}__compareDurations(e,t){return e===t?0:e&&t?this.__getEstimatedDaysFrom(e)<this.__getEstimatedDaysFrom(t)?1:-1:1}__renderJSONataSummary(e){return c(St||(St=qt` <code class="inline-block rounded bg-success-10 text-success px-xs text-xs leading-s"> ${0} </code> `),e)}__renderMinMaxContent(e){if(e){const{count:t,units:s}=e;return c(Rt||(Rt=qt` ${0} <x-i18n .ns="${0}" .lang="${0}" key="${0}" .opts="${0}"></x-i18n> `),t,this.ns,this.lang,s,{count:t})}return c(It||(It=qt`<x-i18n .ns="${0}" .lang="${0}" key="ndmod.any"></x-i18n>`),this.ns,this.lang)}__renderMinMaxSummary(e,t){return c(jt||(jt=qt` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.range"> <span>:</span> <span class="text-secondary"> ${0} &mdash; ${0} </span> </x-i18n> </div> `),this.ns,this.lang,this.__renderMinMaxContent(e?M(e):void 0),this.__renderMinMaxContent(t?M(t):void 0))}__renderAllowedSummary({type:e,days:t}){return c(Vt||(Vt=qt` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.allowed"> <span>:</span> <span class="text-secondary"> ${0} ${0} </span> </x-i18n> </div> `),this.ns,this.lang,"month"===e?t.join(", "):"","day"===e?t.map((e=>I(e,this.lang,"short"))).join(", "):"")}__renderDisallowedSummary(e){return c(Mt||(Mt=qt` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.excluded"> <span>:</span> <span class="text-secondary"> ${0} </span> </x-i18n> </div> `),this.ns,this.lang,e.map((e=>it(e,this.lang))).join("; "))}}class Tt extends CustomEvent{constructor(e){super("change",{detail:e})}}let Dt,At,Ot,Ft=e=>e;class Lt extends m{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=!1}static get scopedElements(){return{"x-next-date-modification-rule":Nt,"vaadin-button":customElements.get("vaadin-button"),"x-section":ge,"iron-icon":customElements.get("iron-icon"),"x-switch":xe,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Array}})}render(){const e=!this._isI18nReady||this.disabled||!this.value||Array.isArray(this.value)&&this.value.length>=10;return c(Dt||(Dt=Ft` <x-section> <x-switch slot="title" class="-my-xs" data-testid="toggle" .checked="${0}" .disabled="${0}" @change="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.title" class="text-l"></x-i18n> </x-switch> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.subtitle" slot="subtitle" class="mr-xl"> </x-i18n> ${0} <div class="mt-m sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="add" theme="primary" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.add"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="ndmod.add_hint" class="${0}"> </x-i18n> </div> </x-section> `),Boolean(this.value),this.disabled||!this._isI18nReady,this.__toggleValue,this.ns,this.lang,this.ns,this.lang,this.value?c(At||(At=Ft` ${0} `),this.__normalizedValue.map(((e,t,s)=>c(Ot||(Ot=Ft` <x-next-date-modification-rule data-testid="rule" .disabled="${0}" .value="${0}" .lang="${0}" @remove="${0}" @change="${0}"> </x-next-date-modification-rule> `),this.disabled||!this._isI18nReady,e,this.lang,(()=>{this.value=s.filter(((e,s)=>s!==t)),this.__sendChange()}),(e=>{this.value=s.map(((s,i)=>i===t?e.detail:s)),this.__sendChange()}))))):"",e,this.__addRule,this.ns,this.lang,this.lang,this.ns,q({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":Array.isArray(this.value)&&this.value.length<10,"text-primary":Array.isArray(this.value)&&this.value.length>=10,hidden:!Array.isArray(this.value)||0===this.value.length}))}get __normalizedValue(){return"boolean"==typeof this.value?[]:this.value}__addRule(){this.value=[...this.__normalizedValue,{jsonataQuery:"*"}],this.__sendChange()}__toggleValue(){this.value=!this.value,this.__sendChange()}__sendChange(){this.dispatchEvent(new Tt(this.value))}}class Ut extends K{}let Bt,Pt,zt,Qt=e=>e;class Jt extends m{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.__errorCode="invalid",this.__invalid=!1,this.__newValue=""}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-button":customElements.get("vaadin-button"),"x-skeleton":E,"iron-icon":customElements.get("iron-icon"),"x-group":T,"x-list":se,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},invalid:{type:Boolean},disabled:{type:Boolean}})}render(){return c(Bt||(Bt=Qt` <x-group frame> <x-list data-testid="list" .disabled="${0}" .value="${0}" @change="${0}"> ${0} <div class="flex flex-col sm-flex-row sm-items-start"> <vaadin-text-field data-testid="input" class="mb-s sm-mb-0 sm-mr-s" .placeholder="${0}" .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" @keypress="${0}" @change="${0}" @input="${0}"> </vaadin-text-field> <div class="sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="button" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="origins.add"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="origins.add_hint" class="${0}"> </x-i18n> </div> </div> </x-list> </x-group> `),this.disabled||!this._isI18nReady,this.value,this.__handleChange,this.value.map(((e,t)=>this._isI18nReady?c(Pt||(Pt=Qt` <div class="flex items-center" slot="${0}"> <img height="16" width="16" class="mr-m" src="https://www.google.com/s2/favicons?domain=${0}"> ${0} </div> `),t,e,e):c(zt||(zt=Qt`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this._isI18nReady?"https://foxy.io":"",this._t(`origins.${this.__errorCode}`).toString(),this.disabled||!this._isI18nReady,this.__invalid,this.__newValue,(e=>"Enter"===e.key&&this.__submit()),(e=>e.stopPropagation()),this.__handleInput,!this._isI18nReady||this.disabled||this.__invalid||this.value.length>=10,this.__submit,this.ns,this.lang,this.lang,this.ns,q({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":this.value.length<10,"text-primary":this.value.length>=10,hidden:0===this.value.length}))}__sendChange(){this.dispatchEvent(new Ut(this.value))}__handleInput(e){this.__newValue=e.target.value;try{const e=new URL(this.__newValue),t="https:"===e.protocol,s="localhost"===e.hostname;this.__invalid=!s&&!t,this.__errorCode="https_only"}catch(e){this.__invalid=this.__newValue.length>0,this.__errorCode="invalid"}this.requestUpdate()}__submit(){this.__newValue.length>0&&(this.value=[...this.value,new URL(this.__newValue).origin],this.__newValue="",this.__invalid=!1,this.__sendChange()),this.requestUpdate()}__handleChange(e){this.value=e.detail,this.__sendChange()}}class Ht extends CustomEvent{constructor(e){super("change",{detail:e})}}let Wt,Yt=e=>e;class Gt extends m{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=!1}static get scopedElements(){return{"x-section":ge,"x-switch":xe,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Array}})}render(){return c(Wt||(Wt=Yt` <x-section> <x-switch slot="title" class="-my-xs" data-testid="toggle" .checked="${0}" .disabled="${0}" @change="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="sso.title" class="text-l"></x-i18n> </x-switch> <x-i18n .ns="${0}" .lang="${0}" key="sso.subtitle" slot="subtitle" class="mr-xl"> </x-i18n> </x-section> `),Boolean(this.value),this.disabled||!this._isI18nReady,this.__toggleValue,this.ns,this.lang,this.ns,this.lang)}__toggleValue(){this.value=!this.value,this.__sendChange()}__sendChange(){this.dispatchEvent(new Ht(this.value))}}const Xt=f.assign({error:(e,t)=>t.data.type}),Kt=f.assign({oldResource:(e,t)=>t.data.resource,newResource:(e,t)=>t.data.resource,store:(e,t)=>t.data.store}),Zt=f.assign({oldResource:e=>e.newResource}),es=f.assign({invalid:[],newResource:({oldResource:e})=>e}),ts=f.assign({invalid:[],newResource:e=>({allowedOrigins:[],subscriptions:{allowFrequencyModification:[],allowNextDateModification:!1},jwtSharedSecret:X(72,(()=>Y(35).toString(36))).join(""),sessionLifespanInMinutes:40320,sso:!1,date_created:(new Date).toISOString(),date_modified:(new Date).toISOString(),_links:{"fx:store":e.store._links.self,curies:e.store._links.curies,self:e.store._links["fx:customer_portal_settings"]}})}),ss=f.assign({newResource:null}),is=f.assign({error:"setup_needed"}),as=f.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{allowedOrigins:s})}}),ns=f.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{subscriptions:n(n({},e.subscriptions),{},{allowFrequencyModification:s})})}}),ls=f.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{subscriptions:n(n({},e.subscriptions),{},{allowNextDateModification:s})})}}),rs=f.assign({invalid:(e,t)=>{const s="sessionLifespanInMinutes",i=t.invalid;return e.invalid.filter((e=>e!==s)).concat(...i?[s]:[])},newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{sessionLifespanInMinutes:s})}}),os=f.assign({invalid:(e,t)=>{const s="jwtSharedSecret",i=t.invalid;return e.invalid.filter((e=>e!==s)).concat(...i?[s]:[])},newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{jwtSharedSecret:s})}}),ds=f.assign({oldResource:null,newResource:null,store:null,error:null,href:(e,t)=>t.data}),hs=f.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{sso:s})}}),us={SET_SSO:{target:"#cps.idle",actions:"setSSO"},SET_SECRET:{target:"#cps.idle",actions:"setSecret"},SET_ORIGINS:{target:"#cps.idle",actions:"setOrigins"},SET_SESSION:{target:"#cps.idle",actions:"setSession"},SET_FREQUENCY_MODIFICATION:{target:"#cps.idle",actions:"setFrequencyModification"},SET_NEXT_DATE_MODIFICATION:{target:"#cps.idle",actions:"setNextDateModification"}},cs={initial:"unknown",states:{unknown:{always:[{target:"invalid",cond:"isInvalid"},{target:"valid"}]},invalid:{},valid:{}}},_s=l({id:"cps",initial:"unknown",context:{oldResource:null,newResource:null,invalid:[],store:null,error:null,href:null},states:{unknown:{always:[{target:"error",cond:"isSetupNeeded",actions:"requireSetup"},{target:"idle",cond:"isLoaded"},{target:"busy"}]},error:{on:{RELOAD:{target:"busy.loading"}}},busy:{initial:"loading",states:{loading:{invoke:{src:"load",onDone:{target:"#cps.idle.clean",actions:"handleLoadingSuccess"},onError:{target:"#cps.error",actions:"handleError"}}},saving:{invoke:{src:"save",onDone:{target:"#cps.idle.clean",actions:"handleSavingSuccess"},onError:{target:"#cps.error",actions:"handleError"}}}}},idle:{initial:"unknown",on:{DISABLE:{target:"#cps.idle",actions:"remove"},ENABLE:{target:"#cps.idle",actions:"create"},RESET:{target:"#cps.idle",actions:"reset"}},states:{unknown:{always:[{target:"clean",cond:"isClean"},{target:"dirty"}]},clean:{initial:"unknown",states:{unknown:{always:[{target:"enabled",cond:"isEnabled"},{target:"disabled"}]},enabled:{on:us},disabled:{}}},dirty:{on:{SAVE:"#cps.busy.saving"},initial:"unknown",states:{unknown:{always:[{target:"created",cond:"isCreated"},{target:"deleted",cond:"isDeleted"},{target:"updated"}]},created:n({on:us},cs),updated:n({on:us},cs),deleted:{}}}}}},on:{SET_HREF:{actions:"setHref",target:"unknown"}}},{guards:{isClean:e=>r(e.newResource,e.oldResource),isLoaded:e=>null!==e.store,isInvalid:e=>e.invalid.length>0,isEnabled:e=>null!==e.oldResource,isCreated:e=>null===e.oldResource&&null!==e.newResource,isDeleted:e=>null!==e.oldResource&&null===e.newResource,isSetupNeeded:e=>null===e.href},actions:{setFrequencyModification:ns,setNextDateModification:ls,setOrigins:as,setSession:rs,setSecret:os,setHref:ds,setSSO:hs,handleLoadingSuccess:Kt,handleSavingSuccess:Zt,handleError:Xt,create:ts,reset:es,remove:ss,requireSetup:is}});let gs,ps,ms,vs,xs=e=>e;function ys(e){if(!e.ok)throw new h(401===e.status?"unauthorized":"unknown")}class $s extends CustomEvent{constructor(){super("ready")}}class fs extends CustomEvent{constructor(){super("update")}}class bs extends m{constructor(){super("customer-portal-settings"),this.rel="customer_portal_settings",this.__machine=_s.withConfig({services:{load:()=>this.__load(),save:()=>this.__save()}}),this.__service=U(this.__machine).onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}static get scopedElements(){return{"iron-icon":customElements.get("iron-icon"),"vaadin-button":customElements.get("vaadin-button"),"x-frequency-modification":st,"x-next-date-modification":Lt,"x-session-duration":ke,"x-session-secret":Re,"x-loading-screen":le,"x-error-screen":d,"x-origins-list":Jt,"x-sso-switch":Gt,"x-skeleton":E,"x-section":ge,"x-switch":xe,"x-i18n":w,"x-page":he}}static get properties(){return n(n({},super.properties),{},{href:{type:String,noAccessor:!0}})}get href(){return this.__service.state.context.href}set href(e){this.__service.send({type:"SET_HREF",data:e})}render(){var e,t,s,i,a,l;if(this.__service.state.matches("error"))return c(gs||(gs=xs` <x-error-screen data-testid="error" lang="${0}" type="${0}" reload @reload="${0}"> </x-error-screen> `),this.lang,this.__service.state.context.error,this.__reload);const{newResource:r}=this.__service.state.context,o=this.__service.state.matches("idle.dirty.created"),d=this.__service.state.matches("idle.dirty.deleted"),h=this.__service.state.matches("idle.dirty.updated"),u=this.__service.state.matches("idle.clean.enabled"),_=this.__service.state.matches("idle.dirty.updated.invalid")||this.__service.state.matches("idle.dirty.created.invalid");return c(ps||(ps=xs` <x-page class="relative"> <x-switch slot="title" data-testid="switch" .disabled="${0}" .checked="${0}" @change="${0}"> <x-i18n key="title" class="text-xxl" .ns="${0}" .lang="${0}"> <sup class="text-tertiary"> <x-i18n key="beta" .ns="${0}" .lang="${0}"> </x-i18n> </sup> </x-i18n> </x-switch> <x-i18n class="block mr-xl" slot="subtitle" key="subtitle" .ns="${0}" .lang="${0}"> </x-i18n> <x-section> <x-i18n slot="title" key="origins.title" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="subtitle" key="origins.subtitle" .ns="${0}" .lang="${0}"></x-i18n> <x-origins-list data-testid="origins" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-origins-list> </x-section> <x-frequency-modification data-testid="fmod" .lang="${0}" .ns="${0}" .value="${0}" ?disabled="${0}" @change="${0}"> </x-frequency-modification> <x-next-date-modification data-testid="ndmod" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-next-date-modification> <x-sso-switch data-testid="sso" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-sso-switch> <x-section> <x-i18n slot="title" key="advanced.title" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="subtitle" key="advanced.subtitle" .ns="${0}" .lang="${0}"> </x-i18n> <x-session-duration data-testid="session" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @change="${0}"> </x-session-duration> <x-session-secret data-testid="secret" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @change="${0}"> </x-session-secret> </x-section> ${0} </x-page> `),!this.__service.state.matches("idle")||!this._isI18nReady,u||o||h,(e=>{this.__service.send(e.detail?"ENABLE":"DISABLE")}),this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.lang,this.ns,null!==(e=null==r?void 0:r.allowedOrigins)&&void 0!==e?e:[],!r,(e=>{this.__service.send({type:"SET_ORIGINS",value:e.detail})}),this.lang,this.ns,null!==(t=null==r?void 0:r.subscriptions.allowFrequencyModification)&&void 0!==t?t:[],!r,(e=>{this.__service.send({type:"SET_FREQUENCY_MODIFICATION",value:e.detail})}),this.lang,this.ns,null!==(s=null==r?void 0:r.subscriptions.allowNextDateModification)&&void 0!==s&&s,!r,(e=>{this.__service.send({type:"SET_NEXT_DATE_MODIFICATION",value:e.detail})}),this.lang,this.ns,null!==(i=null==r?void 0:r.sso)&&void 0!==i&&i,!r,(e=>{this.__service.send({type:"SET_SSO",value:e.detail})}),this.ns,this.lang,this.ns,this.lang,!r||!this._isI18nReady,null!==(a=null==r?void 0:r.sessionLifespanInMinutes)&&void 0!==a?a:1,this.lang,this.ns,(({detail:e})=>{this.__service.send(n({type:"SET_SESSION"},e))}),!r||!this._isI18nReady,null!==(l=null==r?void 0:r.jwtSharedSecret)&&void 0!==l?l:"",this.lang,this.ns,(({detail:e})=>{this.__service.send(n({type:"SET_SECRET"},e))}),this.__service.state.matches("idle.dirty")?c(ms||(ms=xs` <div class="sticky flex justify-between rounded-t-l rounded-b-l shadow-m -mx-s p-s bg-contrast" style="bottom:var(--lumo-space-m)"> <vaadin-button data-testid="save" theme="primary ${0}" .disabled="${0}" @click="${0}"> <x-i18n lang="${0}" ns="${0}" key="save_${0}"> </x-i18n> </vaadin-button> <vaadin-button style="--lumo-contrast:var(--lumo-base-color)" data-testid="reset" theme="contrast tertiary" @click="${0}"> <x-i18n lang="${0}" key="undo_all"></x-i18n> <iron-icon icon="lumo:reload" slot="suffix"></iron-icon> </vaadin-button> </div> `),d?"error":"success",_,(()=>this.__service.send("SAVE")),this.lang,this.ns,o?"create":d?"delete":"update",(()=>this.__service.send("RESET")),this.lang):this.__service.state.matches("busy")?c(vs||(vs=xs`<x-loading-screen data-testid="loading" class="mt-0"></x-loading-screen>`)):"")}async __reload(){this.__service.stop(),this.__service.onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}async __load(){if(null===this.href)throw new h("setup_needed");try{await this.updateComplete;const e=await $e.emit({source:this,init:[this.href]});let t,s;if(e.status.toString().startsWith("4")){t=null;const e=await $e.emit({source:this,init:["/"]});ys(e);const i=(await e.json())._links["fx:store"].href,a=await $e.emit({source:this,init:[i]});ys(a),s=await a.json()}else{ys(e),t=await e.json();const i=t._links["fx:store"].href,a=await $e.emit({source:this,init:[i]});ys(a),s=await a.json()}return{store:s,resource:t}}catch(e){if(e instanceof h)throw e;if(e instanceof ye)throw new h("setup_needed");throw new h("unknown")}finally{await this.updateComplete,this.dispatchEvent(new $s)}}async __save(){try{const e=this.__service.state.context,t=L(e.newResource),s=t?"PUT":"DELETE";t&&(delete t._links,delete t.date_created,delete t.date_modified);const i={method:s,body:t?JSON.stringify(t):void 0};ys(await $e.emit({source:this,init:[this.href,i]}))}catch(e){if(e instanceof h)throw e;if(e instanceof ye)throw new h("setup_needed");throw new h("unknown")}finally{await this.updateComplete,this.dispatchEvent(new fs)}}}customElements.define("foxy-customer-portal-settings",bs);export{bs as CustomerPortalSettings};
1
+ import{d as e,an as t,ag as s,ai as i,ao as a,_ as n,ap as l,aq as r}from"./shared-0dabe195.js";import"./shared-c97f7178.js";import{B as o}from"./shared-9bdd5400.js";import{E as d,F as h}from"./shared-5616a12f.js";import"./shared-4bd1efd7.js";import"./shared-a96a2154.js";import{L as u,h as c,c as _}from"./shared-7f33a83a.js";import{z as g,w as p,x as m,A as v}from"./shared-a88c5cf1.js";import{D as x,a as y,C as $,b as f}from"./shared-619bcf83.js";import"./shared-c758220c.js";import{a as b,I as w,D as k,S as E,M as C,W as S,c as R,t as I}from"./shared-19c9fe00.js";import"./shared-7680d300.js";import"./shared-0689b25a.js";import{I as j}from"./shared-13cc4ed4.js";import{C as V}from"./shared-db06114b.js";import"./shared-c541c9e9.js";import{p as M}from"./shared-46f3f71c.js";import"./shared-2fa6a5a0.js";import{c as q}from"./shared-4e709717.js";import"./shared-6dffe67d.js";import{P as N}from"./shared-ad0256d0.js";import{G as T}from"./shared-639dda4b.js";import{j as D}from"./shared-e640e9fa.js";import{p as A,W as O}from"./shared-e5786b8b.js";import{D as F}from"./shared-aa569a99.js";import{c as L}from"./shared-aa22ee61.js";import{i as U}from"./shared-8528906b.js";import"./shared-a7475f62.js";import"./shared-8134d8a7.js";import"./shared-763a6797.js";import"./shared-11c2efc8.js";import"./shared-bbbb8894.js";import"./shared-343d1fd7.js";import"./shared-1fd59009.js";import"./shared-d3bf9ac0.js";import"./shared-f4822b9e.js";import"./shared-6b0498b2.js";import"./shared-53532131.js";var B=1/0,P=17976931348623157e292;function z(e){return e?(e=g(e))===B||e===-B?(e<0?-1:1)*P:e==e?e:0:0===e?e:0}function Q(e){return e}var J=Math.floor,H=Math.random;var W=parseFloat,Y=Math.min,G=Math.random;function X(a,n,l){if(l&&"boolean"!=typeof l&&function(a,n,l){if(!e(l))return!1;var r=typeof n;return!!("number"==r?t(l)&&s(n,l.length):"string"==r&&n in l)&&i(l[n],a)}(a,n,l)&&(n=l=void 0),void 0===l&&("boolean"==typeof n?(l=n,n=void 0):"boolean"==typeof a&&(l=a,a=void 0)),void 0===a&&void 0===n?(a=0,n=1):(a=z(a),void 0===n?(n=a,a=0):n=z(n)),a>n){var r=a;a=n,n=r}if(l||a%1||n%1){var o=G();return Y(a+o*(n-a+W("1e-"+((o+"").length-1))),n)}return function(e,t){return e+J(H()*(t-e+1))}(a,n)}var K=4294967295,Z=Math.min;function ee(e,t){if(e=function(e){var t=z(e),s=t%1;return t==t?s?t-s:t:0}(e),e<1||e>9007199254740991)return[];var s,i=K,n=Z(e,K);e-=K;for(var l=a(n,t="function"==typeof(s=t)?s:Q);++i<e;)t(i);return l}class te extends CustomEvent{constructor(e){super("change",{detail:e})}}let se,ie,ae=e=>e;class ne extends u{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.getText=e=>e}static get properties(){return n(n({},super.properties),{},{value:{type:Array},disabled:{type:Boolean},getText:{type:Object}})}static get styles(){return p.styles}render(){return c(se||(se=ae` <div class="font-lumo text-m w-full"> <ul> ${0} </ul> <div class="p-m"> <slot></slot> </div> </div> `),this.value.map(((e,t)=>c(ie||(ie=ae` <li class="${0}"> <slot name="${0}">${0}</slot> <button ?disabled="${0}" class="w-l h-l rounded text-tertiary transition duration-150 hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </li> `),"ml-m h-l text-body flex justify-between items-center"+(t>0?" border-t border-contrast-10":""),t,this.getText(e),this.disabled,(()=>this.__remove(t))))))}__remove(e){this.value=this.value.filter(((t,s)=>s!==e)),this.dispatchEvent(new te(this.value))}}let le,re,oe=e=>e;class de extends u{static get styles(){return[p.styles,_(le||(le=oe`:host{position:absolute;top:0;right:0;bottom:0;left:0}.top-center{top:calc(50% - (var(--lumo-size-xl)/ 2))}@keyframes dash0{from{transform:translate(0,0)}to{transform:translate(5.681301px,3.368302px)}}@keyframes dash1{from{transform:translate(0,0)}to{transform:translate(5.677051px,3.457428px)}}@keyframes dash2{from{transform:translate(0,0)}to{transform:translate(5.686002px,3.127455px)}}@keyframes dash3{from{transform:translate(-5.6842px,-3.404556px)}to{transform:translate(0,0)}}`))]}render(){return c(re||(re=oe` <div class="h-full bg-base text-primary"> <svg xmlns="http://www.w3.org/2000/svg" class="fill-current w-xl h-xl mx-auto sticky top-center" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" viewBox="0 0 64 64"> <path id="ew5fy7afo2w2" fill-rule="evenodd" stroke="none" stroke-width="1" d="M41.93 49.46c0 .18-.2.3-.36.2l-1.78-1.07-22.73-13.76a1.5 1.5 0 01-.7-1.3V11.08c0-.18.2-.3.36-.2l1.75 1.04c.44.25.74.75.74 1.32v19.27c0 .08.05.16.12.2L41.22 46c.47.28.73.8.72 1.32v2.15z" clip-rule="evenodd"/> <path id="ew5fy7afo2w3" fill-rule="evenodd" stroke="none" stroke-width="1" d="M47.64 52.9c0 .2-.2.3-.36.21l-1.8-1.08c-.42-.26-.7-.74-.7-1.3v-19.3a.24.24 0 00-.12-.2L25.27 19.47a.24.24 0 00-.37.21v12.55c0 .19-.21.3-.37.2l-1.76-1.06a1.46 1.46 0 01-.71-1.28V16.7c0-.54.27-1.03.71-1.3.45-.27 1-.26 1.44 0l22.72 13.77c.44.26.7.76.7 1.3v20.27l.01 2.17z" clip-rule="evenodd"/> <g style="animation:dash0 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w4" fill-rule="evenodd" stroke="none" stroke-width="1" d="M30.59 35.68c0 .2-.21.3-.37.21l-1.8-1.1c-.41-.27-.68-.74-.68-1.28V27v-2.15c0-.2.2-.3.37-.21l1.78 1.06c.42.26.7.74.7 1.3v8.68z" clip-rule="evenodd"/> </g> <g style="animation:dash1 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w5" fill-rule="evenodd" stroke="none" stroke-width="1" d="M36.28 39.13c0 .2-.2.3-.37.21l-1.79-1.1c-.41-.25-.69-.73-.69-1.28v-6.51-2.16c0-.2.2-.31.37-.21l1.76 1.06c.44.26.73.75.73 1.3v8.69z" clip-rule="evenodd"/> </g> <g style="animation:dash2 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w6" fill-rule="evenodd" stroke="none" stroke-width="1" d="M41.96 42.57c0 .2-.2.3-.37.21L39.8 41.7a1.52 1.52 0 01-.71-1.3v-6.51-2.17c0-.2.2-.31.37-.21l1.74 1.06c.45.25.75.75.75 1.32v8.68z" clip-rule="evenodd"/> </g> <g transform="translate(-5.68 -3.4)" style="animation:dash3 .3s linear infinite normal forwards"> <path id="ew5fy7afo2w7" fill-rule="evenodd" stroke="none" stroke-width="1" d="M30.59 35.68c0 .2-.21.3-.37.21l-1.8-1.1c-.41-.27-.68-.74-.68-1.28V27v-2.15c0-.2.2-.3.37-.21l1.78 1.06c.42.26.7.74.7 1.3v8.68z" clip-rule="evenodd"/> </g> </svg> </div> `))}}let he,ue,ce=e=>e;class _e extends u{static get styles(){return[p.styles,_(he||(he=ce`::slotted(:not([slot])){margin-top:var(--lumo-space-xl)}`))]}render(){return c(ue||(ue=ce` <article class="relative antialiased font-lumo"> <header class="space-y-xs leading-s"> <h1 class="font-medium text-header text-xl border-b border-contrast-10 pb-s mb-s"> <slot name="title"></slot> </h1> <p class="text-l text-secondary"> <slot name="subtitle"></slot> </p> </header> <slot></slot> </article> `))}}let ge,pe,me=e=>e;class ve extends _e{static get styles(){return[super.styles,_(ge||(ge=me`::slotted(:not([slot])){margin-top:var(--lumo-space-m)}`))]}render(){return c(pe||(pe=me` <section class="leading-s antialiased font-lumo"> <header> <h2 class="text-header font-medium text-l"> <slot name="title"></slot> </h2> <p class="text-secondary text-m"> <slot name="subtitle"></slot> </p> </header> <slot></slot> </section> `))}}let xe,ye=e=>e;class $e extends CustomEvent{constructor(e){super("change",{detail:e})}}class fe extends u{constructor(){super(...arguments),this.disabled=!1,this.checked=!1}static get properties(){return n(n({},super.properties),{},{disabled:{attribute:!1},checked:{attribute:!1}})}static get styles(){return p.styles}render(){return c(xe||(xe=ye` <label class="${0}"> <span class="text-body font-medium text-m mr-m"> <slot></slot> </span> <span style="border-radius:var(--lumo-size-xl);width:calc((var(--lumo-space-l) * 2) + (var(--lumo-space-xs) * 2))" class="${0}"> <span style="width:var(--lumo-space-l);height:var(--lumo-space-l)" class="${0}"></span> <input type="checkbox" class="opacity-0 absolute inset-0" .checked="${0}" .disabled="${0}" @change="${0}"> </span> </label> `),q({"transition duration-200 flex justify-between items-center group":!0,"cursor-pointer":!this.disabled}),q({"transition duration-150 relative flex flex-shrink-0 items-center":!0,"bg-success focus-within-shadow-outline-success":!this.disabled&&this.checked,"bg-contrast-10 focus-within-shadow-outline":this.disabled||!this.checked,"bg-contrast-20":!this.disabled&&!this.checked}),q({"bg-tint transition duration-200 transform block rounded-full m-xs":!0,"translate-x-l":this.checked,"translate-x-0":!this.checked,"shadow-xs group-hover-shadow-s group-hover-scale-110":!this.disabled}),this.checked,this.disabled,(()=>{this.checked=!this.checked,this.dispatchEvent(new $e(this.checked))}))}}class be extends Error{constructor(){super("Unhandled request detected. Please add a request handler to connect this component to a backend.")}}class we extends CustomEvent{static emit(e){return new Promise(((t,s)=>{const i=new we(n({resolve:t,reject:s},e));e.source.dispatchEvent(i)&&s(new be)}))}constructor({source:e,resolve:t,reject:s,init:i}){var a;super("request",{cancelable:!0,composed:!0,bubbles:!0,detail:{source:e,handle:async function(e){a.stopImmediatePropagation(),a.preventDefault();try{t(await e(...i))}catch(e){s(e)}}}}),a=this}}let ke,Ee=e=>e;class Ce extends CustomEvent{constructor(e){super("change",{detail:e})}}class Se extends m{constructor(){super(...arguments),this.disabled=!1,this.value=1,this.__errorMessage=null,this.__customFieldI18n={formatValue:e=>{const t=parseInt(e[0]);if(isNaN(t))return"0";const s=e[1];return"w"===s?(10080*t).toFixed(0):"d"===s?(1440*t).toFixed(0):"h"===s?(60*t).toFixed(0):t.toFixed(0)},parseValue:e=>{const t=parseInt(e);return t%10080==0?[(t/10080).toFixed(0),"w"]:t%1440==0?[(t/1440).toFixed(0),"d"]:t%60==0?[(t/60).toFixed(0),"h"]:[t.toFixed(0),"m"]}},this.__renderer=this.__renderItems.bind(this)}static get scopedElements(){return{"vaadin-integer-field":j,"vaadin-custom-field":V,"vaadin-select":b,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{attribute:!1},value:{attribute:!1}})}render(){var e;return c(ke||(ke=Ee` <div class="text-xs text-tertiary font-lumo"> <vaadin-custom-field ?disabled="${0}" .label="${0}" .value="${0}" .i18n="${0}" data-testid="field" id="field" @change="${0}"> <vaadin-integer-field .disabled="${0}" .min="${0}" data-testid="count" has-controls> </vaadin-integer-field> <vaadin-select .disabled="${0}" .renderer="${0}" data-testid="units"> </vaadin-select> </vaadin-custom-field> <br> <x-i18n .lang="${0}" .ns="${0}" .key="${0}" data-testid="error" class="${0}"> </x-i18n> </div> `),this.disabled||!this._isI18nReady,this._isI18nReady?this._t("session.title").toString():"---",this._isI18nReady?this.value.toString():"",this.__customFieldI18n,this.__handleChange,this.disabled||!this._isI18nReady,1,this.disabled||!this._isI18nReady,this._isI18nReady?this.__renderer:null,this.lang,this.ns,this._t(`session.${null!==(e=this.__errorMessage)&&void 0!==e?e:"subtitle"}`).toString(),q({"text-error":null!==this.__errorMessage&&!this.disabled}))}firstUpdated(){this.shadowRoot.getElementById("field").value=this.value.toString()}updated(e){e.has("value")&&this.__reportValidity()}__renderItems(e){let t=e.querySelector("vaadin-list-box");null===t&&(t=document.createElement("vaadin-list-box"),e.appendChild(t));const s=["m","h","d","w"],i=["minute_plural","hour_plural","d_plural","w_plural"],a=t.querySelectorAll("vaadin-item");for(let e=0;e<Math.max(s.length,a.length);++e)if(s[e]){let n;a[e]?n=a[e]:(n=document.createElement("vaadin-item"),t.appendChild(n)),n.value=s[e],n.textContent=this._t(i[e])}else a[e].remove()}__handleChange(e){e.stopPropagation(),this.value=parseInt(e.target.value),this.dispatchEvent(new Ce({value:this.value,invalid:!this.__reportValidity()}))}__reportValidity(){return this.__errorMessage=this.value<1?"too_short":this.value>40320?"too_long":null,this.requestUpdate(),null===this.__errorMessage}}let Re,Ie=e=>e;class je extends CustomEvent{constructor(e){super("change",{detail:e})}}class Ve extends m{constructor(){super(...arguments),this.disabled=!1,this.value="",this.__errorMessage=""}static get scopedElements(){return{"vaadin-password-field":N,"vaadin-button":o,"iron-icon":customElements.get("iron-icon"),"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{attribute:!1},value:{attribute:!1}})}render(){const e=""!==this.__errorMessage&&!this.disabled,t=e?this._t(`jwt.${this.__errorMessage}`).toString():"";return c(Re||(Re=Ie` <div class="space-y-xs"> <div class="flex items-start"> <vaadin-password-field .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" .label="${0}" data-testid="input" class="w-full" @change="${0}" @input="${0}"> </vaadin-password-field> <vaadin-button class="flex-shrink-0 ml-s" style="margin-top:calc(var(--lumo-font-size-s) * 1.5)" theme="error" data-testid="button" .disabled="${0}" @click="${0}"> <x-i18n .lang="${0}" .ns="${0}" key="jwt.refresh"></x-i18n> <iron-icon icon="icons:refresh" slot="suffix"></iron-icon> </vaadin-button> </div> <x-i18n .lang="${0}" .ns="${0}" key="jwt.subtitle" class="text-xs text-tertiary font-lumo"> </x-i18n> </div> `),t,this.disabled||!this._isI18nReady,e,this._isI18nReady?this.value:"",this._isI18nReady?this._t("jwt.title").toString():"---",(e=>e.stopPropagation()),this.__handleInput,this.disabled||!this._isI18nReady,this.__regenerateValue,this.lang,this.ns,this.lang,this.ns)}updated(e){e.has("value")&&this.__reportValidity()}__regenerateValue(){this.__errorMessage="",this.value=ee(72,(()=>X(35).toString(36))).join(""),this.dispatchEvent(new je({value:this.value,invalid:!1}))}__handleInput(e){this.value=e.target.value,this.dispatchEvent(new je({value:this.value,invalid:!this.__reportValidity()}))}__reportValidity(){var e;return this.__errorMessage=0===this.value.length?"required":this.value.length<40?"too_short":this.value.length>100?"too_long":(e=this.value,/^[a-z0-9-]+$/i.test(e)?"":"invalid"),this.requestUpdate(),""===this.__errorMessage}}function Me(e){return t=>{t.preventDefault(),e(t)}}class qe extends x{}let Ne,Te=e=>e;class De extends m{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=De.defaultValue,this.__items=["y","m","w","d"]}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"vaadin-button":customElements.get("vaadin-button"),"x-dropdown":k}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:String}})}render(){return c(Ne||(Ne=Te` <div class="grid grid-cols-2 gap-s"> <vaadin-integer-field data-testid="value" class="w-full" min="1" has-controls .value="${0}" .disabled="${0}" @change="${0}"> </vaadin-integer-field> <x-dropdown data-testid="units" .disabled="${0}" .getText="${0}" .items="${0}" .value="${0}" @change="${0}"> </x-dropdown> </div> `),this._isI18nReady?this.__numericValue:"",this.disabled,this.__handleNumberChange,this.disabled,(e=>this._isI18nReady?this._t(`${e}_plural`):""),this.__items,this._isI18nReady?this.__unitsValue:"",this.__handleUnitsChange)}get __numericValue(){var e;return M(null!==(e=this.value)&&void 0!==e?e:"").count}get __unitsValue(){var e;return M(null!==(e=this.value)&&void 0!==e?e:"").units}__handleNumberChange(e){e.stopPropagation();const t=e.target.value;this.value=this.value.replace(String(this.__numericValue),t),this.__sendChange()}__handleUnitsChange(e){this.value=this.value.replace(String(this.__unitsValue),e.detail),this.__sendChange()}__sendChange(){this.dispatchEvent(new qe(this.value))}}De.defaultValue="1w";class Ae extends te{}let Oe,Fe,Le,Ue,Be=e=>e;class Pe extends m{constructor(){super("customer-portal-settings"),this.value=[],this.disabled=!1,this.__newValue=De.defaultValue}static get scopedElements(){return{"iron-icon":customElements.get("iron-icon"),"vaadin-button":customElements.get("vaadin-button"),"x-frequency-input":De,"x-skeleton":E,"x-list":ne,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const e=this.disabled||!this._isI18nReady||this.value.length>=20;return c(Oe||(Oe=Be` <x-list data-testid="list" .value="${0}" .disabled="${0}" @change="${0}"> ${0} <div class="w-full md-flex"> <x-frequency-input data-testid="input" class="mb-s md-mb-0 md-mr-s" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-input> <vaadin-button data-testid="button" class="w-full md-w-auto" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_option"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> </div> ${0} </x-list> `),this.value,this.disabled||!this._isI18nReady,this.__handleListChange,this.value.map(((e,t)=>this._isI18nReady?c(Fe||(Fe=Be`<span slot="${0}">${0}</span>`),t,this.__getText(e)):c(Le||(Le=Be`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this.lang,this.__newValue,e,this.__handleNewValueChange,e,this.__handleSubmit,this.ns,this.lang,this.value.length>0?c(Ue||(Ue=Be` <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_option_hint" class="${0}"> </x-i18n> `),this.ns,this.lang,q({"block text-xs mt-xs text-center md-text-left":!0,"text-tertiary":this.value.length<20,"text-primary":this.value.length>=20})):"")}__handleNewValueChange(e){this.__newValue=e.detail}__handleListChange(e){this.value=e.detail,this.__sendChange()}__handleSubmit(){this.value=[...this.value,this.__newValue],this.__newValue=De.defaultValue,this.__sendChange()}__sendChange(){this.dispatchEvent(new Ae(this.value))}__getText(e){const t=e[e.length-1],s=parseInt(e.replace(t,""));return this._t("duration",{count:s,units:this._t(t,{count:s})})}}class ze extends y{}let Qe,Je,He=e=>e;class We extends m{constructor(){super(...arguments),this.disabled=!1,this.value="*",this.__errorMessage="",this.__items=["all","some"],this.__handleNewValueChange=v((e=>{try{D(e).evaluate({}),this.value=e,this.__errorMessage="",this.__sendChange()}catch(e){this.__errorMessage=e.message}this.requestUpdate()}),275)}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"iron-icon":customElements.get("iron-icon"),"x-choice":$,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:String}})}render(){const e="pl-xs text-primary rounded font-medium cursor-pointer transition duration-200 focus-outline-none focus-shadow-outline hover-underline";return c(Qe||(Qe=He` <x-choice data-testid="choice" .disabled="${0}" .value="${0}" .items="${0}" @change="${0}"> <x-i18n slot="all-label" .ns="${0}" .lang="${0}" key="jsonata.all"></x-i18n> <x-i18n slot="some-label" .ns="${0}" .lang="${0}" key="jsonata.some"></x-i18n> ${0} </x-choice> `),this.disabled||!this._isI18nReady,this.__choice,this.__items,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.__choice===this.__items[1]?c(Je||(Je=He` <div slot="${0}" class="space-y-s pb-m"> <x-i18n .ns="${0}" .lang="${0}" key="jsonata.hint" class="block font-lumo text-s text-tertiary leading-s"> <a target="_blank" class="${0}" href="https://docs.jsonata.org" rel="noopener noreferrer"> JSONata <iron-icon icon="icons:open-in-new" class="icon-inline"></iron-icon> </a> <a target="_blank" class="${0}" href="https://api.foxycart.com/rels/subscription" rel="noopener noreferrer"> hAPI subscription <iron-icon icon="icons:open-in-new" class="icon-inline"></iron-icon> </a> </x-i18n> <vaadin-text-field class="w-full" data-testid="input" .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" @keydown="${0}" @change="${0}" @input="${0}"> </vaadin-text-field> </div> `),this.__items[1],this.ns,this.lang,e,e,this.__errorMessage,this.disabled||!this._isI18nReady,this.__errorMessage.length>0,this._isI18nReady?this.value:"",this.__stopNavigation,(e=>e.stopPropagation()),(e=>this.__handleNewValueChange(e.target.value))):"")}get __choice(){return this.__items["*"===this.value?0:1]}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?"*":'$contains(frequency, "w")',this.__sendChange()}__stopNavigation(e){e.key.startsWith("Arrow")&&e.stopPropagation()}__sendChange(){this.dispatchEvent(new ze(this.value))}}class Ye extends CustomEvent{constructor(e){super("change",{detail:e})}}class Ge extends CustomEvent{constructor(){super("remove")}}let Xe,Ke,Ze=e=>e;class et extends m{constructor(){super(...arguments),this.open=!1,this.value={jsonataQuery:"*",values:[]},this.disabled=!1}static get scopedElements(){return{"x-frequency-list":Pe,"x-jsonata-input":We,"iron-icon":customElements.get("iron-icon"),"x-group":T,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{open:{attribute:!1},value:{attribute:!1},disabled:{attribute:!1}})}render(){const{jsonataQuery:e,values:t}=this.value,s=this.open?"":"rounded-b-l";return c(Xe||(Xe=Ze` <x-group frame> <details data-testid="details" class="${0}" ?open="${0}" @toggle="${0}"> <summary class="${0} cursor-pointer relative leading-s rounded-t-l focus-outline-none focus-shadow-outline"> <div class="p-m space-y-xs mr-xl"> <x-i18n .ns="${0}" .lang="${0}" .key="${0}" class="block text-m text-header font-medium"> ${0} </x-i18n> <x-i18n .ns="${0}" .lang="${0}" class="block text-s text-tertiary" key="fmod.valuesLabel"> <x-i18n .ns="${0}" .key="${0}" .lang="${0}" .opts="${0}" class="text-secondary"> </x-i18n> </x-i18n> </div> <button data-testid="remove" .disabled="${0}" class="flex items-center justify-center rounded absolute top-0 right-0 text-tertiary hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" style="width:54px;height:54px" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </summary> <div class="space-y-l pt-m" slot="content"> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="fmod.match"></x-i18n> <x-jsonata-input data-testid="jsonata" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-jsonata-input> </x-group> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="fmod.options"> </x-i18n> <x-frequency-list data-testid="frequency" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-list> </x-group> </div> </details> </x-group> `),q({"font-lumo":!0,"pointer-events-none":!this._isI18nReady}),this.open,(()=>this.open=!this.open),s,this.ns,this.lang,`fmod.${"*"===e?"all":"some"}Title`,"*"!==e?this.__renderJSONataSummary(e):"",this.ns,this.lang,this.ns,"fmod.valuesList"+(0===t.length?"Empty":""),this.lang,{values:t.map((e=>this.__translateFrequency(e)))},this.disabled||!this._isI18nReady,Me((()=>{this.dispatchEvent(new Ge)})),this.ns,this.lang,this.ns,this.lang,this.value.jsonataQuery,this.disabled||!this._isI18nReady,this.__handleQueryChange,this.ns,this.lang,this.lang,this.value.values,this.disabled||!this._isI18nReady,this.__handleValuesChange)}__translateFrequency(e){if(".5m"===e)return this._t("frequency_0_5m");const{count:t,units:s}=M(e);return this._t("frequency",{units:this._t(s,{count:t}),count:t})}__renderJSONataSummary(e){return c(Ke||(Ke=Ze` <code class="inline-block rounded bg-success-10 text-success px-xs text-xs leading-s"> ${0} </code> `),e)}__handleQueryChange(e){this.value=n(n({},this.value),{},{jsonataQuery:e.detail}),this.__sendChange()}__handleValuesChange(e){this.value=n(n({},this.value),{},{values:e.detail}),this.__sendChange()}__sendChange(){this.dispatchEvent(new Ye(this.value))}}class tt extends CustomEvent{constructor(e){super("change",{detail:e})}}let st,it,at=e=>e;class nt extends m{constructor(){super(...arguments),this.value=[],this.disabled=!1}static get scopedElements(){return{"x-frequency-modification-rule":et,"vaadin-button":customElements.get("vaadin-button"),"x-section":ve,"iron-icon":customElements.get("iron-icon"),"x-group":T,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const{ns:e,lang:t}=this;return c(st||(st=at` <x-section> <x-i18n .ns="${0}" .lang="${0}" key="fmod.title" slot="title" class="text-l"></x-i18n> <x-i18n .ns="${0}" .lang="${0}" key="fmod.subtitle" slot="subtitle" class="mr-xl"></x-i18n> ${0} <div class="mt-m sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="add" theme="primary" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="fmod.add_rule"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="fmod.add_rule_hint" class="${0}"> </x-i18n> </div> </x-section> `),e,t,e,t,this.value.map(((e,t,s)=>c(it||(it=at` <x-frequency-modification-rule data-testid="rule" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @remove="${0}" @change="${0}"> </x-frequency-modification-rule> `),this.disabled,e,this.lang,this.ns,(()=>{this.value=s.filter(((e,s)=>s!==t)),this.__sendChange()}),(e=>{this.value=s.map(((s,i)=>i===t?e.detail:s)),this.__sendChange()})))),this.disabled||this.value.length>=10||!this._isI18nReady,this.__addRule,this.ns,this.lang,this.lang,this.ns,q({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":this.value.length<10,"text-primary":this.value.length>=10,hidden:0===this.value.length}))}__addRule(){this.value=[...this.value,{jsonataQuery:"*",values:[]}],this.__sendChange()}__sendChange(){this.dispatchEvent(new tt(this.value))}}function lt(e,t){const s=(new Date).getFullYear(),i={month:"long",day:"numeric"};return e.split("..").map((e=>{const a=A(e),l=(null==a?void 0:a.getFullYear())===s?void 0:"numeric";return null==a?void 0:a.toLocaleDateString(t,n({year:l},i))})).join(" – ")}class rt extends CustomEvent{constructor(e){super("change",{detail:e})}}let ot,dt,ht,ut=e=>e;class ct extends m{constructor(){super("customer-portal-settings"),this.disabled=!1,this.__items=["all","month","day"]}static get scopedElements(){return{"x-monthday-picker":C,"x-weekday-picker":S,"x-choice":$,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Object}})}render(){var e,t,s,i;return c(ot||(ot=ut` <x-choice data-testid="choice" .value="${0}" .items="${0}" .disabled="${0}" @change="${0}"> <x-i18n slot="all-label" key="ndmod.all" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="month-label" key="ndmod.month" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="day-label" key="ndmod.day" .ns="${0}" .lang="${0}"></x-i18n> ${0} </x-choice> `),null!==(t=null===(e=this.value)||void 0===e?void 0:e.type)&&void 0!==t?t:"all",this.__items,this.disabled,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,"month"===(null===(s=this.value)||void 0===s?void 0:s.type)?c(dt||(dt=ut` <x-monthday-picker slot="month" class="mb-m" data-testid="monthday-picker" .lang="${0}" .disabled="${0}" .value="${0}" @change="${0}"> </x-monthday-picker> `),this.lang,this.disabled||!this._isI18nReady,this.value.days,this.__handleNewValueChange):"day"===(null===(i=this.value)||void 0===i?void 0:i.type)?c(ht||(ht=ut` <x-weekday-picker slot="day" class="mb-m" data-testid="weekday-picker" .lang="${0}" .disabled="${0}" .value="${0}" @change="${0}"> </x-weekday-picker> `),this.lang,this.disabled||!this._isI18nReady,this.value.days,this.__handleNewValueChange):"")}__handleNewValueChange(e){this.value.days=e.detail,this.__sendChange()}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?void 0:e.detail===this.__items[1]?{type:"month",days:[]}:{type:"day",days:[]},this.__sendChange()}__sendChange(){this.dispatchEvent(new rt(this.value))}}class _t extends te{}let gt,pt,mt,vt,xt=e=>e;class yt extends m{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.__startValue="",this.__endValue=""}static get scopedElements(){return{"vaadin-date-picker":F,"vaadin-button":o,"x-skeleton":E,"iron-icon":customElements.get("iron-icon"),"x-i18n":w,"x-list":ne}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},disabled:{type:Boolean}})}render(){const e=this.value.length>=20||this.disabled||!this._isI18nReady;return c(gt||(gt=xt` <x-list data-testid="list" .value="${0}" .disabled="${0}" @change="${0}"> ${0} <div class="sm-flex sm-items-end"> <div class="grid grid-cols-2 gap-s"> <vaadin-date-picker data-testid="start" .label="${0}" .value="${0}" .disabled="${0}" .placeholder="${0}" @change="${0}"> </vaadin-date-picker> <vaadin-date-picker data-testid="end" .min="${0}" .label="${0}" .value="${0}" .disabled="${0}" .placeholder="${0}" clear-button-visible @change="${0}"> </vaadin-date-picker> </div> <vaadin-button .disabled="${0}" data-testid="submit" class="w-full mt-s sm-mt-0 sm-w-auto sm-ml-s" @click="${0}"> <x-i18n .lang="${0}" .key="ndmod.add_${0}" .ns="${0}"> </x-i18n> <iron-icon icon="icons:add" slot="suffix"></iron-icon> </vaadin-button> </div> ${0} </x-list> `),this.value,this.disabled||!this._isI18nReady,this.__handleListChange,this.value.map(((e,t)=>this._isI18nReady?c(pt||(pt=xt`<span slot="${0}" class="truncate">${0}</span>`),t,lt(e,this.lang)):c(mt||(mt=xt`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this._t("ndmod.range_start").toString(),this.__startValue,e,this._isI18nReady?this._t("ndmod.select").toString():"",this.__handleStartValueChange,this.__startValue,this._t("ndmod.range_end").toString(),this.__endValue,e||!this.__startValue,this._isI18nReady?this._t("ndmod.select").toString():"",this.__handleEndValueChange,e||!this.__startValue,this.__submit,this.lang,this.__endValue?"range":"single",this.ns,this.value.length>0?c(vt||(vt=xt` <x-i18n .ns="${0}" .lang="${0}" key="ndmod.add_range_hint" class="${0}"> </x-i18n> `),this.ns,this.lang,q({"block text-xs mt-xs text-center sm-text-left":!0,"text-tertiary":this.value.length<20,"text-primary":this.value.length>=20})):"")}updated(){const e=this.constructor.getScopedTagName("vaadin-date-picker"),t=this.shadowRoot.querySelectorAll(e);Array.from(t).forEach((e=>e.validate()))}__handleStartValueChange(e){e.stopPropagation(),this.__startValue=e.target.value;const t=A(this.__endValue),s=A(this.__startValue);t&&t.getTime()<s.getTime()&&(this.__endValue=""),this.requestUpdate()}__handleEndValueChange(e){e.stopPropagation(),this.__endValue=e.target.value,this.requestUpdate()}__submit(){this.__startValue&&this.__endValue?this.value=[...this.value,[this.__startValue,this.__endValue].join("..")]:this.value=[...this.value,this.__startValue],this.__sendChange(),this.__startValue="",this.__endValue=""}__handleListChange(e){this.value=e.detail,this.__sendChange()}__sendChange(){this.dispatchEvent(new _t(this.value))}}class $t extends CustomEvent{constructor(e){super("change",{detail:e})}}let ft,bt,wt=e=>e;class kt extends m{constructor(){super("customer-portal-settings"),this.disabled=!1,this.type="min",this.__items=["none","custom"]}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"x-frequency-input":De,"x-choice":$,"x-group":T,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:String},type:{type:String}})}render(){return c(ft||(ft=wt` <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="${0}"> </x-i18n> <x-choice data-testid="choice" .disabled="${0}" .value="${0}" .items="${0}" @change="${0}"> <x-i18n slot="none-label" .ns="${0}" .lang="${0}" key="ndmod.none"></x-i18n> <x-i18n slot="custom-label" .ns="${0}" .lang="${0}" key="ndmod.custom"></x-i18n> ${0} </x-choice> </x-group> `),this.ns,this.lang,`ndmod.${this.type}`,this.disabled,this.__choice,this.__items,this.__handleChoiceChange,this.ns,this.lang,this.ns,this.lang,this.__choice===this.__items[1]?c(bt||(bt=wt` <div slot="${0}" class="space-y-s"> <x-frequency-input data-testid="input" .value="${0}" .disabled="${0}" @change="${0}"> </x-frequency-input> <p class="text-s text-tertiary leading-s">${0}</p> </div> `),this.__items[1],this.value,this.disabled,this.__handleNewValueChange,this.__hint):"")}get __choice(){return this.__items[this.value?1:0]}get __hint(){var e;if(!this._isI18nReady)return"";const{count:t,units:s}=M(null!==(e=this.value)&&void 0!==e?e:"");return this._t(`ndmod.${this.type}Hint`,{duration:this._t("duration",{count:t,units:this._t(null!=s?s:"",{count:t})})})}__handleNewValueChange(e){this.value=e.detail,this.__sendChange()}__handleChoiceChange(e){this.value=e.detail===this.__items[0]?void 0:"1w",this.__sendChange()}__sendChange(){this.dispatchEvent(new $t(this.value))}}class Et extends CustomEvent{constructor(e){super("change",{detail:e})}}class Ct extends CustomEvent{constructor(){super("remove")}}let St,Rt,It,jt,Vt,Mt,qt,Nt,Tt,Dt=e=>e;class At extends m{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value={jsonataQuery:"*"},this.open=!1}static get scopedElements(){return{"x-disallowed-dates":yt,"x-jsonata-input":We,"x-offset-input":kt,"x-allowed-days":ct,"iron-icon":customElements.get("iron-icon"),"x-warning":O,"x-group":T,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Object},open:{type:Boolean}})}render(){const{min:e,max:t,allowedDays:s,jsonataQuery:i,disallowedDates:a}=this.value,l=e||t,r=s&&s.days.length>0,o=a&&a.length>0,d=this.open?"":"rounded-b-l";return c(St||(St=Dt` <x-group frame> <details data-testid="details" class="${0}" ?open="${0}" @toggle="${0}"> <summary class="${0} cursor-pointer relative leading-s rounded-t-l focus-outline-none focus-shadow-outline"> <div class="p-m mr-xl text-m text-header font-medium space-y-s"> <div> <x-i18n .ns="${0}" .lang="${0}" key="${0}"> ${0} </x-i18n> </div> ${0} </div> <button data-testid="remove" .disabled="${0}" class="flex items-center justify-center rounded absolute top-0 right-0 text-tertiary hover-text-secondary disabled-text-tertiary disabled-opacity-50 disabled-cursor-default focus-outline-none focus-shadow-outline" style="width:54px;height:54px" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> </summary> <article class="space-y-l"> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.match"> </x-i18n> <x-jsonata-input data-testid="jsonata" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-jsonata-input> </x-group> <div class="flex flex-col md-flex-row"> <div class="mb-l md-mb-0 md-w-1-2 md-border-r md-border-contrast-10"> <x-offset-input data-testid="min" type="min" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-offset-input> </div> <div class="md-w-1-2"> <x-offset-input data-testid="max" type="max" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-offset-input> </div> </div> ${0} <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.allowed"> </x-i18n> <x-allowed-days data-testid="allowed" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-allowed-days> </x-group> <x-group> <x-i18n slot="header" .ns="${0}" .lang="${0}" key="ndmod.excluded"> </x-i18n> <x-disallowed-dates data-testid="disallowed" .ns="${0}" .lang="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-disallowed-dates> </x-group> </article> </details> </x-group> `),q({"font-lumo":!0,"pointer-events-none":!this._isI18nReady}),this.open,(()=>this.open=!this.open),d,this.ns,this.lang,`ndmod.${"*"===i?"all":"some"}Title`,"*"!==i?this.__renderJSONataSummary(i):"",l||r||o?c(Rt||(Rt=Dt` <div> ${0} </div> `),R(l&&this.__renderMinMaxSummary(e,t),r&&this.__renderAllowedSummary(s),o&&this.__renderDisallowedSummary(a))):"",this.disabled||!this._isI18nReady,Me((()=>this.dispatchEvent(new Ct))),this.ns,this.lang,this.ns,this.lang,i,this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{jsonataQuery:e.detail}),this.__sendUpdate()}),this.lang,e,this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{min:e.detail}),this.__sendUpdate()}),this.lang,t,this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{max:e.detail}),this.__sendUpdate()}),-1===this.__compareDurations(e,t)?c(It||(It=Dt` <x-warning class="mx-m" data-testid="warning"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.minWarning"> </x-i18n> </x-warning> `),this.ns,this.lang):"",this.ns,this.lang,this.lang,s,this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{allowedDays:e.detail}),this.__sendUpdate()}),this.ns,this.lang,this.ns,this.lang,null!=a?a:[],this.disabled||!this._isI18nReady,(e=>{this.value=n(n({},this.value),{},{disallowedDates:e.detail}),this.__sendUpdate()}))}__sendUpdate(){this.dispatchEvent(new Et(this.value))}__getEstimatedDaysFrom(e){const{count:t,units:s}=M(e);return t*{y:365,m:31,w:7,d:1}[s]}__compareDurations(e,t){return e===t?0:e&&t?this.__getEstimatedDaysFrom(e)<this.__getEstimatedDaysFrom(t)?1:-1:1}__renderJSONataSummary(e){return c(jt||(jt=Dt` <code class="inline-block rounded bg-success-10 text-success px-xs text-xs leading-s"> ${0} </code> `),e)}__renderMinMaxContent(e){if(e){const{count:t,units:s}=e;return c(Vt||(Vt=Dt` ${0} <x-i18n .ns="${0}" .lang="${0}" key="${0}" .opts="${0}"></x-i18n> `),t,this.ns,this.lang,s,{count:t})}return c(Mt||(Mt=Dt`<x-i18n .ns="${0}" .lang="${0}" key="ndmod.any"></x-i18n>`),this.ns,this.lang)}__renderMinMaxSummary(e,t){return c(qt||(qt=Dt` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.range"> <span>:</span> <span class="text-secondary"> ${0} &mdash; ${0} </span> </x-i18n> </div> `),this.ns,this.lang,this.__renderMinMaxContent(e?M(e):void 0),this.__renderMinMaxContent(t?M(t):void 0))}__renderAllowedSummary({type:e,days:t}){return c(Nt||(Nt=Dt` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.allowed"> <span>:</span> <span class="text-secondary"> ${0} ${0} </span> </x-i18n> </div> `),this.ns,this.lang,"month"===e?t.join(", "):"","day"===e?t.map((e=>I(e,this.lang,"short"))).join(", "):"")}__renderDisallowedSummary(e){return c(Tt||(Tt=Dt` <div class="text-s text-tertiary font-normal"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.excluded"> <span>:</span> <span class="text-secondary"> ${0} </span> </x-i18n> </div> `),this.ns,this.lang,e.map((e=>lt(e,this.lang))).join("; "))}}class Ot extends CustomEvent{constructor(e){super("change",{detail:e})}}let Ft,Lt,Ut,Bt=e=>e;class Pt extends m{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=!1}static get scopedElements(){return{"x-next-date-modification-rule":At,"vaadin-button":customElements.get("vaadin-button"),"x-section":ve,"iron-icon":customElements.get("iron-icon"),"x-switch":fe,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Array}})}render(){const e=!this._isI18nReady||this.disabled||!this.value||Array.isArray(this.value)&&this.value.length>=10;return c(Ft||(Ft=Bt` <x-section> <x-switch slot="title" class="-my-xs" data-testid="toggle" .checked="${0}" .disabled="${0}" @change="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.title" class="text-l"></x-i18n> </x-switch> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.subtitle" slot="subtitle" class="mr-xl"> </x-i18n> ${0} <div class="mt-m sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="add" theme="primary" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="ndmod.add"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="ndmod.add_hint" class="${0}"> </x-i18n> </div> </x-section> `),Boolean(this.value),this.disabled||!this._isI18nReady,this.__toggleValue,this.ns,this.lang,this.ns,this.lang,this.value?c(Lt||(Lt=Bt` ${0} `),this.__normalizedValue.map(((e,t,s)=>c(Ut||(Ut=Bt` <x-next-date-modification-rule data-testid="rule" .disabled="${0}" .value="${0}" .lang="${0}" @remove="${0}" @change="${0}"> </x-next-date-modification-rule> `),this.disabled||!this._isI18nReady,e,this.lang,(()=>{this.value=s.filter(((e,s)=>s!==t)),this.__sendChange()}),(e=>{this.value=s.map(((s,i)=>i===t?e.detail:s)),this.__sendChange()}))))):"",e,this.__addRule,this.ns,this.lang,this.lang,this.ns,q({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":Array.isArray(this.value)&&this.value.length<10,"text-primary":Array.isArray(this.value)&&this.value.length>=10,hidden:!Array.isArray(this.value)||0===this.value.length}))}get __normalizedValue(){return"boolean"==typeof this.value?[]:this.value}__addRule(){this.value=[...this.__normalizedValue,{jsonataQuery:"*"}],this.__sendChange()}__toggleValue(){this.value=!this.value,this.__sendChange()}__sendChange(){this.dispatchEvent(new Ot(this.value))}}class zt extends te{}let Qt,Jt,Ht,Wt=e=>e;class Yt extends m{constructor(){super(...arguments),this.value=[],this.disabled=!1,this.__errorCode="invalid",this.__invalid=!1,this.__newValue=""}static get scopedElements(){return{"vaadin-text-field":customElements.get("vaadin-text-field"),"vaadin-button":customElements.get("vaadin-button"),"x-skeleton":E,"iron-icon":customElements.get("iron-icon"),"x-group":T,"x-list":ne,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{value:{type:Array},invalid:{type:Boolean},disabled:{type:Boolean}})}render(){return c(Qt||(Qt=Wt` <x-group frame> <x-list data-testid="list" .disabled="${0}" .value="${0}" @change="${0}"> ${0} <div class="flex flex-col sm-flex-row sm-items-start"> <vaadin-text-field data-testid="input" class="mb-s sm-mb-0 sm-mr-s" .placeholder="${0}" .errorMessage="${0}" .disabled="${0}" .invalid="${0}" .value="${0}" @keypress="${0}" @change="${0}" @input="${0}"> </vaadin-text-field> <div class="sm-flex sm-items-center"> <vaadin-button class="w-full sm-w-auto" data-testid="button" .disabled="${0}" @click="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="origins.add"></x-i18n> <iron-icon icon="lumo:plus" slot="suffix"></iron-icon> </vaadin-button> <x-i18n .lang="${0}" .ns="${0}" key="origins.add_hint" class="${0}"> </x-i18n> </div> </div> </x-list> </x-group> `),this.disabled||!this._isI18nReady,this.value,this.__handleChange,this.value.map(((e,t)=>this._isI18nReady?c(Jt||(Jt=Wt` <div class="flex items-center" slot="${0}"> <img height="16" width="16" class="mr-m" src="https://www.google.com/s2/favicons?domain=${0}"> ${0} </div> `),t,e,e):c(Ht||(Ht=Wt`<x-skeleton slot="${0}">${0}</x-skeleton>`),t,e))),this._isI18nReady?"https://foxy.io":"",this._t(`origins.${this.__errorCode}`).toString(),this.disabled||!this._isI18nReady,this.__invalid,this.__newValue,(e=>"Enter"===e.key&&this.__submit()),(e=>e.stopPropagation()),this.__handleInput,!this._isI18nReady||this.disabled||this.__invalid||this.value.length>=10,this.__submit,this.ns,this.lang,this.lang,this.ns,q({"text-xs text-center block font-lumo mt-xs transition duration-200 sm-mt-0 sm-ml-m":!0,"text-tertiary":this.value.length<10,"text-primary":this.value.length>=10,hidden:0===this.value.length}))}__sendChange(){this.dispatchEvent(new zt(this.value))}__handleInput(e){this.__newValue=e.target.value;try{const e=new URL(this.__newValue),t="https:"===e.protocol,s="localhost"===e.hostname;this.__invalid=!s&&!t,this.__errorCode="https_only"}catch(e){this.__invalid=this.__newValue.length>0,this.__errorCode="invalid"}this.requestUpdate()}__submit(){this.__newValue.length>0&&(this.value=[...this.value,new URL(this.__newValue).origin],this.__newValue="",this.__invalid=!1,this.__sendChange()),this.requestUpdate()}__handleChange(e){this.value=e.detail,this.__sendChange()}}class Gt extends CustomEvent{constructor(e){super("change",{detail:e})}}let Xt,Kt=e=>e;class Zt extends m{constructor(){super("customer-portal-settings"),this.disabled=!1,this.value=!1}static get scopedElements(){return{"x-section":ve,"x-switch":fe,"x-i18n":w}}static get properties(){return n(n({},super.properties),{},{disabled:{type:Boolean},value:{type:Array}})}render(){return c(Xt||(Xt=Kt` <x-section> <x-switch slot="title" class="-my-xs" data-testid="toggle" .checked="${0}" .disabled="${0}" @change="${0}"> <x-i18n .ns="${0}" .lang="${0}" key="sso.title" class="text-l"></x-i18n> </x-switch> <x-i18n .ns="${0}" .lang="${0}" key="sso.subtitle" slot="subtitle" class="mr-xl"> </x-i18n> </x-section> `),Boolean(this.value),this.disabled||!this._isI18nReady,this.__toggleValue,this.ns,this.lang,this.ns,this.lang)}__toggleValue(){this.value=!this.value,this.__sendChange()}__sendChange(){this.dispatchEvent(new Gt(this.value))}}const es=f.assign({error:(e,t)=>t.data.type}),ts=f.assign({oldResource:(e,t)=>t.data.resource,newResource:(e,t)=>t.data.resource,store:(e,t)=>t.data.store}),ss=f.assign({oldResource:e=>e.newResource}),is=f.assign({invalid:[],newResource:({oldResource:e})=>e}),as=f.assign({invalid:[],newResource:e=>({allowedOrigins:[],subscriptions:{allowFrequencyModification:[],allowNextDateModification:!1},jwtSharedSecret:ee(72,(()=>X(35).toString(36))).join(""),sessionLifespanInMinutes:40320,sso:!1,date_created:(new Date).toISOString(),date_modified:(new Date).toISOString(),_links:{"fx:store":e.store._links.self,curies:e.store._links.curies,self:e.store._links["fx:customer_portal_settings"]}})}),ns=f.assign({newResource:null}),ls=f.assign({error:"setup_needed"}),rs=f.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{allowedOrigins:s})}}),os=f.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{subscriptions:n(n({},e.subscriptions),{},{allowFrequencyModification:s})})}}),ds=f.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{subscriptions:n(n({},e.subscriptions),{},{allowNextDateModification:s})})}}),hs=f.assign({invalid:(e,t)=>{const s="sessionLifespanInMinutes",i=t.invalid;return e.invalid.filter((e=>e!==s)).concat(...i?[s]:[])},newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{sessionLifespanInMinutes:s})}}),us=f.assign({invalid:(e,t)=>{const s="jwtSharedSecret",i=t.invalid;return e.invalid.filter((e=>e!==s)).concat(...i?[s]:[])},newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{jwtSharedSecret:s})}}),cs=f.assign({oldResource:null,newResource:null,store:null,error:null,href:(e,t)=>t.data}),_s=f.assign({newResource:({newResource:e},t)=>{const s=t.value;return n(n({},e),{},{sso:s})}}),gs={SET_SSO:{target:"#cps.idle",actions:"setSSO"},SET_SECRET:{target:"#cps.idle",actions:"setSecret"},SET_ORIGINS:{target:"#cps.idle",actions:"setOrigins"},SET_SESSION:{target:"#cps.idle",actions:"setSession"},SET_FREQUENCY_MODIFICATION:{target:"#cps.idle",actions:"setFrequencyModification"},SET_NEXT_DATE_MODIFICATION:{target:"#cps.idle",actions:"setNextDateModification"}},ps={initial:"unknown",states:{unknown:{always:[{target:"invalid",cond:"isInvalid"},{target:"valid"}]},invalid:{},valid:{}}},ms=l({id:"cps",initial:"unknown",context:{oldResource:null,newResource:null,invalid:[],store:null,error:null,href:null},states:{unknown:{always:[{target:"error",cond:"isSetupNeeded",actions:"requireSetup"},{target:"idle",cond:"isLoaded"},{target:"busy"}]},error:{on:{RELOAD:{target:"busy.loading"}}},busy:{initial:"loading",states:{loading:{invoke:{src:"load",onDone:{target:"#cps.idle.clean",actions:"handleLoadingSuccess"},onError:{target:"#cps.error",actions:"handleError"}}},saving:{invoke:{src:"save",onDone:{target:"#cps.idle.clean",actions:"handleSavingSuccess"},onError:{target:"#cps.error",actions:"handleError"}}}}},idle:{initial:"unknown",on:{DISABLE:{target:"#cps.idle",actions:"remove"},ENABLE:{target:"#cps.idle",actions:"create"},RESET:{target:"#cps.idle",actions:"reset"}},states:{unknown:{always:[{target:"clean",cond:"isClean"},{target:"dirty"}]},clean:{initial:"unknown",states:{unknown:{always:[{target:"enabled",cond:"isEnabled"},{target:"disabled"}]},enabled:{on:gs},disabled:{}}},dirty:{on:{SAVE:"#cps.busy.saving"},initial:"unknown",states:{unknown:{always:[{target:"created",cond:"isCreated"},{target:"deleted",cond:"isDeleted"},{target:"updated"}]},created:n({on:gs},ps),updated:n({on:gs},ps),deleted:{}}}}}},on:{SET_HREF:{actions:"setHref",target:"unknown"}}},{guards:{isClean:e=>r(e.newResource,e.oldResource),isLoaded:e=>null!==e.store,isInvalid:e=>e.invalid.length>0,isEnabled:e=>null!==e.oldResource,isCreated:e=>null===e.oldResource&&null!==e.newResource,isDeleted:e=>null!==e.oldResource&&null===e.newResource,isSetupNeeded:e=>null===e.href},actions:{setFrequencyModification:os,setNextDateModification:ds,setOrigins:rs,setSession:hs,setSecret:us,setHref:cs,setSSO:_s,handleLoadingSuccess:ts,handleSavingSuccess:ss,handleError:es,create:as,reset:is,remove:ns,requireSetup:ls}});let vs,xs,ys,$s,fs=e=>e;function bs(e){if(!e.ok)throw new h(401===e.status?"unauthorized":"unknown")}class ws extends CustomEvent{constructor(){super("ready")}}class ks extends CustomEvent{constructor(){super("update")}}class Es extends m{constructor(){super("customer-portal-settings"),this.rel="customer_portal_settings",this.__machine=ms.withConfig({services:{load:()=>this.__load(),save:()=>this.__save()}}),this.__service=U(this.__machine).onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}static get scopedElements(){return{"iron-icon":customElements.get("iron-icon"),"vaadin-button":customElements.get("vaadin-button"),"x-frequency-modification":nt,"x-next-date-modification":Pt,"x-session-duration":Se,"x-session-secret":Ve,"x-loading-screen":de,"x-error-screen":d,"x-origins-list":Yt,"x-sso-switch":Zt,"x-skeleton":E,"x-section":ve,"x-switch":fe,"x-i18n":w,"x-page":_e}}static get properties(){return n(n({},super.properties),{},{href:{type:String,noAccessor:!0}})}get href(){return this.__service.state.context.href}set href(e){this.__service.send({type:"SET_HREF",data:e})}render(){var e,t,s,i,a,l;if(this.__service.state.matches("error"))return c(vs||(vs=fs` <x-error-screen data-testid="error" lang="${0}" type="${0}" reload @reload="${0}"> </x-error-screen> `),this.lang,this.__service.state.context.error,this.__reload);const{newResource:r}=this.__service.state.context,o=this.__service.state.matches("idle.dirty.created"),d=this.__service.state.matches("idle.dirty.deleted"),h=this.__service.state.matches("idle.dirty.updated"),u=this.__service.state.matches("idle.clean.enabled"),_=this.__service.state.matches("idle.dirty.updated.invalid")||this.__service.state.matches("idle.dirty.created.invalid");return c(xs||(xs=fs` <x-page class="relative"> <x-switch slot="title" data-testid="switch" .disabled="${0}" .checked="${0}" @change="${0}"> <x-i18n key="title" class="text-xxl" .ns="${0}" .lang="${0}"> <sup class="text-tertiary"> <x-i18n key="beta" .ns="${0}" .lang="${0}"> </x-i18n> </sup> </x-i18n> </x-switch> <x-i18n class="block mr-xl" slot="subtitle" key="subtitle" .ns="${0}" .lang="${0}"> </x-i18n> <x-section> <x-i18n slot="title" key="origins.title" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="subtitle" key="origins.subtitle" .ns="${0}" .lang="${0}"></x-i18n> <x-origins-list data-testid="origins" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-origins-list> </x-section> <x-frequency-modification data-testid="fmod" .lang="${0}" .ns="${0}" .value="${0}" ?disabled="${0}" @change="${0}"> </x-frequency-modification> <x-next-date-modification data-testid="ndmod" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-next-date-modification> <x-sso-switch data-testid="sso" .lang="${0}" .ns="${0}" .value="${0}" .disabled="${0}" @change="${0}"> </x-sso-switch> <x-section> <x-i18n slot="title" key="advanced.title" .ns="${0}" .lang="${0}"></x-i18n> <x-i18n slot="subtitle" key="advanced.subtitle" .ns="${0}" .lang="${0}"> </x-i18n> <x-session-duration data-testid="session" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @change="${0}"> </x-session-duration> <x-session-secret data-testid="secret" .disabled="${0}" .value="${0}" .lang="${0}" .ns="${0}" @change="${0}"> </x-session-secret> </x-section> ${0} </x-page> `),!this.__service.state.matches("idle")||!this._isI18nReady,u||o||h,(e=>{this.__service.send(e.detail?"ENABLE":"DISABLE")}),this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.ns,this.lang,this.lang,this.ns,null!==(e=null==r?void 0:r.allowedOrigins)&&void 0!==e?e:[],!r,(e=>{this.__service.send({type:"SET_ORIGINS",value:e.detail})}),this.lang,this.ns,null!==(t=null==r?void 0:r.subscriptions.allowFrequencyModification)&&void 0!==t?t:[],!r,(e=>{this.__service.send({type:"SET_FREQUENCY_MODIFICATION",value:e.detail})}),this.lang,this.ns,null!==(s=null==r?void 0:r.subscriptions.allowNextDateModification)&&void 0!==s&&s,!r,(e=>{this.__service.send({type:"SET_NEXT_DATE_MODIFICATION",value:e.detail})}),this.lang,this.ns,null!==(i=null==r?void 0:r.sso)&&void 0!==i&&i,!r,(e=>{this.__service.send({type:"SET_SSO",value:e.detail})}),this.ns,this.lang,this.ns,this.lang,!r||!this._isI18nReady,null!==(a=null==r?void 0:r.sessionLifespanInMinutes)&&void 0!==a?a:1,this.lang,this.ns,(({detail:e})=>{this.__service.send(n({type:"SET_SESSION"},e))}),!r||!this._isI18nReady,null!==(l=null==r?void 0:r.jwtSharedSecret)&&void 0!==l?l:"",this.lang,this.ns,(({detail:e})=>{this.__service.send(n({type:"SET_SECRET"},e))}),this.__service.state.matches("idle.dirty")?c(ys||(ys=fs` <div class="sticky flex justify-between rounded-t-l rounded-b-l shadow-m -mx-s p-s bg-contrast" style="bottom:var(--lumo-space-m)"> <vaadin-button data-testid="save" theme="primary ${0}" .disabled="${0}" @click="${0}"> <x-i18n lang="${0}" ns="${0}" key="save_${0}"> </x-i18n> </vaadin-button> <vaadin-button style="--lumo-contrast:var(--lumo-base-color)" data-testid="reset" theme="contrast tertiary" @click="${0}"> <x-i18n lang="${0}" key="undo_all"></x-i18n> <iron-icon icon="lumo:reload" slot="suffix"></iron-icon> </vaadin-button> </div> `),d?"error":"success",_,(()=>this.__service.send("SAVE")),this.lang,this.ns,o?"create":d?"delete":"update",(()=>this.__service.send("RESET")),this.lang):this.__service.state.matches("busy")?c($s||($s=fs`<x-loading-screen data-testid="loading" class="mt-0"></x-loading-screen>`)):"")}async __reload(){this.__service.stop(),this.__service.onTransition((({changed:e})=>e&&this.requestUpdate())).onChange((()=>this.requestUpdate())).start()}async __load(){if(null===this.href)throw new h("setup_needed");try{await this.updateComplete;const e=await we.emit({source:this,init:[this.href]});let t,s;if(e.status.toString().startsWith("4")){t=null;const e=await we.emit({source:this,init:["/"]});bs(e);const i=(await e.json())._links["fx:store"].href,a=await we.emit({source:this,init:[i]});bs(a),s=await a.json()}else{bs(e),t=await e.json();const i=t._links["fx:store"].href,a=await we.emit({source:this,init:[i]});bs(a),s=await a.json()}return{store:s,resource:t}}catch(e){if(e instanceof h)throw e;if(e instanceof be)throw new h("setup_needed");throw new h("unknown")}finally{await this.updateComplete,this.dispatchEvent(new ws)}}async __save(){try{const e=this.__service.state.context,t=L(e.newResource),s=t?"PUT":"DELETE";t&&(delete t._links,delete t.date_created,delete t.date_modified);const i={method:s,body:t?JSON.stringify(t):void 0};bs(await we.emit({source:this,init:[this.href,i]}))}catch(e){if(e instanceof h)throw e;if(e instanceof be)throw new h("setup_needed");throw new h("unknown")}finally{await this.updateComplete,this.dispatchEvent(new ks)}}}customElements.define("foxy-customer-portal-settings",Es);export{Es as CustomerPortalSettings};
@@ -1,4 +1,4 @@
1
- import"./foxy-customer.js";import"./shared-e6997950.js";import"./shared-c6c6ba69.js";import"./shared-4674063d.js";import"./shared-0479553e.js";import"./foxy-access-recovery-form.js";import"./foxy-payment-method-card.js";import{TransactionsTable as e}from"./foxy-transactions-table.js";import"./foxy-subscription-card.js";import"./foxy-subscription-form.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import"./foxy-sign-in-form.js";import"./foxy-form-dialog.js";import"./foxy-spinner.js";import{_ as t,B as s,am as r}from"./shared-307262a1.js";import{h as o,L as i,c as n}from"./shared-7f33a83a.js";import{A as a}from"./shared-1eac92fa.js";import"./shared-39f3b48d.js";import{C as l}from"./shared-cf269a17.js";import{a as d,T as c,R as m}from"./shared-09d4fbb8.js";import{A as h}from"./shared-1d08a5ad.js";import{I as u}from"./shared-4b67d699.js";import{c as p}from"./shared-4e709717.js";import{C as f}from"./shared-c7f2f1ab.js";import{N as g}from"./shared-c2d3b32b.js";import{i as $}from"./shared-d3bf9ac0.js";import"./shared-59042137.js";import"./foxy-attribute-card.js";import"./shared-77a4d8e8.js";import"./shared-64657919.js";import"./shared-d6276c83.js";import"./shared-332f2997.js";import"./foxy-attribute-form.js";import"./shared-984fcdf5.js";import"./shared-17d0db7f.js";import"./shared-e6828dbf.js";import"./shared-31651a9c.js";import"./shared-6dc64a17.js";import"./shared-36725fe3.js";import"./shared-479ad951.js";import"./shared-b0f534ef.js";import"./shared-fef9ecc1.js";import"./shared-432c5183.js";import"./shared-64f98a0f.js";import"./shared-88e36564.js";import"./shared-d14c2060.js";import"./shared-11c2efc8.js";import"./shared-379b37e6.js";import"./shared-bdb51db9.js";import"./shared-4904bca4.js";import"./shared-69a21b9d.js";import"./foxy-customer-form.js";import"./foxy-nucleon-element.js";import"./shared-b738ee96.js";import"./foxy-address-card.js";import"./shared-4bbd600d.js";import"./foxy-address-form.js";import"./foxy-table.js";import"./shared-e84fa0ea.js";import"./shared-e7c3b7b6.js";import"./shared-7f5618ba.js";import"./shared-99065f2a.js";import"./shared-25f64060.js";import"./shared-0a248c0d.js";import"./shared-1d28220a.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-dfe2602a.js";import"./shared-8474bc4a.js";import"./foxy-cancellation-form.js";import"./shared-665d6cc4.js";import"./shared-79d0699c.js";import"./foxy-transaction-card.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-bf62a65b.js";import"./shared-a92ae606.js";import"./shared-d519a301.js";import"./shared-e10052d0.js";import"./shared-e8e92fe3.js";import"./shared-b3ac59eb.js";let y,b,v=e=>e;class S extends(d(c(l),"customer-portal")){constructor(){super(...arguments),this.transactionsTableColumns=[e.priceColumn,e.summaryColumn,e.statusColumn,e.idColumn,e.dateColumn,e.receiptColumn],this.group=""}static get properties(){return t(t({},super.properties),{},{transactionsTableColumns:{attribute:!1},group:{type:String}})}render(){return this.api.storage.getItem(a.SESSION)?o(y||(y=v` <foxy-internal-customer-portal-logged-in-view disabledcontrols="${0}" readonlycontrols="${0}" hiddencontrols="${0}" customer="${0}" group="${0}" class="h-full" lang="${0}" href="${0}" ns="${0}" .transactionsTableColumns="${0}" .templates="${0}"> </foxy-internal-customer-portal-logged-in-view> `),this.disabledSelector.toString(),this.readonlySelector.toString(),this.hiddenSelector.toString(),this.base,this.group,this.lang,new URL("./customer_portal_settings",this.base).toString(),this.ns,this.transactionsTableColumns,this.templates):o(b||(b=v` <foxy-internal-customer-portal-logged-out-view disabledcontrols="${0}" readonlycontrols="${0}" hiddencontrols="${0}" group="${0}" class="h-full" lang="${0}" ns="${0}" .templates="${0}"> </foxy-internal-customer-portal-logged-out-view> `),this.disabledSelector.toString(),this.readonlySelector.toString(),this.hiddenSelector.toString(),this.group,this.lang,this.ns,this.templates)}}let x,_,j=e=>e;const T=m(c(d(u(i))));let w,O,k,E,R=e=>e;class z extends(c(i)){constructor(){super(...arguments),this.disabled=!1,this.href="",this.icon=""}static get properties(){return t(t({},super.properties),{},{disabled:{type:Boolean},href:{type:String},icon:{type:String}})}render(){const e=p({"flex-auto font-medium tracking-wide text-s rounded-s transition-colors":!0,"hover-text-primary hover-cursor-pointer":!this.disabled,"focus-outline-none focus-ring-2 ring-primary-50 ring-offset-2":!this.disabled,"text-disabled cursor-default":this.disabled}),t=o(w||(w=R` ${0} <slot></slot> `),this.icon?o(O||(O=R`<iron-icon icon="${0}" class="icon-inline"></iron-icon>`),this.icon):"");return this.disabled?o(k||(k=R`<button class="${0}" disabled="disabled">${0}</button>`),e,t):o(E||(E=R` <a class="${0}" href="${0}" rel="nofollow noopener">${0}</a> `),e,this.href,t)}}let N,A,F,C,I,H,U,q,L,P,D=e=>e;const V=c(f(d(g)));let B,J,W,G,K,M,Q,X,Y,Z,ee=e=>e;const te=c(f(d(u(i))));const se=["html"],re=["html"];let oe,ie,ne,ae,le,de,ce,me,he,ue,pe,fe,ge=e=>e;const $e=d(f(c(u(i))));let ye,be,ve,Se=e=>e;const xe=f(c(d(u(i),"customer-portal")));customElements.define("foxy-internal-customer-portal-logged-in-view",class extends V{constructor(){var e;super(...arguments),e=this,this.templates={},this.customer="",this.loggingOutState="idle",this.transactionsTableColumns=[],this.loggingOutStateResetTimeout=null,this.__renderHeaderActionsSignOut=()=>{var t,s,r,i,n;const a="customer:header:actions:sign-out",l=this.loggingOutState,d=this.disabledSelector.matches(a)||!(null===(t=this.__customerElement)||void 0===t?void 0:t.in({idle:"snapshot"}))||"idle"!==l,c={"border-radius":"100%",padding:"var(--lumo-space-xs)",display:"flex",margin:"0",cursor:d?"default":"pointer"};return o(N||(N=D` <div style="display:flex;margin-left:var(--lumo-space-m)"> ${0} <vaadin-button data-testid="sign-out" aria-label="${0}" style="${0}" theme="icon" ?disabled="${0}" @click="${0}"> ${0} </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot(`${a}:before`),this.t("sign_out").toString(),Object.entries(c).reduce(((e,[t,s])=>`${e}${t}:${s};`),""),d,(async function(){try{e.loggingOutState="busy",await new h(e).fetch("foxy://customer-api/session",{method:"DELETE"}),e.loggingOutState="idle"}catch(t){e.loggingOutState="fail",e.loggingOutStateResetTimeout=setTimeout((()=>{e.loggingOutState="idle",e.loggingOutStateResetTimeout=null}),1e3)}}),"idle"===l?o(A||(A=D`<iron-icon icon="icons:exit-to-app"></iron-icon>`)):o(F||(F=D` <foxy-spinner layout="no-label" state="${0}" style="margin:auto" lang="${0}" ns="${0}"> </foxy-spinner> `),"fail"===l?"error":"busy",this.lang,[this.ns,null!==(r=null===(s=customElements.get("foxy-customer"))||void 0===s?void 0:s.defaultNS)&&void 0!==r?r:"",null!==(n=null===(i=customElements.get("foxy-spinner"))||void 0===i?void 0:i.defaultNS)&&void 0!==n?n:""].join(" ")),this.renderTemplateOrSlot(`${a}:after`))},this.__renderSubscriptions=(e,t)=>{const s="customer:subscriptions";return e(C||(C=D`
1
+ import"./foxy-customer.js";import"./shared-9bdd5400.js";import"./shared-6dffe67d.js";import"./shared-c97f7178.js";import"./shared-f9180815.js";import"./foxy-access-recovery-form.js";import"./foxy-payment-method-card.js";import{TransactionsTable as e}from"./foxy-transactions-table.js";import"./foxy-subscription-card.js";import"./foxy-subscription-form.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import"./foxy-sign-in-form.js";import"./foxy-form-dialog.js";import"./foxy-spinner.js";import{_ as t,B as s,al as r}from"./shared-0dabe195.js";import{h as o,L as i,c as n}from"./shared-7f33a83a.js";import{A as a}from"./shared-7e887e5b.js";import"./shared-e640e9fa.js";import{C as l}from"./shared-d2222c8d.js";import{a as d,T as c,R as m}from"./shared-a88c5cf1.js";import{A as h}from"./shared-bbbb8894.js";import{I as u}from"./shared-763a6797.js";import{c as p}from"./shared-4e709717.js";import{C as f}from"./shared-1fd59009.js";import{N as g}from"./shared-a6517170.js";import{i as $}from"./shared-d3bf9ac0.js";import"./shared-a7475f62.js";import"./foxy-attribute-card.js";import"./shared-46f3f71c.js";import"./shared-343d1fd7.js";import"./shared-3ab0306f.js";import"./shared-8528906b.js";import"./foxy-attribute-form.js";import"./shared-8134d8a7.js";import"./shared-4bd1efd7.js";import"./shared-0689b25a.js";import"./shared-2fa6a5a0.js";import"./shared-8128b5e3.js";import"./shared-c758220c.js";import"./shared-a96a2154.js";import"./shared-619bcf83.js";import"./shared-7680d300.js";import"./shared-13cc4ed4.js";import"./shared-db06114b.js";import"./shared-c541c9e9.js";import"./shared-6b0498b2.js";import"./shared-11c2efc8.js";import"./shared-19c9fe00.js";import"./shared-f4822b9e.js";import"./shared-639dda4b.js";import"./shared-7d4e0011.js";import"./foxy-customer-form.js";import"./foxy-nucleon-element.js";import"./shared-b738ee96.js";import"./foxy-address-card.js";import"./shared-8fbab85c.js";import"./foxy-address-form.js";import"./foxy-table.js";import"./shared-4966b3e4.js";import"./shared-848813a4.js";import"./shared-1e43b4db.js";import"./shared-d7be11de.js";import"./shared-b334c8b6.js";import"./shared-91eb066c.js";import"./shared-9765be8f.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-a134d313.js";import"./shared-7ead930c.js";import"./foxy-cancellation-form.js";import"./shared-e5786b8b.js";import"./shared-79d0699c.js";import"./foxy-transaction-card.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-79d01877.js";import"./shared-421e46e9.js";import"./shared-d519a301.js";import"./shared-31a891e8.js";import"./shared-ad0256d0.js";import"./shared-403af08d.js";let y,b,v=e=>e;class S extends(d(c(l),"customer-portal")){constructor(){super(...arguments),this.transactionsTableColumns=[e.priceColumn,e.summaryColumn,e.statusColumn,e.idColumn,e.dateColumn,e.receiptColumn],this.group=""}static get properties(){return t(t({},super.properties),{},{transactionsTableColumns:{attribute:!1},group:{type:String}})}render(){return this.api.storage.getItem(a.SESSION)?o(y||(y=v` <foxy-internal-customer-portal-logged-in-view disabledcontrols="${0}" readonlycontrols="${0}" hiddencontrols="${0}" customer="${0}" group="${0}" class="h-full" lang="${0}" href="${0}" ns="${0}" .transactionsTableColumns="${0}" .templates="${0}"> </foxy-internal-customer-portal-logged-in-view> `),this.disabledSelector.toString(),this.readonlySelector.toString(),this.hiddenSelector.toString(),this.base,this.group,this.lang,new URL("./customer_portal_settings",this.base).toString(),this.ns,this.transactionsTableColumns,this.templates):o(b||(b=v` <foxy-internal-customer-portal-logged-out-view disabledcontrols="${0}" readonlycontrols="${0}" hiddencontrols="${0}" group="${0}" class="h-full" lang="${0}" ns="${0}" .templates="${0}"> </foxy-internal-customer-portal-logged-out-view> `),this.disabledSelector.toString(),this.readonlySelector.toString(),this.hiddenSelector.toString(),this.group,this.lang,this.ns,this.templates)}}let x,_,j=e=>e;const T=m(c(d(u(i))));let w,O,k,E,R=e=>e;class z extends(c(i)){constructor(){super(...arguments),this.disabled=!1,this.href="",this.icon=""}static get properties(){return t(t({},super.properties),{},{disabled:{type:Boolean},href:{type:String},icon:{type:String}})}render(){const e=p({"flex-auto font-medium tracking-wide text-s rounded-s transition-colors":!0,"hover-text-primary hover-cursor-pointer":!this.disabled,"focus-outline-none focus-ring-2 ring-primary-50 ring-offset-2":!this.disabled,"text-disabled cursor-default":this.disabled}),t=o(w||(w=R` ${0} <slot></slot> `),this.icon?o(O||(O=R`<iron-icon icon="${0}" class="icon-inline"></iron-icon>`),this.icon):"");return this.disabled?o(k||(k=R`<button class="${0}" disabled="disabled">${0}</button>`),e,t):o(E||(E=R` <a class="${0}" href="${0}" rel="nofollow noopener">${0}</a> `),e,this.href,t)}}let N,A,F,C,I,H,U,q,L,P,D=e=>e;const V=c(f(d(g)));let B,J,W,G,K,M,Q,X,Y,Z,ee=e=>e;const te=c(f(d(u(i))));const se=["html"],re=["html"];let oe,ie,ne,ae,le,de,ce,me,he,ue,pe,fe,ge=e=>e;const $e=d(f(c(u(i))));let ye,be,ve,Se=e=>e;const xe=f(c(d(u(i),"customer-portal")));customElements.define("foxy-internal-customer-portal-logged-in-view",class extends V{constructor(){var e;super(...arguments),e=this,this.templates={},this.customer="",this.loggingOutState="idle",this.transactionsTableColumns=[],this.loggingOutStateResetTimeout=null,this.__renderHeaderActionsSignOut=()=>{var t,s,r,i,n;const a="customer:header:actions:sign-out",l=this.loggingOutState,d=this.disabledSelector.matches(a)||!(null===(t=this.__customerElement)||void 0===t?void 0:t.in({idle:"snapshot"}))||"idle"!==l,c={"border-radius":"100%",padding:"var(--lumo-space-xs)",display:"flex",margin:"0",cursor:d?"default":"pointer"};return o(N||(N=D` <div style="display:flex;margin-left:var(--lumo-space-m)"> ${0} <vaadin-button data-testid="sign-out" aria-label="${0}" style="${0}" theme="icon" ?disabled="${0}" @click="${0}"> ${0} </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot(`${a}:before`),this.t("sign_out").toString(),Object.entries(c).reduce(((e,[t,s])=>`${e}${t}:${s};`),""),d,(async function(){try{e.loggingOutState="busy",await new h(e).fetch("foxy://customer-api/session",{method:"DELETE"}),e.loggingOutState="idle"}catch(t){e.loggingOutState="fail",e.loggingOutStateResetTimeout=setTimeout((()=>{e.loggingOutState="idle",e.loggingOutStateResetTimeout=null}),1e3)}}),"idle"===l?o(A||(A=D`<iron-icon icon="icons:exit-to-app"></iron-icon>`)):o(F||(F=D` <foxy-spinner layout="no-label" state="${0}" style="margin:auto" lang="${0}" ns="${0}"> </foxy-spinner> `),"fail"===l?"error":"busy",this.lang,[this.ns,null!==(r=null===(s=customElements.get("foxy-customer"))||void 0===s?void 0:s.defaultNS)&&void 0!==r?r:"",null!==(n=null===(i=customElements.get("foxy-spinner"))||void 0===i?void 0:i.defaultNS)&&void 0!==n?n:""].join(" ")),this.renderTemplateOrSlot(`${a}:after`))},this.__renderSubscriptions=(e,t)=>{const s="customer:subscriptions";return e(C||(C=D`
2
2
  ${0}
3
3
 
4
4
  <foxy-internal-customer-portal-subscriptions
@@ -70,7 +70,7 @@ import"./foxy-customer.js";import"./shared-e6997950.js";import"./shared-c6c6ba69
70
70
  </foxy-internal-customer-portal-change-password>
71
71
 
72
72
  ${0}
73
- `),t.renderTemplateOrSlot(`${o}:before`),t.href,null!==(r=null===(s=t.data)||void 0===s?void 0:s.email)&&void 0!==r?r:"",t.lang,t.ns,t.in("busy")||t.disabledSelector.matches(o,!0),t.renderTemplateOrSlot(`${o}:after`)))},o(P||(P=D` <foxy-customer readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" data-testid="customer" group="${0}" href="${0}" lang="${0}" ns="${0} ${0}" id="customer" .templates="${0}" @update="${0}"> </foxy-customer> `),this.readonlySelector.zoom("customer").toString(),this.disabledSelector.zoom("customer").toString(),i,this.group,this.customer,this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-customer"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",n,(()=>this.requestUpdate()))}disconnectedCallback(){super.disconnectedCallback(),this.loggingOutStateResetTimeout&&clearTimeout(this.loggingOutStateResetTimeout)}get __customerElement(){return this.renderRoot.querySelector("#customer")}}),customElements.define("foxy-internal-customer-portal-logged-out-view",class extends te{constructor(){super(...arguments),this.group="",this.page="sign-in",this.__renderAccessRecoveryHeader=()=>{var e,t,s,r;const{lang:i,ns:n}=this,a=this.renderRoot.querySelector("#access-recovery-form"),l=!!(null==a?void 0:a.in("busy"));return o(B||(B=ee` <div class="flex flex-col leading-m font-lumo" data-testid="access-recovery:header"> ${0} <foxy-i18n class="text-xxl font-medium ${0}" lang="${0}" key="recover_access" ns="${0} ${0}"> </foxy-i18n> <foxy-i18n class="text-l ${0}" lang="${0}" key="recover_access_hint" ns="${0} ${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("access-recovery:header:before"),l?"text-disabled":"text-body",i,n,null!==(t=null===(e=customElements.get("foxy-access-recovery-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",l?"text-disabled":"text-secondary",i,n,null!==(r=null===(s=customElements.get("foxy-access-recovery-form"))||void 0===s?void 0:s.defaultNS)&&void 0!==r?r:"",this.renderTemplateOrSlot("access-recovery:header:after"))},this.__renderAccessRecoveryBack=()=>{var e,t;const s=this.renderRoot.querySelector("#access-recovery-form"),r=this.disabledSelector.zoom("access-recovery");return o(J||(J=ee` <div> ${0} <vaadin-button data-testid="access-recovery:back" class="w-full" theme="tertiary" ?disabled="${0}" @click="${0}"> <foxy-i18n lang="${0}" key="back" ns="${0} ${0}"> </foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("access-recovery:back:before"),!!(null==s?void 0:s.in("busy"))||r.matches("back",!0),(()=>this.page="sign-in"),this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-access-recovery-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",this.renderTemplateOrSlot("access-recovery:back:after"))},this.__renderAccessRecoveryForm=()=>{var e,t;const s="access-recovery:form",r=this.hiddenSelector.zoom(s);return o(W||(W=ee` <div> ${0} <foxy-access-recovery-form readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" data-testid="access-recovery:form" parent="foxy://customer-api/recover" group="${0}" lang="${0}" ns="${0} ${0}" id="access-recovery-form" .templates="${0}" @update="${0}"> </foxy-access-recovery-form> ${0} </div> `),this.renderTemplateOrSlot(`${s}:before`),this.readonlySelector.zoom(s).toString(),this.disabledSelector.zoom(s).toString(),r.toString(),this.group,this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-access-recovery-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",this.getNestedTemplates(s),(()=>this.requestUpdate()),this.renderTemplateOrSlot(`${s}:after`))},this.__renderAccessRecovery=()=>{const e="access-recovery",t=this.hiddenSelector.zoom(e);return o(G||(G=ee` <div class="h-full flex" data-testid="access-recovery"> <div class="m-auto max-w-20rem flex-1"> ${0} <div class="space-y-l"> ${0} <div class="space-y-s"> ${0} ${0} </div> </div> ${0} </div> </div> `),this.renderTemplateOrSlot(`${e}:before`),t.matches("header",!0)?"":this.__renderAccessRecoveryHeader(),t.matches("form",!0)?"":this.__renderAccessRecoveryForm(),t.matches("back",!0)?"":this.__renderAccessRecoveryBack(),this.renderTemplateOrSlot(`${e}:after`))},this.__renderSignInHeader=()=>{var e,t,s,r;const{lang:i,ns:n}=this,a=this.renderRoot.querySelector("#sign-in-form"),l=!!(null==a?void 0:a.in("busy"));return o(K||(K=ee` <div class="flex flex-col leading-m font-lumo" data-testid="sign-in:header"> ${0} <foxy-i18n class="text-xxl font-medium ${0}" lang="${0}" key="sign_in" ns="${0} ${0}"> </foxy-i18n> <foxy-i18n class="text-l ${0}" lang="${0}" key="sign_in_hint" ns="${0} ${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("sign-in:header:before"),l?"text-disabled":"text-body",i,n,null!==(t=null===(e=customElements.get("foxy-sign-in-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",l?"text-disabled":"text-secondary",i,n,null!==(r=null===(s=customElements.get("foxy-sign-in-form"))||void 0===s?void 0:s.defaultNS)&&void 0!==r?r:"",this.renderTemplateOrSlot("sign-in:header:after"))},this.__renderSignInRecover=()=>{var e,t;const s=this.renderRoot.querySelector("#sign-in-form"),r=this.disabledSelector.zoom("sign-in");return o(M||(M=ee` <div> ${0} <vaadin-button data-testid="sign-in:recover" class="w-full" theme="tertiary" ?disabled="${0}" @click="${0}"> <foxy-i18n lang="${0}" key="recover_access" ns="${0} ${0}"> </foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("sign-in:recover:before"),!!(null==s?void 0:s.in("busy"))||r.matches("recover",!0),(()=>this.page="access-recovery"),this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-sign-in-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",this.renderTemplateOrSlot("sign-in:recover:after"))},this.__renderSignInForm=()=>{var e,t;const s="sign-in:form",r=this.hiddenSelector.zoom(s);return o(Q||(Q=ee` <div> ${0} <foxy-sign-in-form readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" data-testid="sign-in:form" parent="foxy://customer-api/session" group="${0}" lang="${0}" id="sign-in-form" ns="${0} ${0}" .templates="${0}" @update="${0}"> </foxy-sign-in-form> ${0} </div> `),this.renderTemplateOrSlot(`${s}:before`),this.readonlySelector.zoom(s).toString(),this.disabledSelector.zoom(s).toString(),r.toString(),this.group,this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-sign-in-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",this.getNestedTemplates("sign-in:form"),(()=>this.requestUpdate()),this.renderTemplateOrSlot(`${s}:after`))},this.__renderSignIn=()=>{const e="sign-in",t=this.hiddenSelector.zoom(e);return o(X||(X=ee` <div class="h-full flex" data-testid="sign-in"> <div class="m-auto max-w-20rem flex-1"> ${0} <div class="space-y-l"> ${0} <div class="space-y-s"> ${0} ${0} </div> </div> ${0} </div> </div> `),this.renderTemplateOrSlot("sign-in:before"),t.matches("header",!0)?"":this.__renderSignInHeader(),t.matches("form",!0)?"":this.__renderSignInForm(),t.matches("recover",!0)?"":this.__renderSignInRecover(),this.renderTemplateOrSlot("sign-in:after"))}}static get properties(){return t(t({},super.properties),{},{group:{type:String},page:{type:String}})}static get styles(){return[super.styles,n(Y||(Y=ee`.max-w-20rem{max-width:20rem}`))]}render(){const{page:e,hiddenSelector:t}=this;return"access-recovery"!==e||t.matches("access-recovery",!0)?"sign-in"!==e||t.matches("sign-in",!0)?o(Z||(Z=ee``)):this.__renderSignIn():this.__renderAccessRecovery()}}),customElements.define("foxy-internal-customer-portal-subscriptions",class extends $e{constructor(){super(...arguments),this.settings=null,this.customer=null,this.group="",this.__renderFormHeaderActionsUpdate=(e,t)=>{var s;const r=!!(null===(s=t.data)||void 0===s?void 0:s.end_date)&&new Date(t.data.end_date).getTime()<=Date.now();let o="";if(!r&&t.in({idle:"snapshot"})){const e=t.data._links["fx:sub_token_url"].href,s=new URL(e);s.searchParams.set("cart","checkout"),s.searchParams.set("sub_restart","auto"),o=s.toString()}return e(oe||(oe=ge`
73
+ `),t.renderTemplateOrSlot(`${o}:before`),t.href,null!==(r=null===(s=t.data)||void 0===s?void 0:s.email)&&void 0!==r?r:"",t.lang,t.ns,t.in("busy")||t.disabledSelector.matches(o,!0),t.renderTemplateOrSlot(`${o}:after`)))},o(P||(P=D` <foxy-customer readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" data-testid="customer" group="${0}" href="${0}" lang="${0}" ns="${0} ${0}" id="customer" .templates="${0}" @update="${0}"> </foxy-customer> `),this.readonlySelector.zoom("customer").toString(),this.disabledSelector.zoom("customer").toString(),i,this.group,this.customer,this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-customer"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",n,(()=>this.requestUpdate()))}disconnectedCallback(){super.disconnectedCallback(),this.loggingOutStateResetTimeout&&clearTimeout(this.loggingOutStateResetTimeout)}get __customerElement(){return this.renderRoot.querySelector("#customer")}}),customElements.define("foxy-internal-customer-portal-logged-out-view",class extends te{constructor(){super(...arguments),this.group="",this.page="sign-in",this.__renderAccessRecoveryHeader=()=>{var e,t,s,r;const{lang:i,ns:n}=this,a=this.renderRoot.querySelector("#access-recovery-form"),l=!!(null==a?void 0:a.in("busy"));return o(B||(B=ee` <div class="flex flex-col leading-m font-lumo" data-testid="access-recovery:header"> ${0} <foxy-i18n class="text-xxl font-medium ${0}" lang="${0}" key="recover_access" ns="${0} ${0}"> </foxy-i18n> <foxy-i18n class="text-l ${0}" lang="${0}" key="recover_access_hint" ns="${0} ${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("access-recovery:header:before"),l?"text-disabled":"text-body",i,n,null!==(t=null===(e=customElements.get("foxy-access-recovery-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",l?"text-disabled":"text-secondary",i,n,null!==(r=null===(s=customElements.get("foxy-access-recovery-form"))||void 0===s?void 0:s.defaultNS)&&void 0!==r?r:"",this.renderTemplateOrSlot("access-recovery:header:after"))},this.__renderAccessRecoveryBack=()=>{var e,t;const s=this.renderRoot.querySelector("#access-recovery-form"),r=this.disabledSelector.zoom("access-recovery");return o(J||(J=ee` <div> ${0} <vaadin-button data-testid="access-recovery:back" class="w-full" theme="tertiary" ?disabled="${0}" @click="${0}"> <foxy-i18n lang="${0}" key="back" ns="${0} ${0}"> </foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("access-recovery:back:before"),!!(null==s?void 0:s.in("busy"))||r.matches("back",!0),(()=>this.page="sign-in"),this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-access-recovery-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",this.renderTemplateOrSlot("access-recovery:back:after"))},this.__renderAccessRecoveryForm=()=>{var e,t;const s="access-recovery:form",r=this.hiddenSelector.zoom(s);return o(W||(W=ee` <div> ${0} <foxy-access-recovery-form readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" data-testid="access-recovery:form" parent="foxy://customer-api/recover" group="${0}" lang="${0}" ns="${0} ${0}" id="access-recovery-form" .templates="${0}" @update="${0}"> </foxy-access-recovery-form> ${0} </div> `),this.renderTemplateOrSlot(`${s}:before`),this.readonlySelector.zoom(s).toString(),this.disabledSelector.zoom(s).toString(),r.toString(),this.group,this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-access-recovery-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",this.getNestedTemplates(s),(()=>this.requestUpdate()),this.renderTemplateOrSlot(`${s}:after`))},this.__renderAccessRecovery=()=>{const e="access-recovery",t=this.hiddenSelector.zoom(e);return o(G||(G=ee` <div class="h-full flex" data-testid="access-recovery"> <div class="m-auto max-w-20rem flex-1"> ${0} <div class="space-y-l"> ${0} <div class="space-y-s"> ${0} ${0} </div> </div> ${0} </div> </div> `),this.renderTemplateOrSlot(`${e}:before`),t.matches("header",!0)?"":this.__renderAccessRecoveryHeader(),t.matches("form",!0)?"":this.__renderAccessRecoveryForm(),t.matches("back",!0)?"":this.__renderAccessRecoveryBack(),this.renderTemplateOrSlot(`${e}:after`))},this.__renderSignInHeader=()=>{var e,t,s,r;const{lang:i,ns:n}=this,a=this.renderRoot.querySelector("#sign-in-form"),l=!!(null==a?void 0:a.in("busy"));return o(K||(K=ee` <div class="flex flex-col leading-m font-lumo" data-testid="sign-in:header"> ${0} <foxy-i18n class="text-xxl font-medium ${0}" lang="${0}" key="sign_in" ns="${0} ${0}"> </foxy-i18n> <foxy-i18n class="text-l ${0}" lang="${0}" key="sign_in_hint" ns="${0} ${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("sign-in:header:before"),l?"text-disabled":"text-body",i,n,null!==(t=null===(e=customElements.get("foxy-sign-in-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",l?"text-disabled":"text-secondary",i,n,null!==(r=null===(s=customElements.get("foxy-sign-in-form"))||void 0===s?void 0:s.defaultNS)&&void 0!==r?r:"",this.renderTemplateOrSlot("sign-in:header:after"))},this.__renderSignInRecover=()=>{var e,t;const s=this.renderRoot.querySelector("#sign-in-form"),r=this.disabledSelector.zoom("sign-in");return o(M||(M=ee` <div> ${0} <vaadin-button data-testid="sign-in:recover" class="w-full" theme="tertiary" ?disabled="${0}" @click="${0}"> <foxy-i18n lang="${0}" key="recover_access" ns="${0} ${0}"> </foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("sign-in:recover:before"),!!(null==s?void 0:s.in("busy"))||r.matches("recover",!0),(()=>this.page="access-recovery"),this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-sign-in-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",this.renderTemplateOrSlot("sign-in:recover:after"))},this.__renderSignInForm=()=>{var e,t;const s="sign-in:form",r=this.hiddenSelector.zoom(s);return o(Q||(Q=ee` <div> ${0} <foxy-sign-in-form readonlycontrols="${0}" disabledcontrols="${0}" hiddencontrols="${0}" data-testid="sign-in:form" parent="foxy://customer-api/session" group="${0}" lang="${0}" id="sign-in-form" ns="${0} ${0}" .templates="${0}" @update="${0}"> </foxy-sign-in-form> ${0} </div> `),this.renderTemplateOrSlot(`${s}:before`),this.readonlySelector.zoom(s).toString(),this.disabledSelector.zoom(s).toString(),r.toString(),this.group,this.lang,this.ns,null!==(t=null===(e=customElements.get("foxy-sign-in-form"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"",this.getNestedTemplates("sign-in:form"),(()=>this.requestUpdate()),this.renderTemplateOrSlot(`${s}:after`))},this.__renderSignIn=()=>{const e="sign-in",t=this.hiddenSelector.zoom(e);return o(X||(X=ee` <div class="h-full flex" data-testid="sign-in"> <div class="m-auto max-w-20rem flex-1"> ${0} <div class="space-y-l"> ${0} <div class="space-y-s"> ${0} ${0} </div> </div> ${0} </div> </div> `),this.renderTemplateOrSlot(`${e}:before`),t.matches("header",!0)?"":this.__renderSignInHeader(),t.matches("form",!0)?"":this.__renderSignInForm(),t.matches("recover",!0)?"":this.__renderSignInRecover(),this.renderTemplateOrSlot(`${e}:after`))}}static get properties(){return t(t({},super.properties),{},{group:{type:String},page:{type:String}})}static get styles(){return[super.styles,n(Y||(Y=ee`.max-w-20rem{max-width:20rem}`))]}render(){const{page:e,hiddenSelector:t}=this;return"access-recovery"!==e||t.matches("access-recovery",!0)?"sign-in"!==e||t.matches("sign-in",!0)?o(Z||(Z=ee``)):this.__renderSignIn():this.__renderAccessRecovery()}}),customElements.define("foxy-internal-customer-portal-subscriptions",class extends $e{constructor(){super(...arguments),this.settings=null,this.customer=null,this.group="",this.__renderFormHeaderActionsUpdate=(e,t)=>{var s;const r=!!(null===(s=t.data)||void 0===s?void 0:s.end_date)&&new Date(t.data.end_date).getTime()<=Date.now();let o="";if(!r&&t.in({idle:"snapshot"})){const e=t.data._links["fx:sub_token_url"].href,s=new URL(e);s.searchParams.set("cart","checkout"),s.searchParams.set("sub_restart","auto"),o=s.toString()}return e(oe||(oe=ge`
74
74
  ${0}
75
75
 
76
76
  <foxy-internal-customer-portal-link
@@ -1,4 +1,4 @@
1
- import"./shared-4674063d.js";import"./shared-c6c6ba69.js";import{h as t}from"./shared-59042137.js";import"./shared-e6997950.js";import"./shared-0479553e.js";import"./foxy-payment-method-card.js";import"./foxy-subscription-form.js";import"./foxy-form-dialog.js";import"./foxy-transactions-table.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-customer-form.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./foxy-spinner.js";import"./foxy-table.js";import"./shared-77a4d8e8.js";import{am as e}from"./shared-307262a1.js";import{L as s,h as r,c as a}from"./shared-7f33a83a.js";import{C as o}from"./shared-c7f2f1ab.js";import"./shared-17d0db7f.js";import"./shared-479ad951.js";import{w as i,S as h,T as d,a as n}from"./shared-09d4fbb8.js";import{c as l}from"./shared-4e709717.js";import"./shared-b0f534ef.js";import"./shared-36725fe3.js";import{S as m}from"./shared-379b37e6.js";import"./shared-fef9ecc1.js";import"./shared-e6828dbf.js";import"./shared-432c5183.js";import"./shared-64f98a0f.js";import"./shared-88e36564.js";import{G as c}from"./shared-4904bca4.js";import"./shared-31651a9c.js";import{N as v}from"./shared-c2d3b32b.js";import{S as p}from"./shared-e7c3b7b6.js";import{i as f}from"./shared-d3bf9ac0.js";import"./shared-6dc64a17.js";import"./shared-99065f2a.js";import"./foxy-nucleon-element.js";import"./shared-1d08a5ad.js";import"./shared-64657919.js";import"./shared-d6276c83.js";import"./shared-4b67d699.js";import"./shared-332f2997.js";import"./shared-25f64060.js";import"./shared-0a248c0d.js";import"./shared-1d28220a.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-dfe2602a.js";import"./shared-8474bc4a.js";import"./foxy-cancellation-form.js";import"./shared-665d6cc4.js";import"./shared-79d0699c.js";import"./shared-984fcdf5.js";import"./shared-11c2efc8.js";import"./shared-bdb51db9.js";import"./shared-d14c2060.js";import"./foxy-transaction-card.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-bf62a65b.js";import"./shared-a92ae606.js";import"./shared-7f5618ba.js";import"./shared-1eac92fa.js";import"./shared-39f3b48d.js";import"./shared-d519a301.js";import"./shared-69a21b9d.js";import"./shared-e84fa0ea.js";import"./shared-b738ee96.js";import"./shared-4bbd600d.js";let g,z,u,b=t=>t;class $ extends s{constructor(){super(...arguments),this.value=0,this.size=0}static get properties(){return{value:{type:Number},size:{type:Number}}}static get styles(){return i.styles}render(){const t=[],e=[];for(let s=0;s<this.size;++s)t.push(r(g||(g=b` <button id="tab-${0}" role="tab" class="${0}" aria-controls="panel-${0}" aria-selected="${0}" @click="${0}" @keydown="${0}"> <slot name="tab-${0}"></slot> </button> `),s,l({"text-l font-medium px-s rounded focus-outline-none focus-shadow-outline":!0,"text-tertiary hover-text-body focus-text-body":this.value!==s}),s,this.value===s,(()=>this.value=s),this.__handleKeyDown,s)),e.push(r(z||(z=b` <slot id="panel-${0}" role="tabpanel" name="panel-${0}" class="${0}" aria-hidden="${0}" aria-labelledby="tab-${0}"> </slot> `),s,s,l({hidden:this.value!==s}),this.value!==s,s));return r(u||(u=b` <div role="tablist" aria-orientation="horizontal" class="-mx-s mb-s">${0}</div> ${0} `),t,e)}__handleKeyDown(t){if(t.key.startsWith("Arrow")){t.preventDefault();const e=t.target;let s=null;"ArrowRight"===t.key||"ArrowDown"===t.key?s=e.nextElementSibling:"ArrowLeft"!==t.key&&"ArrowUp"!==t.key||(s=e.previousElementSibling),null==s||s.click(),null==s||s.focus()}}}
1
+ import"./shared-c97f7178.js";import"./shared-6dffe67d.js";import{h as t}from"./shared-a7475f62.js";import"./shared-9bdd5400.js";import"./shared-f9180815.js";import"./foxy-payment-method-card.js";import"./foxy-subscription-form.js";import"./foxy-form-dialog.js";import"./foxy-transactions-table.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-customer-form.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./foxy-spinner.js";import"./foxy-table.js";import"./shared-46f3f71c.js";import{al as e}from"./shared-0dabe195.js";import{L as s,h as r,c as a}from"./shared-7f33a83a.js";import{C as o}from"./shared-1fd59009.js";import"./shared-4bd1efd7.js";import"./shared-a96a2154.js";import{w as i,S as h,T as d,a as n}from"./shared-a88c5cf1.js";import{c as l}from"./shared-4e709717.js";import"./shared-619bcf83.js";import"./shared-c758220c.js";import{S as m}from"./shared-19c9fe00.js";import"./shared-7680d300.js";import"./shared-0689b25a.js";import"./shared-13cc4ed4.js";import"./shared-db06114b.js";import"./shared-c541c9e9.js";import{G as c}from"./shared-639dda4b.js";import"./shared-2fa6a5a0.js";import{N as v}from"./shared-a6517170.js";import{S as p}from"./shared-848813a4.js";import{i as f}from"./shared-d3bf9ac0.js";import"./shared-8128b5e3.js";import"./shared-d7be11de.js";import"./foxy-nucleon-element.js";import"./shared-bbbb8894.js";import"./shared-343d1fd7.js";import"./shared-3ab0306f.js";import"./shared-763a6797.js";import"./shared-8528906b.js";import"./shared-b334c8b6.js";import"./shared-91eb066c.js";import"./shared-9765be8f.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-a134d313.js";import"./shared-7ead930c.js";import"./foxy-cancellation-form.js";import"./shared-e5786b8b.js";import"./shared-79d0699c.js";import"./shared-8134d8a7.js";import"./shared-11c2efc8.js";import"./shared-f4822b9e.js";import"./shared-6b0498b2.js";import"./foxy-transaction-card.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-79d01877.js";import"./shared-421e46e9.js";import"./shared-1e43b4db.js";import"./shared-7e887e5b.js";import"./shared-e640e9fa.js";import"./shared-d519a301.js";import"./shared-7d4e0011.js";import"./shared-4966b3e4.js";import"./shared-b738ee96.js";import"./shared-8fbab85c.js";let g,z,u,b=t=>t;class $ extends s{constructor(){super(...arguments),this.value=0,this.size=0}static get properties(){return{value:{type:Number},size:{type:Number}}}static get styles(){return i.styles}render(){const t=[],e=[];for(let s=0;s<this.size;++s)t.push(r(g||(g=b` <button id="tab-${0}" role="tab" class="${0}" aria-controls="panel-${0}" aria-selected="${0}" @click="${0}" @keydown="${0}"> <slot name="tab-${0}"></slot> </button> `),s,l({"text-l font-medium px-s rounded focus-outline-none focus-shadow-outline":!0,"text-tertiary hover-text-body focus-text-body":this.value!==s}),s,this.value===s,(()=>this.value=s),this.__handleKeyDown,s)),e.push(r(z||(z=b` <slot id="panel-${0}" role="tabpanel" name="panel-${0}" class="${0}" aria-hidden="${0}" aria-labelledby="tab-${0}"> </slot> `),s,s,l({hidden:this.value!==s}),this.value!==s,s));return r(u||(u=b` <div role="tablist" aria-orientation="horizontal" class="-mx-s mb-s">${0}</div> ${0} `),t,e)}__handleKeyDown(t){if(t.key.startsWith("Arrow")){t.preventDefault();const e=t.target;let s=null;"ArrowRight"===t.key||"ArrowDown"===t.key?s=e.nextElementSibling:"ArrowLeft"!==t.key&&"ArrowUp"!==t.key||(s=e.previousElementSibling),null==s||s.click(),null==s||s.focus()}}}
2
2
  /**
3
3
  @license
4
4
  Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
@@ -1 +1 @@
1
- import"./foxy-spinner.js";import"./shared-77a4d8e8.js";import{T as s}from"./shared-e84fa0ea.js";import{a}from"./shared-09d4fbb8.js";import{h as e}from"./shared-7f33a83a.js";import"./shared-4674063d.js";import"./shared-59042137.js";import"./shared-c6c6ba69.js";import"./shared-307262a1.js";import"./shared-4b67d699.js";import"./shared-64657919.js";import"./shared-c7f2f1ab.js";import"./shared-d3bf9ac0.js";import"./foxy-nucleon-element.js";import"./shared-c2d3b32b.js";import"./shared-1d08a5ad.js";import"./shared-d6276c83.js";import"./shared-332f2997.js";import"./shared-4e709717.js";let t,n,d,o,r=s=>s;class m extends(a(s,"customers-table")){constructor(){super(...arguments),this.columns=[m.nameColumn,m.idColumn,m.dateColumn,m.emailColumn]}}m.nameColumn={cell:s=>e(t||(t=r` <span data-testclass="names">${0} ${0}</span> `),s.data.first_name,s.data.last_name)},m.idColumn={hideBelow:"md",cell:s=>e(n||(n=r` <span role="presentation" class="text-m text-tertiary">ID&nbsp;</span> <span data-testclass="ids" class="text-m text-secondary font-tnum">${0}</span> `),s.data.id)},m.dateColumn={hideBelow:"md",cell:s=>e(d||(d=r` <span class="text-m text-secondary font-tnum"> <foxy-i18n data-testclass="i18n" lang="${0}" key="date_created" ns="${0}"> </foxy-i18n> <foxy-i18n data-testclass="dates i18n" lang="${0}" key="date" ns="${0}" .options="${0}"> </foxy-i18n> </span> `),s.lang,s.ns,s.lang,s.ns,{value:s.data.date_created})},m.emailColumn={cell:s=>e(o||(o=r`<span data-testclass="emails" class="text-m text-secondary">${0}</span>`),s.data.email)},m.__ns="customers-table",customElements.define("foxy-customers-table",m);export{m as CustomersTable};
1
+ import"./foxy-spinner.js";import"./shared-46f3f71c.js";import{T as s}from"./shared-4966b3e4.js";import{a}from"./shared-a88c5cf1.js";import{h as e}from"./shared-7f33a83a.js";import"./shared-c97f7178.js";import"./shared-a7475f62.js";import"./shared-6dffe67d.js";import"./shared-0dabe195.js";import"./shared-763a6797.js";import"./shared-343d1fd7.js";import"./shared-1fd59009.js";import"./shared-d3bf9ac0.js";import"./foxy-nucleon-element.js";import"./shared-a6517170.js";import"./shared-bbbb8894.js";import"./shared-3ab0306f.js";import"./shared-8528906b.js";import"./shared-4e709717.js";let t,n,o,r,d=s=>s;class m extends(a(s,"customers-table")){constructor(){super(...arguments),this.columns=[m.nameColumn,m.idColumn,m.dateColumn,m.emailColumn]}}m.nameColumn={cell:s=>e(t||(t=d` <span data-testclass="names">${0} ${0}</span> `),s.data.first_name,s.data.last_name)},m.idColumn={hideBelow:"md",cell:s=>e(n||(n=d` <span role="presentation" class="text-m text-tertiary">ID&nbsp;</span> <span data-testclass="ids" class="text-m text-secondary font-tnum">${0}</span> `),s.data.id)},m.dateColumn={hideBelow:"md",cell:s=>e(o||(o=d` <span class="text-m text-secondary font-tnum"> <foxy-i18n data-testclass="i18n" lang="${0}" key="date_created" ns="${0}"> </foxy-i18n> <foxy-i18n data-testclass="dates i18n" lang="${0}" key="date" ns="${0}" .options="${0}"> </foxy-i18n> </span> `),s.lang,s.ns,s.lang,s.ns,{value:s.data.date_created})},m.emailColumn={cell:s=>e(r||(r=d`<span data-testclass="emails" class="text-m text-secondary">${0}</span>`),s.data.email)},m.__ns="customers-table",customElements.define("foxy-customers-table",m);export{m as CustomersTable};
@@ -1 +1 @@
1
- import"./shared-77a4d8e8.js";import{_ as e}from"./shared-307262a1.js";import{h as t,L as s}from"./shared-7f33a83a.js";import{r}from"./shared-d519a301.js";import{C as i}from"./shared-c7f2f1ab.js";import{I as n}from"./shared-4b67d699.js";import{T as a,a as o}from"./shared-09d4fbb8.js";import{c as l}from"./shared-4e709717.js";import{o as d}from"./shared-e6f3e9f0.js";import"./shared-64657919.js";import"./shared-d3bf9ac0.js";let c,u,h,p,m,b,f,y,g=e=>e;const v=a(i(o(n(s),"discount-builder")));class $ extends v{constructor(){super(...arguments),this.value=null}static get properties(){return e(e({},super.properties),{},{value:{type:String}})}get parsedValue(){var e;let t="",s="",r="quantity_amount";try{const[[i,n]]=Array.from(new URLSearchParams(null!==(e=this.value)&&void 0!==e?e:"").entries()),a=i.substring("discount_".length);["price_amount","price_percentage","quantity_amount","quantity_percentage"].includes(a)&&(r=a);const o=n.indexOf("{"),l=n.lastIndexOf("}");-1!==o&&-1!==l&&(t=n.substring(o+1,l),s=n.substring(0,o))}catch(e){}return 0===s.length&&(s="Discount"),{type:r,name:s,details:t}}set parsedValue({name:e,type:t,details:s}){this.value=new URLSearchParams([[`discount_${t}`,`${e}{${s}}`]]).toString()}render(){var s;const i=this.parsedValue.details.split("|").filter((e=>!!e.trim())),n=null!==(s=/[-+]/.test(i[0])?null:i.shift())&&void 0!==s?s:"single",a="repeat"===n?[i[0]]:[...i,void 0],o=this.parsedValue.type,[l,d]=o.split("_");return t(c||(c=g` <div class="space-y-s"> ${0} </div> `),r(a,((t,s)=>this.__renderTier({source:l,method:n,units:d,tier:t,onChange:r=>{var a,o,c;const u=null!==(a=r.method)&&void 0!==a?a:n,h=null!==(o=r.source)&&void 0!==o?o:l,p=null!==(c=r.units)&&void 0!==c?c:d,m=r.tier,b=[...i];if(m){const e=t?s:b.length,r=t?1:0;b.splice(e,r,m)}this.parsedValue=e(e({},this.parsedValue),{},{type:`${h}_${p}`,details:`${u}|${b.join("|")}`}),this.dispatchEvent(new CustomEvent("change"))},onDelete:()=>{const t=i.filter(((e,t)=>t!==s)),r=`${n}|${t.join("|")}`;this.parsedValue=e(e({},this.parsedValue),{},{details:r}),this.dispatchEvent(new CustomEvent("change"))}}))))}__renderSelect({label:e,value:s,options:r,onChange:i}){const n=!this.disabled&&!this.readonly;return t(u||(u=g` <label class="${0}"> <foxy-i18n class="sr-only" infer="" key="${0}"></foxy-i18n> <span class="relative leading-none font-medium flex items-center h-full"> <span class="truncate">${0}</span> <iron-icon class="icon-inline text-xl ml-xs" icon="icons:expand-more"></iron-icon> <select data-testclass="interactive editable" class="opacity-0 absolute inset-0 w-full focus-outline-none" ?disabled="${0}" @change="${0}"> ${0} </select> </span> </label> `),l({"h-xs whitespace-nowrap block ring-primary-50 rounded-s pl-s transition-colors":!0,"hover-bg-primary hover-text-primary-contrast focus-within-ring-2":n,"bg-primary-10 text-primary":n,"bg-contrast-5 text-disabled":this.disabled,"bg-contrast-5 text-secondary":this.readonly&&!this.disabled}),e,this.t(r[s]),!n,(e=>{const t=e.currentTarget;i(t.options[t.selectedIndex].value)}),Object.entries(r).map((([e,r])=>t(h||(h=g` <option value="${0}" ?selected="${0}"> ${0} </option> `),e,e===s,this.t(r)))))}__renderSwitch({value:e,options:s,onChange:r}){const i=!this.disabled&&!this.readonly,n=`switch-${Math.floor(Math.random()*Math.pow(10,10))}`,a="width: 0.4rem; height: 0.4rem";return t(p||(p=g` <div class="${0}" @click="${0}"> <div class="leading-none font-medium px-xs pointer-events-none"> ${0} </div> <div class="flex justify-evenly h-full ${0}"> <div style="${0}" class="bg-current rounded-full"></div> <div style="${0}" class="border border-current rounded-full"></div> </div> </div> `),l({"h-xs px-xs space-x-xs flex items-center rounded-s transition-colors":!0,"hover-bg-primary hover-text-primary-contrast focus-within-ring-2":i,"ring-primary-50 cursor-pointer bg-primary-10 text-primary":i,"bg-contrast-5 text-disabled":this.disabled,"bg-contrast-5 text-secondary":this.readonly&&!this.disabled}),(t=>{if(!i)return;t.currentTarget.querySelector("input").focus(),r(0===e?1:0)}),s.map(((s,a)=>t(m||(m=g` <label> <foxy-i18n class="${0}" infer="" key="${0}"> </foxy-i18n> <input data-testclass="interactive editable" class="sr-only" value="${0}" name="${0}" type="radio" ?disabled="${0}" ?checked="${0}" @change="${0}"> </label> `),l({"sr-only":a!==e}),s,s,n,!i,a===e,(e=>{e.currentTarget.checked&&r(a)})))),e?"flex-col-reverse":"flex-col",a,a)}__renderField({value:e,label:s,onChange:r}){const i=!this.disabled&&!this.readonly,n=e.toString().length;return t(b||(b=g` <label> <foxy-i18n class="sr-only" infer="" key="${0}"></foxy-i18n> <input data-testclass="interactive editable" style="width:calc(var(--lumo-size-xl) * ${0})" class="${0}" type="number" lang="${0}" min="0" ?disabled="${0}" .value="${0}" @input="${0}"> </label> `),s,n<=2?1:2.5,l({"transition-colors border p-xs h-xs font-medium text-m rounded-s":!0,"ring-primary-50 text-body bg-contrast-10":i,"hover-bg-contrast-20":i,"focus-outline-none focus-ring-2":i,"text-disabled bg-contrast-5":this.disabled,"text-secondary":this.readonly&&!this.disabled,"border-transparent border-solid":!this.readonly,"border-dashed border-contrast-30":this.readonly}),this.lang,!i,e,(e=>{const t=e.currentTarget;r(t.value||"0")}))}__renderTier(e){var s;const r=null!==(s=e.tier)&&void 0!==s?s:"0-0",i=r.includes("+")?"+":"-",[n,a]=r.split(/[-+]/).map((e=>parseFloat(e)));return t(f||(f=g` <div data-testclass="rules:tier" aria-label="${0}" class="${0}"> <div class="${0}"> <foxy-i18n class="uppercase text-s font-medium" infer="" key="tier_if"></foxy-i18n> ${0} <div class="h-s w-s">${0}</div> ${0} <foxy-i18n class="uppercase text-s font-medium" infer="" key="tier_then"></foxy-i18n> ${0} ${0} <foxy-i18n class="uppercase text-s font-medium" infer="" key="tier_by"></foxy-i18n> ${0} ${0} </div> ${0} </div> `),this.t("tier"),l({"flex items-start justify-between rounded":!0,"border border-contrast-10":!0,"border-dashed":!e.tier}),l({"transition-colors flex flex-wrap items-center gap-s p-s":!0,"text-tertiary":!this.disabled,"text-disabled":this.disabled}),this.__renderSwitch({options:["total","quantity"],value:"price"===e.source?0:1,onChange:t=>e.onChange({source:t?"quantity":"price"})}),d,this.__renderField({label:"from",value:String(n),onChange:t=>e.onChange({tier:`${t}${i}${a}`})}),this.__renderSwitch({options:["reduce","increase"],value:"-"===i?0:1,onChange:t=>e.onChange({tier:`${n}${t?"+":"-"}${a}`})}),this.__renderSelect({options:{incremental:"tier_incremental",allunits:"tier_allunits",repeat:"tier_repeat",single:"tier_single"},value:e.method,label:"target",onChange:t=>e.onChange({method:t})}),this.__renderField({label:"adjustment",value:String(a),onChange:t=>e.onChange({tier:`${n}${i}${t}`})}),this.__renderSwitch({value:"percentage"===e.units?0:1,options:["%","¤"],onChange:t=>e.onChange({units:t?"amount":"percentage"})}),e.tier?t(y||(y=g` <button data-testclass="interactive" aria-label="${0}" class="${0}" ?disabled="${0}" ?hidden="${0}" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> `),this.t("delete"),l({"w-s h-s m-s flex-shrink-0 rounded-s transition-colors ring-primary-50":!0,"text-tertiary hover-text-secondary focus-outline-none focus-ring-2":!this.disabled,"text-disabled cursor-default":this.disabled}),this.disabled,this.readonly,(()=>e.onDelete())):"")}}customElements.define("foxy-discount-builder",$);export{$ as DiscountBuilder};
1
+ import"./shared-46f3f71c.js";import{_ as e}from"./shared-0dabe195.js";import{h as t,L as s}from"./shared-7f33a83a.js";import{r}from"./shared-d519a301.js";import{C as i}from"./shared-1fd59009.js";import{I as n}from"./shared-763a6797.js";import{T as a,a as o}from"./shared-a88c5cf1.js";import{c as l}from"./shared-4e709717.js";import{o as d}from"./shared-bb05cfed.js";import"./shared-343d1fd7.js";import"./shared-d3bf9ac0.js";let c,u,h,p,m,b,f,y,g=e=>e;const v=a(i(o(n(s),"discount-builder")));class $ extends v{constructor(){super(...arguments),this.value=null}static get properties(){return e(e({},super.properties),{},{value:{type:String}})}get parsedValue(){var e;let t="",s="",r="quantity_amount";try{const[[i,n]]=Array.from(new URLSearchParams(null!==(e=this.value)&&void 0!==e?e:"").entries()),a=i.substring(9);["price_amount","price_percentage","quantity_amount","quantity_percentage"].includes(a)&&(r=a);const o=n.indexOf("{"),l=n.lastIndexOf("}");-1!==o&&-1!==l&&(t=n.substring(o+1,l),s=n.substring(0,o))}catch(e){}return 0===s.length&&(s="Discount"),{type:r,name:s,details:t}}set parsedValue({name:e,type:t,details:s}){this.value=new URLSearchParams([[`discount_${t}`,`${e}{${s}}`]]).toString()}render(){var s;const i=this.parsedValue.details.split("|").filter((e=>!!e.trim())),n=null!==(s=/[-+]/.test(i[0])?null:i.shift())&&void 0!==s?s:"single",a="repeat"===n?[i[0]]:[...i,void 0],o=this.parsedValue.type,[l,d]=o.split("_");return t(c||(c=g` <div class="space-y-s"> ${0} </div> `),r(a,((t,s)=>this.__renderTier({source:l,method:n,units:d,tier:t,onChange:r=>{var a,o,c;const u=null!==(a=r.method)&&void 0!==a?a:n,h=null!==(o=r.source)&&void 0!==o?o:l,p=null!==(c=r.units)&&void 0!==c?c:d,m=r.tier,b=[...i];if(m){const e=t?s:b.length,r=t?1:0;b.splice(e,r,m)}this.parsedValue=e(e({},this.parsedValue),{},{type:`${h}_${p}`,details:`${u}|${b.join("|")}`}),this.dispatchEvent(new CustomEvent("change"))},onDelete:()=>{const t=i.filter(((e,t)=>t!==s)),r=`${n}|${t.join("|")}`;this.parsedValue=e(e({},this.parsedValue),{},{details:r}),this.dispatchEvent(new CustomEvent("change"))}}))))}__renderSelect({label:e,value:s,options:r,onChange:i}){const n=!this.disabled&&!this.readonly;return t(u||(u=g` <label class="${0}"> <foxy-i18n class="sr-only" infer="" key="${0}"></foxy-i18n> <span class="relative leading-none font-medium flex items-center h-full"> <span class="truncate">${0}</span> <iron-icon class="icon-inline text-xl ml-xs" icon="icons:expand-more"></iron-icon> <select data-testclass="interactive editable" class="opacity-0 absolute inset-0 w-full focus-outline-none" ?disabled="${0}" @change="${0}"> ${0} </select> </span> </label> `),l({"h-xs whitespace-nowrap block ring-primary-50 rounded-s pl-s transition-colors":!0,"hover-bg-primary hover-text-primary-contrast focus-within-ring-2":n,"bg-primary-10 text-primary":n,"bg-contrast-5 text-disabled":this.disabled,"bg-contrast-5 text-secondary":this.readonly&&!this.disabled}),e,this.t(r[s]),!n,(e=>{const t=e.currentTarget;i(t.options[t.selectedIndex].value)}),Object.entries(r).map((([e,r])=>t(h||(h=g` <option value="${0}" ?selected="${0}"> ${0} </option> `),e,e===s,this.t(r)))))}__renderSwitch({value:e,options:s,onChange:r}){const i=!this.disabled&&!this.readonly,n=`switch-${Math.floor(Math.random()*Math.pow(10,10))}`,a="width: 0.4rem; height: 0.4rem";return t(p||(p=g` <div class="${0}" @click="${0}"> <div class="leading-none font-medium px-xs pointer-events-none"> ${0} </div> <div class="flex justify-evenly h-full ${0}"> <div style="${0}" class="bg-current rounded-full"></div> <div style="${0}" class="border border-current rounded-full"></div> </div> </div> `),l({"h-xs px-xs space-x-xs flex items-center rounded-s transition-colors":!0,"hover-bg-primary hover-text-primary-contrast focus-within-ring-2":i,"ring-primary-50 cursor-pointer bg-primary-10 text-primary":i,"bg-contrast-5 text-disabled":this.disabled,"bg-contrast-5 text-secondary":this.readonly&&!this.disabled}),(t=>{if(!i)return;t.currentTarget.querySelector("input").focus(),r(0===e?1:0)}),s.map(((s,a)=>t(m||(m=g` <label> <foxy-i18n class="${0}" infer="" key="${0}"> </foxy-i18n> <input data-testclass="interactive editable" class="sr-only" value="${0}" name="${0}" type="radio" ?disabled="${0}" ?checked="${0}" @change="${0}"> </label> `),l({"sr-only":a!==e}),s,s,n,!i,a===e,(e=>{e.currentTarget.checked&&r(a)})))),e?"flex-col-reverse":"flex-col",a,a)}__renderField({value:e,label:s,onChange:r}){const i=!this.disabled&&!this.readonly,n=e.toString().length;return t(b||(b=g` <label> <foxy-i18n class="sr-only" infer="" key="${0}"></foxy-i18n> <input data-testclass="interactive editable" style="width:calc(var(--lumo-size-xl) * ${0})" class="${0}" type="number" lang="${0}" min="0" ?disabled="${0}" .value="${0}" @input="${0}"> </label> `),s,n<=2?1:2.5,l({"transition-colors border p-xs h-xs font-medium text-m rounded-s":!0,"ring-primary-50 text-body bg-contrast-10":i,"hover-bg-contrast-20":i,"focus-outline-none focus-ring-2":i,"text-disabled bg-contrast-5":this.disabled,"text-secondary":this.readonly&&!this.disabled,"border-transparent border-solid":!this.readonly,"border-dashed border-contrast-30":this.readonly}),this.lang,!i,e,(e=>{const t=e.currentTarget;r(t.value||"0")}))}__renderTier(e){var s;const r=null!==(s=e.tier)&&void 0!==s?s:"0-0",i=r.includes("+")?"+":"-",[n,a]=r.split(/[-+]/).map((e=>parseFloat(e)));return t(f||(f=g` <div data-testclass="rules:tier" aria-label="${0}" class="${0}"> <div class="${0}"> <foxy-i18n class="uppercase text-s font-medium" infer="" key="tier_if"></foxy-i18n> ${0} <div class="h-s w-s">${0}</div> ${0} <foxy-i18n class="uppercase text-s font-medium" infer="" key="tier_then"></foxy-i18n> ${0} ${0} <foxy-i18n class="uppercase text-s font-medium" infer="" key="tier_by"></foxy-i18n> ${0} ${0} </div> ${0} </div> `),this.t("tier"),l({"flex items-start justify-between rounded":!0,"border border-contrast-10":!0,"border-dashed":!e.tier}),l({"transition-colors flex flex-wrap items-center gap-s p-s":!0,"text-tertiary":!this.disabled,"text-disabled":this.disabled}),this.__renderSwitch({options:["total","quantity"],value:"price"===e.source?0:1,onChange:t=>e.onChange({source:t?"quantity":"price"})}),d,this.__renderField({label:"from",value:String(n),onChange:t=>e.onChange({tier:`${t}${i}${a}`})}),this.__renderSwitch({options:["reduce","increase"],value:"-"===i?0:1,onChange:t=>e.onChange({tier:`${n}${t?"+":"-"}${a}`})}),this.__renderSelect({options:{incremental:"tier_incremental",allunits:"tier_allunits",repeat:"tier_repeat",single:"tier_single"},value:e.method,label:"target",onChange:t=>e.onChange({method:t})}),this.__renderField({label:"adjustment",value:String(a),onChange:t=>e.onChange({tier:`${n}${i}${t}`})}),this.__renderSwitch({value:"percentage"===e.units?0:1,options:["%","¤"],onChange:t=>e.onChange({units:t?"amount":"percentage"})}),e.tier?t(y||(y=g` <button data-testclass="interactive" aria-label="${0}" class="${0}" ?disabled="${0}" ?hidden="${0}" @click="${0}"> <iron-icon icon="lumo:cross"></iron-icon> </button> `),this.t("delete"),l({"w-s h-s m-s flex-shrink-0 rounded-s transition-colors ring-primary-50":!0,"text-tertiary hover-text-secondary focus-outline-none focus-ring-2":!this.disabled,"text-disabled cursor-default":this.disabled}),this.disabled,this.readonly,(()=>e.onDelete())):"")}}customElements.define("foxy-discount-builder",$);export{$ as DiscountBuilder};
@@ -1 +1 @@
1
- import"./shared-0479553e.js";import"./foxy-spinner.js";import"./shared-77a4d8e8.js";import{h as r}from"./shared-7f33a83a.js";import{a as s}from"./shared-09d4fbb8.js";import{T as e}from"./shared-ff992ead.js";import"./shared-4674063d.js";import"./shared-59042137.js";import"./shared-c6c6ba69.js";import"./shared-307262a1.js";import"./shared-4b67d699.js";import"./shared-64657919.js";import"./shared-c7f2f1ab.js";import"./shared-d3bf9ac0.js";import"./shared-a92ae606.js";import"./shared-c2d3b32b.js";import"./shared-1d08a5ad.js";import"./shared-d6276c83.js";import"./shared-332f2997.js";import"./shared-4e709717.js";let t,a,i=r=>r;class o extends(s(e,"discount-card")){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=>r(a||(a=i` <foxy-i18n options="${0}" class="${0}" lang="${0}" key="price" ns="${0}"> </foxy-i18n> `),JSON.stringify({currencyDisplay:this.__currencyDisplay,amount:`${s.amount} ${this.__currency}`}),s.amount>=0?"text-success":"text-error",this.lang,this.ns)})}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-discount-card",o);export{o as DiscountCard};
1
+ import"./shared-f9180815.js";import"./foxy-spinner.js";import"./shared-46f3f71c.js";import{h as r}from"./shared-7f33a83a.js";import{a as s}from"./shared-a88c5cf1.js";import{T as e}from"./shared-15fe0f50.js";import"./shared-c97f7178.js";import"./shared-a7475f62.js";import"./shared-6dffe67d.js";import"./shared-0dabe195.js";import"./shared-763a6797.js";import"./shared-343d1fd7.js";import"./shared-1fd59009.js";import"./shared-d3bf9ac0.js";import"./shared-421e46e9.js";import"./shared-a6517170.js";import"./shared-bbbb8894.js";import"./shared-3ab0306f.js";import"./shared-8528906b.js";import"./shared-4e709717.js";let t,a,i=r=>r;class o extends(s(e,"discount-card")){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=>r(a||(a=i` <foxy-i18n options="${0}" class="${0}" lang="${0}" key="price" ns="${0}"> </foxy-i18n> `),JSON.stringify({currencyDisplay:this.__currencyDisplay,amount:`${s.amount} ${this.__currency}`}),s.amount>=0?"text-success":"text-error",this.lang,this.ns)})}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-discount-card",o);export{o as DiscountCard};
@@ -1 +1 @@
1
- import"./shared-0479553e.js";import"./foxy-spinner.js";import"./shared-77a4d8e8.js";import{h as r}from"./shared-7f33a83a.js";import{a as s}from"./shared-09d4fbb8.js";import{T as e}from"./shared-ff992ead.js";import"./shared-4674063d.js";import"./shared-59042137.js";import"./shared-c6c6ba69.js";import"./shared-307262a1.js";import"./shared-4b67d699.js";import"./shared-64657919.js";import"./shared-c7f2f1ab.js";import"./shared-d3bf9ac0.js";import"./shared-a92ae606.js";import"./shared-c2d3b32b.js";import"./shared-1d08a5ad.js";import"./shared-d6276c83.js";import"./shared-332f2997.js";import"./shared-4e709717.js";let t,a,i=r=>r;const c=s(e,"discount-detail-card");class o extends c{constructor(){super(...arguments),this.__currencyDisplay="",this.__currency=""}renderBody(){return super.renderBody({title:s=>r(t||(t=i`${0}`),s.name),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-discount-detail-card",o);export{o as DiscountDetailCard};
1
+ import"./shared-f9180815.js";import"./foxy-spinner.js";import"./shared-46f3f71c.js";import{h as r}from"./shared-7f33a83a.js";import{a as s}from"./shared-a88c5cf1.js";import{T as e}from"./shared-15fe0f50.js";import"./shared-c97f7178.js";import"./shared-a7475f62.js";import"./shared-6dffe67d.js";import"./shared-0dabe195.js";import"./shared-763a6797.js";import"./shared-343d1fd7.js";import"./shared-1fd59009.js";import"./shared-d3bf9ac0.js";import"./shared-421e46e9.js";import"./shared-a6517170.js";import"./shared-bbbb8894.js";import"./shared-3ab0306f.js";import"./shared-8528906b.js";import"./shared-4e709717.js";let t,a,i=r=>r;const c=s(e,"discount-detail-card");class o extends c{constructor(){super(...arguments),this.__currencyDisplay="",this.__currency=""}renderBody(){return super.renderBody({title:s=>r(t||(t=i`${0}`),s.name),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-discount-detail-card",o);export{o as DiscountDetailCard};