@foxy.io/elements 1.15.0-beta.1 → 1.15.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) 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-applied-tax-card.js +1 -1
  5. package/dist/cdn/foxy-attribute-card.js +1 -1
  6. package/dist/cdn/foxy-attribute-form.js +1 -1
  7. package/dist/cdn/foxy-cancellation-form.js +1 -1
  8. package/dist/cdn/foxy-collection-page.js +1 -1
  9. package/dist/cdn/foxy-collection-pages.js +1 -1
  10. package/dist/cdn/foxy-coupon-card.js +1 -0
  11. package/dist/cdn/foxy-coupon-code-form.js +1 -0
  12. package/dist/cdn/foxy-coupon-codes-form.js +1 -0
  13. package/dist/cdn/foxy-coupon-form.js +1 -0
  14. package/dist/cdn/foxy-custom-field-card.js +1 -1
  15. package/dist/cdn/foxy-custom-field-form.js +1 -1
  16. package/dist/cdn/foxy-customer-api.js +1 -1
  17. package/dist/cdn/foxy-customer-card.js +1 -1
  18. package/dist/cdn/foxy-customer-form.js +1 -1
  19. package/dist/cdn/foxy-customer-portal-settings.js +4 -807
  20. package/dist/cdn/foxy-customer-portal.js +4 -4
  21. package/dist/cdn/foxy-customer.js +1 -1
  22. package/dist/cdn/foxy-customers-table.js +1 -1
  23. package/dist/cdn/foxy-discount-card.js +1 -1
  24. package/dist/cdn/foxy-donation.js +1 -1
  25. package/dist/cdn/foxy-email-template-form.js +1 -1
  26. package/dist/cdn/foxy-error-entry-card.js +1 -1
  27. package/dist/cdn/foxy-form-dialog.js +1 -1
  28. package/dist/cdn/foxy-generate-codes-form.js +1 -0
  29. package/dist/cdn/foxy-i18n.js +1 -1
  30. package/dist/cdn/foxy-items-form.js +1 -1
  31. package/dist/cdn/foxy-nucleon-element.js +1 -1
  32. package/dist/cdn/foxy-pagination.js +1 -0
  33. package/dist/cdn/foxy-payment-card.js +1 -1
  34. package/dist/cdn/foxy-payment-method-card.js +1 -1
  35. package/dist/cdn/foxy-query-builder.js +1 -69
  36. package/dist/cdn/foxy-sign-in-form.js +1 -1
  37. package/dist/cdn/foxy-spinner.js +1 -1
  38. package/dist/cdn/foxy-subscription-card.js +1 -1
  39. package/dist/cdn/foxy-subscription-form.js +3 -3
  40. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  41. package/dist/cdn/foxy-table.js +1 -1
  42. package/dist/cdn/foxy-tax-card.js +1 -1
  43. package/dist/cdn/foxy-tax-form.js +1 -1
  44. package/dist/cdn/foxy-template-config-form.js +1 -1
  45. package/dist/cdn/foxy-template-form.js +1 -1
  46. package/dist/cdn/foxy-transaction-card.js +1 -1
  47. package/dist/cdn/foxy-transactions-table.js +1 -1
  48. package/dist/cdn/foxy-user-form.js +1 -1
  49. package/dist/cdn/foxy-users-table.js +1 -1
  50. package/dist/cdn/{shared-5c8b531d.js → shared-0bda8ecb.js} +1 -1
  51. package/dist/cdn/{shared-07abcd7b.js → shared-0fcdd1c4.js} +1 -1
  52. package/dist/cdn/{shared-a46edf4b.js → shared-30131f76.js} +1 -1
  53. package/dist/cdn/shared-36629ded.js +131 -0
  54. package/dist/cdn/{shared-bc2bfe52.js → shared-4038cb18.js} +1 -1
  55. package/dist/cdn/{shared-44cfc617.js → shared-423a4840.js} +1 -1
  56. package/dist/cdn/shared-4fa5f144.js +1 -0
  57. package/dist/cdn/shared-51b5e223.js +1 -0
  58. package/dist/cdn/{shared-593f7e2c.js → shared-51e28c83.js} +1 -1
  59. package/dist/cdn/shared-710ed658.js +134 -0
  60. package/dist/cdn/shared-800a5471.js +1 -0
  61. package/dist/cdn/{shared-8a7bee0d.js → shared-8f7a66c4.js} +1 -1
  62. package/dist/cdn/{shared-91e768be.js → shared-9af7b5f0.js} +1 -1
  63. package/dist/cdn/{shared-7a42073a.js → shared-a11160e7.js} +5 -5
  64. package/dist/cdn/{shared-5f54e916.js → shared-a4e6ecb0.js} +1 -1
  65. package/dist/cdn/{shared-b5147166.js → shared-a8d96c23.js} +1 -1
  66. package/dist/cdn/{shared-322e60b1.js → shared-b03b6d72.js} +1 -1
  67. package/dist/cdn/shared-b2330475.js +1 -0
  68. package/dist/cdn/{shared-1761daef.js → shared-c1dadefe.js} +1 -1
  69. package/dist/cdn/shared-c6a4b2d6.js +1 -0
  70. package/dist/cdn/shared-ccea5a33.js +69 -0
  71. package/dist/cdn/shared-cd3c902e.js +1 -0
  72. package/dist/cdn/{shared-34b2c1e2.js → shared-d3831f99.js} +1 -1
  73. package/dist/cdn/shared-d9a260f0.js +1 -0
  74. package/dist/cdn/{shared-e5cbf291.js → shared-f875a4f8.js} +1 -1
  75. package/dist/cdn/{shared-e7f8ffe9.js → shared-fb403e1f.js} +1 -1
  76. package/dist/cdn/shared-ff149b55.js +804 -0
  77. package/dist/cdn/translations/shared/en.json +105 -0
  78. package/dist/elements/private/Checkbox/Checkbox.js +36 -22
  79. package/dist/elements/private/Checkbox/Checkbox.js.map +1 -1
  80. package/dist/elements/private/EditableList/EditableList.d.ts +20 -0
  81. package/dist/elements/private/EditableList/EditableList.js +123 -0
  82. package/dist/elements/private/EditableList/EditableList.js.map +1 -0
  83. package/dist/elements/public/CouponCard/CouponCard.d.ts +29 -0
  84. package/dist/elements/public/CouponCard/CouponCard.js +130 -0
  85. package/dist/elements/public/CouponCard/CouponCard.js.map +1 -0
  86. package/dist/elements/public/CouponCard/index.d.ts +5 -0
  87. package/dist/elements/public/CouponCard/index.js +7 -0
  88. package/dist/elements/public/CouponCard/index.js.map +1 -0
  89. package/dist/elements/public/CouponCard/types.d.ts +15 -0
  90. package/dist/elements/public/CouponCard/types.js +2 -0
  91. package/dist/elements/public/CouponCard/types.js.map +1 -0
  92. package/dist/elements/public/CouponCodeForm/CouponCodeForm.d.ts +45 -0
  93. package/dist/elements/public/CouponCodeForm/CouponCodeForm.js +218 -0
  94. package/dist/elements/public/CouponCodeForm/CouponCodeForm.js.map +1 -0
  95. package/dist/elements/public/CouponCodeForm/index.d.ts +8 -0
  96. package/dist/elements/public/CouponCodeForm/index.js +10 -0
  97. package/dist/elements/public/CouponCodeForm/index.js.map +1 -0
  98. package/dist/elements/public/CouponCodeForm/types.d.ts +15 -0
  99. package/dist/elements/public/CouponCodeForm/types.js +2 -0
  100. package/dist/elements/public/CouponCodeForm/types.js.map +1 -0
  101. package/dist/elements/public/CouponCodesForm/CouponCodesForm.d.ts +29 -0
  102. package/dist/elements/public/CouponCodesForm/CouponCodesForm.js +209 -0
  103. package/dist/elements/public/CouponCodesForm/CouponCodesForm.js.map +1 -0
  104. package/dist/elements/public/CouponCodesForm/index.d.ts +8 -0
  105. package/dist/elements/public/CouponCodesForm/index.js +12 -0
  106. package/dist/elements/public/CouponCodesForm/index.js.map +1 -0
  107. package/dist/elements/public/CouponCodesForm/internal/InternalCouponCodesFormListItem.d.ts +14 -0
  108. package/dist/elements/public/CouponCodesForm/internal/InternalCouponCodesFormListItem.js +48 -0
  109. package/dist/elements/public/CouponCodesForm/internal/InternalCouponCodesFormListItem.js.map +1 -0
  110. package/dist/elements/public/CouponCodesForm/types.d.ts +16 -0
  111. package/dist/elements/public/CouponCodesForm/types.js +2 -0
  112. package/dist/elements/public/CouponCodesForm/types.js.map +1 -0
  113. package/dist/elements/public/CouponForm/CouponForm.d.ts +77 -0
  114. package/dist/elements/public/CouponForm/CouponForm.js +1266 -0
  115. package/dist/elements/public/CouponForm/CouponForm.js.map +1 -0
  116. package/dist/elements/public/CouponForm/index.d.ts +19 -0
  117. package/dist/elements/public/CouponForm/index.js +21 -0
  118. package/dist/elements/public/CouponForm/index.js.map +1 -0
  119. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPage.d.ts +19 -0
  120. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPage.js +98 -0
  121. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPage.js.map +1 -0
  122. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItem.d.ts +19 -0
  123. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItem.js +51 -0
  124. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItem.js.map +1 -0
  125. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItemContent.d.ts +19 -0
  126. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItemContent.js +52 -0
  127. package/dist/elements/public/CouponForm/private/CategoryRestrictionsPageItemContent.js.map +1 -0
  128. package/dist/elements/public/CouponForm/types.d.ts +27 -0
  129. package/dist/elements/public/CouponForm/types.js +2 -0
  130. package/dist/elements/public/CouponForm/types.js.map +1 -0
  131. package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedInView.js +19 -6
  132. package/dist/elements/public/CustomerPortal/InternalCustomerPortalLoggedInView.js.map +1 -1
  133. package/dist/elements/public/GenerateCodesForm/GenerateCodesForm.d.ts +39 -0
  134. package/dist/elements/public/GenerateCodesForm/GenerateCodesForm.js +197 -0
  135. package/dist/elements/public/GenerateCodesForm/GenerateCodesForm.js.map +1 -0
  136. package/dist/elements/public/GenerateCodesForm/index.d.ts +8 -0
  137. package/dist/elements/public/GenerateCodesForm/index.js +10 -0
  138. package/dist/elements/public/GenerateCodesForm/index.js.map +1 -0
  139. package/dist/elements/public/GenerateCodesForm/types.d.ts +24 -0
  140. package/dist/elements/public/GenerateCodesForm/types.js +2 -0
  141. package/dist/elements/public/GenerateCodesForm/types.js.map +1 -0
  142. package/dist/elements/public/I18n/I18n.js +1 -1
  143. package/dist/elements/public/I18n/I18n.js.map +1 -1
  144. package/dist/elements/public/I18n/format/date.js +7 -6
  145. package/dist/elements/public/I18n/format/date.js.map +1 -1
  146. package/dist/elements/public/I18n/format/discount.d.ts +6 -0
  147. package/dist/elements/public/I18n/format/discount.js +20 -0
  148. package/dist/elements/public/I18n/format/discount.js.map +1 -0
  149. package/dist/elements/public/I18n/format/index.js +4 -0
  150. package/dist/elements/public/I18n/format/index.js.map +1 -1
  151. package/dist/elements/public/I18n/format/ordinal.d.ts +6 -0
  152. package/dist/elements/public/I18n/format/ordinal.js +9 -0
  153. package/dist/elements/public/I18n/format/ordinal.js.map +1 -0
  154. package/dist/elements/public/Pagination/Pagination.d.ts +37 -0
  155. package/dist/elements/public/Pagination/Pagination.js +154 -0
  156. package/dist/elements/public/Pagination/Pagination.js.map +1 -0
  157. package/dist/elements/public/Pagination/index.d.ts +6 -0
  158. package/dist/elements/public/Pagination/index.js +8 -0
  159. package/dist/elements/public/Pagination/index.js.map +1 -0
  160. package/dist/elements/public/Table/Table.js +20 -5
  161. package/dist/elements/public/Table/Table.js.map +1 -1
  162. package/dist/elements/public/index.d.ts +6 -0
  163. package/dist/elements/public/index.defined.d.ts +6 -0
  164. package/dist/elements/public/index.defined.js +6 -0
  165. package/dist/elements/public/index.defined.js.map +1 -1
  166. package/dist/elements/public/index.js +6 -0
  167. package/dist/elements/public/index.js.map +1 -1
  168. package/dist/mixins/themeable.js +80 -4
  169. package/dist/mixins/themeable.js.map +1 -1
  170. package/package.json +1 -1
  171. package/dist/cdn/shared-00563cb0.js +0 -1
  172. package/dist/cdn/shared-35dbd2c5.js +0 -1
  173. package/dist/cdn/shared-9a40309d.js +0 -1
  174. package/dist/cdn/shared-ce1da35d.js +0 -1
  175. package/dist/cdn/shared-d01d809a.js +0 -1
  176. package/dist/cdn/shared-d8ffb279.js +0 -264
  177. package/dist/cdn/shared-f1dc1c6c.js +0 -1
@@ -0,0 +1,131 @@
1
+ import{T as e}from"./shared-bb824ab4.js";import"./shared-df573cea.js";import{h as t,D as i}from"./shared-ff79f3f9.js";const n=t`<dom-module id="lumo-number-field" theme-for="vaadin-number-field">
2
+ <template>
3
+ <style include="lumo-field-button">
4
+ :host {
5
+ width: 8em;
6
+ }
7
+
8
+ :host([has-controls]:not([theme~="align-right"])) [part="value"] {
9
+ text-align: center;
10
+ }
11
+
12
+ [part="decrease-button"][disabled],
13
+ [part="increase-button"][disabled] {
14
+ opacity: 0.2;
15
+ }
16
+
17
+ :host([has-controls]) [part="input-field"] {
18
+ padding: 0;
19
+ }
20
+
21
+ [part="decrease-button"],
22
+ [part="increase-button"] {
23
+ cursor: pointer;
24
+ font-size: var(--lumo-icon-size-s);
25
+ width: 1.6em;
26
+ height: 1.6em;
27
+ }
28
+
29
+ [part="decrease-button"]::before,
30
+ [part="increase-button"]::before {
31
+ margin-top: 0.2em;
32
+ }
33
+
34
+ /* RTL specific styles */
35
+
36
+ :host([dir="rtl"]) [part="value"],
37
+ :host([dir="rtl"]) [part="input-field"] ::slotted(input) {
38
+ --_lumo-text-field-overflow-mask-image: linear-gradient(to left, transparent, #000 1.25em);
39
+ }
40
+ </style>
41
+ </template>
42
+ </dom-module>`;document.head.appendChild(n.content);
43
+ /**
44
+ @license
45
+ Copyright (c) 2017 Vaadin Ltd.
46
+ This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
47
+ */
48
+ const s=t`<dom-module id="vaadin-number-field-template">
49
+ <template>
50
+ <style>
51
+ :host([readonly]) [part\$="button"] {
52
+ pointer-events: none;
53
+ }
54
+
55
+ [part="decrease-button"]::before {
56
+ content: "−";
57
+ }
58
+
59
+ [part="increase-button"]::before {
60
+ content: "+";
61
+ }
62
+
63
+ [part="decrease-button"],
64
+ [part="increase-button"] {
65
+ -webkit-user-select: none;
66
+ -moz-user-select: none;
67
+ -ms-user-select: none;
68
+ user-select: none;
69
+ }
70
+
71
+ /* Hide the native arrow icons */
72
+ [part="value"]::-webkit-outer-spin-button,
73
+ [part="value"]::-webkit-inner-spin-button {
74
+ -webkit-appearance: none;
75
+ margin: 0;
76
+ }
77
+
78
+ [part="value"] {
79
+ /* Older Firefox versions (v47.0) requires !important */
80
+ -moz-appearance: textfield !important;
81
+ }
82
+
83
+ :host([dir="rtl"]) [part="input-field"] {
84
+ direction: ltr;
85
+ }
86
+
87
+ :host([dir="rtl"]) [part="value"]::placeholder {
88
+ direction: rtl;
89
+ }
90
+
91
+ :host([dir="rtl"]) [part="input-field"] ::slotted(input)::placeholder {
92
+ direction: rtl;
93
+ }
94
+
95
+ :host([dir="rtl"]) [part="value"]:-ms-input-placeholder,
96
+ :host([dir="rtl"]) [part="input-field"] ::slotted(input):-ms-input-placeholder {
97
+ direction: rtl;
98
+ }
99
+
100
+ :host([dir="rtl"]:not([has-controls])) [part="value"]::placeholder {
101
+ text-align: left;
102
+ }
103
+
104
+ :host([dir="rtl"]:not([has-controls])) [part="input-field"] ::slotted(input)::placeholder {
105
+ text-align: left;
106
+ }
107
+
108
+ :host([dir="rtl"]:not([has-controls])) [part="value"]:-ms-input-placeholder,
109
+ :host([dir="rtl"]:not([has-controls])) [part="input-field"] ::slotted(input):-ms-input-placeholder {
110
+ text-align: left;
111
+ }
112
+ </style>
113
+
114
+ <div disabled\$="[[!_allowed(-1, value, min, max, step)]]" part="decrease-button" on-click="_decreaseValue" on-touchend="_decreaseButtonTouchend" hidden\$="[[!hasControls]]">
115
+ </div>
116
+
117
+ <div disabled\$="[[!_allowed(1, value, min, max, step)]]" part="increase-button" on-click="_increaseValue" on-touchend="_increaseButtonTouchend" hidden\$="[[!hasControls]]">
118
+ </div>
119
+ </template>
120
+
121
+
122
+ </dom-module>`;let a;document.head.appendChild(s.content);class r extends e{static get is(){return"vaadin-number-field"}static get version(){return"2.9.0"}static get properties(){return{hasControls:{type:Boolean,value:!1,reflectToAttribute:!0},min:{type:Number,reflectToAttribute:!0,observer:"_minChanged"},max:{type:Number,reflectToAttribute:!0,observer:"_maxChanged"},step:{type:Number,value:1,observer:"_stepChanged"}}}ready(){super.ready(),this.__previousValidInput=this.value||"",this.inputElement.type="number",this.inputElement.addEventListener("change",this.__onInputChange.bind(this))}_decreaseButtonTouchend(e){e.preventDefault(),this._decreaseValue()}_increaseButtonTouchend(e){e.preventDefault(),this._increaseValue()}static get template(){if(!a){a=super.template.cloneNode(!0);const e=i.import(this.is+"-template","template"),t=e.content.querySelector('[part="decrease-button"]'),n=e.content.querySelector('[part="increase-button"]'),s=e.content.querySelector("style"),r=a.content.querySelector('[part="input-field"]'),l=a.content.querySelector('[name="prefix"]');r.insertBefore(t,l),r.appendChild(n),a.content.appendChild(s)}return a}_createConstraintsObserver(){this._createMethodObserver("_constraintsChanged(required, minlength, maxlength, pattern, min, max, step)")}_constraintsChanged(e,t,i,n,s,a,r){if(!this.invalid)return;const l=e=>!e&&0!==e;l(s)&&l(a)?super._constraintsChanged(e,t,i,n):this.validate()}_decreaseValue(){this._incrementValue(-1)}_increaseValue(){this._incrementValue(1)}_incrementValue(e){if(this.disabled||this.readonly)return;let t=parseFloat(this.value);this.value?t<this.min?(e=0,t=this.min):t>this.max&&(e=0,t=this.max):0==this.min&&e<0||0==this.max&&e>0||0==this.max&&0==this.min?(e=0,t=0):(null==this.max||this.max>=0)&&(null==this.min||this.min<=0)?t=0:this.min>0?(t=this.min,this.max<0&&e<0&&(t=this.max),e=0):this.max<0&&(t=this.max,e<0?e=0:this._getIncrement(1,t-this.step)>this.max?t-=2*this.step:t-=this.step);const i=this._getIncrement(e,t);this.value&&0!=e&&!this._incrementIsInsideTheLimits(e,t)||this._setValue(i)}_setValue(e){this.value=this.inputElement.value=String(parseFloat(e)),this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))}_getIncrement(e,t){let i=this.step||1,n=this.min||0;const s=Math.max(this._getMultiplier(t),this._getMultiplier(i),this._getMultiplier(n));i*=s,n*=s;const a=((t=Math.round(t*s))-n)%i;return e>0?(t-a+i)/s:e<0?(t-(a||i))/s:t/s}_getDecimalCount(e){const t=String(e),i=t.indexOf(".");return-1===i?1:t.length-i-1}_getMultiplier(e){if(!isNaN(e))return Math.pow(10,this._getDecimalCount(e))}_incrementIsInsideTheLimits(e,t){return e<0?null==this.min||this._getIncrement(e,t)>=this.min:e>0?null==this.max||this._getIncrement(e,t)<=this.max:this._getIncrement(e,t)<=this.max&&this._getIncrement(e,t)>=this.min}_allowed(e){const t=e*(this.step||1),i=parseFloat(this.value);return!this.value||!this.disabled&&this._incrementIsInsideTheLimits(t,i)}_stepChanged(e,t){this.__validateByStep=this.__stepChangedCalled||null!==this.getAttribute("step"),this.inputElement.step=this.__validateByStep?e:"any",this.__stepChangedCalled=!0,this.setAttribute("step",e)}_minChanged(e){this.inputElement.min=e}_maxChanged(e){this.inputElement.max=e}_valueChanged(e,t){e&&isNaN(parseFloat(e))?this.value="":"string"!=typeof this.value&&(this.value=String(this.value)),super._valueChanged(this.value,t)}_onKeyDown(e){38==e.keyCode?(e.preventDefault(),this._increaseValue()):40==e.keyCode&&(e.preventDefault(),this._decreaseValue()),super._onKeyDown(e)}__onInputChange(){this.validate()}checkValidity(){return void 0!==this.min||void 0!==this.max||this.__validateByStep?this.inputElement.checkValidity():super.checkValidity()}}window.customElements.define(r.is,r);
123
+ /**
124
+ @license
125
+ Copyright (c) 2019 Vaadin Ltd.
126
+ This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
127
+ */
128
+ const l=t`<dom-module id="vaadin-integer-field-template">
129
+
130
+
131
+ </dom-module>`;document.head.appendChild(l.content);class o extends r{static get is(){return"vaadin-integer-field"}static get version(){return"2.9.0"}static get properties(){return{pattern:String,preventInvalidInput:Boolean,minlength:Number,maxlength:Number}}ready(){super.ready(),this._enabledCharPattern="[-+\\d]"}_valueChanged(e,t){if(""!==e&&!this.__isInteger(e))return console.warn(`Trying to set non-integer value "${e}" to <vaadin-integer-field>. Clearing the value.`),void(this.value="");super._valueChanged(e,t)}_stepChanged(e,t){if(!this.__hasOnlyDigits(e))return console.warn(`Trying to set invalid step size "${e}", which is not a positive integer, to <vaadin-integer-field>. Resetting the default value 1.`),void(this.step=1);super._stepChanged(e,t)}__isInteger(e){return/^(-\d)?\d*$/.test(String(e))}__hasOnlyDigits(e){return/^\d*$/.test(String(e))}}window.customElements.define(o.is,o);export{o as I};
@@ -1 +1 @@
1
- import{h as t,_ as e}from"./shared-63eaded9.js";import{C as i}from"./shared-593f7e2c.js";import{N as s}from"./shared-44cfc617.js";import{T as r}from"./shared-9a40309d.js";import{c as a}from"./shared-4e709717.js";let d,l,n,o=t=>t;const h=i(r(s));class p extends h{constructor(){super(...arguments),this.templates={},this.lang="",this.ns="",this.__renderTitle=e=>t(d||(d=o` <div data-testid="title"> ${0} <div class="text-secondary truncate"> ${0}&ZeroWidthSpace; </div> ${0} </div> `),this.renderTemplateOrSlot("title:before"),this.data?null==e?void 0:e(this.data):"",this.renderTemplateOrSlot("title:after")),this.__renderSubtitle=e=>t(l||(l=o` <div data-testid="subtitle"> ${0} <div class="font-semibold truncate"> ${0}&ZeroWidthSpace; </div> ${0} </div> `),this.renderTemplateOrSlot("subtitle:before"),this.data?null==e?void 0:e(this.data):"",this.renderTemplateOrSlot("subtitle:after"))}static get properties(){return e(e({},super.properties),{},{lang:{type:String},ns:{type:String}})}render(e){var i,s;const r=this.hiddenSelector;return t(n||(n=o` <div aria-live="polite" aria-busy="${0}" class="relative text-body text-m font-lumo leading-m"> ${0} ${0} <div class="${0}"> <foxy-spinner data-testid="spinner" class="m-auto" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),!this.data&&this.in("busy"),r.matches("title",!0)?"":this.__renderTitle(null==e?void 0:e.title),r.matches("subtitle",!0)?"":this.__renderSubtitle(null==e?void 0:e.subtitle),a({"transition duration-250 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!!this.data}),this.in("fail")?"error":this.in({idle:"template"})?"empty":"busy",this.lang,this.ns,null!==(s=null===(i=customElements.get("foxy-spinner"))||void 0===i?void 0:i.defaultNS)&&void 0!==s?s:"")}}export{p as T};
1
+ import{h as t,_ as e}from"./shared-63eaded9.js";import{C as i}from"./shared-51e28c83.js";import{N as s}from"./shared-423a4840.js";import{T as r}from"./shared-cd3c902e.js";import{c as a}from"./shared-4e709717.js";let d,l,n,o=t=>t;const h=i(r(s));class p extends h{constructor(){super(...arguments),this.templates={},this.lang="",this.ns="",this.__renderTitle=e=>t(d||(d=o` <div data-testid="title"> ${0} <div class="text-secondary truncate"> ${0}&ZeroWidthSpace; </div> ${0} </div> `),this.renderTemplateOrSlot("title:before"),this.data?null==e?void 0:e(this.data):"",this.renderTemplateOrSlot("title:after")),this.__renderSubtitle=e=>t(l||(l=o` <div data-testid="subtitle"> ${0} <div class="font-semibold truncate"> ${0}&ZeroWidthSpace; </div> ${0} </div> `),this.renderTemplateOrSlot("subtitle:before"),this.data?null==e?void 0:e(this.data):"",this.renderTemplateOrSlot("subtitle:after"))}static get properties(){return e(e({},super.properties),{},{lang:{type:String},ns:{type:String}})}render(e){var i,s;const r=this.hiddenSelector;return t(n||(n=o` <div aria-live="polite" aria-busy="${0}" class="relative text-body text-m font-lumo leading-m"> ${0} ${0} <div class="${0}"> <foxy-spinner data-testid="spinner" class="m-auto" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),!this.data&&this.in("busy"),r.matches("title",!0)?"":this.__renderTitle(null==e?void 0:e.title),r.matches("subtitle",!0)?"":this.__renderSubtitle(null==e?void 0:e.subtitle),a({"transition duration-250 ease-in-out absolute inset-0 flex":!0,"opacity-0 pointer-events-none":!!this.data}),this.in("fail")?"error":this.in({idle:"template"})?"empty":"busy",this.lang,this.ns,null!==(s=null===(i=customElements.get("foxy-spinner"))||void 0===i?void 0:i.defaultNS)&&void 0!==s?s:"")}}export{p as T};
@@ -1 +1 @@
1
- import{L as e,_ as t}from"./shared-63eaded9.js";import{t as s,m as r,a as i,b as n,R as h,F as o}from"./shared-1761daef.js";import{A as a}from"./shared-00563cb0.js";import{U as _}from"./shared-7684cb05.js";import{i as u}from"./shared-a46edf4b.js";function d(e,t){let r=null;return s(t).forEach((function(){var t,s,i,n,h,o,a,_,u,d,c;if(null===(i=null===(s=null===(t=this.node)||void 0===t?void 0:t._links)||void 0===s?void 0:s.self)||void 0===i?void 0:i.href){const t=null===(o=null===(h=null===(n=this.node)||void 0===n?void 0:n._links)||void 0===h?void 0:h.self)||void 0===o?void 0:o.href,s=new URL(null===(u=null===(_=null===(a=this.node)||void 0===a?void 0:a._links)||void 0===_?void 0:_.self)||void 0===u?void 0:u.href);if(s.searchParams.delete("zoom"),e===t||e===s.toString())return r=JSON.stringify(this.node),void this.stop()}Object.entries(null!==(c=null===(d=this.node)||void 0===d?void 0:d._links)&&void 0!==c?c:{}).some((([t,s])=>{var i,n;if(s.href!==e)return!1;const h=null===(n=null===(i=this.node)||void 0===i?void 0:i._embedded)||void 0===n?void 0:n[t];if(!h||!Array.isArray(h))return!1;const o=h.length<20?h.length:21,a=new URL(e),_=new URL(e);return a.searchParams.set("offset",h.length.toString()),_.searchParams.set("offset",o.toString()),r=JSON.stringify({returned_items:h.length,total_items:o,offset:0,limit:20,_embedded:{[t]:h},_links:{curies:this.node._links.curies,first:{href:e},last:{href:_.toString()},prev:{href:e},next:{href:a.toString()},self:{href:e}}}),this.stop(),!0}))})),new Response(r,{status:r?200:404})}class c extends e{constructor(){super(...arguments),this.lang="",this.parent="",this.related=[],this.__href="",this.__group="",this.__fetchEventQueue=[],this.__service=u(i.withConfig({services:{sendDelete:()=>this._sendDelete(),sendPatch:({edits:e})=>this._sendPatch(e),sendPost:({edits:e})=>this._sendPost(e),sendGet:()=>this._sendGet()},actions:{validate:n({errors:e=>{const s=this.constructor.v8n,r=t(t({},e.data),e.edits);return s.map((e=>e(r))).filter((e=>"string"==typeof e)).filter(((e,t,s)=>s.indexOf(e)===t))}})}}))}static get properties(){return{related:{type:Array},parent:{type:String},group:{type:String,noAccessor:!0},href:{type:String,noAccessor:!0},lang:{type:String}}}static get v8n(){return[]}get failure(){return this.__service.state.context.failure}get errors(){return this.__service.state.context.errors}get form(){const{data:e,edits:s}=this.__service.state.context;return t(t({},e),s)}get data(){return this.__service.state.context.data}set data(e){var t;this.__service.send({type:"SET_DATA",data:e}),this.__href=null!==(t=null==e?void 0:e._links.self.href)&&void 0!==t?t:""}get group(){return this.__group}set group(e){this.__group=e,this.__destroyRumour(),this.__createRumour()}get href(){return this.__href}set href(e){this.__href=e,e?this.__service.send({type:"FETCH"}):this.__service.send({type:"SET_DATA",data:null})}in(e){return this.__service.state.matches(e)}undo(){this.__service.send({type:"UNDO"})}edit(e){this.__service.send({type:"EDIT",data:e})}submit(){this.__service.send({type:"SUBMIT"})}delete(){this.__service.send({type:"DELETE"})}refresh(){this.__service.send({type:"REFRESH"})}connectedCallback(){super.connectedCallback(),this.__createService(),this.__createRumour(),this.__createServer(),this.__processFetchEventQueue()}disconnectedCallback(){super.disconnectedCallback(),this.__destroyService(),this.__destroyRumour(),this.__destroyServer(),this.__flushFetchEventQueue("parent element was disconnected")}async _fetch(...e){const t=await new a(this).fetch(...e);if(!t.ok)throw t;return t.json()}async _sendPost(e){const t=JSON.stringify(e),s=await this._fetch(this.parent,{body:t,method:"POST"}),r=c.Rumour(this.group),i=[...this.related,this.parent];return this.__destroyRumour(),r.share({data:s,related:i,source:s._links.self.href}),this.__createRumour(),s}async _sendGet(){const e=await this._fetch(this.href),t=c.Rumour(this.group);return this.__destroyRumour(),t.share({data:e,source:this.href}),this.__createRumour(),e}async _sendPatch(e){const t=JSON.stringify(e),s=await this._fetch(this.href,{body:t,method:"PATCH"}),r=c.Rumour(this.group);return this.__destroyRumour(),r.share({data:s,source:this.href,related:this.related}),this.__createRumour(),s}async _sendDelete(){const e=await this._fetch(this.href,{method:"DELETE"}),t=c.Rumour(this.group),s=[...this.related,this.parent];return this.__destroyRumour(),t.share({data:null,source:this.href,related:s}),this.__createRumour(),e}__createService(){this.__service.onTransition((e=>{if(!e.changed)return;const t=e.toStrings().reduce(((e,t)=>[...e,...t.split(".")]),[]);this.setAttribute("state",[...new Set(t)].join(" ")),this.requestUpdate(),this.dispatchEvent(new _),e.matches("busy")||this.__processFetchEventQueue()})),this.__service.onChange((()=>{this.requestUpdate(),this.dispatchEvent(new _)})),this.__service.start()}__destroyService(){this.__service.stop()}__createRumour(){const e=c.Rumour(this.group);this.__unsubscribeFromRumour=e.track((e=>this.__handleRumourUpdate(e)))}__destroyRumour(){var e;null===(e=this.__unsubscribeFromRumour)||void 0===e||e.call(this)}__createServer(){this.__fetchEventHandler=this.__handleFetchEvent.bind(this),this.addEventListener("fetch",this.__fetchEventHandler)}__destroyServer(){this.removeEventListener("fetch",this.__fetchEventHandler)}__handleRumourUpdate(e){var t;try{const s=null===(t=this.__service.state)||void 0===t?void 0:t.context.data;if(!s)return;const r=e(s);r!==s&&this.__service.send({data:r,type:"SET_DATA"})}catch(e){if(!(e instanceof h.UpdateError))throw e;this.__service.send({type:"REFRESH"})}}__processFetchEventQueue(){const e=new c.API(this);this.__fetchEventQueue.forEach((t=>{const s=t.request,r=d(s.url,this.data),i=r.ok?r:e.fetch(s);t.respondWith(Promise.resolve(i)),r.ok&&console.debug(`%c@foxy.io/elements::${this.localName}\n%c200%c GET ${s.url}`,"color: gray","background: gray; padding: 0 .2em; border-radius: .2em; color: white;","")})),this.__fetchEventQueue=[]}__flushFetchEventQueue(e){this.__fetchEventQueue.forEach((t=>{t.respondWith(Promise.reject(new Error(e)))})),this.__fetchEventQueue=[]}__handleFetchEvent(e){e instanceof o&&(e.defaultPrevented||"GET"===e.request.method&&(e.request.url.startsWith("foxy://")||e.composedPath()[0]!==this&&(e.preventDefault(),this.__fetchEventQueue.push(e),this.in("busy")||this.__processFetchEventQueue())))}}c.UpdateEvent=_,c.Rumour=r((()=>new h)),c.API=a;export{c as N,d as s};
1
+ import{L as e,_ as t}from"./shared-63eaded9.js";import{t as s,m as r,a as i,b as n,R as h,F as o}from"./shared-c1dadefe.js";import{A as a}from"./shared-4fa5f144.js";import{U as _}from"./shared-7684cb05.js";import{i as u}from"./shared-30131f76.js";function d(e,t){let r=null;return s(t).forEach((function(){var t,s,i,n,h,o,a,_,u,d,c;if(null===(i=null===(s=null===(t=this.node)||void 0===t?void 0:t._links)||void 0===s?void 0:s.self)||void 0===i?void 0:i.href){const t=null===(o=null===(h=null===(n=this.node)||void 0===n?void 0:n._links)||void 0===h?void 0:h.self)||void 0===o?void 0:o.href,s=new URL(null===(u=null===(_=null===(a=this.node)||void 0===a?void 0:a._links)||void 0===_?void 0:_.self)||void 0===u?void 0:u.href);if(s.searchParams.delete("zoom"),e===t||e===s.toString())return r=JSON.stringify(this.node),void this.stop()}Object.entries(null!==(c=null===(d=this.node)||void 0===d?void 0:d._links)&&void 0!==c?c:{}).some((([t,s])=>{var i,n;if(s.href!==e)return!1;const h=null===(n=null===(i=this.node)||void 0===i?void 0:i._embedded)||void 0===n?void 0:n[t];if(!h||!Array.isArray(h))return!1;const o=h.length<20?h.length:21,a=new URL(e),_=new URL(e);return a.searchParams.set("offset",h.length.toString()),_.searchParams.set("offset",o.toString()),r=JSON.stringify({returned_items:h.length,total_items:o,offset:0,limit:20,_embedded:{[t]:h},_links:{curies:this.node._links.curies,first:{href:e},last:{href:_.toString()},prev:{href:e},next:{href:a.toString()},self:{href:e}}}),this.stop(),!0}))})),new Response(r,{status:r?200:404})}class c extends e{constructor(){super(...arguments),this.lang="",this.parent="",this.related=[],this.__href="",this.__group="",this.__fetchEventQueue=[],this.__service=u(i.withConfig({services:{sendDelete:()=>this._sendDelete(),sendPatch:({edits:e})=>this._sendPatch(e),sendPost:({edits:e})=>this._sendPost(e),sendGet:()=>this._sendGet()},actions:{validate:n({errors:e=>{const s=this.constructor.v8n,r=t(t({},e.data),e.edits);return s.map((e=>e(r))).filter((e=>"string"==typeof e)).filter(((e,t,s)=>s.indexOf(e)===t))}})}}))}static get properties(){return{related:{type:Array},parent:{type:String},group:{type:String,noAccessor:!0},href:{type:String,noAccessor:!0},lang:{type:String}}}static get v8n(){return[]}get failure(){return this.__service.state.context.failure}get errors(){return this.__service.state.context.errors}get form(){const{data:e,edits:s}=this.__service.state.context;return t(t({},e),s)}get data(){return this.__service.state.context.data}set data(e){var t;this.__service.send({type:"SET_DATA",data:e}),this.__href=null!==(t=null==e?void 0:e._links.self.href)&&void 0!==t?t:""}get group(){return this.__group}set group(e){this.__group=e,this.__destroyRumour(),this.__createRumour()}get href(){return this.__href}set href(e){this.__href=e,e?this.__service.send({type:"FETCH"}):this.__service.send({type:"SET_DATA",data:null})}in(e){return this.__service.state.matches(e)}undo(){this.__service.send({type:"UNDO"})}edit(e){this.__service.send({type:"EDIT",data:e})}submit(){this.__service.send({type:"SUBMIT"})}delete(){this.__service.send({type:"DELETE"})}refresh(){this.__service.send({type:"REFRESH"})}connectedCallback(){super.connectedCallback(),this.__createService(),this.__createRumour(),this.__createServer(),this.__processFetchEventQueue()}disconnectedCallback(){super.disconnectedCallback(),this.__destroyService(),this.__destroyRumour(),this.__destroyServer(),this.__flushFetchEventQueue("parent element was disconnected")}async _fetch(...e){const t=await new a(this).fetch(...e);if(!t.ok)throw t;return t.json()}async _sendPost(e){const t=JSON.stringify(e),s=await this._fetch(this.parent,{body:t,method:"POST"}),r=c.Rumour(this.group),i=[...this.related,this.parent];return this.__destroyRumour(),r.share({data:s,related:i,source:s._links.self.href}),this.__createRumour(),s}async _sendGet(){const e=await this._fetch(this.href),t=c.Rumour(this.group);return this.__destroyRumour(),t.share({data:e,source:this.href}),this.__createRumour(),e}async _sendPatch(e){const t=JSON.stringify(e),s=await this._fetch(this.href,{body:t,method:"PATCH"}),r=c.Rumour(this.group);return this.__destroyRumour(),r.share({data:s,source:this.href,related:this.related}),this.__createRumour(),s}async _sendDelete(){const e=await this._fetch(this.href,{method:"DELETE"}),t=c.Rumour(this.group),s=[...this.related,this.parent];return this.__destroyRumour(),t.share({data:null,source:this.href,related:s}),this.__createRumour(),e}__createService(){this.__service.onTransition((e=>{if(!e.changed)return;const t=e.toStrings().reduce(((e,t)=>[...e,...t.split(".")]),[]);this.setAttribute("state",[...new Set(t)].join(" ")),this.requestUpdate(),this.dispatchEvent(new _),e.matches("busy")||this.__processFetchEventQueue()})),this.__service.onChange((()=>{this.requestUpdate(),this.dispatchEvent(new _)})),this.__service.start()}__destroyService(){this.__service.stop()}__createRumour(){const e=c.Rumour(this.group);this.__unsubscribeFromRumour=e.track((e=>this.__handleRumourUpdate(e)))}__destroyRumour(){var e;null===(e=this.__unsubscribeFromRumour)||void 0===e||e.call(this)}__createServer(){this.__fetchEventHandler=this.__handleFetchEvent.bind(this),this.addEventListener("fetch",this.__fetchEventHandler)}__destroyServer(){this.removeEventListener("fetch",this.__fetchEventHandler)}__handleRumourUpdate(e){var t;try{const s=null===(t=this.__service.state)||void 0===t?void 0:t.context.data;if(!s)return;const r=e(s);r!==s&&this.__service.send({data:r,type:"SET_DATA"})}catch(e){if(!(e instanceof h.UpdateError))throw e;this.__service.send({type:"REFRESH"})}}__processFetchEventQueue(){const e=new c.API(this);this.__fetchEventQueue.forEach((t=>{const s=t.request,r=d(s.url,this.data),i=r.ok?r:e.fetch(s);t.respondWith(Promise.resolve(i)),r.ok&&console.debug(`%c@foxy.io/elements::${this.localName}\n%c200%c GET ${s.url}`,"color: gray","background: gray; padding: 0 .2em; border-radius: .2em; color: white;","")})),this.__fetchEventQueue=[]}__flushFetchEventQueue(e){this.__fetchEventQueue.forEach((t=>{t.respondWith(Promise.reject(new Error(e)))})),this.__fetchEventQueue=[]}__handleFetchEvent(e){e instanceof o&&(e.defaultPrevented||"GET"===e.request.method&&(e.request.url.startsWith("foxy://")||e.composedPath()[0]!==this&&(e.preventDefault(),this.__fetchEventQueue.push(e),this.in("busy")||this.__processFetchEventQueue())))}}c.UpdateEvent=_,c.Rumour=r((()=>new h)),c.API=a;export{c as N,d as s};
@@ -0,0 +1 @@
1
+ import{F as e,A as t}from"./shared-c1dadefe.js";class s extends t{constructor(t){super({base:new URL(document.baseURI),fetch:(...c)=>new Promise(((n,a)=>{const o="string"==typeof c[0]?new s.WHATWGRequest(...c):c[0];o.headers.set("Content-Type","application/json"),o.headers.set("FOXY-API-VERSION","1");const r=new e("fetch",{cancelable:!0,composed:!0,bubbles:!0,request:o,resolve:n,reject:a});t.dispatchEvent(r),r.defaultPrevented||fetch(o).then(n).catch(a)}))})}}s.FetchEvent=e;export{s as A};
@@ -0,0 +1 @@
1
+ import{L as e,_ as s,j as t,h as r}from"./shared-63eaded9.js";import"./shared-46ee137f.js";import"./shared-df573cea.js";import"./shared-f0a83bd6.js";import{T as a}from"./shared-cd3c902e.js";import{c as i}from"./shared-4e709717.js";class c extends CustomEvent{constructor(e){super("change",{detail:e})}}let o,l,d=e=>e;class h extends(a(e)){constructor(){super(...arguments),this.readonly=!1,this.disabled=!1,this.checked=!1}static get properties(){return s(s({},super.properties),{},{readonly:{type:Boolean},disabled:{type:Boolean},checked:{type:Boolean}})}static get styles(){return[super.styles,t(o||(o=d`:host{--check-size:1.125rem}label{margin:calc(((1rem * var(--lumo-line-height-s)) - var(--check-size))/ -2) 0}label>:first-child{height:calc(1rem * var(--lumo-line-height-s))}.ml-xxl{margin-left:calc(var(--lumo-space-m) + var(--check-size))}.check{height:var(--check-size);width:var(--check-size)}`))]}render(){return r(l||(l=d` <label class="${0}"> <div class="flex items-center"> <div class="${0}"> <iron-icon icon="lumo:checkmark" class="${0}"> </iron-icon> <input type="checkbox" class="sr-only" .checked="${0}" ?disabled="${0}" data-testid="input" @change="${0}"> </div> </div> <div class="flex-1 font-lumo leading-s ml-m"> <slot></slot> </div> </label> <div class="${0}"> <slot name="content"></slot> </div> `),i({"flex items-start group transition-colors":!0,"cursor-default":this.disabled||this.readonly,"text-disabled":this.disabled,"text-secondary":this.readonly,"cursor-pointer":!this.disabled}),i({"flex-shrink-0 check transition-colors rounded-s border":!0,"focus-within-shadow-outline":!0,"bg-primary text-primary-contrast":!this.readonly&&this.checked,"border-dashed border-contrast-30":this.readonly,"border-transparent":!this.readonly,"opacity-50":this.disabled,"text-secondary bg-contrast-20":!this.readonly&&!this.checked,"group-hover-bg-contrast-30":!this.readonly&&!this.checked}),i({"block w-full h-full transition-transform transform":!0,"scale-100":this.checked,"scale-0":!this.checked}),this.checked,this.disabled,(e=>{if(this.readonly)return e.preventDefault();e.stopPropagation(),this.checked=!this.checked,this.dispatchEvent(new c(this.checked))}),i({"font-lumo ml-xxl transition-colors":!0,"text-disabled":this.disabled}))}}export{h as C,c as a};
@@ -1 +1 @@
1
- import{_ as e,h as t}from"./shared-63eaded9.js";import{B as r}from"./shared-1761daef.js";import{i as s}from"./shared-6d45a07b.js";let o,n,i=e=>e;const a=a=>class extends a{constructor(){super(...arguments),this.templates={},this.mode="production",this.readonly=!1,this.readonlyControls=r.False,this.disabled=!1,this.disabledControls=r.False,this.hidden=!1,this.hiddenControls=r.False,this.__observer=new MutationObserver((()=>this.__onMutation()))}static get properties(){return e(e({},super.properties),{},{templates:{attribute:!1},mode:{type:String},readonly:{type:Boolean,reflect:!0},readonlyControls:{attribute:"readonlycontrols",converter:{fromAttribute:e=>new r(null!=e?e:"")}},disabled:{type:Boolean,reflect:!0},disabledControls:{attribute:"disabledcontrols",converter:{fromAttribute:e=>new r(null!=e?e:"")}},hidden:{type:Boolean,reflect:!0},hiddenControls:{attribute:"hiddencontrols",converter:{fromAttribute:e=>new r(null!=e?e:"")}}})}get readonlySelector(){return this.readonly?r.True:this.readonlyControls}get disabledSelector(){return this.disabled?r.True:this.disabledControls}get hiddenSelector(){return this.hidden?r.True:this.hiddenControls}connectedCallback(){super.connectedCallback(),"development"===this.mode&&this.__observe()}disconnectedCallback(){super.disconnectedCallback(),this.__observer.disconnect()}firstUpdated(...e){super.firstUpdated(...e),"production"===this.mode&&this.compileTemplates()}updated(e){super.updated(e),e.has("mode")&&(this.__observer.disconnect(),"development"===this.mode&&this.__observe())}compileTemplates(t=!1){const r=t?{}:e({},this.templates);Array.from(this.children).forEach((e=>{var t;if("template"!==e.localName)return;const s=null!==(t=e.getAttribute("slot"))&&void 0!==t?t:"default";try{const t=`return html\`${e.innerHTML}\``;r[s]=new Function("html","host",t)}catch(e){console.error(e)}})),this.templates=r}renderTemplateOrSlot(e,r=!1){const a=null!=e?e:"default",l=this.templates[a];if(!l)return t(o||(o=i`<slot name="${0}"></slot>`),s(e));const d=()=>{try{const e=new Proxy({},{get:(e,t)=>this[t]});return null==l?void 0:l(t,e)}catch(e){console.error(e)}};return r?d():t(n||(n=i` <foxy-internal-sandbox data-testid="${0}" .render="${0}"> </foxy-internal-sandbox> `),a,d)}getNestedTemplates(e){const t={};return Object.entries(this.templates).forEach((([r,s])=>{if(r.startsWith(`${e}:`)){const o=r.replace(`${e}:`,"");t[o]=s}})),t}__observe(){this.__observer.observe(this,{characterData:!0,attributes:!0,childList:!0,subtree:!0}),this.__onMutation()}__onMutation(){const e={characterData:!0,attributes:!0,childList:!0,subtree:!0};this.__observer.disconnect(),this.__observer.observe(this,e),Array.from(this.children).forEach((t=>{"template"===t.localName&&t.hasAttribute("slot")&&this.__observer.observe(t.content,e)})),this.compileTemplates(!0)}};export{a as C};
1
+ import{_ as e,h as t}from"./shared-63eaded9.js";import{B as r}from"./shared-c1dadefe.js";import{i as s}from"./shared-6d45a07b.js";let o,n,i=e=>e;const a=a=>class extends a{constructor(){super(...arguments),this.templates={},this.mode="production",this.readonly=!1,this.readonlyControls=r.False,this.disabled=!1,this.disabledControls=r.False,this.hidden=!1,this.hiddenControls=r.False,this.__observer=new MutationObserver((()=>this.__onMutation()))}static get properties(){return e(e({},super.properties),{},{templates:{attribute:!1},mode:{type:String},readonly:{type:Boolean,reflect:!0},readonlyControls:{attribute:"readonlycontrols",converter:{fromAttribute:e=>new r(null!=e?e:"")}},disabled:{type:Boolean,reflect:!0},disabledControls:{attribute:"disabledcontrols",converter:{fromAttribute:e=>new r(null!=e?e:"")}},hidden:{type:Boolean,reflect:!0},hiddenControls:{attribute:"hiddencontrols",converter:{fromAttribute:e=>new r(null!=e?e:"")}}})}get readonlySelector(){return this.readonly?r.True:this.readonlyControls}get disabledSelector(){return this.disabled?r.True:this.disabledControls}get hiddenSelector(){return this.hidden?r.True:this.hiddenControls}connectedCallback(){super.connectedCallback(),"development"===this.mode&&this.__observe()}disconnectedCallback(){super.disconnectedCallback(),this.__observer.disconnect()}firstUpdated(...e){super.firstUpdated(...e),"production"===this.mode&&this.compileTemplates()}updated(e){super.updated(e),e.has("mode")&&(this.__observer.disconnect(),"development"===this.mode&&this.__observe())}compileTemplates(t=!1){const r=t?{}:e({},this.templates);Array.from(this.children).forEach((e=>{var t;if("template"!==e.localName)return;const s=null!==(t=e.getAttribute("slot"))&&void 0!==t?t:"default";try{const t=`return html\`${e.innerHTML}\``;r[s]=new Function("html","host",t)}catch(e){console.error(e)}})),this.templates=r}renderTemplateOrSlot(e,r=!1){const a=null!=e?e:"default",l=this.templates[a];if(!l)return t(o||(o=i`<slot name="${0}"></slot>`),s(e));const d=()=>{try{const e=new Proxy({},{get:(e,t)=>this[t]});return null==l?void 0:l(t,e)}catch(e){console.error(e)}};return r?d():t(n||(n=i` <foxy-internal-sandbox data-testid="${0}" .render="${0}"> </foxy-internal-sandbox> `),a,d)}getNestedTemplates(e){const t={};return Object.entries(this.templates).forEach((([r,s])=>{if(r.startsWith(`${e}:`)){const o=r.replace(`${e}:`,"");t[o]=s}})),t}__observe(){this.__observer.observe(this,{characterData:!0,attributes:!0,childList:!0,subtree:!0}),this.__onMutation()}__onMutation(){const e={characterData:!0,attributes:!0,childList:!0,subtree:!0};this.__observer.disconnect(),this.__observer.observe(this,e),Array.from(this.children).forEach((t=>{"template"===t.localName&&t.hasAttribute("slot")&&this.__observer.observe(t.content,e)})),this.compileTemplates(!0)}};export{a as C};
@@ -0,0 +1,134 @@
1
+ import{k as e,P as t,A as a,L as s,j as i,h as n,_ as r}from"./shared-63eaded9.js";import"./shared-46ee137f.js";import{E as o,C as l,T as d}from"./shared-df573cea.js";import"./shared-f0a83bd6.js";import"./shared-36629ded.js";import{a as u}from"./shared-bb824ab4.js";import{h as c,P as h}from"./shared-ff79f3f9.js";import"./shared-ec861f31.js";import"./foxy-i18n.js";import{Q as m,T as p,U as g,V as v,W as y,X as f,Y as x,Z as b,b as _,$ as w,a0 as E,a1 as k,a2 as $,a3 as T,a4 as S,a5 as C,m as V,a6 as A}from"./shared-c1dadefe.js";import{p as M}from"./shared-87ca7818.js";import{c as I}from"./shared-cd3c902e.js";import{s as j}from"./shared-b0f0e8b5.js";import{i as P}from"./shared-30131f76.js";var U={raise:m,send:p,sendParent:g,sendUpdate:v,log:y,cancel:f,start:x,stop:b,assign:_,after:w,done:E,respond:k,forwardTo:$,escalate:T,choose:S,pure:C};const q=c`<dom-module id="lumo-text-area" theme-for="vaadin-text-area">
2
+ <template>
3
+ <style include="lumo-text-field">
4
+ [part="input-field"],
5
+ [part="input-field"] ::slotted(textarea) {
6
+ /* Equal to the implicit padding in vaadin-text-field */
7
+ padding-top: calc((var(--lumo-text-field-size) - 1em * var(--lumo-line-height-s)) / 2);
8
+ padding-bottom: calc((var(--lumo-text-field-size) - 1em * var(--lumo-line-height-s)) / 2);
9
+ height: auto;
10
+ box-sizing: border-box;
11
+ transition: background-color 0.1s;
12
+ line-height: var(--lumo-line-height-s);
13
+ }
14
+
15
+ :host(:not([readonly])) [part="input-field"]::after {
16
+ display: none;
17
+ }
18
+
19
+ :host([readonly]) [part="input-field"] {
20
+ border: 1px dashed var(--lumo-contrast-30pct);
21
+ }
22
+
23
+ :host([readonly]) [part="input-field"]::after {
24
+ border: none;
25
+ }
26
+
27
+ :host(:hover:not([readonly]):not([focused]):not([invalid])) [part="input-field"] {
28
+ background-color: var(--lumo-contrast-20pct);
29
+ }
30
+
31
+ @media (pointer: coarse) {
32
+ :host(:hover:not([readonly]):not([focused]):not([invalid])) [part="input-field"] {
33
+ background-color: var(--lumo-contrast-10pct);
34
+ }
35
+
36
+ :host(:active:not([readonly]):not([focused])) [part="input-field"] {
37
+ background-color: var(--lumo-contrast-20pct);
38
+ }
39
+ }
40
+
41
+ [part="value"],
42
+ [part="input-field"] ::slotted(textarea) {
43
+ line-height: inherit;
44
+ --_lumo-text-field-overflow-mask-image: none;
45
+ }
46
+
47
+ /* Vertically align icon prefix/suffix with the first line of text */
48
+ [part="input-field"] ::slotted(iron-icon) {
49
+ margin-top: calc((var(--lumo-icon-size-m) - 1em * var(--lumo-line-height-s)) / -2);
50
+ }
51
+
52
+ [part="input-field"] [part="value"],
53
+ [part="input-field"] ::slotted(textarea) {
54
+ white-space: pre-wrap; /* override \`nowrap\` from <vaadin-text-field> */
55
+ align-self: stretch; /* override \`baseline\` from <vaadin-text-field> */
56
+ }
57
+ </style>
58
+ </template>
59
+ </dom-module>`;document.head.appendChild(q.content);
60
+ /**
61
+ @license
62
+ Copyright (c) 2017 Vaadin Ltd.
63
+ This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
64
+ */
65
+ class L extends(o(u(l(d(h))))){static get template(){return c`
66
+ <style include="vaadin-text-field-shared-styles">
67
+ .vaadin-text-area-container {
68
+ flex: auto;
69
+ max-height: inherit; /* MSIE 11 */
70
+ min-height: inherit; /* MSIE 11 */
71
+ }
72
+
73
+ /* The label, helper text and the error message should neither grow nor shrink. */
74
+ [part="label"],
75
+ [part="helper-text"],
76
+ [part="error-message"] {
77
+ flex: none;
78
+ }
79
+
80
+ [part="input-field"] {
81
+ overflow: auto;
82
+ -webkit-overflow-scrolling: touch;
83
+ }
84
+
85
+ [part="value"] {
86
+ resize: none;
87
+ }
88
+
89
+ [part="value"],
90
+ [part="input-field"] ::slotted(*) {
91
+ align-self: flex-start;
92
+ }
93
+
94
+ @keyframes vaadin-text-area-appear {
95
+ to {
96
+ opacity: 1;
97
+ }
98
+ }
99
+
100
+ :host {
101
+ animation: 1ms vaadin-text-area-appear;
102
+ }
103
+
104
+ /* Workaround https://bugzilla.mozilla.org/show_bug.cgi?id=1739079 */
105
+ :host([disabled]) [part='value'] {
106
+ user-select: none;
107
+ }
108
+ </style>
109
+
110
+ <div class="vaadin-text-area-container">
111
+
112
+ <label part="label" on-click="focus" id="[[_labelId]]">[[label]]</label>
113
+
114
+ <div part="input-field" id="[[_inputId]]">
115
+
116
+ <slot name="prefix"></slot>
117
+
118
+ <slot name="textarea">
119
+ <textarea part="value"></textarea>
120
+ </slot>
121
+
122
+ <div part="clear-button" id="clearButton" role="button" aria-label\$="[[i18n.clear]]"></div>
123
+ <slot name="suffix"></slot>
124
+
125
+ </div>
126
+
127
+ <div part="helper-text" id="[[_helperTextId]]">
128
+ <slot name="helper">[[helperText]]</slot>
129
+ </div>
130
+
131
+ <div part="error-message" id="[[_errorId]]" aria-live="assertive" aria-hidden\$="[[_getErrorMessageAriaHidden(invalid, errorMessage, _errorId)]]">[[errorMessage]]</div>
132
+
133
+ </div>
134
+ `}static get is(){return"vaadin-text-area"}static get version(){return"2.9.0"}static get properties(){return{pattern:{type:String}}}static get observers(){return["_textAreaValueChanged(value)"]}ready(){super.ready(),this._updateHeight(),this.addEventListener("animationend",this._onAnimationEnd)}_onAnimationEnd(e){0===e.animationName.indexOf("vaadin-text-area-appear")&&this._updateHeight()}get _slottedTagName(){return"textarea"}_textAreaValueChanged(e){this._updateHeight()}_updateHeight(){const e=this.root.querySelector("[part=input-field]"),t=e.scrollTop,a=this.inputElement,s=this.value?this.value.length:0;if(this._oldValueLength>=s){const t=getComputedStyle(e).height,s=getComputedStyle(a).width;e.style.display="block",e.style.height=t,a.style.maxWidth=s,a.style.height="auto"}this._oldValueLength=s;const i=a.scrollHeight;i>a.clientHeight&&(a.style.height=i+"px"),a.style.removeProperty("max-width"),e.style.removeProperty("display"),e.style.removeProperty("height"),e.scrollTop=t,this._dispatchIronResizeEventIfNeeded("InputHeight",i)}checkValidity(){if(!super.checkValidity())return!1;if(!this.pattern||!this.inputElement.value)return!0;try{const e=this.inputElement.value.match(this.pattern);return!!e&&e[0]===e.input}catch(e){return!0}}}customElements.define(L.is,L);class D extends CustomEvent{constructor(e){super("change",{detail:e})}}class F extends CustomEvent{constructor(e){super("change",{detail:e})}}class z extends F{}const N=e((e=>s=>{const{element:i,name:n,strings:r}=s.committer;if(2!==r.length||""!==r[0]||""!==r[1])throw new Error("live directive bindings must not contain any static values");if(s.committer.parts.length>1)throw new Error("live directive must be the only directive for an attribute or property");if(s instanceof t)i[n]!==e&&s.setValue(e);else{if(!(s instanceof a))throw new Error("live directive can only be used on attributes or properties");i.getAttribute(n)!==e&&s.setValue(e)}}));let B,H,O=e=>e;class Y extends s{constructor(){super(...arguments),this.label="",this.value="",this.disabled=!1,this.readonly=!1,this.errorMessage="",this.__i18n={formatValue:e=>e.join(""),parseValue:e=>{const{count:t,units:a}=M(e);return[t.toString(),a]}},this.__getItems=V((e=>{const t=M(e).count;return[{value:"d",label:this.__t("day",{count:t})},{value:"w",label:this.__t("week",{count:t})},{value:"m",label:this.__t("month",{count:t})},{value:"y",label:this.__t("year",{count:t})}]}))}static get properties(){return{checkValidity:{attribute:!1},errorMessage:{type:String,attribute:"error-message"},disabled:{type:Boolean,reflect:!0},readonly:{type:Boolean,reflect:!0},label:{type:String},value:{type:String},lang:{type:String}}}static get styles(){return i(B||(B=O`:host{display:block}vaadin-custom-field{width:100%;font-size:0;line-height:0}vaadin-custom-field::part(label){padding-bottom:var(--lumo-space-s)}vaadin-custom-field::part(error-message)[aria-hidden=false]{padding-top:var(--lumo-space-xs)}vaadin-combo-box,vaadin-integer-field{width:calc(50% - (var(--lumo-space-s)/ 2))}vaadin-integer-field{margin-right:var(--lumo-space-s);padding:0}vaadin-combo-box::part(text-field){padding:0}`))}connectedCallback(){super.connectedCallback(),this.__untrackTranslations=customElements.get("foxy-i18n").onTranslationChange((()=>{var e,t;null===(t=(e=this.__getItems.cache).clear)||void 0===t||t.call(e),this.requestUpdate()}))}render(){return n(H||(H=O` <vaadin-custom-field data-testid="field" .i18n="${0}" .label="${0}" .value="${0}" ?disabled="${0}" ?readonly="${0}" .errorMessage="${0}" .checkValidity="${0}" @change="${0}"> <vaadin-integer-field data-testid="value" min="1" max="999" has-controls prevent-invalid-input ?invalid="${0}" ?disabled="${0}" ?readonly="${0}"> </vaadin-integer-field> <vaadin-combo-box data-testid="units" item-value-path="value" item-label-path="label" .items="${0}" ?invalid="${0}" ?disabled="${0}" ?readonly="${0}"> </vaadin-combo-box> </vaadin-custom-field> `),this.__i18n,this.label,N(this.value),this.disabled,this.readonly,this.errorMessage,this.checkValidity,this.__handleChange,!this.checkValidity(),this.disabled,this.readonly,this.__getItems(this.value),!this.checkValidity(),this.disabled,this.readonly)}updated(e){super.updated(e);const t=this.renderRoot.firstElementChild;t.value!==this.value&&(t.value=this.value)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this.__untrackTranslations)||void 0===e||e.call(this)}checkValidity(){return!0}get __t(){return customElements.get("foxy-i18n").i18next.getFixedT(this.lang)}__handleChange(e){const t=e.target;this.value=t.value,this.dispatchEvent(new z(this.value))}}const R=A({id:"choice",type:"parallel",context:{defaultCustomValue:"",customValue:null,custom:!1,items:[],value:null,type:"text",min:null,max:null},states:{mutability:{initial:"editable",states:{editable:{},readonly:{}},on:{SET_READONLY:[{target:".editable",cond:"isPayloadFalsey"},{target:".readonly",cond:"isPayloadTruthy"}]}},interactivity:{initial:"enabled",states:{enabled:{},disabled:{}},on:{SET_DISABLED:[{target:".enabled",cond:"isPayloadFalsey"},{target:".disabled",cond:"isPayloadTruthy"}]}},selection:{initial:"unknown",states:{unknown:{always:[{target:"multiple",cond:"isValueArray"},{target:"single"}]},none:{},single:{},multiple:{}}},extension:{initial:"unknown",states:{unknown:{always:[{target:"present",cond:"hasCustom"},{target:"absent"}]},absent:{},present:{initial:"unknown",states:{unknown:{always:[{target:"selected",cond:"hasCustomValue"},{target:"available"}]},available:{on:{SET_TYPE:{actions:"setType"}}},selected:{initial:"unknown",states:{unknown:{always:[{target:"integer",cond:"showsIntegerField"},{target:"textarea",cond:"showsTextarea"},{target:"frequency",cond:"showsFrequency"},{target:"text"}]},text:{},frequency:{},textarea:{},integer:{type:"parallel",states:{min:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMinConstraint"},{target:"none"}]},none:{},custom:{}}},max:{initial:"unknown",states:{unknown:{always:[{target:"custom",cond:"hasMaxConstraint"},{target:"none"}]},none:{},custom:{}}}}}}}}}}}},on:{SET_DEFAULT_CUSTOM_VALUE:{actions:"setDefaultCustomValue"},SET_CUSTOM:{actions:"setCustom",target:[".selection.unknown",".extension.unknown"]},SET_VALUE:{actions:"setValue",target:[".selection.unknown",".extension.unknown"]},SET_ITEMS:{actions:"setItems",target:[".selection.unknown",".extension.unknown"]},SET_TYPE:{actions:"setType",target:".extension.unknown"},SET_MIN:{actions:"setMin",target:".extension.unknown"},SET_MAX:{actions:"setMax",target:".extension.unknown"}}},{guards:{isPayloadFalsey:(e,t)=>!t.data,isPayloadTruthy:(e,t)=>!!t.data,isValueArray:e=>Array.isArray(e.value),showsIntegerField:e=>"integer"===e.type,showsFrequency:e=>"frequency"===e.type,showsTextarea:e=>"textarea"===e.type,hasMinConstraint:e=>"number"==typeof e.min,hasMaxConstraint:e=>"number"==typeof e.max,hasCustomValue:e=>"string"==typeof e.customValue,hasCustom:e=>e.custom},actions:{setDefaultCustomValue:U.assign({defaultCustomValue:(e,t)=>t.data}),setValue:U.assign({value:(e,t)=>t.data,customValue:(e,t)=>Array.isArray(t.data)?t.data.find((t=>!e.items.includes(t))):e.items.includes(t.data)?null:t.data}),setCustom:U.assign({custom:(e,t)=>t.data}),setItems:U.assign({items:(e,t)=>t.data}),setType:U.assign({type:(e,t)=>t.data}),setMin:U.assign({min:(e,t)=>t.data}),setMax:U.assign({max:(e,t)=>t.data})}});let W,X,Q,Z,G,J,K,ee,te,ae,se,ie,ne,re=e=>e;const oe=`@foxy.io/elements::other[${(Math.pow(10,10)*Math.random()).toFixed(0)}]`;class le extends I{constructor(){super(...arguments),this.getText=e=>e,this.__service=P(R).onChange((()=>this.requestUpdate())).onTransition((({changed:e})=>e&&this.requestUpdate())).start()}static get scopedElements(){return{"vaadin-integer-field":customElements.get("vaadin-integer-field"),"vaadin-text-field":customElements.get("vaadin-text-field"),"x-frequency-input":Y,"vaadin-text-area":customElements.get("vaadin-text-area"),"iron-icon":customElements.get("iron-icon")}}static get styles(){return[super.styles,i(Q||(Q=re`:host{--item-width:calc((var(--lumo-space-m) * 2) + 1.25rem)}.ml-xxl{margin-left:var(--item-width)}.item{height:var(--lumo-size-l);width:var(--item-width)}.radio{height:1.25rem;width:1.25rem}.check{height:1.125rem;width:1.125rem}.dot{height:.5rem;width:.5rem}`))]}static get properties(){return r(r({},super.properties),{},{defaultCustomValue:{type:String,attribute:"default-custom-value"},disabled:{type:Boolean},readonly:{type:Boolean},custom:{type:Boolean},type:{type:String},min:{type:Number},max:{type:Number},value:{type:Array},items:{type:Array},getText:{attribute:!1}})}get defaultCustomValue(){return this.__service.state.context.defaultCustomValue}set defaultCustomValue(e){this.__service.send("SET_DEFAULT_CUSTOM_VALUE",{data:e})}get readonly(){return this.__service.state.matches("mutability.readonly")}set readonly(e){this.__service.send("SET_READONLY",{data:e})}get disabled(){return this.__service.state.matches("interactivity.disabled")}set disabled(e){this.__service.send("SET_DISABLED",{data:e})}get custom(){return this.__service.state.matches("extension.present")}set custom(e){this.__service.send("SET_CUSTOM",{data:e})}get type(){return this.__service.state.context.type}set type(e){this.__service.send("SET_TYPE",{data:e})}get min(){return this.__service.state.context.min}set min(e){this.__service.send("SET_MIN",{data:e})}get max(){return this.__service.state.context.max}set max(e){this.__service.send("SET_MAX",{data:e})}get value(){return this.__service.state.context.value}set value(e){this.__service.send("SET_VALUE",{data:e})}get items(){return this.__service.state.context.items}set items(e){this.__service.send("SET_ITEMS",{data:e})}render(){const e=this.custom?[...this.items,oe]:this.items,t=Array.isArray(this.value),a=this.__service.state.matches("extension.present.selected"),s=n(Z||(Z=re` ${0} `),e.map(((e,s,i)=>{var r;const o=this.custom&&s===i.length-1,l=o?a:t?!!(null===(r=this.value)||void 0===r?void 0:r.includes(e)):e===String(this.value),d=this.disabled||!this._isI18nReady,u=j({value:o?oe:e,name:t?e:"choice","data-testid":`item-${e}`,"?disabled":d,"@change":t=>{if(this.readonly)return t.preventDefault();const a=t.target.checked,s=e===oe?this.defaultCustomValue:e,i=this.value;Array.isArray(i)?this.value=e===oe?a?[...i,s]:i.slice(0,i.length-1):a?[s,...i]:i.filter((e=>e!==s)):this.value=a?s:null,this.dispatchEvent(new D(this.value))}}),c=n(G||(G=re` <div> ${0} </div> `),e===oe?this._t("choice.other").toString():n(J||(J=re`<slot name="${0}">${0}</slot>`),`${e}-label`,this.getText(e)));return n(K||(K=re` <div class="ml-xxl border-t border-contrast-10 ${0}"></div> ${0} <div class="mr-m ml-xxl"> ${0} ${0} </div> `),s?"":"hidden",t?function(e,t,a,s,i){const r="transition ease-in-out duration-200",o=`${r} transform ${a?"scale-100":"scale-0"} ${e?"text-contrast-70":"text-tint"}`;return n(X||(X=re` <label class="group flex items-center ${0}"> <div class="item flex items-center justify-center flex-shrink-0 text-primary-contrast"> <div class="check rounded-s ${0} ${0} ${0} focus-within-shadow-outline"> <iron-icon icon="lumo:checkmark" class="block w-full h-full ${0}"></iron-icon> <input type="checkbox" class="sr-only" .checked="${0}" ...="${0}"> </div> </div> <div class="font-lumo leading-m ${0}">${0}</div> </label> `),t||e?"":"cursor-pointer","border "+(e?"border-dashed border-contrast-30":"border-transparent"),r,e?"":t?a?"bg-primary-50":"bg-contrast-10":a?"bg-primary":"bg-contrast-20 group-hover-bg-contrast-30",o,a,s,t?"text-disabled":e?"text-secondary":"text-body",i)}(this.readonly,d,l,u,c):function(e,t,a,s,i){const r="transition ease-in-out duration-200",o=`${r} ${t||e?"":"shadow-xs"} transform ${a?"scale-100":"scale-0"} ${e?"bg-contrast-70":"bg-tint"}`;return n(W||(W=re` <label class="group flex items-center ${0}"> <div class="item flex items-center justify-center flex-shrink-0"> <div class="flex radio rounded-full ${0} ${0} ${0} focus-within-shadow-outline"> <div class="dot m-auto rounded-full ${0}"></div> <input type="radio" class="sr-only" .checked="${0}" ...="${0}"> </div> </div> <div class="font-lumo leading-m ${0}">${0}</div> </label> `),t||e?"":"cursor-pointer","border "+(e?"border-dashed border-contrast-30":"border-transparent"),r,e?"":t?a?"bg-primary-50":"bg-contrast-10":a?"bg-primary":"bg-contrast-20 group-hover-bg-contrast-30",o,a,s,t?"text-disabled":e?"text-secondary":"text-body",i)}(this.readonly,d,l,u,c),e===oe&&a?this.__field:"",e!==oe?n(ee||(ee=re`<slot name="${0}"></slot>`),e):"")})));return n(te||(te=re`<form>${0}</form> `),s)}get __field(){const e=j({placeholder:this._t("choice.other").toString(),class:"w-full mb-m",value:this.__service.state.context.customValue,max:this.max,min:this.min,"?disabled":this.disabled,"?readonly":this.readonly,"data-testid":"field","@change":e=>{e.stopPropagation();const t=e.target.value;Array.isArray(this.value)?this.value=this.value.slice(0,this.value.length-1).concat(t):this.value=t,this.dispatchEvent(new D(this.value))}});return"frequency"===this.type?n(ae||(ae=re`<x-frequency-input ...="${0}"></x-frequency-input>`),e):"integer"===this.type?n(se||(se=re`<vaadin-integer-field ...="${0}" has-controls></vaadin-integer-field>`),e):"textarea"===this.type?n(ie||(ie=re`<vaadin-text-area ...="${0}"></vaadin-text-area>`),e):n(ne||(ne=re`<vaadin-text-field ...="${0}"></vaadin-text-field>`),e)}}export{le as C,F as D,D as a,U as b};
@@ -0,0 +1 @@
1
+ import"./shared-0ced76a0.js";import"./shared-60126eee.js";import"./shared-46ee137f.js";import"./shared-9221e6b2.js";import"./foxy-spinner.js";import"./foxy-i18n.js";import{L as e,_ as t,h as s}from"./shared-63eaded9.js";import{C as i}from"./shared-51e28c83.js";import{a as n,T as o,S as r}from"./shared-cd3c902e.js";import{c as a}from"./shared-4e709717.js";import{l}from"./shared-07134f93.js";import{r as d}from"./shared-b710881a.js";import{G as c}from"./shared-9af7b5f0.js";import{N as m}from"./shared-423a4840.js";let h,u,p,x=e=>e;class f extends(n(i(o(e)))){constructor(){super(...arguments),this.options=[],this.items=[],this.__newItem=""}static get properties(){return t(t({},super.properties),{},{options:{type:Array},items:{type:Array},__newItem:{attribute:!1}})}render(){const e=a({"w-xs h-xs mr-xs rounded-full transition-colors flex-shrink-0":!0,"focus-outline-none focus-ring-2 ring-inset ring-error-50":!0,"text-tertiary hover-bg-error-10 hover-text-error":!this.disabled,"cursor-default text-disabled":this.disabled,"flex items-center justify-center":!this.readonly,hidden:this.readonly}),t=a({"transition-colors h-l ml-m flex items-center":!0,"text-secondary":this.readonly,"text-disabled":this.disabled}),i=this.disabled||!this.__newItem,n=()=>{this.__newItem&&(this.items.push({value:this.__newItem}),this.requestUpdate("items"),this.dispatchEvent(new CustomEvent("change")),this.__newItem="")};return s(h||(h=x` <slot></slot> <ol class="divide-y divide-contrast-10"> ${0} </ol> <div class="${0}"> <input placeholder="${0}" class="w-full bg-transparent appearance-none h-m focus-outline-none" list="list" .value="${0}" ?disabled="${0}" ?readonly="${0}" @keydown="${0}" @input="${0}"> <datalist id="list"> ${0} </datalist> <div class="transition-opacity ${0}"> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="lumo:plus" class="icon-inline text-l"></iron-icon> </button> </div> </div> `),d(this.items,(e=>e.value),((i,n)=>{var o;return s(u||(u=x` <li class="${0}"> <div class="flex-1 mr-s">${0}</div> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <iron-icon icon="lumo:cross" class="icon-inline text-xl"></iron-icon> </button> </li> `),t,null!==(o=i.label)&&void 0!==o?o:i.value,this.t("delete"),e,this.disabled,(()=>{this.items.splice(n,1),this.requestUpdate("items"),this.dispatchEvent(new CustomEvent("change"))}))})),a({"ml-m h-l flex items-center":!0,"border-t border-contrast-10":this.items.length>0,flex:!this.readonly,hidden:this.readonly}),this.t("type_here"),l(this.__newItem),this.disabled,this.readonly,(e=>"Enter"===e.key&&n()),(e=>{this.__newItem=e.currentTarget.value.trim()}),this.options.map((({label:e,value:t})=>{if(!this.items.some((e=>e.value===t)))return s(p||(p=x`<option value="${0}">${0}</option>`),t,null!=e?e:t)})),this.__newItem?"opacity-100":"opacity-0",this.t("submit"),a({"w-xs h-xs mr-xs flex-shrink-0 ring-inset ring-success-50 focus-outline-none":!0,"flex items-center justify-center rounded-full transition-colors":!0,"bg-contrast-5 text-disabled cursor-default":i,"bg-success-10 text-success cursor-pointer":!i,"hover-bg-success hover-text-success-contrast":!i,"focus-ring-2":!i}),i,n)}}let y,b,v,g,$=e=>e;const _=i(o(r(n(m,"coupon-codes-form"))));class w extends _{constructor(){super(...arguments),this.templates={}}static get scopedElements(){return{"vaadin-button":customElements.get("vaadin-button"),"iron-icon":customElements.get("iron-icon"),"foxy-internal-sandbox":customElements.get("foxy-internal-sandbox"),"foxy-spinner":customElements.get("foxy-spinner"),"foxy-i18n":customElements.get("foxy-i18n"),"x-editable-list":f,"x-group":c}}render(){var e,t;const{hiddenSelector:i,lang:n,ns:o}=this,r=this.in("busy"),l=this.in("fail"),d=this.in({idle:"snapshot"}),c=this.in({idle:"template"}),m="transition-opacity duration-500",h="opacity-0 pointer-events-none";return s(y||(y=$` <div class="relative"> <div class="${0}"> ${0} ${0} </div> <div class="${0}"> <div class="mx-auto flex mb-m w-l h-l rounded-t-l rounded-b-l bg-success"> <iron-icon icon="icons:done-all" class="m-auto text-success-contrast"></iron-icon> </div> <foxy-i18n class="block" lang="${0}" key="import_codes_done" ns="${0}"></foxy-i18n> </div> <div class="${0}"> <foxy-spinner layout="vertical" class="m-auto p-m bg-base shadow-xs rounded-t-l rounded-b-l" state="${0}" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> </div> `),a({"relative space-y-m":!0,[m]:!0,[h]:d}),i.matches("codes",!0)?"":this.__renderCodes(),i.matches("import",!0)?"":this.__renderImport(),a({"absolute inset-0 flex flex-col items-center justify-center":!0,"text-center text-m text-secondary leading-m":!0,[m]:!0,[h]:!d}),n,o,a({"absolute inset-0 flex":!0,[m]:!0,[h]:!r&&!l}),l?"error":c?"empty":"busy",n,o,null!==(t=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==t?t:"")}__renderCodes(){var e;const t=null!==(e=this.form.coupon_codes)&&void 0!==e?e:[],i=t.length>16?t.slice(-16):t,n=t.length>16?t.slice(0,-16):[],o=i.map((e=>{let t;try{const s=new URL(this.parent);s.searchParams.set("code",e),t=s.toString()}catch(e){t=this.parent}return{value:e,label:s(b||(b=$` <foxy-internal-coupon-codes-form-list-item group="${0}" href="${0}" lang="${0}" ns="${0}"> </foxy-internal-coupon-codes-form-list-item> `),this.group,t,this.lang,this.ns)}}));return s(v||(v=$` <div> ${0} <x-group class="mb-xs" frame> <foxy-i18n slot="header" lang="${0}" key="code_plural" ns="${0}"></foxy-i18n> <x-editable-list lang="${0}" ns="${0}" ?disabled="${0}" ?readonly="${0}" .items="${0}" @change="${0}" @paste="${0}"> <div class="ml-m py-s border-b border-contrast-10 font-lumo" ?hidden="${0}"> <foxy-i18n options="${0}" class="block text-body text-m mb-xs" lang="${0}" key="hidden_codes_header" ns="${0}"> </foxy-i18n> <foxy-i18n class="block text-xs text-tertiary" lang="${0}" key="hidden_codes_explainer" ns="${0}"> </foxy-i18n> </div> </x-editable-list> </x-group> <foxy-i18n class="block text-xs text-tertiary leading-s" lang="${0}" key="code_import_hint" ns="${0}"> </foxy-i18n> ${0} </div> `),this.renderTemplateOrSlot("codes:before"),this.lang,this.ns,this.lang,this.ns,!this.in("idle")||this.disabledSelector.matches("codes",!0),this.readonlySelector.matches("codes",!0),o,(e=>{const t=e.currentTarget,s=new Set([...n,...t.items.map((e=>e.value))]);this.edit({coupon_codes:[...s]})}),(e=>{var s,i;e.preventDefault();const n=(null!==(i=null===(s=e.clipboardData)||void 0===s?void 0:s.getData("text"))&&void 0!==i?i:"").split(" ").map((e=>e.trim())).filter((e=>e.length>0));this.edit({coupon_codes:Array.from(new Set([...t,...n]))})}),0===n.length,JSON.stringify({count:n.length}),this.lang,this.ns,this.lang,this.ns,this.lang,this.ns,this.renderTemplateOrSlot("codes:after"))}__renderImport(){return s(g||(g=$` <div> ${0} <vaadin-button class="w-full mb-xs" theme="primary success" ?disabled="${0}" @click="${0}"> <foxy-i18n ns="${0}" key="import" lang="${0}"></foxy-i18n> </vaadin-button> ${0} </div> `),this.renderTemplateOrSlot("import:before"),!this.in("idle")||this.disabledSelector.matches("import",!0),this.submit,this.ns,this.lang,this.renderTemplateOrSlot("import:after"))}}let j,k,E=e=>e;const S=n(o(m));customElements.define("foxy-coupon-codes-form",w),customElements.define("foxy-internal-coupon-codes-form-list-item",class extends S{render(){var e,t;let i;try{i=null!==(e=new URL(this.href).searchParams.get("code"))&&void 0!==e?e:""}catch(e){return s(j||(j=E``))}let n,o="text-tertiary bg-contrast-5",r="text-body";return this.in("fail")?n="loading_error":this.in("busy")?n="loading_busy":0===(null===(t=this.data)||void 0===t?void 0:t.returned_items)?(o="text-success bg-success-10",n="unique"):(o="text-error bg-error-10",n="duplicate",r="text-error"),s(k||(k=E` <div class="flex justify-between items-center font-lumo leading-m"> <div class="text-m ${0}">${0}</div> <foxy-i18n class="text-xs font-medium px-xs rounded ${0}" lang="${0}" key="${0}" ns="${0}"> </foxy-i18n> </div> `),r,i,o,this.lang,n,this.ns)}});export{w as C,f as E};
@@ -1 +1 @@
1
- import{L as t,j as e,h as s}from"./shared-63eaded9.js";import{b as a}from"./shared-9a40309d.js";let d,i,r,l=t=>t;class o extends t{constructor(){super(...arguments),this.items=[],this.disabled=!1}static get properties(){return{disabled:{type:Boolean,reflect:!0},items:{attribute:!1}}}static get styles(){return[a.styles,e(d||(d=l`.max-w-0{max-width:0}`))]}render(){const t=this.disabled?"text-disabled":"text-body",e=this.disabled?"text-disabled":"text-secondary",a="max-w-0 truncate py-s";return s(i||(i=l` <table class="font-lumo text-m leading-m w-full"> <tbody class="divide-y divide-contrast-10"> ${0} </tbody> </table> `),this.items.map((({name:d,value:i})=>s(r||(r=l` <tr> <td class="${0} ${0} w-1-3 pr-m" title="${0}">${0}</td> <td class="${0} ${0} w-2-3" title="${0}">${0}</td> </tr> `),a,e,d,d,a,t,i,i))))}}export{o as P};
1
+ import{L as t,j as e,h as s}from"./shared-63eaded9.js";import{b as a}from"./shared-cd3c902e.js";let d,i,r,l=t=>t;class o extends t{constructor(){super(...arguments),this.items=[],this.disabled=!1}static get properties(){return{disabled:{type:Boolean,reflect:!0},items:{attribute:!1}}}static get styles(){return[a.styles,e(d||(d=l`.max-w-0{max-width:0}`))]}render(){const t=this.disabled?"text-disabled":"text-body",e=this.disabled?"text-disabled":"text-secondary",a="max-w-0 truncate py-s";return s(i||(i=l` <table class="font-lumo text-m leading-m w-full"> <tbody class="divide-y divide-contrast-10"> ${0} </tbody> </table> `),this.items.map((({name:d,value:i})=>s(r||(r=l` <tr> <td class="${0} ${0} w-1-3 pr-m" title="${0}">${0}</td> <td class="${0} ${0} w-2-3" title="${0}">${0}</td> </tr> `),a,e,d,d,a,t,i,i))))}}export{o as P};
@@ -1 +1 @@
1
- import{L as e,_ as s,h as t}from"./shared-63eaded9.js";import{b as r}from"./shared-9a40309d.js";let a,o=e=>e;class d extends e{constructor(){super(...arguments),this.frame=!1}static get properties(){return s(s({},super.properties),{},{frame:{type:Boolean}})}static get styles(){return r.styles}render(){return t(a||(a=o` <section class="space-y-s font-lumo antialiased"> <h3 class="${0}"> <slot name="header"></slot> </h3> <div class="rounded-t-l rounded-b-l ${0}"> <slot></slot> </div> </section> `),"text-s font-medium text-secondary leading-none "+(this.frame?"":"pl-m"),this.frame?"border border-contrast-10 overflow-hidden":"")}}export{d as G};
1
+ import{L as e,_ as s,h as t}from"./shared-63eaded9.js";import{b as r}from"./shared-cd3c902e.js";let o,a=e=>e;class d extends e{constructor(){super(...arguments),this.frame=!1}static get properties(){return s(s({},super.properties),{},{frame:{type:Boolean}})}static get styles(){return r.styles}render(){return t(o||(o=a` <section class="space-y-s font-lumo antialiased"> <h3 class="${0}"> <slot name="header"></slot> </h3> <div class="rounded-t-l rounded-b-l ${0}"> <slot></slot> </div> </section> `),"text-s font-medium text-secondary leading-none "+(this.frame?"":"pl-m"),this.frame?"border border-contrast-10 overflow-hidden":"")}}export{d as G};
@@ -1,4 +1,4 @@
1
- import{_ as t}from"./shared-63eaded9.js";import{T as e}from"./shared-ce1da35d.js";import{a as s}from"./shared-9a40309d.js";import{p as a}from"./shared-6b7602c7.js";let n,o,r,i,l=t=>t;class c extends(s(e,"subscriptions-table")){constructor(){super(...arguments),this.columns=[c.priceColumn,c.summaryColumn,c.statusColumn,c.subTokenURLColumn]}}c.priceColumn={cell:e=>{const s=e.data._embedded["fx:last_transaction"],o=`${s.total_order} ${s.currency_code}`;return e.html(n||(n=l`
1
+ import{_ as t}from"./shared-63eaded9.js";import{T as e}from"./shared-b2330475.js";import{a as s}from"./shared-cd3c902e.js";import{p as a}from"./shared-6b7602c7.js";let n,o,r,i,c=t=>t;class l extends(s(e,"subscriptions-table")){constructor(){super(...arguments),this.columns=[l.priceColumn,l.summaryColumn,l.statusColumn,l.subTokenURLColumn]}}l.priceColumn={cell:e=>{const s=e.data._embedded["fx:last_transaction"],o=`${s.total_order} ${s.currency_code}`;return e.html(n||(n=c`
2
2
  <foxy-i18n
3
3
  data-testclass="i18n frequencies"
4
4
  class="font-semibold text-m font-tnum"
@@ -8,7 +8,7 @@ import{_ as t}from"./shared-63eaded9.js";import{T as e}from"./shared-ce1da35d.js
8
8
  .options=${0}
9
9
  >
10
10
  </foxy-i18n>
11
- `),e.lang,".5m"===e.data.frequency?"twice_a_month":"recurring",e.ns,t(t({},a(e.data.frequency)),{},{amount:o}))}},c.summaryColumn={cell:t=>{const e=t.data._embedded["fx:transaction_template"]._embedded["fx:items"],s={most_expensive_item:[...e].sort(((t,e)=>t.price-e.price))[0],count:e.length};return t.html(o||(o=l`
11
+ `),e.lang,".5m"===e.data.frequency?"twice_a_month":"recurring",e.ns,t(t({},a(e.data.frequency)),{},{amount:o}))}},l.summaryColumn={cell:t=>{const e=t.data._embedded["fx:transaction_template"]._embedded["fx:items"],s={most_expensive_item:[...e].sort(((t,e)=>t.price-e.price))[0],count:e.length};return t.html(o||(o=c`
12
12
  <foxy-i18n
13
13
  data-testclass="i18n summaries"
14
14
  class="text-m"
@@ -18,7 +18,7 @@ import{_ as t}from"./shared-63eaded9.js";import{T as e}from"./shared-ce1da35d.js
18
18
  .options=${0}
19
19
  >
20
20
  </foxy-i18n>
21
- `),t.lang,t.ns,s)}},c.statusColumn={hideBelow:"md",cell:t=>{let e,s,a;if(t.data.first_failed_transaction_date)s=t.data.first_failed_transaction_date,a="subscription_failed",e="bg-error-10 text-error";else if(t.data.end_date){s=t.data.end_date;const n=new Date(s).getTime()>Date.now();a=n?"subscription_will_be_cancelled":"subscription_cancelled",e=n?"bg-success-10 text-success":"bg-contrast-5 text-tertiary"}else s=t.data.next_transaction_date,t.data.is_active?(a="subscription_active",e="bg-success-10 text-success"):(a="subscription_inactive",e="bg-contrast-5 text-tertiary");return t.html(r||(r=l`
21
+ `),t.lang,t.ns,s)}},l.statusColumn={hideBelow:"md",cell:t=>{let e,s,a;if(t.data.first_failed_transaction_date)s=t.data.first_failed_transaction_date,a="subscription_failed",e="bg-error-10 text-error";else if(t.data.end_date){s=t.data.end_date;const n=new Date(s).getTime()>Date.now();a=n?"subscription_will_be_cancelled":"subscription_cancelled",e=n?"bg-success-10 text-success":"bg-contrast-5 text-tertiary"}else s=t.data.next_transaction_date,t.data.is_active?(a="subscription_active",e="bg-success-10 text-success"):(a="subscription_inactive",e="bg-contrast-5 text-tertiary");return t.html(r||(r=c`
22
22
  <foxy-i18n
23
23
  data-testclass="i18n statuses"
24
24
  class="px-s py-xs text-m font-semibold rounded ${0}"
@@ -28,7 +28,7 @@ import{_ as t}from"./shared-63eaded9.js";import{T as e}from"./shared-ce1da35d.js
28
28
  .options=${0}
29
29
  >
30
30
  </foxy-i18n>
31
- `),e,t.lang,a,t.ns,{date:s})}},c.subTokenURLColumn={cell:t=>t.html(i||(i=l`
31
+ `),e,t.lang,a,t.ns,{date:s})}},l.subTokenURLColumn={cell:t=>t.html(i||(i=c`
32
32
  <a
33
33
  data-testclass="links"
34
34
  target="_blank"
@@ -43,4 +43,4 @@ import{_ as t}from"./shared-63eaded9.js";import{T as e}from"./shared-ce1da35d.js
43
43
  >
44
44
  </foxy-i18n>
45
45
  </a>
46
- `),t.data._links["fx:sub_token_url"].href,t.lang,t.ns)};export{c as S};
46
+ `),t.data._links["fx:sub_token_url"].href,t.lang,t.ns)};export{l as S};
@@ -1,4 +1,4 @@
1
- import{T as t}from"./shared-ce1da35d.js";import{a as s}from"./shared-9a40309d.js";let e,n,a,o,l,i,r=t=>t;class c extends(s(t,"transactions-table")){constructor(){super(...arguments),this.columns=[c.priceColumn,c.summaryColumn,c.statusColumn,c.idColumn,c.dateColumn,c.receiptColumn]}}c.priceColumn={cell:t=>t.html(e||(e=r`
1
+ import{T as t}from"./shared-b2330475.js";import{a as s}from"./shared-cd3c902e.js";let e,n,a,o,l,i,r=t=>t;class c extends(s(t,"transactions-table")){constructor(){super(...arguments),this.columns=[c.priceColumn,c.summaryColumn,c.statusColumn,c.idColumn,c.dateColumn,c.receiptColumn]}}c.priceColumn={cell:t=>t.html(e||(e=r`
2
2
  <foxy-i18n
3
3
  data-testclass="i18n totals"
4
4
  class="text-m font-semibold font-tnum"
@@ -1,4 +1,4 @@
1
- import{C as e,j as t,L as s,_ as i,h as n}from"./shared-63eaded9.js";import{a as r,E as o,T as l,C as a}from"./shared-df573cea.js";import{T as d}from"./shared-bb824ab4.js";import{O as A,I as h}from"./shared-ec861f31.js";import{h as c,a as m,t as u,P as p}from"./shared-ff79f3f9.js";import{F as g,P as v,a as y}from"./shared-46ee137f.js";import{D as _}from"./shared-d8ffb279.js";import{b as f,c as b}from"./shared-9a40309d.js";class w extends CustomEvent{constructor(e){super("change",{detail:e})}}class x extends w{}const E=c`<dom-module id="lumo-list-box" theme-for="vaadin-list-box">
1
+ import{C as e,j as t,L as s,_ as i,h as n}from"./shared-63eaded9.js";import{a as r,E as o,T as l,C as a}from"./shared-df573cea.js";import{T as d}from"./shared-bb824ab4.js";import{O as A,I as h}from"./shared-ec861f31.js";import{h as c,a as m,t as u,P as p}from"./shared-ff79f3f9.js";import{F as g,P as v,a as y}from"./shared-46ee137f.js";import{D as _}from"./shared-710ed658.js";import{b as f,c as b}from"./shared-cd3c902e.js";class w extends CustomEvent{constructor(e){super("change",{detail:e})}}class x extends w{}const E=c`<dom-module id="lumo-list-box" theme-for="vaadin-list-box">
2
2
  <template>
3
3
  <style>
4
4
  :host {
@@ -1 +1 @@
1
- import{L as e,h as r}from"./shared-63eaded9.js";import{b as s}from"./shared-9a40309d.js";let t,o=e=>e;class n extends e{static get styles(){return s.styles}render(){return r(t||(t=o` <p class="flex text-s border border-contrast-10 rounded-t-l rounded-b-l p-s text-body leading-s"> <iron-icon icon="lumo:error" class="text-error flex-shrink-0 mr-s"></iron-icon> <slot></slot> </p> `))}}function a(e){const[r,s,t]=e.split("-").map((e=>parseInt(e,10)));return[r,s,t].some((e=>"number"!=typeof e||isNaN(e)))?null:new Date(r,s-1,t)}export{n as W,a as p};
1
+ import{L as e,h as r}from"./shared-63eaded9.js";import{b as s}from"./shared-cd3c902e.js";let t,o=e=>e;class n extends e{static get styles(){return s.styles}render(){return r(t||(t=o` <p class="flex text-s border border-contrast-10 rounded-t-l rounded-b-l p-s text-body leading-s"> <iron-icon icon="lumo:error" class="text-error flex-shrink-0 mr-s"></iron-icon> <slot></slot> </p> `))}}function a(e){const[r,s,t]=e.split("-").map((e=>parseInt(e,10)));return[r,s,t].some((e=>"number"!=typeof e||isNaN(e)))?null:new Date(r,s-1,t)}export{n as W,a as p};
@@ -0,0 +1 @@
1
+ import{_ as e,h as t}from"./shared-63eaded9.js";import{C as l}from"./shared-51e28c83.js";import"./foxy-nucleon-element.js";import{R as s,T as a,a as i}from"./shared-cd3c902e.js";import{c as r}from"./shared-4e709717.js";import{N as d}from"./shared-423a4840.js";let n,o,h,c,m,u=e=>e;const p=l(s(a(i(d))));class v extends p{constructor(){super(...arguments),this.templates={},this.columns=[]}static get properties(){return e(e({},super.properties),{},{columns:{attribute:!1}})}render(){var e,l;const s=this.columns.some((e=>!!e.header));return t(n||(n=u` <div data-testid="wrapper" aria-busy="${0}" aria-live="polite" class="relative font-lumo text-m"> <table class="table-fixed w-full" data-testid="table"> <thead class="${0}"> <tr> ${0} </tr> </thead> <tbody class="divide-y divide-contrast-10"> ${0} </tbody> </table> ${0} </div> ${0} `),this.in("busy"),s?"border-b border-contrast-10":"sr-only",this.columns.map(((e,l)=>{var s;return t(o||(o=u` <th class="${0}"> ${0} </th> `),r({"truncate h-l text-tertiary text-m text-left font-medium":!0,"text-right":l===this.columns.length-1,"hidden sm-table-cell":"sm"===e.hideBelow,"hidden md-table-cell":"md"===e.hideBelow,"hidden lg-table-cell":"lg"===e.hideBelow,"hidden xl-table-cell":"xl"===e.hideBelow}),null===(s=e.header)||void 0===s?void 0:s.call(e,{html:t,lang:this.lang,data:this.data,ns:this.ns}))})),this.__rows.map((e=>{var l;return t(h||(h=u` <tr class="h-l"> ${0} </tr> `),null===(l=this.columns)||void 0===l?void 0:l.map(((l,s)=>{var a;return t(c||(c=u` <td class="${0}"> ${0} </td> `),r({"text-right":s===this.columns.length-1,"hidden sm-table-cell":"sm"===l.hideBelow,"hidden md-table-cell":"md"===l.hideBelow,"hidden lg-table-cell":"lg"===l.hideBelow,"hidden xl-table-cell":"xl"===l.hideBelow,"truncate h-l text-body":!0}),e?null===(a=l.cell)||void 0===a?void 0:a.call(l,{html:t,lang:this.lang,data:e,ns:this.ns}):"")})))})),this.in({idle:"snapshot"})?"":t(m||(m=u` <div class="absolute inset-0 flex items-center justify-center"> <foxy-spinner data-testid="spinner" layout="vertical" state="${0}" class="p-m bg-base shadow-xs rounded-t-l rounded-b-l" lang="${0}" ns="${0} ${0}"> </foxy-spinner> </div> `),this.in("busy")?"busy":this.in("idle")?"empty":"error",this.lang,this.ns,null!==(l=null===(e=customElements.get("foxy-spinner"))||void 0===e?void 0:e.defaultNS)&&void 0!==l?l:""),this.renderTemplateOrSlot())}get __rows(){var e,t,l;const s=Object.values(null!==(t=null===(e=this.data)||void 0===e?void 0:e._embedded)&&void 0!==t?t:{}).reduce(((e,t)=>[...e,...t]),[]);let a;if(0===s.length)try{const e=new URL(null!==(l=this.href)&&void 0!==l?l:"").searchParams.get("limit"),t=parseInt(null!=e?e:"");a=isNaN(t)?20:t}catch(e){a=20}else a=s.length;return new Array(a).fill(null).map(((e,t)=>{var l;return null!==(l=s[t])&&void 0!==l?l:e}))}}export{v as T};