@foxy.io/elements 1.59.0 → 1.60.1

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 (173) 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-admin-subscription-form.js +1 -1
  6. package/dist/cdn/foxy-admin-transaction-card.js +1 -1
  7. package/dist/cdn/foxy-api-browser.js +1 -1
  8. package/dist/cdn/foxy-applied-coupon-code-card.js +1 -1
  9. package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
  10. package/dist/cdn/foxy-applied-tax-card.js +1 -1
  11. package/dist/cdn/foxy-attribute-card.js +1 -1
  12. package/dist/cdn/foxy-attribute-form.js +1 -1
  13. package/dist/cdn/foxy-billing-address-card.js +1 -1
  14. package/dist/cdn/foxy-cancellation-form.js +1 -1
  15. package/dist/cdn/foxy-cart-card.js +1 -1
  16. package/dist/cdn/foxy-cart-form.js +1 -1
  17. package/dist/cdn/foxy-client-card.js +1 -1
  18. package/dist/cdn/foxy-client-form.js +1 -1
  19. package/dist/cdn/foxy-collection-page.js +1 -1
  20. package/dist/cdn/foxy-collection-pages.js +1 -1
  21. package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
  22. package/dist/cdn/foxy-coupon-card.js +1 -1
  23. package/dist/cdn/foxy-coupon-code-card.js +1 -1
  24. package/dist/cdn/foxy-coupon-code-form.js +1 -1
  25. package/dist/cdn/foxy-coupon-codes-form.js +1 -1
  26. package/dist/cdn/foxy-coupon-detail-card.js +1 -1
  27. package/dist/cdn/foxy-coupon-form.js +1 -1
  28. package/dist/cdn/foxy-custom-field-card.js +1 -1
  29. package/dist/cdn/foxy-custom-field-form.js +1 -1
  30. package/dist/cdn/foxy-customer-api.js +1 -1
  31. package/dist/cdn/foxy-customer-card.js +1 -1
  32. package/dist/cdn/foxy-customer-form.js +1 -1
  33. package/dist/cdn/foxy-customer-portal-settings-form.js +1 -1
  34. package/dist/cdn/foxy-customer-portal-settings.js +1 -1
  35. package/dist/cdn/foxy-customer-portal.js +1 -1
  36. package/dist/cdn/foxy-customer.js +1 -1
  37. package/dist/cdn/foxy-customers-table.js +1 -1
  38. package/dist/cdn/foxy-discount-builder.js +1 -1
  39. package/dist/cdn/foxy-discount-card.js +1 -1
  40. package/dist/cdn/foxy-discount-detail-card.js +1 -1
  41. package/dist/cdn/foxy-donation.js +1 -1
  42. package/dist/cdn/foxy-downloadable-card.js +1 -1
  43. package/dist/cdn/foxy-downloadable-form.js +1 -1
  44. package/dist/cdn/foxy-email-template-card.js +1 -1
  45. package/dist/cdn/foxy-email-template-form.js +1 -1
  46. package/dist/cdn/foxy-error-entry-card.js +1 -1
  47. package/dist/cdn/foxy-experimental-add-to-cart-builder.js +1 -1
  48. package/dist/cdn/foxy-filter-attribute-card.js +1 -1
  49. package/dist/cdn/foxy-filter-attribute-form.js +1 -1
  50. package/dist/cdn/foxy-form-dialog.js +1 -1
  51. package/dist/cdn/foxy-generate-codes-form.js +1 -1
  52. package/dist/cdn/foxy-gift-card-card.js +1 -1
  53. package/dist/cdn/foxy-gift-card-code-card.js +1 -1
  54. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  55. package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
  56. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  57. package/dist/cdn/foxy-gift-card-form.js +1 -1
  58. package/dist/cdn/foxy-i18n-editor.js +1 -1
  59. package/dist/cdn/foxy-integration-card.js +1 -1
  60. package/dist/cdn/foxy-integration-form.js +1 -1
  61. package/dist/cdn/foxy-item-card.js +1 -1
  62. package/dist/cdn/foxy-item-category-card.js +1 -1
  63. package/dist/cdn/foxy-item-category-form.js +1 -1
  64. package/dist/cdn/foxy-item-form.js +1 -1
  65. package/dist/cdn/foxy-item-option-card.js +1 -1
  66. package/dist/cdn/foxy-item-option-form.js +1 -1
  67. package/dist/cdn/foxy-items-form.js +1 -1
  68. package/dist/cdn/foxy-native-integration-card.js +1 -1
  69. package/dist/cdn/foxy-native-integration-form.js +1 -1
  70. package/dist/cdn/foxy-nucleon-element.js +1 -1
  71. package/dist/cdn/foxy-pagination.js +1 -1
  72. package/dist/cdn/foxy-passkey-card.js +1 -1
  73. package/dist/cdn/foxy-passkey-form.js +1 -1
  74. package/dist/cdn/foxy-payment-card-embed.js +1 -1
  75. package/dist/cdn/foxy-payment-card.js +1 -1
  76. package/dist/cdn/foxy-payment-method-card.js +1 -1
  77. package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
  78. package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
  79. package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
  80. package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
  81. package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
  82. package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
  83. package/dist/cdn/foxy-query-builder.js +1 -1
  84. package/dist/cdn/foxy-report-form.js +1 -1
  85. package/dist/cdn/foxy-reports-table.js +6 -6
  86. package/dist/cdn/foxy-shipment-card.js +1 -1
  87. package/dist/cdn/foxy-shipping-container-card.js +1 -1
  88. package/dist/cdn/foxy-shipping-drop-type-card.js +1 -1
  89. package/dist/cdn/foxy-shipping-method-card.js +1 -1
  90. package/dist/cdn/foxy-shipping-service-card.js +1 -1
  91. package/dist/cdn/foxy-sign-in-form.js +1 -1
  92. package/dist/cdn/foxy-store-card.js +1 -1
  93. package/dist/cdn/foxy-store-form.js +1 -1
  94. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  95. package/dist/cdn/foxy-store-transaction-folder-card.js +1 -1
  96. package/dist/cdn/foxy-store-transaction-folder-form.js +1 -1
  97. package/dist/cdn/foxy-subscription-card.js +1 -1
  98. package/dist/cdn/foxy-subscription-form.js +1 -1
  99. package/dist/cdn/foxy-subscription-settings-form.js +1 -1
  100. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  101. package/dist/cdn/foxy-table.js +1 -1
  102. package/dist/cdn/foxy-tax-card.js +1 -1
  103. package/dist/cdn/foxy-tax-form.js +1 -1
  104. package/dist/cdn/foxy-template-config-form.js +1 -1
  105. package/dist/cdn/foxy-template-form.js +1 -1
  106. package/dist/cdn/foxy-template-set-card.js +1 -1
  107. package/dist/cdn/foxy-template-set-form.js +1 -1
  108. package/dist/cdn/foxy-transaction-card.js +1 -1
  109. package/dist/cdn/foxy-transaction.js +1 -1
  110. package/dist/cdn/foxy-transactions-table.js +1 -1
  111. package/dist/cdn/foxy-update-payment-method-form.js +1 -1
  112. package/dist/cdn/foxy-user-card.js +1 -1
  113. package/dist/cdn/foxy-user-form.js +1 -1
  114. package/dist/cdn/foxy-user-invitation-card.js +1 -1
  115. package/dist/cdn/foxy-user-invitation-form.js +1 -1
  116. package/dist/cdn/foxy-users-table.js +1 -1
  117. package/dist/cdn/foxy-webhook-card.js +1 -1
  118. package/dist/cdn/foxy-webhook-form.js +1 -1
  119. package/dist/cdn/foxy-webhook-log-card.js +1 -1
  120. package/dist/cdn/foxy-webhook-status-card.js +1 -1
  121. package/dist/cdn/{shared-7b6a899b.js → shared-091e97f3.js} +1 -1
  122. package/dist/cdn/shared-0996f4d0.js +1 -0
  123. package/dist/cdn/{shared-3991076b.js → shared-0b0ab3d2.js} +1 -1
  124. package/dist/cdn/{shared-14713ead.js → shared-18707481.js} +1 -1
  125. package/dist/cdn/{shared-336e73ce.js → shared-222b23bb.js} +1 -1
  126. package/dist/cdn/shared-2fbff8e7.js +1 -0
  127. package/dist/cdn/{shared-8ec1b077.js → shared-32a39c0b.js} +1 -1
  128. package/dist/cdn/shared-345b07f1.js +1 -0
  129. package/dist/cdn/{shared-bc74cd11.js → shared-3a61d8a6.js} +1 -1
  130. package/dist/cdn/{shared-1e9df11c.js → shared-3ef23488.js} +1 -1
  131. package/dist/cdn/{shared-33d770fe.js → shared-40a2705c.js} +1 -1
  132. package/dist/cdn/{shared-cb5305b9.js → shared-41f93e6c.js} +1 -1
  133. package/dist/cdn/{shared-45649d84.js → shared-4ab85bea.js} +1 -1
  134. package/dist/cdn/{shared-28fa98d7.js → shared-4ed4b075.js} +1 -1
  135. package/dist/cdn/{shared-20841d9c.js → shared-56278a3c.js} +1 -1
  136. package/dist/cdn/{shared-d743ec15.js → shared-5e7defee.js} +1 -1
  137. package/dist/cdn/{shared-59dfee2c.js → shared-7b15217c.js} +1 -1
  138. package/dist/cdn/{shared-1a814f90.js → shared-7e28c953.js} +1 -1
  139. package/dist/cdn/{shared-2652e98e.js → shared-8292d44e.js} +1 -1
  140. package/dist/cdn/shared-87e17c02.js +1 -0
  141. package/dist/cdn/{shared-a1bec4a0.js → shared-88f841ff.js} +1 -1
  142. package/dist/cdn/{shared-3eca56ee.js → shared-8be109a9.js} +1 -1
  143. package/dist/cdn/{shared-9f8b593b.js → shared-8f5c8c08.js} +1 -1
  144. package/dist/cdn/{shared-be20875c.js → shared-9b290320.js} +1 -1
  145. package/dist/cdn/{shared-b84996e5.js → shared-a95a66b8.js} +1 -1
  146. package/dist/cdn/{shared-4cc16cdf.js → shared-ac536c67.js} +1 -1
  147. package/dist/cdn/{shared-a44fcc6a.js → shared-ad5617ef.js} +1 -1
  148. package/dist/cdn/{shared-38e0a818.js → shared-af4f71bf.js} +1 -1
  149. package/dist/cdn/{shared-50ef1d5a.js → shared-c85c1864.js} +1 -1
  150. package/dist/cdn/{shared-760a2243.js → shared-cda51ccf.js} +1 -1
  151. package/dist/cdn/{shared-db17c9ee.js → shared-d2f777dc.js} +1 -1
  152. package/dist/cdn/{shared-fdf6df5c.js → shared-e9f9face.js} +1 -1
  153. package/dist/cdn/{shared-3baa9cc9.js → shared-eb349085.js} +1 -1
  154. package/dist/cdn/{shared-19b475f7.js → shared-f9c8881a.js} +1 -1
  155. package/dist/cdn/translations/user-invitation-form/en.json +4 -0
  156. package/dist/elements/public/AdminSubscriptionCard/AdminSubscriptionCard.js +3 -3
  157. package/dist/elements/public/AdminSubscriptionCard/AdminSubscriptionCard.js.map +1 -1
  158. package/dist/elements/public/UserInvitationForm/internal/InternalUserInvitationFormScopeControl/InternalUserInvitationFormScopeControl.d.ts +5 -2
  159. package/dist/elements/public/UserInvitationForm/internal/InternalUserInvitationFormScopeControl/InternalUserInvitationFormScopeControl.js +28 -8
  160. package/dist/elements/public/UserInvitationForm/internal/InternalUserInvitationFormScopeControl/InternalUserInvitationFormScopeControl.js.map +1 -1
  161. package/dist/utils/group-invitation-scopes.d.ts +1 -1
  162. package/dist/utils/group-invitation-scopes.js +4 -2
  163. package/dist/utils/group-invitation-scopes.js.map +1 -1
  164. package/dist/utils/invitation-scope.d.ts +1 -1
  165. package/dist/utils/invitation-scope.js +9 -10
  166. package/dist/utils/invitation-scope.js.map +1 -1
  167. package/dist/utils/user-scope.js +2 -2
  168. package/dist/utils/user-scope.js.map +1 -1
  169. package/package.json +1 -1
  170. package/dist/cdn/shared-36f1e29f.js +0 -1
  171. package/dist/cdn/shared-559b648a.js +0 -1
  172. package/dist/cdn/shared-ab1f5f1f.js +0 -1
  173. package/dist/cdn/shared-da3393a5.js +0 -1
@@ -1 +1 @@
1
- import"./foxy-billing-address-card.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-custom-field-form.js";import"./foxy-custom-field-card.js";import"./foxy-copy-to-clipboard.js";import"./foxy-nucleon-element.js";import"./foxy-shipment-card.js";import"./foxy-payment-card.js";import"./foxy-webhook-card.js";import"./foxy-webhook-form.js";import"./foxy-address-form.js";import"./foxy-item-card.js";import"./foxy-item-form.js";import"./shared-c066b7fd.js";import"./shared-a1bec4a0.js";import"./shared-bc74cd11.js";import"./shared-3eca56ee.js";import"./shared-59dfee2c.js";import{I as e}from"./shared-be20875c.js";import{a as t}from"./shared-45649d84.js";import"./foxy-customer-card.js";import"./foxy-swipe-actions.js";import"./foxy-spinner.js";import{_ as o,B as i}from"./shared-8f9014ff.js";import{g as r}from"./shared-bab2ea2c.js";import{i as n}from"./shared-53e42a77.js";import{h as s,s as a}from"./shared-ba5c42c7.js";import{c as l}from"./shared-4e709717.js";import"./shared-a8ae24f0.js";import{R as d,a as c}from"./shared-5b8c7250.js";import{f as u,p as f}from"./shared-da3393a5.js";import{u as p}from"./shared-91c18cdd.js";import"./shared-559b648a.js";import"./shared-20841d9c.js";import"./shared-50ef1d5a.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-930e68b7.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-cf1965cb.js";import"./shared-c59277a4.js";import"./shared-c3d6bcc0.js";import"./shared-f410644a.js";import"./shared-5212ef4f.js";import"./shared-336e73ce.js";import"./shared-38e0a818.js";import"./shared-dc6e5879.js";import"./shared-f77994ad.js";import"./shared-c56c3e1e.js";import"./shared-28fa98d7.js";import"./shared-5fd5805c.js";import"./shared-760a2243.js";import"./shared-cb5305b9.js";import"./shared-affe06c0.js";import"./shared-cfc6735e.js";import"./shared-fdf6df5c.js";import"./shared-91483320.js";import"./shared-ab1f5f1f.js";import"./shared-14713ead.js";import"./shared-c84333db.js";import"./shared-cf613436.js";import"./shared-8ec1b077.js";import"./shared-5dbd66e3.js";import"./shared-28cc8aa1.js";import"./shared-53a5212e.js";import"./shared-e9f51baa.js";import"./shared-b84996e5.js";import"./shared-d8b880bb.js";import"./shared-6262e0d6.js";import"./shared-2fbfbe12.js";import"./shared-7b6a899b.js";import"./shared-d0aed1c1.js";import"./foxy-webhook-status-card.js";import"./foxy-webhook-log-card.js";import"./shared-1b414966.js";import"./shared-3baa9cc9.js";import"./foxy-form-dialog.js";import"./shared-53e476fd.js";import"./shared-19b475f7.js";import"./shared-56741bad.js";import"./shared-34262bb8.js";import"./shared-1a814f90.js";import"./shared-4cc16cdf.js";import"./shared-3fd75ee6.js";import"./shared-48910b3f.js";import"./shared-2061be9a.js";import"./shared-e650caf3.js";import"./shared-af6ccc54.js";import"./foxy-discount-detail-card.js";import"./shared-36f1e29f.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./shared-63c32024.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-collection-page.js";import"./foxy-pagination.js";let h,m,v,_,y=e=>e;customElements.define("foxy-internal-transaction-customer-control",class extends t{constructor(){super(...arguments),this.__copyEmailState="idle",this.__copyIdState="idle"}static get properties(){return o(o({},super.properties),{},{__copyEmailState:{attribute:!1},__copyIdState:{attribute:!1}})}renderControl(){var e,t,o,i;const d=this.nucleon,c=null===(e=null==d?void 0:d.data)||void 0===e?void 0:e._links["fx:customer"].href,u=c?null===(t=null==d?void 0:d.getCustomerPageHref)||void 0===t?void 0:t.call(d,c):void 0;return s(h||(h=y` <foxy-i18n infer="" class="block text-l font-medium leading-xs mb-s" key="label"> </foxy-i18n> <foxy-swipe-actions> <a class="${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" href="${0}"> <foxy-customer-card infer="" href="${0}"></foxy-customer-card> </a> <div class="h-full grid grid-cols-2 gap-s ml-s" slot="action"> ${0} ${0} </div> </foxy-swipe-actions> `),l({"block ring-inset rounded transition-colors bg-contrast-5":!0,"cursor-pointer hover-bg-contrast-10":!!u,"focus-outline-none focus-ring-2 focus-ring-primary-50":!!u}),n(u),n(c),this.__renderCopyAction(a(m||(m=y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.2rem; height: 1.2rem"><path fill-rule="evenodd" d="M9.493 2.852a.75.75 0 0 0-1.486-.204L7.545 6H4.198a.75.75 0 0 0 0 1.5h3.14l-.69 5H3.302a.75.75 0 0 0 0 1.5h3.14l-.435 3.148a.75.75 0 0 0 1.486.204L7.955 14h2.986l-.434 3.148a.75.75 0 0 0 1.486.204L12.456 14h3.346a.75.75 0 0 0 0-1.5h-3.14l.69-5h3.346a.75.75 0 0 0 0-1.5h-3.14l.435-3.148a.75.75 0 0 0-1.486-.204L12.045 6H9.059l.434-3.148ZM8.852 7.5l-.69 5h2.986l.69-5H8.852Z" clip-rule="evenodd" /></svg>`)),"copy_id_caption","__copyIdState",c?String(r(c)):""),this.__renderCopyAction(a(v||(v=y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.2rem; height: 1.2rem"><path fill-rule="evenodd" d="M5.404 14.596A6.5 6.5 0 1 1 16.5 10a1.25 1.25 0 0 1-2.5 0 4 4 0 1 0-.571 2.06A2.75 2.75 0 0 0 18 10a8 8 0 1 0-2.343 5.657.75.75 0 0 0-1.06-1.06 6.5 6.5 0 0 1-9.193 0ZM10 7.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5Z" clip-rule="evenodd" /></svg>`)),"copy_email_caption","__copyEmailState",null!==(i=null===(o=null==d?void 0:d.data)||void 0===o?void 0:o.customer_email)&&void 0!==i?i:""))}__renderCopyAction(e,t,o,i){const r=this[o],n="fail"===r?"error":"done"===r?"end":"busy";return s(_||(_=y` <button class="relative transition-colors bg-contrast-5 text-body hover-bg-contrast-10 rounded h-full py-0 px-m focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50" ?disabled="${0}" @click="${0}" @focusout="${0}" @mouseout="${0}"> <div class="${0}"> ${0} <foxy-i18n class="mt-xs text-s font-medium leading-none" infer="" key="${0}"> </foxy-i18n> </div> <div class="${0}"> <foxy-spinner layout="no-label" state="${0}" infer="spinner"> </foxy-spinner> </div> </button> `),"idle"!==r,(()=>"idle"===r&&this.__copy(i,o)),(e=>"idle"!==r&&e.stopPropagation()),(e=>"idle"!==r&&e.stopPropagation()),l({"relative flex flex-col items-center justify-center transition-opacity":!0,"opacity-0":"idle"!==r}),e,t,l({"absolute inset-0 flex items-center justify-center transition-opacity":!0,"opacity-0":"idle"===r}),n)}async __copy(e,t){this[t]="busy";try{await navigator.clipboard.writeText(e),this[t]="done"}catch(e){this[t]="fail"}setTimeout((()=>this[t]="idle"),3e3)}});let x,b,g,w,j,$,k,S,A,P,L,H=e=>e;customElements.define("foxy-internal-transaction-actions-control",class extends t{constructor(){super(...arguments),this.currencyDisplay=null,this.folders=null}static get properties(){return o(o({},super.properties),{},{currencyDisplay:{attribute:"currency-display"},folders:{}})}renderControl(){var e,t,o,i,r,n,a,l,d,c,u,f;return s(x||(x=H` <div class="flex flex-wrap gap-x-m gap-y-xs"> ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} </div> `),(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:capture"])?this.__renderCaptureAction():"",(null===(i=null===(o=this.nucleon)||void 0===o?void 0:o.data)||void 0===i?void 0:i._links["fx:void"])?this.__renderVoidAction():"",(null===(n=null===(r=this.nucleon)||void 0===r?void 0:r.data)||void 0===n?void 0:n._links["fx:refund"])?this.__renderRefundAction():"",(null===(l=null===(a=this.nucleon)||void 0===a?void 0:a.data)||void 0===l?void 0:l._links["fx:send_emails"])?this.__renderSendEmailsAction():"",(null===(c=null===(d=this.nucleon)||void 0===d?void 0:d.data)||void 0===c?void 0:c._links["fx:subscription"])&&!this.hiddenSelector.matches("subscription",!0)?this.__renderSubscriptionAction():"",(null===(f=null===(u=this.nucleon)||void 0===u?void 0:u.data)||void 0===f?void 0:f._links["fx:receipt"])?this.__renderReceiptAction():"",this.hiddenSelector.matches("archive",!0)?"":this.__renderArchiveAction(),this.folders&&!this.hiddenSelector.matches("folder",!0)?this.__renderFolderSelector(this.folders):"")}get __refundAmount(){var e,t,o,i;const r=null===(e=this.nucleon)||void 0===e?void 0:e.data,n=null!==(t=null==r?void 0:r.total_order)&&void 0!==t?t:0;return parseFloat(null!==(i=null===(o=null==r?void 0:r._links["fx:refund"])||void 0===o?void 0:o.amount)&&void 0!==i?i:n)}__renderSendEmailsAction(){var e,t;return s(b||(b=H` <foxy-internal-post-action-control infer="send-emails" theme="tertiary-inline" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),n(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:send_emails"].href),(()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.refresh()}))}__renderCaptureAction(){var e,t;return s(g||(g=H` <foxy-internal-post-action-control theme="tertiary-inline success" infer="capture" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),n(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:capture"].href),(()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.refresh()}))}__renderVoidAction(){var e,t,o;return s(w||(w=H` <foxy-internal-post-action-control theme="tertiary-inline error" infer="void" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),n(null===(o=null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:void"])||void 0===o?void 0:o.href),(()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.refresh()}))}__renderRefundAction(){var e,t,o,i,r;const a=null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t.currency_code;return s(j||(j=H` <foxy-internal-post-action-control message-options="${0}" infer="refund" theme="tertiary-inline" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),JSON.stringify({currencyDisplay:this.currencyDisplay,amount:`${this.__refundAmount} ${a}`}),n(null===(r=null===(i=null===(o=this.nucleon)||void 0===o?void 0:o.data)||void 0===i?void 0:i._links["fx:refund"])||void 0===r?void 0:r.href),(()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.refresh()}))}__renderSubscriptionAction(){var e,t,o;const i=this.nucleon,r=null===(t=null===(e=null==i?void 0:i.data)||void 0===e?void 0:e._links["fx:subscription"])||void 0===t?void 0:t.href,a=r?null===(o=null==i?void 0:i.getSubscriptionPageHref)||void 0===o?void 0:o.call(i,r):void 0;return s($||($=H` <a class="rounded text-m font-medium text-primary cursor-pointer transition-opacity hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="subscription" key="caption"></foxy-i18n> </a> `),n(a))}__renderReceiptAction(){var e,t;const o=this.nucleon;return s(k||(k=H` <a target="_blank" class="rounded text-m font-medium text-primary cursor-pointer transition-opacity hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="receipt" key="caption"></foxy-i18n> </a> `),n(null===(t=null===(e=null==o?void 0:o.data)||void 0===e?void 0:e._links["fx:receipt"])||void 0===t?void 0:t.href))}__renderArchiveAction(){const e=this.nucleon;return s(S||(S=H` <vaadin-button theme="tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="archive" key="caption_${0}"> </foxy-i18n> </vaadin-button> `),this.disabledSelector.matches("archive",!0),(()=>{null==e||e.edit({hide_transaction:!(null==e?void 0:e.form.hide_transaction)}),null==e||e.submit()}),(null==e?void 0:e.form.hide_transaction)?"unarchive":"archive")}__renderFolderSelector(e){var t,o,i;const r=this.renderRoot.querySelector("#foldersLoader"),n=Array.from(null!==(i=null===(o=null===(t=null==r?void 0:r.data)||void 0===t?void 0:t._embedded)||void 0===o?void 0:o["fx:transaction_folders"])&&void 0!==i?i:[]),l=this.nucleon;return s(A||(A=H` <foxy-nucleon class="hidden" infer="" href="${0}" id="foldersLoader" @update="${0}"> </foxy-nucleon> <label class="group relative rounded focus-within-ring-2 focus-within-ring-primary-50" ?hidden="${0}"> <span class="inline-flex items-center gap-xs relative transition-opacity group-hover-opacity-80"> <foxy-i18n class="font-medium text-primary" infer="folder" key="caption"></foxy-i18n> ${0} </span> <select class="absolute inset-0 opacity-0 cursor-pointer" ?disabled="${0}" ?readonly="${0}" @change="${0}"> <option value="" ?selected="${0}" ?disabled="${0}"> ${0} </option> ${0} </select> </label> `),e,(()=>this.requestUpdate()),0===n.length,a(P||(P=H`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="text-primary transform scale-125" style="width: 1em; height: 1em"><path fill-rule="evenodd" d="M10.53 3.47a.75.75 0 0 0-1.06 0L6.22 6.72a.75.75 0 0 0 1.06 1.06L10 5.06l2.72 2.72a.75.75 0 1 0 1.06-1.06l-3.25-3.25Zm-4.31 9.81 3.25 3.25a.75.75 0 0 0 1.06 0l3.25-3.25a.75.75 0 1 0-1.06-1.06L10 14.94l-2.72-2.72a.75.75 0 0 0-1.06 1.06Z" clip-rule="evenodd" /></svg>`)),this.disabled,this.readonly,(e=>{null==l||l.edit({folder_uri:e.currentTarget.value}),null==l||l.submit(!1)}),!(null==l?void 0:l.form.folder_uri),!(null==l?void 0:l.form.folder_uri),this.t("folder.option_none"),n.sort(((e,t)=>e.sort_order-t.sort_order)).map((e=>{const t=e._links.self.href,o=(null==l?void 0:l.form.folder_uri)===t;return s(L||(L=H` <option value="${0}" ?selected="${0}" ?disabled="${0}"> ${0} </option> `),t,o,o,e.name)})))}});let C,R,B,E,I,U,q,T,Z,D,F,M,W=e=>e;customElements.define("foxy-internal-transaction-summary-control",class extends t{constructor(){super(...arguments),this.__storeLoaderId="storeLoader"}renderControl(){var e,t,o,i,r,a,l,d,c;const u=null===(e=this.nucleon)||void 0===e?void 0:e.data;if(!u)return s(C||(C=W``));const f=null!==(o=null===(t=null==u?void 0:u._embedded)||void 0===t?void 0:t["fx:applied_taxes"])&&void 0!==o?o:[],p=null!==(r=null===(i=u._embedded)||void 0===i?void 0:i["fx:shipments"])&&void 0!==r?r:[],h=this.__refundableAmount;return s(R||(R=W` <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <p class="grid gap-x-s text-right text-s leading-m border-dashed border rounded border-contrast-20 whitespace-nowrap overflow-auto" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 2px);grid-template-columns:1fr min-content"> <span><foxy-i18n key="subtotal" infer=""></foxy-i18n>&colon;</span> <span>${0}</span> ${0} ${0} ${0} ${0} <span class="col-span-2 border-t border-dashed border-contrast-20 my-s"></span> <span class="col-span-2 flex gap-s justify-between items-center"> ${0} <span class="text-xl font-medium leading-xs"> <foxy-i18n infer="" key="total"></foxy-i18n>&colon; ${0} </span> </span> ${0} </p> `),n(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.__renderPrice(u.total_item_price),0===p.length||0===u.total_shipping?s(B||(B=W` <span><foxy-i18n infer="" key="total_shipping"></foxy-i18n>&colon;</span> <span>${0} </span> `),this.__renderPrice(u.total_shipping,!0)):p.map((e=>s(E||(E=W` <span>${0}&colon;</span> <span>${0}</span> `),e.shipping_service_description,this.__renderPrice(e.total_shipping,!0)))),0===f.length||0===u.total_tax?s(I||(I=W` <span><foxy-i18n infer="" key="total_tax"></foxy-i18n>&colon;</span> <span>${0}</span> `),this.__renderPrice(u.total_tax,!0)):f.map((e=>s(U||(U=W` <span>${0}&colon;</span> <span>${0}</span> `),e.name,this.__renderPrice(e.amount,!0)))),null===(l=null===(a=null==u?void 0:u._embedded)||void 0===a?void 0:a["fx:gift_card_code_logs"])||void 0===l?void 0:l.map((e=>{var t,o,i,r,n;const a=null===(o=null===(t=e._embedded)||void 0===t?void 0:t["fx:gift_card"])||void 0===o?void 0:o.name,l=null===(r=null===(i=e._embedded)||void 0===i?void 0:i["fx:gift_card_code"])||void 0===r?void 0:r.code;if(a&&l)return s(q||(q=W` <span data-testclass="gift-card-code">${0} &bull; ${0}&colon;</span> <span>${0}</span> `),a,l,this.__renderPrice(null!==(n=e.balance_adjustment)&&void 0!==n?n:0,!0))})),null===(c=null===(d=null==u?void 0:u._embedded)||void 0===d?void 0:d["fx:discounts"])||void 0===c?void 0:c.map((({name:e,code:t,amount:o})=>s(T||(T=W` <span data-testclass="discount">${0}${0}&colon;</span> <span>${0}</span> `),e,t?s(Z||(Z=W` &bull; ${0}`),t):"",this.__renderPrice(o,!0)))),this.__renderStatus(),this.__renderPrice(u.total_order),h!==u.total_order?s(D||(D=W` <span class="col-span-2 border-t border-dashed border-contrast-20 my-s"></span> <span class="col-span-2 flex justify-end"> <span> <span class="text-xl font-medium leading-xs"> <foxy-i18n infer="" key="refundable_amount"></foxy-i18n>&colon; ${0} </span> <br> <foxy-i18n class="inline-block whitespace-normal leading-s text-tertiary" style="max-width:48ch" infer="" key="refundable_amount_note"> </foxy-i18n> </span> </span> `),this.__renderPrice(h)):"")}get __refundableAmount(){var e,t,o,i;const r=null===(e=this.nucleon)||void 0===e?void 0:e.data,n=null!==(t=null==r?void 0:r.total_order)&&void 0!==t?t:0;return parseFloat(null!==(i=null===(o=null==r?void 0:r._links["fx:refund"])||void 0===o?void 0:o.amount)&&void 0!==i?i:n)}get __storeHref(){var e,t,o;return null===(o=null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:store"])||void 0===o?void 0:o.href}get __store(){var e,t;const o=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(o))||void 0===e?void 0:e.data)&&void 0!==t?t:null}__renderPrice(e,t=!1){var o,i,r;const n=(null===(o=this.__store)||void 0===o?void 0:o.use_international_currency_symbol)?"code":"symbol",a=null===(r=null===(i=this.nucleon)||void 0===i?void 0:i.data)||void 0===r?void 0:r.currency_code;return s(F||(F=W` <foxy-i18n class="${0}" infer="" key="price" .options="${0}"> </foxy-i18n> `),t&&0!==e?e>0?"text-success":"text-error":"",{currencyDisplay:n,signDisplay:t?"exceptZero":"auto",amount:`${e} ${a}`})}__renderStatus(){var e,t;const o=(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t.status)||"completed";let i="";return i=["capturing","captured","approved","authorized","pending"].includes(o)?"text-success bg-success-10":o&&"completed"!==o?["problem","pending_fraud_review","rejected","declined"].includes(o)?"text-error-contrast bg-error":"bg-contrast-5 text-body":"text-success-contrast bg-success",s(M||(M=W` <foxy-i18n infer="" class="${0} rounded-s py-xs px-s font-medium text-s leading-xs" key="status_${0}"></foxy-i18n> `),i,o)}});let G,z,N,O,V,J=e=>e;const K=d(c(e,"transaction"));class Q extends K{constructor(){var e;super(...arguments),e=this,this.hostedPaymentGatewaysHelper=null,this.paymentGatewaysHelper=null,this.localeCodes=null,this.getSubscriptionPageHref=null,this.getCustomerPageHref=null,this.__webhooksBulkActions=[{name:"refeed",onClick:async function(t){if(!e.data)return;const o=e.data._links["fx:send_webhooks"].href,i=new Q.API(e),n=await i.fetch(o,{method:"POST",body:JSON.stringify({refeed_hooks:t.map((e=>r(e._links.self.href))),event:"refeed"})});if(t.forEach((e=>{Q.Rumour("").share({related:[...t.map((e=>e._links["fx:logs"].href)),...t.map((e=>e._links["fx:statuses"].href))],source:e._links.self.href,data:e})})),!n.ok)throw new Error(await n.text())}}]}static get properties(){return o(o({},super.properties),{},{hostedPaymentGatewaysHelper:{attribute:"hosted-payment-gateways-helper"},paymentGatewaysHelper:{attribute:"payment-gateways-helper"},getSubscriptionPageHref:{attribute:!1},getCustomerPageHref:{attribute:!1},localeCodes:{attribute:"locale-codes"}})}get scopeRules(){return[{path:"customer",collection:"customers"},{path:"items",collection:"transactions",readonlyIfNoWrite:!0},{path:"custom-fields",collection:"transactions",readonlyIfNoWrite:!0},{path:"attributes",collection:"transactions",readonlyIfNoWrite:!0},{path:"actions:capture",collection:"transactions",need:"write"},{path:"actions:void",collection:"transactions",need:"write"},{path:"actions:refund",collection:"transactions",need:"write"},{path:"actions:archive",collection:"transactions",need:"write"},{path:"actions:folder",collection:"transactions",need:"write"},{path:"actions:send-emails",collection:"transactions",need:"resend"},{path:"actions:subscription",collection:"subscriptions"},{path:"webhooks",collection:"stores"},{path:"actions:folder",collection:"stores"},{path:"webhooks",collection:"webhooks"},{path:"webhooks:refeed",collection:"webhooks",need:"resend"},{path:"datafeed:process-webhook",collection:"webhooks",need:"resend"}]}get readonlySelector(){var e,t,o;const r=["billing-addresses","datafeed:data-is-fed","webhooks:dialog:url",super.readonlySelector];return Boolean(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:void"])&&void 0!==t?t:null===(o=this.data)||void 0===o?void 0:o._links["fx:refund"])||r.push("items","attributes","custom-fields"),new i(r.join(" ").trim())}get hiddenSelector(){var e,t,o,r;const n=["billing-addresses:dialog:delete","billing-addresses:dialog:timestamps","webhooks:dialog:header:copy-json","webhooks:dialog:header:copy-id","webhooks:dialog:timestamps","webhooks:dialog:name","webhooks:dialog:query","webhooks:dialog:encryption-key","webhooks:dialog:delete",super.hiddenSelector],s=null===(e=this.data)||void 0===e?void 0:e.type;return(null===(t=this.data)||void 0===t?void 0:t._links["fx:subscription"])||n.unshift("subscription"),"subscription_modification"===s&&n.unshift("actions"),"updateinfo"===s&&n.unshift("not=customer,subscription,payments,custom-fields,attributes"),"subscription_cancellation"===s&&n.unshift("not=customer,subscription,custom-fields,attributes"),(null===(r=null===(o=this.__storeLoader)||void 0===o?void 0:o.data)||void 0===r?void 0:r.use_webhook)||n.unshift("datafeed"),this.__emailTemplateSubject||this.__isTemplateSetUnknownForScope||n.unshift("actions:send-emails"),new i(n.join(" ").trim())}get headerSubtitleOptions(){var e,t,o,i,r;const n=null===(e=this.data)||void 0===e?void 0:e.source,s=null===(t=this.data)||void 0===t?void 0:t.type;let a="";return"updateinfo"===s?a=!n||(null==n?void 0:n.startsWith("cit_"))?"customer_changed_payment_method":"mit_uoe"===n?"admin_changed_payment_method_with_uoe":"mit_api"===n?"integration_changed_payment_method":"admin_changed_payment_method":"subscription_modification"===s?a=!n||(null==n?void 0:n.startsWith("cit_"))?"customer_changed_subscription":"mit_uoe"===n?"admin_changed_subscription_with_uoe":"mit_api"===n?"integration_changed_subscription":"admin_changed_subscription":"subscription_renewal"===s?"mit_recurring"===n?a="subscription_renewal_attempt":"mit_recurring_reattempt_automated"===n?a="subscription_renewal_automated_reattempt":"mit_recurring_reattempt_manual"===n&&(a="subscription_renewal_manual_reattempt"):"subscription_cancellation"===s?"cit_recurring_cancellation"===n?a="customer_canceled_subscription":"mit_recurring_cancellation"===n&&(a="admin_canceled_subscription"):(null===(o=this.data)||void 0===o?void 0:o._links["fx:subscription"])?(null==n?void 0:n.startsWith("cit_"))?a="customer_subscribed":"mit_uoe"===n?a="admin_subscribed_with_uoe":"mit_api"===n&&(a="integration_subscribed"):(null==n?void 0:n.startsWith("cit_"))?a="customer_placed_order":"mit_uoe"===n?a="admin_placed_order_with_uoe":"mit_api"===n&&(a="integration_placed_order"),{transaction_date:null===(i=this.data)||void 0===i?void 0:i.transaction_date,ip_country:null===(r=this.data)||void 0===r?void 0:r.ip_country,context:a}}get headerSubtitleBadges(){var e,t,o,i,r;const n=super.headerSubtitleBadges,s=null===(t=null===(e=this.data)||void 0===e?void 0:e._embedded)||void 0===t?void 0:t["fx:folder"];if(null==s?void 0:s.name){const e=null!==(o=s.color)&&void 0!==o?o:"",t={red:"bg-folder-red text-white",red_pale:"bg-folder-red-pale text-black",green:"bg-folder-green text-white",green_pale:"bg-folder-green-pale text-black",blue:"bg-folder-blue text-white",blue_pale:"bg-folder-blue-pale text-black",orange:"bg-folder-orange text-white",orange_pale:"bg-folder-orange-pale text-black",violet:"bg-folder-violet text-white",violet_pale:"bg-folder-violet-pale text-black","":"bg-contrast-5 text-body"};n.push({class:t[e in t?e:""],icon:a(G||(G=J`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1em; height: 1em;"><path d="M3.75 3A1.75 1.75 0 0 0 2 4.75v3.26a3.235 3.235 0 0 1 1.75-.51h12.5c.644 0 1.245.188 1.75.51V6.75A1.75 1.75 0 0 0 16.25 5h-4.836a.25.25 0 0 1-.177-.073L9.823 3.513A1.75 1.75 0 0 0 8.586 3H3.75ZM3.75 9A1.75 1.75 0 0 0 2 10.75v4.5c0 .966.784 1.75 1.75 1.75h12.5A1.75 1.75 0 0 0 18 15.25v-4.5A1.75 1.75 0 0 0 16.25 9H3.75Z" /></svg>`)),text:s.name})}return(null===(i=this.data)||void 0===i?void 0:i.hide_transaction)&&n.push({key:"archived"}),(null===(r=this.data)||void 0===r?void 0:r.is_test)&&n.push({key:"test"}),n}get headerCopyIdValue(){var e,t,o;return null!==(o=null===(t=null===(e=this.data)||void 0===e?void 0:e.display_id)||void 0===t?void 0:t.toString())&&void 0!==o?o:""}renderHeaderActions(){var e;const t=null===(e=this.__storeLoader)||void 0===e?void 0:e.data,o=null==t?void 0:t._links["fx:transaction_folders"].href;return s(z||(z=J` <foxy-internal-transaction-actions-control currency-display="${0}" folders="${0}" infer="actions"> </foxy-internal-transaction-actions-control> `),(null==t?void 0:t.use_international_currency_symbol)?"code":"symbol",n(o))}renderBody(){var e,t,o,i,r,a,l,d,c,f,h,m,v,_,y,x,b;const g=this.hiddenSelector,w=(e,t,o)=>{if(e)try{const i=new URL(e);return i.searchParams.set(t,o),i.toString()}catch(e){return}},j=w(null===(e=this.data)||void 0===e?void 0:e._links["fx:shipments"].href,"zoom","items:item_category"),$=j&&u(j,this.currentUserScope),k=w(null===(o=null===(t=this.__storeLoader)||void 0===t?void 0:t.data)||void 0===o?void 0:o._links["fx:webhooks"].href,"event_resource","transaction"),S=w(null===(i=this.data)||void 0===i?void 0:i._links["fx:items"].href,"zoom","item_options"),A=(()=>{var e,t,o,i;if(this.data)try{const r=null===(e=this.data._links["fx:template_sets"])||void 0===e?void 0:e.href,n=null===(o=null===(t=this.__storeLoader)||void 0===t?void 0:t.data)||void 0===o?void 0:o._links["fx:template_sets"].href,s=new URL(null!==(i=null!=r?r:n)&&void 0!==i?i:"");return r||s.searchParams.set("code","DEFAULT"),s.searchParams.set("zoom","email_template"),s.toString()}catch(e){return}})();return s(N||(N=J` ${0} ${0} <foxy-internal-transaction-customer-control infer="customer"> </foxy-internal-transaction-customer-control> <div class="grid gap-s" ?hidden="${0}"> <foxy-internal-async-list-control infer="items" class="min-w-0" first="${0}" limit="10" item="foxy-item-card" form="foxy-item-form" alert wide .related="${0}" .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-transaction-summary-control infer="summary" class="min-w-0"> </foxy-internal-transaction-summary-control> </div> <foxy-internal-async-list-control infer="billing-addresses" first="${0}" item="foxy-billing-address-card" form="foxy-address-form" hide-create-button hide-delete-button alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="payments" first="${0}" item="foxy-payment-card" .itemProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="custom-fields" class="min-w-0" first="${0}" limit="5" form="foxy-custom-field-form" item="foxy-custom-field-card" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" limit="5" form="foxy-attribute-form" item="foxy-attribute-card" alert> </foxy-internal-async-list-control> ${0} <foxy-internal-async-list-control infer="shipments" first="${0}" item="foxy-shipment-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="webhooks" first="${0}" item="foxy-webhook-card" form="foxy-webhook-form" hide-create-button hide-delete-button alert .bulkActions="${0}" .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-summary-control infer="datafeed"> <foxy-internal-switch-control infer="data-is-fed"></foxy-internal-switch-control> <foxy-internal-post-action-control infer="process-webhook" theme="tertiary-inline" href="${0}" @success="${0}"> </foxy-internal-post-action-control> </foxy-internal-summary-control> <foxy-nucleon class="hidden" infer="" href="${0}" id="storeLoader" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="templateSetLoader" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),["problem","pending_fraud_review","rejected","declined"].includes(null!==(a=null===(r=this.data)||void 0===r?void 0:r.status)&&void 0!==a?a:"")?s(O||(O=J` <p class="leading-xs text-body rounded bg-error-10 block" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <foxy-i18n infer="header" key="alert_status_${0}"></foxy-i18n> </p> `),null===(l=this.data)||void 0===l?void 0:l.status):"",g.matches("items",!0)&&g.matches("summary",!0),n(S),[this.href],{"locale-codes":this.localeCodes},{"item-categories":null===(c=null===(d=this.__storeLoader)||void 0===d?void 0:d.data)||void 0===c?void 0:c._links["fx:item_categories"].href,"locale-codes":this.localeCodes,store:null===(f=this.data)||void 0===f?void 0:f._links["fx:store"].href},n(null===(h=this.data)||void 0===h?void 0:h._links["fx:billing_addresses"].href),n(null===(m=this.data)||void 0===m?void 0:m._links["fx:payments"].href),{"hosted-payment-gateways-helper":this.hostedPaymentGatewaysHelper,"payment-gateways-helper":this.paymentGatewaysHelper},n(null===(v=this.data)||void 0===v?void 0:v._links["fx:custom_fields"].href),n(null===(_=this.data)||void 0===_?void 0:_._links["fx:attributes"].href),this.data&&this.data.customer_ip&&this.data.user_agent?s(V||(V=J` <foxy-internal-summary-control infer="metadata"> <p class="flex justify-between gap-m"> <foxy-i18n infer="ip" key="label"></foxy-i18n> <span class="text-secondary"> ${0} (${0}) </span> </p> <p class="flex justify-between gap-m"> <foxy-i18n infer="user-agent" key="label"></foxy-i18n> <span class="text-secondary"> ${0} </span> </p> </foxy-internal-summary-control> `),this.data.customer_ip,this.data.ip_country,p.analyze(this.data.user_agent).toString()):"",n($),n(k),g.matches("webhooks:refeed",!0)?[]:this.__webhooksBulkActions,{"resource-uri":this.href},{"resource-uri":this.href},n(null===(x=null===(y=this.data)||void 0===y?void 0:y._links["fx:process_webhook"])||void 0===x?void 0:x.href),(()=>this.refresh()),n(null===(b=this.data)||void 0===b?void 0:b._links["fx:store"].href),(()=>this.requestUpdate()),n(A),(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector("#storeLoader")}get __isTemplateSetUnknownForScope(){var e,t;const o=f(this.currentUserScope);if(!o)return!1;if((null===(e=this.__templateSetLoader)||void 0===e?void 0:e.in("fail"))||!o.canRead("templates"))return!0;return!Boolean(null===(t=this.data)||void 0===t?void 0:t._links["fx:template_sets"])&&!o.canRead("stores")}get __templateSetLoader(){return this.renderRoot.querySelector("#templateSetLoader")}get __emailTemplateSubject(){var e,t,o,i,r,n;const s=null===(e=this.__templateSetLoader)||void 0===e?void 0:e.data,a=null!==(i=null===(o=null===(t=null==s?void 0:s._embedded)||void 0===t?void 0:t["fx:template_sets"])||void 0===o?void 0:o[0])&&void 0!==i?i:s;return null===(n=null===(r=null==a?void 0:a._embedded)||void 0===r?void 0:r["fx:email_template"])||void 0===n?void 0:n.subject}}customElements.define("foxy-transaction",Q);export{Q as Transaction};
1
+ import"./foxy-billing-address-card.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-custom-field-form.js";import"./foxy-custom-field-card.js";import"./foxy-copy-to-clipboard.js";import"./foxy-nucleon-element.js";import"./foxy-shipment-card.js";import"./foxy-payment-card.js";import"./foxy-webhook-card.js";import"./foxy-webhook-form.js";import"./foxy-address-form.js";import"./foxy-item-card.js";import"./foxy-item-form.js";import"./shared-c066b7fd.js";import"./shared-88f841ff.js";import"./shared-3a61d8a6.js";import"./shared-8be109a9.js";import"./shared-7b15217c.js";import{I as e}from"./shared-9b290320.js";import{a as t}from"./shared-4ab85bea.js";import"./foxy-customer-card.js";import"./foxy-swipe-actions.js";import"./foxy-spinner.js";import{_ as o,B as i}from"./shared-8f9014ff.js";import{g as r}from"./shared-bab2ea2c.js";import{i as n}from"./shared-53e42a77.js";import{h as s,s as a}from"./shared-ba5c42c7.js";import{c as l}from"./shared-4e709717.js";import"./shared-a8ae24f0.js";import{R as d,a as c}from"./shared-5b8c7250.js";import{f as u,p as f}from"./shared-87e17c02.js";import{u as p}from"./shared-91c18cdd.js";import"./shared-0996f4d0.js";import"./shared-56278a3c.js";import"./shared-c85c1864.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-930e68b7.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-cf1965cb.js";import"./shared-c59277a4.js";import"./shared-c3d6bcc0.js";import"./shared-f410644a.js";import"./shared-5212ef4f.js";import"./shared-222b23bb.js";import"./shared-af4f71bf.js";import"./shared-dc6e5879.js";import"./shared-f77994ad.js";import"./shared-c56c3e1e.js";import"./shared-4ed4b075.js";import"./shared-5fd5805c.js";import"./shared-cda51ccf.js";import"./shared-41f93e6c.js";import"./shared-affe06c0.js";import"./shared-cfc6735e.js";import"./shared-e9f9face.js";import"./shared-91483320.js";import"./shared-2fbff8e7.js";import"./shared-18707481.js";import"./shared-c84333db.js";import"./shared-cf613436.js";import"./shared-32a39c0b.js";import"./shared-5dbd66e3.js";import"./shared-28cc8aa1.js";import"./shared-53a5212e.js";import"./shared-e9f51baa.js";import"./shared-a95a66b8.js";import"./shared-d8b880bb.js";import"./shared-6262e0d6.js";import"./shared-2fbfbe12.js";import"./shared-091e97f3.js";import"./shared-d0aed1c1.js";import"./foxy-webhook-status-card.js";import"./foxy-webhook-log-card.js";import"./shared-1b414966.js";import"./shared-eb349085.js";import"./foxy-form-dialog.js";import"./shared-53e476fd.js";import"./shared-f9c8881a.js";import"./shared-56741bad.js";import"./shared-34262bb8.js";import"./shared-7e28c953.js";import"./shared-ac536c67.js";import"./shared-3fd75ee6.js";import"./shared-48910b3f.js";import"./shared-2061be9a.js";import"./shared-e650caf3.js";import"./shared-af6ccc54.js";import"./foxy-discount-detail-card.js";import"./shared-345b07f1.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./shared-63c32024.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-collection-page.js";import"./foxy-pagination.js";let h,m,v,_,y=e=>e;customElements.define("foxy-internal-transaction-customer-control",class extends t{constructor(){super(...arguments),this.__copyEmailState="idle",this.__copyIdState="idle"}static get properties(){return o(o({},super.properties),{},{__copyEmailState:{attribute:!1},__copyIdState:{attribute:!1}})}renderControl(){var e,t,o,i;const d=this.nucleon,c=null===(e=null==d?void 0:d.data)||void 0===e?void 0:e._links["fx:customer"].href,u=c?null===(t=null==d?void 0:d.getCustomerPageHref)||void 0===t?void 0:t.call(d,c):void 0;return s(h||(h=y` <foxy-i18n infer="" class="block text-l font-medium leading-xs mb-s" key="label"> </foxy-i18n> <foxy-swipe-actions> <a class="${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" href="${0}"> <foxy-customer-card infer="" href="${0}"></foxy-customer-card> </a> <div class="h-full grid grid-cols-2 gap-s ml-s" slot="action"> ${0} ${0} </div> </foxy-swipe-actions> `),l({"block ring-inset rounded transition-colors bg-contrast-5":!0,"cursor-pointer hover-bg-contrast-10":!!u,"focus-outline-none focus-ring-2 focus-ring-primary-50":!!u}),n(u),n(c),this.__renderCopyAction(a(m||(m=y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.2rem; height: 1.2rem"><path fill-rule="evenodd" d="M9.493 2.852a.75.75 0 0 0-1.486-.204L7.545 6H4.198a.75.75 0 0 0 0 1.5h3.14l-.69 5H3.302a.75.75 0 0 0 0 1.5h3.14l-.435 3.148a.75.75 0 0 0 1.486.204L7.955 14h2.986l-.434 3.148a.75.75 0 0 0 1.486.204L12.456 14h3.346a.75.75 0 0 0 0-1.5h-3.14l.69-5h3.346a.75.75 0 0 0 0-1.5h-3.14l.435-3.148a.75.75 0 0 0-1.486-.204L12.045 6H9.059l.434-3.148ZM8.852 7.5l-.69 5h2.986l.69-5H8.852Z" clip-rule="evenodd" /></svg>`)),"copy_id_caption","__copyIdState",c?String(r(c)):""),this.__renderCopyAction(a(v||(v=y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.2rem; height: 1.2rem"><path fill-rule="evenodd" d="M5.404 14.596A6.5 6.5 0 1 1 16.5 10a1.25 1.25 0 0 1-2.5 0 4 4 0 1 0-.571 2.06A2.75 2.75 0 0 0 18 10a8 8 0 1 0-2.343 5.657.75.75 0 0 0-1.06-1.06 6.5 6.5 0 0 1-9.193 0ZM10 7.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5Z" clip-rule="evenodd" /></svg>`)),"copy_email_caption","__copyEmailState",null!==(i=null===(o=null==d?void 0:d.data)||void 0===o?void 0:o.customer_email)&&void 0!==i?i:""))}__renderCopyAction(e,t,o,i){const r=this[o],n="fail"===r?"error":"done"===r?"end":"busy";return s(_||(_=y` <button class="relative transition-colors bg-contrast-5 text-body hover-bg-contrast-10 rounded h-full py-0 px-m focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50" ?disabled="${0}" @click="${0}" @focusout="${0}" @mouseout="${0}"> <div class="${0}"> ${0} <foxy-i18n class="mt-xs text-s font-medium leading-none" infer="" key="${0}"> </foxy-i18n> </div> <div class="${0}"> <foxy-spinner layout="no-label" state="${0}" infer="spinner"> </foxy-spinner> </div> </button> `),"idle"!==r,(()=>"idle"===r&&this.__copy(i,o)),(e=>"idle"!==r&&e.stopPropagation()),(e=>"idle"!==r&&e.stopPropagation()),l({"relative flex flex-col items-center justify-center transition-opacity":!0,"opacity-0":"idle"!==r}),e,t,l({"absolute inset-0 flex items-center justify-center transition-opacity":!0,"opacity-0":"idle"===r}),n)}async __copy(e,t){this[t]="busy";try{await navigator.clipboard.writeText(e),this[t]="done"}catch(e){this[t]="fail"}setTimeout((()=>this[t]="idle"),3e3)}});let x,b,g,w,j,$,k,S,A,P,L,H=e=>e;customElements.define("foxy-internal-transaction-actions-control",class extends t{constructor(){super(...arguments),this.currencyDisplay=null,this.folders=null}static get properties(){return o(o({},super.properties),{},{currencyDisplay:{attribute:"currency-display"},folders:{}})}renderControl(){var e,t,o,i,r,n,a,l,d,c,u,f;return s(x||(x=H` <div class="flex flex-wrap gap-x-m gap-y-xs"> ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} </div> `),(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:capture"])?this.__renderCaptureAction():"",(null===(i=null===(o=this.nucleon)||void 0===o?void 0:o.data)||void 0===i?void 0:i._links["fx:void"])?this.__renderVoidAction():"",(null===(n=null===(r=this.nucleon)||void 0===r?void 0:r.data)||void 0===n?void 0:n._links["fx:refund"])?this.__renderRefundAction():"",(null===(l=null===(a=this.nucleon)||void 0===a?void 0:a.data)||void 0===l?void 0:l._links["fx:send_emails"])?this.__renderSendEmailsAction():"",(null===(c=null===(d=this.nucleon)||void 0===d?void 0:d.data)||void 0===c?void 0:c._links["fx:subscription"])&&!this.hiddenSelector.matches("subscription",!0)?this.__renderSubscriptionAction():"",(null===(f=null===(u=this.nucleon)||void 0===u?void 0:u.data)||void 0===f?void 0:f._links["fx:receipt"])?this.__renderReceiptAction():"",this.hiddenSelector.matches("archive",!0)?"":this.__renderArchiveAction(),this.folders&&!this.hiddenSelector.matches("folder",!0)?this.__renderFolderSelector(this.folders):"")}get __refundAmount(){var e,t,o,i;const r=null===(e=this.nucleon)||void 0===e?void 0:e.data,n=null!==(t=null==r?void 0:r.total_order)&&void 0!==t?t:0;return parseFloat(null!==(i=null===(o=null==r?void 0:r._links["fx:refund"])||void 0===o?void 0:o.amount)&&void 0!==i?i:n)}__renderSendEmailsAction(){var e,t;return s(b||(b=H` <foxy-internal-post-action-control infer="send-emails" theme="tertiary-inline" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),n(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:send_emails"].href),(()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.refresh()}))}__renderCaptureAction(){var e,t;return s(g||(g=H` <foxy-internal-post-action-control theme="tertiary-inline success" infer="capture" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),n(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:capture"].href),(()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.refresh()}))}__renderVoidAction(){var e,t,o;return s(w||(w=H` <foxy-internal-post-action-control theme="tertiary-inline error" infer="void" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),n(null===(o=null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:void"])||void 0===o?void 0:o.href),(()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.refresh()}))}__renderRefundAction(){var e,t,o,i,r;const a=null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t.currency_code;return s(j||(j=H` <foxy-internal-post-action-control message-options="${0}" infer="refund" theme="tertiary-inline" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),JSON.stringify({currencyDisplay:this.currencyDisplay,amount:`${this.__refundAmount} ${a}`}),n(null===(r=null===(i=null===(o=this.nucleon)||void 0===o?void 0:o.data)||void 0===i?void 0:i._links["fx:refund"])||void 0===r?void 0:r.href),(()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.refresh()}))}__renderSubscriptionAction(){var e,t,o;const i=this.nucleon,r=null===(t=null===(e=null==i?void 0:i.data)||void 0===e?void 0:e._links["fx:subscription"])||void 0===t?void 0:t.href,a=r?null===(o=null==i?void 0:i.getSubscriptionPageHref)||void 0===o?void 0:o.call(i,r):void 0;return s($||($=H` <a class="rounded text-m font-medium text-primary cursor-pointer transition-opacity hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="subscription" key="caption"></foxy-i18n> </a> `),n(a))}__renderReceiptAction(){var e,t;const o=this.nucleon;return s(k||(k=H` <a target="_blank" class="rounded text-m font-medium text-primary cursor-pointer transition-opacity hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="receipt" key="caption"></foxy-i18n> </a> `),n(null===(t=null===(e=null==o?void 0:o.data)||void 0===e?void 0:e._links["fx:receipt"])||void 0===t?void 0:t.href))}__renderArchiveAction(){const e=this.nucleon;return s(S||(S=H` <vaadin-button theme="tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="archive" key="caption_${0}"> </foxy-i18n> </vaadin-button> `),this.disabledSelector.matches("archive",!0),(()=>{null==e||e.edit({hide_transaction:!(null==e?void 0:e.form.hide_transaction)}),null==e||e.submit()}),(null==e?void 0:e.form.hide_transaction)?"unarchive":"archive")}__renderFolderSelector(e){var t,o,i;const r=this.renderRoot.querySelector("#foldersLoader"),n=Array.from(null!==(i=null===(o=null===(t=null==r?void 0:r.data)||void 0===t?void 0:t._embedded)||void 0===o?void 0:o["fx:transaction_folders"])&&void 0!==i?i:[]),l=this.nucleon;return s(A||(A=H` <foxy-nucleon class="hidden" infer="" href="${0}" id="foldersLoader" @update="${0}"> </foxy-nucleon> <label class="group relative rounded focus-within-ring-2 focus-within-ring-primary-50" ?hidden="${0}"> <span class="inline-flex items-center gap-xs relative transition-opacity group-hover-opacity-80"> <foxy-i18n class="font-medium text-primary" infer="folder" key="caption"></foxy-i18n> ${0} </span> <select class="absolute inset-0 opacity-0 cursor-pointer" ?disabled="${0}" ?readonly="${0}" @change="${0}"> <option value="" ?selected="${0}" ?disabled="${0}"> ${0} </option> ${0} </select> </label> `),e,(()=>this.requestUpdate()),0===n.length,a(P||(P=H`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="text-primary transform scale-125" style="width: 1em; height: 1em"><path fill-rule="evenodd" d="M10.53 3.47a.75.75 0 0 0-1.06 0L6.22 6.72a.75.75 0 0 0 1.06 1.06L10 5.06l2.72 2.72a.75.75 0 1 0 1.06-1.06l-3.25-3.25Zm-4.31 9.81 3.25 3.25a.75.75 0 0 0 1.06 0l3.25-3.25a.75.75 0 1 0-1.06-1.06L10 14.94l-2.72-2.72a.75.75 0 0 0-1.06 1.06Z" clip-rule="evenodd" /></svg>`)),this.disabled,this.readonly,(e=>{null==l||l.edit({folder_uri:e.currentTarget.value}),null==l||l.submit(!1)}),!(null==l?void 0:l.form.folder_uri),!(null==l?void 0:l.form.folder_uri),this.t("folder.option_none"),n.sort(((e,t)=>e.sort_order-t.sort_order)).map((e=>{const t=e._links.self.href,o=(null==l?void 0:l.form.folder_uri)===t;return s(L||(L=H` <option value="${0}" ?selected="${0}" ?disabled="${0}"> ${0} </option> `),t,o,o,e.name)})))}});let C,R,B,E,I,U,q,T,Z,D,F,M,W=e=>e;customElements.define("foxy-internal-transaction-summary-control",class extends t{constructor(){super(...arguments),this.__storeLoaderId="storeLoader"}renderControl(){var e,t,o,i,r,a,l,d,c;const u=null===(e=this.nucleon)||void 0===e?void 0:e.data;if(!u)return s(C||(C=W``));const f=null!==(o=null===(t=null==u?void 0:u._embedded)||void 0===t?void 0:t["fx:applied_taxes"])&&void 0!==o?o:[],p=null!==(r=null===(i=u._embedded)||void 0===i?void 0:i["fx:shipments"])&&void 0!==r?r:[],h=this.__refundableAmount;return s(R||(R=W` <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <p class="grid gap-x-s text-right text-s leading-m border-dashed border rounded border-contrast-20 whitespace-nowrap overflow-auto" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 2px);grid-template-columns:1fr min-content"> <span><foxy-i18n key="subtotal" infer=""></foxy-i18n>&colon;</span> <span>${0}</span> ${0} ${0} ${0} ${0} <span class="col-span-2 border-t border-dashed border-contrast-20 my-s"></span> <span class="col-span-2 flex gap-s justify-between items-center"> ${0} <span class="text-xl font-medium leading-xs"> <foxy-i18n infer="" key="total"></foxy-i18n>&colon; ${0} </span> </span> ${0} </p> `),n(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.__renderPrice(u.total_item_price),0===p.length||0===u.total_shipping?s(B||(B=W` <span><foxy-i18n infer="" key="total_shipping"></foxy-i18n>&colon;</span> <span>${0} </span> `),this.__renderPrice(u.total_shipping,!0)):p.map((e=>s(E||(E=W` <span>${0}&colon;</span> <span>${0}</span> `),e.shipping_service_description,this.__renderPrice(e.total_shipping,!0)))),0===f.length||0===u.total_tax?s(I||(I=W` <span><foxy-i18n infer="" key="total_tax"></foxy-i18n>&colon;</span> <span>${0}</span> `),this.__renderPrice(u.total_tax,!0)):f.map((e=>s(U||(U=W` <span>${0}&colon;</span> <span>${0}</span> `),e.name,this.__renderPrice(e.amount,!0)))),null===(l=null===(a=null==u?void 0:u._embedded)||void 0===a?void 0:a["fx:gift_card_code_logs"])||void 0===l?void 0:l.map((e=>{var t,o,i,r,n;const a=null===(o=null===(t=e._embedded)||void 0===t?void 0:t["fx:gift_card"])||void 0===o?void 0:o.name,l=null===(r=null===(i=e._embedded)||void 0===i?void 0:i["fx:gift_card_code"])||void 0===r?void 0:r.code;if(a&&l)return s(q||(q=W` <span data-testclass="gift-card-code">${0} &bull; ${0}&colon;</span> <span>${0}</span> `),a,l,this.__renderPrice(null!==(n=e.balance_adjustment)&&void 0!==n?n:0,!0))})),null===(c=null===(d=null==u?void 0:u._embedded)||void 0===d?void 0:d["fx:discounts"])||void 0===c?void 0:c.map((({name:e,code:t,amount:o})=>s(T||(T=W` <span data-testclass="discount">${0}${0}&colon;</span> <span>${0}</span> `),e,t?s(Z||(Z=W` &bull; ${0}`),t):"",this.__renderPrice(o,!0)))),this.__renderStatus(),this.__renderPrice(u.total_order),h!==u.total_order?s(D||(D=W` <span class="col-span-2 border-t border-dashed border-contrast-20 my-s"></span> <span class="col-span-2 flex justify-end"> <span> <span class="text-xl font-medium leading-xs"> <foxy-i18n infer="" key="refundable_amount"></foxy-i18n>&colon; ${0} </span> <br> <foxy-i18n class="inline-block whitespace-normal leading-s text-tertiary" style="max-width:48ch" infer="" key="refundable_amount_note"> </foxy-i18n> </span> </span> `),this.__renderPrice(h)):"")}get __refundableAmount(){var e,t,o,i;const r=null===(e=this.nucleon)||void 0===e?void 0:e.data,n=null!==(t=null==r?void 0:r.total_order)&&void 0!==t?t:0;return parseFloat(null!==(i=null===(o=null==r?void 0:r._links["fx:refund"])||void 0===o?void 0:o.amount)&&void 0!==i?i:n)}get __storeHref(){var e,t,o;return null===(o=null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:store"])||void 0===o?void 0:o.href}get __store(){var e,t;const o=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(o))||void 0===e?void 0:e.data)&&void 0!==t?t:null}__renderPrice(e,t=!1){var o,i,r;const n=(null===(o=this.__store)||void 0===o?void 0:o.use_international_currency_symbol)?"code":"symbol",a=null===(r=null===(i=this.nucleon)||void 0===i?void 0:i.data)||void 0===r?void 0:r.currency_code;return s(F||(F=W` <foxy-i18n class="${0}" infer="" key="price" .options="${0}"> </foxy-i18n> `),t&&0!==e?e>0?"text-success":"text-error":"",{currencyDisplay:n,signDisplay:t?"exceptZero":"auto",amount:`${e} ${a}`})}__renderStatus(){var e,t;const o=(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t.status)||"completed";let i="";return i=["capturing","captured","approved","authorized","pending"].includes(o)?"text-success bg-success-10":o&&"completed"!==o?["problem","pending_fraud_review","rejected","declined"].includes(o)?"text-error-contrast bg-error":"bg-contrast-5 text-body":"text-success-contrast bg-success",s(M||(M=W` <foxy-i18n infer="" class="${0} rounded-s py-xs px-s font-medium text-s leading-xs" key="status_${0}"></foxy-i18n> `),i,o)}});let G,z,N,O,V,J=e=>e;const K=d(c(e,"transaction"));class Q extends K{constructor(){var e;super(...arguments),e=this,this.hostedPaymentGatewaysHelper=null,this.paymentGatewaysHelper=null,this.localeCodes=null,this.getSubscriptionPageHref=null,this.getCustomerPageHref=null,this.__webhooksBulkActions=[{name:"refeed",onClick:async function(t){if(!e.data)return;const o=e.data._links["fx:send_webhooks"].href,i=new Q.API(e),n=await i.fetch(o,{method:"POST",body:JSON.stringify({refeed_hooks:t.map((e=>r(e._links.self.href))),event:"refeed"})});if(t.forEach((e=>{Q.Rumour("").share({related:[...t.map((e=>e._links["fx:logs"].href)),...t.map((e=>e._links["fx:statuses"].href))],source:e._links.self.href,data:e})})),!n.ok)throw new Error(await n.text())}}]}static get properties(){return o(o({},super.properties),{},{hostedPaymentGatewaysHelper:{attribute:"hosted-payment-gateways-helper"},paymentGatewaysHelper:{attribute:"payment-gateways-helper"},getSubscriptionPageHref:{attribute:!1},getCustomerPageHref:{attribute:!1},localeCodes:{attribute:"locale-codes"}})}get scopeRules(){return[{path:"customer",collection:"customers"},{path:"items",collection:"transactions",readonlyIfNoWrite:!0},{path:"custom-fields",collection:"transactions",readonlyIfNoWrite:!0},{path:"attributes",collection:"transactions",readonlyIfNoWrite:!0},{path:"actions:capture",collection:"transactions",need:"write"},{path:"actions:void",collection:"transactions",need:"write"},{path:"actions:refund",collection:"transactions",need:"write"},{path:"actions:archive",collection:"transactions",need:"write"},{path:"actions:folder",collection:"transactions",need:"write"},{path:"actions:send-emails",collection:"transactions",need:"resend"},{path:"actions:subscription",collection:"subscriptions"},{path:"webhooks",collection:"stores"},{path:"actions:folder",collection:"stores"},{path:"webhooks",collection:"webhooks"},{path:"webhooks:refeed",collection:"webhooks",need:"resend"},{path:"datafeed:process-webhook",collection:"webhooks",need:"resend"}]}get readonlySelector(){var e,t,o;const r=["billing-addresses","datafeed:data-is-fed","webhooks:dialog:url",super.readonlySelector];return Boolean(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:void"])&&void 0!==t?t:null===(o=this.data)||void 0===o?void 0:o._links["fx:refund"])||r.push("items","attributes","custom-fields"),new i(r.join(" ").trim())}get hiddenSelector(){var e,t,o,r;const n=["billing-addresses:dialog:delete","billing-addresses:dialog:timestamps","webhooks:dialog:header:copy-json","webhooks:dialog:header:copy-id","webhooks:dialog:timestamps","webhooks:dialog:name","webhooks:dialog:query","webhooks:dialog:encryption-key","webhooks:dialog:delete",super.hiddenSelector],s=null===(e=this.data)||void 0===e?void 0:e.type;return(null===(t=this.data)||void 0===t?void 0:t._links["fx:subscription"])||n.unshift("subscription"),"subscription_modification"===s&&n.unshift("actions"),"updateinfo"===s&&n.unshift("not=customer,subscription,payments,custom-fields,attributes"),"subscription_cancellation"===s&&n.unshift("not=customer,subscription,custom-fields,attributes"),(null===(r=null===(o=this.__storeLoader)||void 0===o?void 0:o.data)||void 0===r?void 0:r.use_webhook)||n.unshift("datafeed"),this.__emailTemplateSubject||this.__isTemplateSetUnknownForScope||n.unshift("actions:send-emails"),new i(n.join(" ").trim())}get headerSubtitleOptions(){var e,t,o,i,r;const n=null===(e=this.data)||void 0===e?void 0:e.source,s=null===(t=this.data)||void 0===t?void 0:t.type;let a="";return"updateinfo"===s?a=!n||(null==n?void 0:n.startsWith("cit_"))?"customer_changed_payment_method":"mit_uoe"===n?"admin_changed_payment_method_with_uoe":"mit_api"===n?"integration_changed_payment_method":"admin_changed_payment_method":"subscription_modification"===s?a=!n||(null==n?void 0:n.startsWith("cit_"))?"customer_changed_subscription":"mit_uoe"===n?"admin_changed_subscription_with_uoe":"mit_api"===n?"integration_changed_subscription":"admin_changed_subscription":"subscription_renewal"===s?"mit_recurring"===n?a="subscription_renewal_attempt":"mit_recurring_reattempt_automated"===n?a="subscription_renewal_automated_reattempt":"mit_recurring_reattempt_manual"===n&&(a="subscription_renewal_manual_reattempt"):"subscription_cancellation"===s?"cit_recurring_cancellation"===n?a="customer_canceled_subscription":"mit_recurring_cancellation"===n&&(a="admin_canceled_subscription"):(null===(o=this.data)||void 0===o?void 0:o._links["fx:subscription"])?(null==n?void 0:n.startsWith("cit_"))?a="customer_subscribed":"mit_uoe"===n?a="admin_subscribed_with_uoe":"mit_api"===n&&(a="integration_subscribed"):(null==n?void 0:n.startsWith("cit_"))?a="customer_placed_order":"mit_uoe"===n?a="admin_placed_order_with_uoe":"mit_api"===n&&(a="integration_placed_order"),{transaction_date:null===(i=this.data)||void 0===i?void 0:i.transaction_date,ip_country:null===(r=this.data)||void 0===r?void 0:r.ip_country,context:a}}get headerSubtitleBadges(){var e,t,o,i,r;const n=super.headerSubtitleBadges,s=null===(t=null===(e=this.data)||void 0===e?void 0:e._embedded)||void 0===t?void 0:t["fx:folder"];if(null==s?void 0:s.name){const e=null!==(o=s.color)&&void 0!==o?o:"",t={red:"bg-folder-red text-white",red_pale:"bg-folder-red-pale text-black",green:"bg-folder-green text-white",green_pale:"bg-folder-green-pale text-black",blue:"bg-folder-blue text-white",blue_pale:"bg-folder-blue-pale text-black",orange:"bg-folder-orange text-white",orange_pale:"bg-folder-orange-pale text-black",violet:"bg-folder-violet text-white",violet_pale:"bg-folder-violet-pale text-black","":"bg-contrast-5 text-body"};n.push({class:t[e in t?e:""],icon:a(G||(G=J`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1em; height: 1em;"><path d="M3.75 3A1.75 1.75 0 0 0 2 4.75v3.26a3.235 3.235 0 0 1 1.75-.51h12.5c.644 0 1.245.188 1.75.51V6.75A1.75 1.75 0 0 0 16.25 5h-4.836a.25.25 0 0 1-.177-.073L9.823 3.513A1.75 1.75 0 0 0 8.586 3H3.75ZM3.75 9A1.75 1.75 0 0 0 2 10.75v4.5c0 .966.784 1.75 1.75 1.75h12.5A1.75 1.75 0 0 0 18 15.25v-4.5A1.75 1.75 0 0 0 16.25 9H3.75Z" /></svg>`)),text:s.name})}return(null===(i=this.data)||void 0===i?void 0:i.hide_transaction)&&n.push({key:"archived"}),(null===(r=this.data)||void 0===r?void 0:r.is_test)&&n.push({key:"test"}),n}get headerCopyIdValue(){var e,t,o;return null!==(o=null===(t=null===(e=this.data)||void 0===e?void 0:e.display_id)||void 0===t?void 0:t.toString())&&void 0!==o?o:""}renderHeaderActions(){var e;const t=null===(e=this.__storeLoader)||void 0===e?void 0:e.data,o=null==t?void 0:t._links["fx:transaction_folders"].href;return s(z||(z=J` <foxy-internal-transaction-actions-control currency-display="${0}" folders="${0}" infer="actions"> </foxy-internal-transaction-actions-control> `),(null==t?void 0:t.use_international_currency_symbol)?"code":"symbol",n(o))}renderBody(){var e,t,o,i,r,a,l,d,c,f,h,m,v,_,y,x,b;const g=this.hiddenSelector,w=(e,t,o)=>{if(e)try{const i=new URL(e);return i.searchParams.set(t,o),i.toString()}catch(e){return}},j=w(null===(e=this.data)||void 0===e?void 0:e._links["fx:shipments"].href,"zoom","items:item_category"),$=j&&u(j,this.currentUserScope),k=w(null===(o=null===(t=this.__storeLoader)||void 0===t?void 0:t.data)||void 0===o?void 0:o._links["fx:webhooks"].href,"event_resource","transaction"),S=w(null===(i=this.data)||void 0===i?void 0:i._links["fx:items"].href,"zoom","item_options"),A=(()=>{var e,t,o,i;if(this.data)try{const r=null===(e=this.data._links["fx:template_sets"])||void 0===e?void 0:e.href,n=null===(o=null===(t=this.__storeLoader)||void 0===t?void 0:t.data)||void 0===o?void 0:o._links["fx:template_sets"].href,s=new URL(null!==(i=null!=r?r:n)&&void 0!==i?i:"");return r||s.searchParams.set("code","DEFAULT"),s.searchParams.set("zoom","email_template"),s.toString()}catch(e){return}})();return s(N||(N=J` ${0} ${0} <foxy-internal-transaction-customer-control infer="customer"> </foxy-internal-transaction-customer-control> <div class="grid gap-s" ?hidden="${0}"> <foxy-internal-async-list-control infer="items" class="min-w-0" first="${0}" limit="10" item="foxy-item-card" form="foxy-item-form" alert wide .related="${0}" .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-transaction-summary-control infer="summary" class="min-w-0"> </foxy-internal-transaction-summary-control> </div> <foxy-internal-async-list-control infer="billing-addresses" first="${0}" item="foxy-billing-address-card" form="foxy-address-form" hide-create-button hide-delete-button alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="payments" first="${0}" item="foxy-payment-card" .itemProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="custom-fields" class="min-w-0" first="${0}" limit="5" form="foxy-custom-field-form" item="foxy-custom-field-card" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" limit="5" form="foxy-attribute-form" item="foxy-attribute-card" alert> </foxy-internal-async-list-control> ${0} <foxy-internal-async-list-control infer="shipments" first="${0}" item="foxy-shipment-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="webhooks" first="${0}" item="foxy-webhook-card" form="foxy-webhook-form" hide-create-button hide-delete-button alert .bulkActions="${0}" .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-summary-control infer="datafeed"> <foxy-internal-switch-control infer="data-is-fed"></foxy-internal-switch-control> <foxy-internal-post-action-control infer="process-webhook" theme="tertiary-inline" href="${0}" @success="${0}"> </foxy-internal-post-action-control> </foxy-internal-summary-control> <foxy-nucleon class="hidden" infer="" href="${0}" id="storeLoader" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="templateSetLoader" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),["problem","pending_fraud_review","rejected","declined"].includes(null!==(a=null===(r=this.data)||void 0===r?void 0:r.status)&&void 0!==a?a:"")?s(O||(O=J` <p class="leading-xs text-body rounded bg-error-10 block" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <foxy-i18n infer="header" key="alert_status_${0}"></foxy-i18n> </p> `),null===(l=this.data)||void 0===l?void 0:l.status):"",g.matches("items",!0)&&g.matches("summary",!0),n(S),[this.href],{"locale-codes":this.localeCodes},{"item-categories":null===(c=null===(d=this.__storeLoader)||void 0===d?void 0:d.data)||void 0===c?void 0:c._links["fx:item_categories"].href,"locale-codes":this.localeCodes,store:null===(f=this.data)||void 0===f?void 0:f._links["fx:store"].href},n(null===(h=this.data)||void 0===h?void 0:h._links["fx:billing_addresses"].href),n(null===(m=this.data)||void 0===m?void 0:m._links["fx:payments"].href),{"hosted-payment-gateways-helper":this.hostedPaymentGatewaysHelper,"payment-gateways-helper":this.paymentGatewaysHelper},n(null===(v=this.data)||void 0===v?void 0:v._links["fx:custom_fields"].href),n(null===(_=this.data)||void 0===_?void 0:_._links["fx:attributes"].href),this.data&&this.data.customer_ip&&this.data.user_agent?s(V||(V=J` <foxy-internal-summary-control infer="metadata"> <p class="flex justify-between gap-m"> <foxy-i18n infer="ip" key="label"></foxy-i18n> <span class="text-secondary"> ${0} (${0}) </span> </p> <p class="flex justify-between gap-m"> <foxy-i18n infer="user-agent" key="label"></foxy-i18n> <span class="text-secondary"> ${0} </span> </p> </foxy-internal-summary-control> `),this.data.customer_ip,this.data.ip_country,p.analyze(this.data.user_agent).toString()):"",n($),n(k),g.matches("webhooks:refeed",!0)?[]:this.__webhooksBulkActions,{"resource-uri":this.href},{"resource-uri":this.href},n(null===(x=null===(y=this.data)||void 0===y?void 0:y._links["fx:process_webhook"])||void 0===x?void 0:x.href),(()=>this.refresh()),n(null===(b=this.data)||void 0===b?void 0:b._links["fx:store"].href),(()=>this.requestUpdate()),n(A),(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector("#storeLoader")}get __isTemplateSetUnknownForScope(){var e,t;const o=f(this.currentUserScope);if(!o)return!1;if((null===(e=this.__templateSetLoader)||void 0===e?void 0:e.in("fail"))||!o.canRead("templates"))return!0;return!Boolean(null===(t=this.data)||void 0===t?void 0:t._links["fx:template_sets"])&&!o.canRead("stores")}get __templateSetLoader(){return this.renderRoot.querySelector("#templateSetLoader")}get __emailTemplateSubject(){var e,t,o,i,r,n;const s=null===(e=this.__templateSetLoader)||void 0===e?void 0:e.data,a=null!==(i=null===(o=null===(t=null==s?void 0:s._embedded)||void 0===t?void 0:t["fx:template_sets"])||void 0===o?void 0:o[0])&&void 0!==i?i:s;return null===(n=null===(r=null==a?void 0:a._embedded)||void 0===r?void 0:r["fx:email_template"])||void 0===n?void 0:n.subject}}customElements.define("foxy-transaction",Q);export{Q as Transaction};
@@ -1,4 +1,4 @@
1
- import"./shared-cf1965cb.js";import"./shared-c59277a4.js";import"./foxy-spinner.js";import"./shared-c066b7fd.js";import{T as t}from"./shared-1e9df11c.js";import{a as s}from"./shared-5b8c7250.js";import"./shared-f410644a.js";import"./shared-c3d6bcc0.js";import"./shared-8f9014ff.js";import"./shared-ba5c42c7.js";import"./shared-930e68b7.js";import"./shared-336e73ce.js";import"./shared-53e42a77.js";import"./shared-da3393a5.js";import"./foxy-nucleon-element.js";import"./shared-50ef1d5a.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-4e709717.js";let e,a,n,o,r,i,l=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]}get scopeCollection(){return"transactions"}}c.priceColumn={cell:t=>t.html(e||(e=l`
1
+ import"./shared-cf1965cb.js";import"./shared-c59277a4.js";import"./foxy-spinner.js";import"./shared-c066b7fd.js";import{T as t}from"./shared-3ef23488.js";import{a as s}from"./shared-5b8c7250.js";import"./shared-f410644a.js";import"./shared-c3d6bcc0.js";import"./shared-8f9014ff.js";import"./shared-ba5c42c7.js";import"./shared-930e68b7.js";import"./shared-222b23bb.js";import"./shared-53e42a77.js";import"./shared-87e17c02.js";import"./foxy-nucleon-element.js";import"./shared-c85c1864.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-4e709717.js";let e,a,n,o,r,i,l=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]}get scopeCollection(){return"transactions"}}c.priceColumn={cell:t=>t.html(e||(e=l`
2
2
  <foxy-i18n
3
3
  data-testclass="i18n totals"
4
4
  class="text-m font-medium font-tnum"
@@ -1 +1 @@
1
- import"./shared-3baa9cc9.js";import{I as e}from"./shared-be20875c.js";import"./foxy-template-set-card.js";import"./foxy-nucleon-element.js";import"./foxy-spinner.js";import{a as t}from"./shared-45649d84.js";import"./foxy-payment-card-embed.js";import"./shared-c066b7fd.js";import"./shared-a8ae24f0.js";import{_ as r,B as s}from"./shared-8f9014ff.js";import{i as o}from"./shared-53e42a77.js";import{h as a}from"./shared-ba5c42c7.js";import{g as i}from"./shared-bab2ea2c.js";import{a as d}from"./shared-5b8c7250.js";import"./shared-bc74cd11.js";import"./shared-dc6e5879.js";import"./shared-f410644a.js";import"./shared-c3d6bcc0.js";import"./shared-f77994ad.js";import"./shared-91483320.js";import"./shared-d8b880bb.js";import"./shared-6262e0d6.js";import"./shared-28cc8aa1.js";import"./shared-2fbfbe12.js";import"./shared-e9f51baa.js";import"./shared-53a5212e.js";import"./shared-c56c3e1e.js";import"./shared-3eca56ee.js";import"./foxy-collection-page.js";import"./shared-336e73ce.js";import"./shared-da3393a5.js";import"./shared-50ef1d5a.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-930e68b7.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./shared-c59277a4.js";import"./shared-cf1965cb.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-760a2243.js";import"./shared-cb5305b9.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-1a814f90.js";import"./shared-56741bad.js";import"./shared-b84996e5.js";import"./shared-5212ef4f.js";import"./foxy-copy-to-clipboard.js";import"./shared-affe06c0.js";import"./shared-cfc6735e.js";import"./shared-14713ead.js";import"./shared-20841d9c.js";import"./shared-142df717.js";import"./shared-7f7d6ceb.js";import"./shared-11de7969.js";let n,m=e=>e;customElements.define("foxy-internal-update-payment-method-form-cc-token-control",class extends t{constructor(){super(...arguments),this.embedUrl=null}static get properties(){return r(r({},super.properties),{},{embedUrl:{attribute:"embed-url"}})}renderControl(){return a(n||(n=m` <foxy-payment-card-embed infer="payment-card-embed" url="${0}" @submit="${0}"> </foxy-payment-card-embed> <vaadin-button theme="primary" class="w-full mt-l" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="tokenize"></foxy-i18n> </vaadin-button> `),o(this.embedUrl),this.__tokenize,this.disabled,(()=>this.__tokenize()))}async __tokenize(){var e,t,r;const s=this.renderRoot.querySelector("[infer=payment-card-embed]");try{null===(e=this.nucleon)||void 0===e||e.edit({cc_token:await s.tokenize()}),null===(t=this.nucleon)||void 0===t||t.submit()}catch(e){null===(r=this.nucleon)||void 0===r||r.undo()}}});let c,p,l=e=>e;const h=d(e,"update-payment-method-form");class f extends h{constructor(){super(...arguments),this.embedUrl=null,this.__templateSetGetValue=()=>this.__templateSetOverride,this.__templateSetSetValue=e=>this.__templateSetOverride=e,this.__templateSetOverride=null}static get properties(){return r(r({},super.properties),{},{__templateSetOverride:{attribute:!1},embedUrl:{attribute:"embed-url"}})}get scopeCollection(){return"customers"}get scopeRules(){return[{path:"template-set",collection:"templates"},{path:"template-set",collection:"customers",need:"write"},{path:"cc-token",collection:"customers",need:"write"}]}get hiddenSelector(){var e;const t=null===(e=this.__formEmbedUrl)||void 0===e?void 0:e.searchParams,r=["header:copy-id","header:copy-json",super.hiddenSelector.toString()],o=null==t?void 0:t.has("demo");return(this.__isPreConfigured||o)&&r.unshift("template-set"),(null==t?void 0:t.has("template_set_id"))||o||r.unshift("cc-token"),new s(r.join(" ").trim())}renderBody(){var e;if(!this.href)return a(c||(c=l` <div class="flex items-center justify-center p-xl"> <foxy-spinner layout="vertical" infer="spinner" state="empty"></foxy-spinner> </div> `));const t=this.__formEmbedUrl,r=this.renderRoot.querySelector("#store-loader");return a(p||(p=l` ${0} <foxy-internal-resource-picker-control first="${0}" infer="template-set" item="foxy-template-set-card" .getValue="${0}" .setValue="${0}"> </foxy-internal-resource-picker-control> <foxy-internal-update-payment-method-form-cc-token-control embed-url="${0}" infer="cc-token"> </foxy-internal-update-payment-method-form-cc-token-control> <foxy-nucleon infer="" class="hidden" href="${0}" id="store-loader" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),o(null===(e=null==r?void 0:r.data)||void 0===e?void 0:e._links["fx:template_sets"].href),this.__templateSetGetValue,this.__templateSetSetValue,o(null==t?void 0:t.toString()),o(this.__storeLoaderHref),(()=>this.requestUpdate()))}updated(e){super.updated(e),(e.has("embedUrl")||e.has("href"))&&(this.__templateSetOverride=null)}async _fetch(...e){try{const t=await super._fetch(...e);return"PATCH"===new f.API.WHATWGRequest(...e).method&&(this.status={key:"cc_token_success"}),t}catch(e){let t;try{t=(await e.json())._embedded["fx:errors"][0].message}catch(t){throw e}throw t.includes("cc_token you provided is invalid")?["error:cc_token_invalid"]:e}}get __storeLoaderHref(){const e=this.data;return e&&"fx:store"in e._links?e._links["fx:store"].href:void 0}get __isPreConfigured(){var e;try{return new URL(null!==(e=this.embedUrl)&&void 0!==e?e:"").searchParams.has("template_set_id")}catch(e){return!1}}get __formEmbedUrl(){var e;try{const t=new URL(null!==(e=this.embedUrl)&&void 0!==e?e:"");if(this.__templateSetOverride){const e=i(this.__templateSetOverride);null!==e&&t.searchParams.set("template_set_id",String(e))}return t}catch(e){}}}customElements.define("foxy-update-payment-method-form",f);export{f as UpdatePaymentMethodForm};
1
+ import"./shared-eb349085.js";import{I as e}from"./shared-9b290320.js";import"./foxy-template-set-card.js";import"./foxy-nucleon-element.js";import"./foxy-spinner.js";import{a as t}from"./shared-4ab85bea.js";import"./foxy-payment-card-embed.js";import"./shared-c066b7fd.js";import"./shared-a8ae24f0.js";import{_ as r,B as s}from"./shared-8f9014ff.js";import{i as o}from"./shared-53e42a77.js";import{h as a}from"./shared-ba5c42c7.js";import{g as i}from"./shared-bab2ea2c.js";import{a as d}from"./shared-5b8c7250.js";import"./shared-3a61d8a6.js";import"./shared-dc6e5879.js";import"./shared-f410644a.js";import"./shared-c3d6bcc0.js";import"./shared-f77994ad.js";import"./shared-91483320.js";import"./shared-d8b880bb.js";import"./shared-6262e0d6.js";import"./shared-28cc8aa1.js";import"./shared-2fbfbe12.js";import"./shared-e9f51baa.js";import"./shared-53a5212e.js";import"./shared-c56c3e1e.js";import"./shared-8be109a9.js";import"./foxy-collection-page.js";import"./shared-222b23bb.js";import"./shared-87e17c02.js";import"./shared-c85c1864.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-930e68b7.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./shared-c59277a4.js";import"./shared-cf1965cb.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-cda51ccf.js";import"./shared-41f93e6c.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-7e28c953.js";import"./shared-56741bad.js";import"./shared-a95a66b8.js";import"./shared-5212ef4f.js";import"./foxy-copy-to-clipboard.js";import"./shared-affe06c0.js";import"./shared-cfc6735e.js";import"./shared-18707481.js";import"./shared-56278a3c.js";import"./shared-142df717.js";import"./shared-7f7d6ceb.js";import"./shared-11de7969.js";let n,m=e=>e;customElements.define("foxy-internal-update-payment-method-form-cc-token-control",class extends t{constructor(){super(...arguments),this.embedUrl=null}static get properties(){return r(r({},super.properties),{},{embedUrl:{attribute:"embed-url"}})}renderControl(){return a(n||(n=m` <foxy-payment-card-embed infer="payment-card-embed" url="${0}" @submit="${0}"> </foxy-payment-card-embed> <vaadin-button theme="primary" class="w-full mt-l" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="tokenize"></foxy-i18n> </vaadin-button> `),o(this.embedUrl),this.__tokenize,this.disabled,(()=>this.__tokenize()))}async __tokenize(){var e,t,r;const s=this.renderRoot.querySelector("[infer=payment-card-embed]");try{null===(e=this.nucleon)||void 0===e||e.edit({cc_token:await s.tokenize()}),null===(t=this.nucleon)||void 0===t||t.submit()}catch(e){null===(r=this.nucleon)||void 0===r||r.undo()}}});let c,p,l=e=>e;const h=d(e,"update-payment-method-form");class f extends h{constructor(){super(...arguments),this.embedUrl=null,this.__templateSetGetValue=()=>this.__templateSetOverride,this.__templateSetSetValue=e=>this.__templateSetOverride=e,this.__templateSetOverride=null}static get properties(){return r(r({},super.properties),{},{__templateSetOverride:{attribute:!1},embedUrl:{attribute:"embed-url"}})}get scopeCollection(){return"customers"}get scopeRules(){return[{path:"template-set",collection:"templates"},{path:"template-set",collection:"customers",need:"write"},{path:"cc-token",collection:"customers",need:"write"}]}get hiddenSelector(){var e;const t=null===(e=this.__formEmbedUrl)||void 0===e?void 0:e.searchParams,r=["header:copy-id","header:copy-json",super.hiddenSelector.toString()],o=null==t?void 0:t.has("demo");return(this.__isPreConfigured||o)&&r.unshift("template-set"),(null==t?void 0:t.has("template_set_id"))||o||r.unshift("cc-token"),new s(r.join(" ").trim())}renderBody(){var e;if(!this.href)return a(c||(c=l` <div class="flex items-center justify-center p-xl"> <foxy-spinner layout="vertical" infer="spinner" state="empty"></foxy-spinner> </div> `));const t=this.__formEmbedUrl,r=this.renderRoot.querySelector("#store-loader");return a(p||(p=l` ${0} <foxy-internal-resource-picker-control first="${0}" infer="template-set" item="foxy-template-set-card" .getValue="${0}" .setValue="${0}"> </foxy-internal-resource-picker-control> <foxy-internal-update-payment-method-form-cc-token-control embed-url="${0}" infer="cc-token"> </foxy-internal-update-payment-method-form-cc-token-control> <foxy-nucleon infer="" class="hidden" href="${0}" id="store-loader" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),o(null===(e=null==r?void 0:r.data)||void 0===e?void 0:e._links["fx:template_sets"].href),this.__templateSetGetValue,this.__templateSetSetValue,o(null==t?void 0:t.toString()),o(this.__storeLoaderHref),(()=>this.requestUpdate()))}updated(e){super.updated(e),(e.has("embedUrl")||e.has("href"))&&(this.__templateSetOverride=null)}async _fetch(...e){try{const t=await super._fetch(...e);return"PATCH"===new f.API.WHATWGRequest(...e).method&&(this.status={key:"cc_token_success"}),t}catch(e){let t;try{t=(await e.json())._embedded["fx:errors"][0].message}catch(t){throw e}throw t.includes("cc_token you provided is invalid")?["error:cc_token_invalid"]:e}}get __storeLoaderHref(){const e=this.data;return e&&"fx:store"in e._links?e._links["fx:store"].href:void 0}get __isPreConfigured(){var e;try{return new URL(null!==(e=this.embedUrl)&&void 0!==e?e:"").searchParams.has("template_set_id")}catch(e){return!1}}get __formEmbedUrl(){var e;try{const t=new URL(null!==(e=this.embedUrl)&&void 0!==e?e:"");if(this.__templateSetOverride){const e=i(this.__templateSetOverride);null!==e&&t.searchParams.set("template_set_id",String(e))}return t}catch(e){}}}customElements.define("foxy-update-payment-method-form",f);export{f as UpdatePaymentMethodForm};
@@ -1 +1 @@
1
- import"./shared-5212ef4f.js";import"./foxy-nucleon-element.js";import"./foxy-spinner.js";import"./shared-c066b7fd.js";import{_ as s,aT as t,aU as e}from"./shared-8f9014ff.js";import{a as r}from"./shared-5b8c7250.js";import{a as i,g as a}from"./shared-37bdd118.js";import{T as o}from"./shared-14713ead.js";import{i as n}from"./shared-53e42a77.js";import{c as d}from"./shared-4e709717.js";import{h as m}from"./shared-ba5c42c7.js";import"./shared-50ef1d5a.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-930e68b7.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-da3393a5.js";import"./shared-0e19bda5.js";import"./shared-c59277a4.js";import"./shared-c3d6bcc0.js";import"./shared-f410644a.js";import"./shared-cf1965cb.js";import"./shared-336e73ce.js";import"./shared-20841d9c.js";let l,c,h,f,p,u=s=>s;const v=r(o,"user-card");class j extends v{constructor(){super(...arguments),this.showInvitations=!1}static get properties(){return s(s({},super.properties),{},{showInvitations:{type:Boolean,attribute:"show-invitations"}})}get scopeCollection(){return"users"}renderBody(){var s,t,e,r;const a=null!==(e=null===(t=null===(s=this.__invitationsLoader)||void 0===s?void 0:s.data)||void 0===t?void 0:t.total_items)&&void 0!==e?e:0;return m(l||(l=u` <div class="flex items-center" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <div class="relative flex-shrink-0"> ${0} <span data-testid="invitations-count" style="min-height:1.5em;min-width:1.5em;border-radius:1.5em;left:calc(100% - 1em);top:-.5em" class="${0}"> ${0} </span> </div> <div class="min-w-0 flex-1"> ${0} </div> </div> <foxy-nucleon infer="" href="${0}" id="invitationsLoader" @update="${0}"> </foxy-nucleon> `),i(this.__getGravatar(null===(r=this.data)||void 0===r?void 0:r.email)),d({"flex items-center justify-center bg-error text-error-contrast":!0,"font-medium px-xs leading-none text-xs absolute transform":!0,"scale-0":!this.showInvitations||0===a}),a,super.renderBody({title:s=>{const t=[s.first_name.trim(),s.last_name.trim()];return m(c||(c=u`${0}`),t.filter((s=>!!s)).join(" ")||this.t("no_name"))},subtitle:s=>m(h||(h=u`${0}`),s.email)}),n(this.__invitationsHref),this.requestUpdate)}get __invitationsLoader(){return this.renderRoot.querySelector("#invitationsLoader")}get __invitationsHref(){var s,t;try{if(!this.showInvitations)return;const e=new URL(null!==(t=null===(s=this.data)||void 0===s?void 0:s._links["fx:user_invitations"].href)&&void 0!==t?t:"");return e.searchParams.set("status","sent"),e.searchParams.set("limit","1"),e.toString()}catch(s){return}}__getGravatar(s){return t((function*(){yield m(f||(f=u`<div class="rounded-full w-s h-s bg-contrast-5"></div>`)),s&&(yield m(p||(p=u` <img class="rounded-full w-s h-s bg-contrast-5 shadow-xs" src="${0}" alt=""> `),yield e(a(s))))}))()}}customElements.define("foxy-user-card",j);export{j as UserCard};
1
+ import"./shared-5212ef4f.js";import"./foxy-nucleon-element.js";import"./foxy-spinner.js";import"./shared-c066b7fd.js";import{_ as s,aT as t,aU as e}from"./shared-8f9014ff.js";import{a as r}from"./shared-5b8c7250.js";import{a as i,g as a}from"./shared-37bdd118.js";import{T as o}from"./shared-18707481.js";import{i as n}from"./shared-53e42a77.js";import{c as d}from"./shared-4e709717.js";import{h as m}from"./shared-ba5c42c7.js";import"./shared-c85c1864.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-930e68b7.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-87e17c02.js";import"./shared-0e19bda5.js";import"./shared-c59277a4.js";import"./shared-c3d6bcc0.js";import"./shared-f410644a.js";import"./shared-cf1965cb.js";import"./shared-222b23bb.js";import"./shared-56278a3c.js";let l,c,h,p,u,f=s=>s;const v=r(o,"user-card");class j extends v{constructor(){super(...arguments),this.showInvitations=!1}static get properties(){return s(s({},super.properties),{},{showInvitations:{type:Boolean,attribute:"show-invitations"}})}get scopeCollection(){return"users"}renderBody(){var s,t,e,r;const a=null!==(e=null===(t=null===(s=this.__invitationsLoader)||void 0===s?void 0:s.data)||void 0===t?void 0:t.total_items)&&void 0!==e?e:0;return m(l||(l=f` <div class="flex items-center" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <div class="relative flex-shrink-0"> ${0} <span data-testid="invitations-count" style="min-height:1.5em;min-width:1.5em;border-radius:1.5em;left:calc(100% - 1em);top:-.5em" class="${0}"> ${0} </span> </div> <div class="min-w-0 flex-1"> ${0} </div> </div> <foxy-nucleon infer="" href="${0}" id="invitationsLoader" @update="${0}"> </foxy-nucleon> `),i(this.__getGravatar(null===(r=this.data)||void 0===r?void 0:r.email)),d({"flex items-center justify-center bg-error text-error-contrast":!0,"font-medium px-xs leading-none text-xs absolute transform":!0,"scale-0":!this.showInvitations||0===a}),a,super.renderBody({title:s=>{const t=[s.first_name.trim(),s.last_name.trim()];return m(c||(c=f`${0}`),t.filter((s=>!!s)).join(" ")||this.t("no_name"))},subtitle:s=>m(h||(h=f`${0}`),s.email)}),n(this.__invitationsHref),this.requestUpdate)}get __invitationsLoader(){return this.renderRoot.querySelector("#invitationsLoader")}get __invitationsHref(){var s,t;try{if(!this.showInvitations)return;const e=new URL(null!==(t=null===(s=this.data)||void 0===s?void 0:s._links["fx:user_invitations"].href)&&void 0!==t?t:"");return e.searchParams.set("status","sent"),e.searchParams.set("limit","1"),e.toString()}catch(s){return}}__getGravatar(s){return t((function*(){yield m(p||(p=f`<div class="rounded-full w-s h-s bg-contrast-5"></div>`)),s&&(yield m(u||(u=f` <img class="rounded-full w-s h-s bg-contrast-5 shadow-xs" src="${0}" alt=""> `),yield e(a(s))))}))()}}customElements.define("foxy-user-card",j);export{j as UserCard};
@@ -1 +1 @@
1
- import"./shared-3eca56ee.js";import"./shared-59dfee2c.js";import"./shared-7b6a899b.js";import{I as r}from"./shared-be20875c.js";import{_ as e}from"./shared-8f9014ff.js";import{v as t}from"./shared-b738ee96.js";import{a as o}from"./shared-5b8c7250.js";import{h as a}from"./shared-ba5c42c7.js";import"./shared-45649d84.js";import"./shared-5212ef4f.js";import"./shared-c066b7fd.js";import"./shared-930e68b7.js";import"./shared-336e73ce.js";import"./shared-53e42a77.js";import"./shared-da3393a5.js";import"./shared-50ef1d5a.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-affe06c0.js";import"./shared-f410644a.js";import"./shared-f77994ad.js";import"./shared-dc6e5879.js";import"./shared-c59277a4.js";import"./shared-c3d6bcc0.js";import"./shared-cfc6735e.js";import"./shared-4e709717.js";import"./shared-53a5212e.js";import"./shared-c56c3e1e.js";import"./shared-28cc8aa1.js";import"./shared-e9f51baa.js";import"./shared-a8ae24f0.js";import"./shared-d0aed1c1.js";import"./shared-760a2243.js";import"./shared-cb5305b9.js";import"./foxy-copy-to-clipboard.js";import"./shared-cf1965cb.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let s,n=r=>r;const i=o(r,"user-form");class m extends i{static get v8n(){return[({first_name:r})=>r&&r.length>0||"first-name:v8n_required",({first_name:r})=>!r||r.length<=50||"first-name:v8n_too_long",({last_name:r})=>r&&r.length>0||"last-name:v8n_required",({last_name:r})=>!r||r.length<=50||"last-name:v8n_too_long",({email:r})=>r&&r.length>0||"email:v8n_required",({email:r})=>!r||r.length<=100||"email:v8n_too_long",({email:r})=>!r||t(r)||"email:v8n_invalid_email",({phone:r})=>!r||r.length<=50||"phone:v8n_too_long"]}get scopeCollection(){return"users"}get headerSubtitleOptions(){var r;return e(e({},super.headerSubtitleOptions),{},{context:(null===(r=this.data)||void 0===r?void 0:r.affiliate_id)?"affiliate":""})}renderBody(){return a(s||(s=n` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="first-name"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="last-name"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="contact-info"> <foxy-internal-text-control layout="summary-item" infer="email"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="phone"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="role"> <foxy-internal-switch-control infer="is-merchant"></foxy-internal-switch-control> <foxy-internal-switch-control infer="is-programmer"></foxy-internal-switch-control> <foxy-internal-switch-control infer="is-front-end-developer"></foxy-internal-switch-control> <foxy-internal-switch-control infer="is-designer"></foxy-internal-switch-control> </foxy-internal-summary-control> ${0} `),this.renderHeader(),super.renderBody())}}customElements.define("foxy-user-form",m);export{m as UserForm};
1
+ import"./shared-8be109a9.js";import"./shared-7b15217c.js";import"./shared-091e97f3.js";import{I as r}from"./shared-9b290320.js";import{_ as e}from"./shared-8f9014ff.js";import{v as t}from"./shared-b738ee96.js";import{a as o}from"./shared-5b8c7250.js";import{h as a}from"./shared-ba5c42c7.js";import"./shared-4ab85bea.js";import"./shared-5212ef4f.js";import"./shared-c066b7fd.js";import"./shared-930e68b7.js";import"./shared-222b23bb.js";import"./shared-53e42a77.js";import"./shared-87e17c02.js";import"./shared-c85c1864.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-affe06c0.js";import"./shared-f410644a.js";import"./shared-f77994ad.js";import"./shared-dc6e5879.js";import"./shared-c59277a4.js";import"./shared-c3d6bcc0.js";import"./shared-cfc6735e.js";import"./shared-4e709717.js";import"./shared-53a5212e.js";import"./shared-c56c3e1e.js";import"./shared-28cc8aa1.js";import"./shared-e9f51baa.js";import"./shared-a8ae24f0.js";import"./shared-d0aed1c1.js";import"./shared-cda51ccf.js";import"./shared-41f93e6c.js";import"./foxy-copy-to-clipboard.js";import"./shared-cf1965cb.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let s,n=r=>r;const i=o(r,"user-form");class m extends i{static get v8n(){return[({first_name:r})=>r&&r.length>0||"first-name:v8n_required",({first_name:r})=>!r||r.length<=50||"first-name:v8n_too_long",({last_name:r})=>r&&r.length>0||"last-name:v8n_required",({last_name:r})=>!r||r.length<=50||"last-name:v8n_too_long",({email:r})=>r&&r.length>0||"email:v8n_required",({email:r})=>!r||r.length<=100||"email:v8n_too_long",({email:r})=>!r||t(r)||"email:v8n_invalid_email",({phone:r})=>!r||r.length<=50||"phone:v8n_too_long"]}get scopeCollection(){return"users"}get headerSubtitleOptions(){var r;return e(e({},super.headerSubtitleOptions),{},{context:(null===(r=this.data)||void 0===r?void 0:r.affiliate_id)?"affiliate":""})}renderBody(){return a(s||(s=n` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="first-name"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="last-name"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="contact-info"> <foxy-internal-text-control layout="summary-item" infer="email"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="phone"> </foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="role"> <foxy-internal-switch-control infer="is-merchant"></foxy-internal-switch-control> <foxy-internal-switch-control infer="is-programmer"></foxy-internal-switch-control> <foxy-internal-switch-control infer="is-front-end-developer"></foxy-internal-switch-control> <foxy-internal-switch-control infer="is-designer"></foxy-internal-switch-control> </foxy-internal-summary-control> ${0} `),this.renderHeader(),super.renderBody())}}customElements.define("foxy-user-form",m);export{m as UserForm};
@@ -1 +1 @@
1
- import"./shared-559b648a.js";import"./shared-c066b7fd.js";import{_ as s,aT as e,aU as t}from"./shared-8f9014ff.js";import{a}from"./shared-5b8c7250.js";import{a as r,g as i}from"./shared-37bdd118.js";import{a as o}from"./shared-da3393a5.js";import{g as n}from"./shared-bab2ea2c.js";import{I as d}from"./shared-20841d9c.js";import{h as l}from"./shared-ba5c42c7.js";import"./foxy-spinner.js";import"./shared-c59277a4.js";import"./shared-c3d6bcc0.js";import"./shared-f410644a.js";import"./shared-cf1965cb.js";import"./shared-930e68b7.js";import"./shared-50ef1d5a.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-4e709717.js";let c,u,m,f,p,h,x,v,_,y,b=s=>s;const j=a(d,"user-invitation-card");class $ extends j{constructor(){super(...arguments),this.defaultDomain=null,this.layout=null}static get properties(){return s(s({},super.properties),{},{defaultDomain:{attribute:"default-domain"},layout:{}})}renderBody(){var s,e,t,a,i,o,d,p,h;if("admin"===(null!==(s=this.layout)&&void 0!==s?s:"user")){const{first_name:s,last_name:o,status:d,email:m}=null!==(e=this.data)&&void 0!==e?e:{},f=(null==s?void 0:s.trim())||(null==o?void 0:o.trim()),p={first_name:s,last_name:o,context:f?"":"empty"},h={context:`admin_${d}`,email:m},x=null===(a=null===(t=this.data)||void 0===t?void 0:t._links["fx:user"])||void 0===a?void 0:a.href;return l(c||(c=b` <div class="flex items-start" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <div class="min-w-0 flex-1 leading-xs"> <div class="flex items-center"> <foxy-i18n class="font-medium truncate mr-auto" infer="" key="full_name" .options="${0}"> </foxy-i18n> ${0} </div> <foxy-i18n .options="${0}" class="block truncate text-s text-secondary" infer="" key="status"> </foxy-i18n> ${0} </div> </div> `),r(this.__getGravatar(null===(i=this.data)||void 0===i?void 0:i.email)),p,x?l(u||(u=b` <span class="text-tertiary uppercase text-s flex-shrink-0"> ID ${0} </span> `),n(x)):"",h,this.__renderScopes())}const x=null===(o=this.data)||void 0===o?void 0:o._links["fx:store"].href,v=this.defaultDomain,_=null===(d=this.data)||void 0===d?void 0:d.store_domain,y=(null==_?void 0:_.includes("."))||!v?_:`${_}.${v}`,j={context:`user_${null===(p=this.data)||void 0===p?void 0:p.status}`,domain:y};return l(m||(m=b` <div class="min-w-0 flex-1 leading-xs"> <div class="flex items-center"> <span class="font-medium truncate mr-auto"> ${0}&ZeroWidthSpace; </span> ${0} </div> <foxy-i18n .options="${0}" class="block truncate text-s text-secondary" infer="" key="status"> </foxy-i18n> </div> `),null===(h=this.data)||void 0===h?void 0:h.store_name,x?l(f||(f=b` <span class="text-tertiary uppercase text-s flex-shrink-0"> ID ${0} </span> `),n(x)):"",j)}__renderScopes(){var s;const e=null===(s=this.data)||void 0===s?void 0:s.scope,t=o(this.data&&!(null==e?void 0:e.trim())?"store_full_access":e);return t.storeFullAccess||!!t.full.length||!!t.read.length||!!t.resend.length?l(p||(p=b` <div class="border-t border-contrast-10 mt-s pt-s"> ${0} </div> `),t.storeFullAccess?l(h||(h=b` <foxy-i18n class="block truncate text-s text-secondary" infer="" key="scope_store_full_access"> </foxy-i18n> `)):l(x||(x=b` ${0} ${0} ${0} `),this.__renderScopeLine("scope_full",t.full),this.__renderScopeLine("scope_read",t.read),this.__renderScopeLine("scope_resend",t.resend))):""}__renderScopeLine(s,e){if(!e.length)return"";const t=e.map((s=>this.t(`scopes.${s}`))).sort(),a=Math.max(0,t.length-3),r={names:t.slice(0,3).join(", "),count:a,context:a?"truncated":""};return l(v||(v=b` <foxy-i18n .options="${0}" class="block truncate text-s text-secondary" infer="" key="${0}"> </foxy-i18n> `),r,s)}__getGravatar(s){return e((function*(){yield l(_||(_=b`<div class="flex-shrink-0 rounded-full w-s h-s bg-contrast-5"></div>`)),s&&(yield l(y||(y=b` <img class="flex-shrink-0 rounded-full w-s h-s bg-contrast-5 shadow-xs" src="${0}" alt=""> `),yield t(i(s))))}))()}}customElements.define("foxy-user-invitation-card",$);export{$ as UserInvitationCard};
1
+ import"./shared-0996f4d0.js";import"./shared-c066b7fd.js";import{_ as s,aT as e,aU as t}from"./shared-8f9014ff.js";import{a as r}from"./shared-5b8c7250.js";import{a,g as i}from"./shared-37bdd118.js";import{a as o}from"./shared-87e17c02.js";import{g as n}from"./shared-bab2ea2c.js";import{I as d}from"./shared-56278a3c.js";import{h as l}from"./shared-ba5c42c7.js";import"./foxy-spinner.js";import"./shared-c59277a4.js";import"./shared-c3d6bcc0.js";import"./shared-f410644a.js";import"./shared-cf1965cb.js";import"./shared-930e68b7.js";import"./shared-c85c1864.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-4e709717.js";let c,u,m,f,p,h,x,v,_,y,j=s=>s;const b=r(d,"user-invitation-card");class $ extends b{constructor(){super(...arguments),this.defaultDomain=null,this.layout=null}static get properties(){return s(s({},super.properties),{},{defaultDomain:{attribute:"default-domain"},layout:{}})}renderBody(){var s,e,t,r,i,o,d,p,h;if("admin"===(null!==(s=this.layout)&&void 0!==s?s:"user")){const{first_name:s,last_name:o,status:d,email:m}=null!==(e=this.data)&&void 0!==e?e:{},f=(null==s?void 0:s.trim())||(null==o?void 0:o.trim()),p={first_name:s,last_name:o,context:f?"":"empty"},h={context:`admin_${d}`,email:m},x=null===(r=null===(t=this.data)||void 0===t?void 0:t._links["fx:user"])||void 0===r?void 0:r.href;return l(c||(c=j` <div class="flex items-start" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <div class="min-w-0 flex-1 leading-xs"> <div class="flex items-center"> <foxy-i18n class="font-medium truncate mr-auto" infer="" key="full_name" .options="${0}"> </foxy-i18n> ${0} </div> <foxy-i18n .options="${0}" class="block truncate text-s text-secondary" infer="" key="status"> </foxy-i18n> ${0} </div> </div> `),a(this.__getGravatar(null===(i=this.data)||void 0===i?void 0:i.email)),p,x?l(u||(u=j` <span class="text-tertiary uppercase text-s flex-shrink-0"> ID ${0} </span> `),n(x)):"",h,this.__renderScopes())}const x=null===(o=this.data)||void 0===o?void 0:o._links["fx:store"].href,v=this.defaultDomain,_=null===(d=this.data)||void 0===d?void 0:d.store_domain,y=(null==_?void 0:_.includes("."))||!v?_:`${_}.${v}`,b={context:`user_${null===(p=this.data)||void 0===p?void 0:p.status}`,domain:y};return l(m||(m=j` <div class="min-w-0 flex-1 leading-xs"> <div class="flex items-center"> <span class="font-medium truncate mr-auto"> ${0}&ZeroWidthSpace; </span> ${0} </div> <foxy-i18n .options="${0}" class="block truncate text-s text-secondary" infer="" key="status"> </foxy-i18n> </div> `),null===(h=this.data)||void 0===h?void 0:h.store_name,x?l(f||(f=j` <span class="text-tertiary uppercase text-s flex-shrink-0"> ID ${0} </span> `),n(x)):"",b)}__renderScopes(){var s;const e=null===(s=this.data)||void 0===s?void 0:s.scope,t=o(this.data&&!(null==e?void 0:e.trim())?"store_full_access":e);return t.storeFullAccess||!!t.full.length||!!t.read.length||!!t.resend.length?l(p||(p=j` <div class="border-t border-contrast-10 mt-s pt-s"> ${0} </div> `),t.storeFullAccess?l(h||(h=j` <foxy-i18n class="block truncate text-s text-secondary" infer="" key="scope_store_full_access"> </foxy-i18n> `)):l(x||(x=j` ${0} ${0} ${0} `),this.__renderScopeLine("scope_full",t.full),this.__renderScopeLine("scope_read",t.read),this.__renderScopeLine("scope_resend",t.resend))):""}__renderScopeLine(s,e){if(!e.length)return"";const t=e.map((s=>this.t(`scopes.${s}`))).sort(),r=Math.max(0,t.length-3),a={names:t.slice(0,3).join(", "),count:r,context:r?"truncated":""};return l(v||(v=j` <foxy-i18n .options="${0}" class="block truncate text-s text-secondary" infer="" key="${0}"> </foxy-i18n> `),a,s)}__getGravatar(s){return e((function*(){yield l(_||(_=j`<div class="flex-shrink-0 rounded-full w-s h-s bg-contrast-5"></div>`)),s&&(yield l(y||(y=j` <img class="flex-shrink-0 rounded-full w-s h-s bg-contrast-5 shadow-xs" src="${0}" alt=""> `),yield t(i(s))))}))()}}customElements.define("foxy-user-invitation-card",$);export{$ as UserInvitationCard};
@@ -1 +1 @@
1
- import"./shared-a1bec4a0.js";import"./shared-3eca56ee.js";import{I as e}from"./shared-be20875c.js";import"./shared-7b6a899b.js";import"./shared-a8ae24f0.js";import{a as t,I as r}from"./shared-45649d84.js";import"./shared-c066b7fd.js";import{_ as s,B as a,aT as o,aU as i}from"./shared-8f9014ff.js";import{N as n,i as l}from"./shared-50ef1d5a.js";import{i as c}from"./shared-53e42a77.js";import{h as d,c as u,s as m}from"./shared-ba5c42c7.js";import"./shared-b84996e5.js";import"./shared-59dfee2c.js";import{C as h,R as f}from"./shared-da3393a5.js";import{a as v}from"./shared-5b8c7250.js";import{a as p,g as _}from"./shared-37bdd118.js";import{c as y}from"./shared-4e709717.js";import"./foxy-spinner.js";import"./shared-c59277a4.js";import"./shared-c3d6bcc0.js";import"./shared-f410644a.js";import"./shared-cf1965cb.js";import"./shared-930e68b7.js";import"./shared-cb5305b9.js";import"./shared-69c98b7b.js";import"./shared-336e73ce.js";import"./shared-760a2243.js";import"./foxy-copy-to-clipboard.js";import"./shared-affe06c0.js";import"./shared-f77994ad.js";import"./shared-dc6e5879.js";import"./shared-cfc6735e.js";import"./shared-bab2ea2c.js";import"./shared-53a5212e.js";import"./shared-c56c3e1e.js";import"./shared-28cc8aa1.js";import"./shared-e9f51baa.js";import"./shared-d0aed1c1.js";import"./shared-5212ef4f.js";import"./shared-791b4510.js";import"./shared-9496e995.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-0e19bda5.js";import"./shared-d8b880bb.js";import"./shared-6262e0d6.js";import"./shared-2fbfbe12.js";let x,g=e=>e;customElements.define("foxy-internal-user-invitation-form-async-action",class extends t{constructor(){super(...arguments),this.theme=null,this.href=null,this.__state="idle"}static get properties(){return s(s({},super.properties),{},{__state:{type:String},theme:{type:String},href:{type:String}})}renderControl(){const e=this.__state,t="fail"===e||"access_denied"===e?"error":"idle"===e?this.theme:"";return d(x||(x=g` <vaadin-button theme="${0}" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n key="${0}" infer=""></foxy-i18n> </vaadin-button> `),c(null!=t?t:void 0),"busy"===e||this.disabled,this.__submit,e)}async __submit(){var e;if("busy"!==this.__state)try{this.__state="busy";const t=new n.API(this),r=await t.fetch(null!==(e=this.href)&&void 0!==e?e:"",{method:"POST"});r.ok?(await this.__share(t),this.__state="idle"):this.__state=await l(r)?"access_denied":"fail"}catch(e){this.__state="fail"}}async __share(e){const t=this.nucleon;if(null==t?void 0:t.href)try{const r={"cache-control":"no-cache"},s=await e.fetch(t.href,{headers:r});if(!s.ok)return;const a=await s.json(),o=[...t.related,t.parent].filter(Boolean);n.Rumour(t.group).share({related:o,source:t.href,data:a})}catch(e){}}});const b=e=>new Set((null!=e?e:"").split(/\s+/).filter((e=>e.length>0)));function $(e){const t=b(e),r=new Set,s={};h.forEach((e=>{const a=`${e}_read`,o=`${e}_write`;t.has(o)?s[e]="full":t.has(a)?s[e]="read":s[e]="none",t.has(a)&&r.add(a),t.has(o)&&r.add(o)}));const a=f.filter((e=>{const s=`${e}_resend`;return!!t.has(s)&&(r.add(s),!0)})),o=t.has("store_full_access");o&&r.add("store_full_access");const i=[...t].filter((e=>!r.has(e)));let n;return n=o?"store":t.size?a.length||i.length||!h.every((e=>"read"===s[e]))?"custom":"read":null,{preset:n,levels:s,resend:a,extra:[...i]}}function w(e){if("store"===e.preset)return["store_full_access",...e.extra].join(" ");const t=[];return h.forEach((r=>{var s;const a=null!==(s=e.levels[r])&&void 0!==s?s:"none";"full"===a?t.push(`${r}_read`,`${r}_write`):"read"===a&&t.push(`${r}_read`)})),f.forEach((r=>{e.resend.includes(r)&&t.push(`${r}_resend`)})),[...t,...e.extra].join(" ")}function S(e){const t=b(e);return{storeFullAccess:t.has("store_full_access"),tokens:t}}function j(e,t,r){if("none"===r)return!0;if(e.storeFullAccess)return!0;const s=e.tokens.has(`${t}_read`);return"read"===r?s:s&&e.tokens.has(`${t}_write`)}function Z(e,t){return e.storeFullAccess||e.tokens.has(`${t}_resend`)}let k,C,L,U,V,A,E=e=>e;customElements.define("foxy-internal-user-invitation-form-scope-control",class extends r{constructor(){super(...arguments),this.granterScope=null,this.__customSelected=!1,this.__isLocked=!1}static get properties(){return s(s({},super.properties),{},{granterScope:{attribute:"granter-scope"},__customSelected:{attribute:!1}})}static get styles(){return[...super.styles,u(k||(k=E`.matrix{display:grid;grid-template-columns:minmax(0,1fr);gap:1px;border-radius:var(--lumo-border-radius);overflow:hidden}@media all and (min-width:640px){.matrix{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}.matrix>foxy-internal-select-control{background-color:var(--lumo-contrast-5pct);padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)}`))]}renderControl(){var e;const t=$(this.__scope),r=S(null!==(e=this.granterScope)&&void 0!==e?e:void 0),s=this.__preset(t),a=[];r.storeFullAccess&&a.push("store"),function(e){return!!e.storeFullAccess||h.every((t=>e.tokens.has(`${t}_read`)))}(r)&&a.push("read"),a.push("custom");const o=s&&!a.includes(s)?s:null,i=["store","read","custom"].filter((e=>a.includes(e)||e===o)),n=this.__hasUnreachableGrant(t,r,!!o);this.__isLocked=n;const l=this.readonly||n,c=n?this.t("helper_text_locked"):this.helperText,u=i.map((e=>({label:`preset_${e}`,value:e})));return d(C||(C=E` <div class="grid gap-m"> <foxy-internal-summary-control infer="" label="${0}" helper-text="${0}"> <foxy-internal-select-control layout="summary-item" infer="" label="${0}" helper-text="" data-preset="" ?disabled="${0}" ?readonly="${0}" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-select-control> </foxy-internal-summary-control> ${0} </div> `),this.label,c,this.t("preset_label"),this.disabled,l,u,(()=>null!=s?s:void 0),(e=>this.__selectPreset(e)),"custom"===s?d(L||(L=E` <div class="matrix"> ${0} </div> ${0} `),h.map((e=>this.__renderLevelControl(e,t,r,l))),this.__renderResendSwitches(t,r,l)):"")}updated(e){super.updated(e),this.__isLocked&&!this.readonly&&(this.readonly=!0)}__hasUnreachableGrant(e,t,r){if(r)return!0;return!!h.some((r=>{var s;return!j(t,r,null!==(s=e.levels[r])&&void 0!==s?s:"none")}))||e.resend.some((e=>!Z(t,e)))}__renderLevelControl(e,t,r,s){var a;const o=["none","read","full"],i=null!==(a=t.levels[e])&&void 0!==a?a:"none",n=("stores"===e?["read","full"]:o).filter((t=>j(r,e,t))),l=n.includes(i)?null:i,c=o.filter((e=>n.includes(e)||e===l)).map((e=>({label:`level_${e}`,value:e})));return d(U||(U=E` <foxy-internal-select-control layout="summary-item" infer="" label="${0}" helper-text="" data-collection="${0}" ?disabled="${0}" ?readonly="${0}" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-select-control> `),this.t(`scopes.${e}`),e,this.disabled,s,c,(()=>i),(t=>{this.__setLevel(e,t||"none")}))}__renderResendSwitches(e,t,r){const s=f.map((r=>{const s=e.resend.includes(r),a=Z(t,r),o=s&&!a;return{collection:r,hasResend:s,mismatchedResend:o,show:a||o}})).filter((e=>e.show));return s.length?d(V||(V=E` <foxy-internal-summary-control infer="" label="" helper-text=""> ${0} </foxy-internal-summary-control> `),s.map((({collection:e,hasResend:t})=>d(A||(A=E` <foxy-internal-switch-control infer="" label="${0}" helper-text="" data-resend="${0}" ?disabled="${0}" ?readonly="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> `),`${this.t("resend")} ${this.t(`scopes.${e}`).toLowerCase()}`,e,this.disabled,r,(()=>t),(t=>this.__setResend(e,!!t)))))):""}__setLevel(e,t){this.__customSelected=!0;const r=$(this.__scope);r.levels[e]=t,this._value=w(s(s({},r),{},{preset:"custom"}))}__setResend(e,t){this.__customSelected=!0;const r=$(this.__scope),a=t?[...r.resend,e]:r.resend.filter((t=>t!==e));this._value=w(s(s({},r),{},{preset:"custom",resend:a}))}get __scope(){var e,t;const r=null!==(e=this._value)&&void 0!==e?e:void 0;return!(null==r?void 0:r.trim())&&(null===(t=this.nucleon)||void 0===t?void 0:t.data)?"store_full_access":r}__preset(e){return this.__customSelected?"custom":e.preset}__selectPreset(e){if(this.__customSelected="custom"===e,"custom"===e){const e=$(this.__scope);if("store"!==e.preset)return;return h.forEach((t=>e.levels[t]="full")),void(this._value=w(s(s({},e),{},{preset:"custom",resend:[...f]})))}if("store"===e)this._value="store_full_access";else{const e=$("");h.forEach((t=>e.levels[t]="read")),this._value=w(e)}}});let M,R,G,B,F,H,P,O,D,I,T,q,N,z,J,K,Q,W,X=e=>e;const Y=v(e,"user-invitation-form");class ee extends Y{constructor(){super(...arguments),this.getStorePageHref=null,this.defaultDomain=null,this.currentStore=null,this.currentUser=null,this.layout=null,this.__storeDomainGetValue=()=>{var e;const t=this.defaultDomain,r=null===(e=this.data)||void 0===e?void 0:e.store_domain;return(null==r?void 0:r.includes("."))||!t?r:`${r}.${t}`}}static get properties(){return s(s({},super.properties),{},{getStorePageHref:{attribute:!1},defaultDomain:{attribute:"default-domain"},currentStore:{attribute:"current-store"},currentUser:{attribute:"current-user"},layout:{}})}static get styles(){return[...super.styles,u(M||(M=X`.inner-curve{--r:var(--lumo-border-radius-l);--s:3rem;--a:12deg;--m:0/calc(2 * var(--r)) var(--r) no-repeat radial-gradient(50% 100% at bottom, #000 calc(100% - 1px), #0000);--d:(var(--s) + var(--r)) * cos(var(--a));border-radius:var(--r);width:100%;mask:calc(50% + var(--d)) var(--m),calc(50% - var(--d)) var(--m),radial-gradient(var(--s) at 50% calc(-1 * sin(var(--a)) * var(--s)),#0000 100%,#000 calc(100% + 1px)) 0 calc(var(--r) * (1 - sin(var(--a)))) no-repeat,linear-gradient(90deg,#000 calc(50% - var(--d)),#0000 0 calc(50% + var(--d)),#000 0)}`))]}static get v8n(){return[({email:e})=>!!e||"email:v8n_required",({scope:e,status:t},r)=>!!r.__isScopeGated(t)||(!!(null==e?void 0:e.trim())||(void 0===e?"scope:v8n_required":"scope:v8n_required_custom_empty"))]}get scopeRules(){if("admin"!==this.layout)return super.scopeRules;const e=e=>({path:e,collection:"user_invitations",need:"write"}),t=[...super.scopeRules,e("resend"),e("create")];return this.__isOwnInvitationForCurrentStore||t.push(e("revoke"),e("delete")),t}get readonlySelector(){var e;const t=["store",super.readonlySelector.toString()];if(this.data){const{storeFullAccess:r,tokens:s}=S(null!==(e=this.currentUserScope)&&void 0!==e?e:void 0);r||s.has("user_invitations_write")||t.unshift("scope")}return new a(t.join(" ").trim())}get hiddenSelector(){var e,t;const r=["timestamps","undo",super.hiddenSelector.toString()],s=null===(e=this.data)||void 0===e?void 0:e.status,o=null!==(t=this.layout)&&void 0!==t?t:"user";return"accepted"!==s&&"sent"!==s&&r.unshift("revoke"),"accepted"!==s&&r.unshift("leave"),"sent"!==s&&r.unshift("accept","reject"),"rejected"===s&&"user"===o||"expired"===s&&"admin"===o||"revoked"===s&&"admin"===o||r.unshift("delete"),"sent"===s&&"admin"===o||r.unshift("resend"),this.__isScopeGated(s)&&r.unshift("scope"),new a(r.join(" ").trim())}renderBody(){const{layout:e,data:t}=this;return"admin"===e?t?this.__renderAdminSnapshotState(t):this.__renderAdminTemplateState():t?this.__renderUserSnapshotState(t):this.__renderUserTemplateState()}async _fetch(...e){try{return await super._fetch(...e)}catch(e){let t;try{t=(await e.json())._embedded["fx:errors"][0].message}catch(t){throw e}const r=[["already been created for this email and store","error:invitation_exists"],["already has access to this store","error:already_has_access"],["give more permission than you have","error:scope_too_broad"],["permission to edit scope","error:scope_edit_forbidden"],["Only the inviter can change the scope","error:scope_inviter_only"],["nobody will have full access","error:scope_last_admin"]].find((([e])=>t.includes(e)));if(r)throw[r[1]];throw e}}__isScopeGated(e){var t;const r="sent"===e||"accepted"===e;return!0===(null===(t=this.hiddenControls)||void 0===t?void 0:t.matches("scope",!0))||!this.currentUserScope||!!e&&!r}get __isOwnInvitationForCurrentStore(){var e;const t=null===(e=this.data)||void 0===e?void 0:e._links;return!!(this.currentStore&&this.currentUser&&(null==t?void 0:t["fx:store"])&&(null==t?void 0:t["fx:user"])&&this.currentStore===t["fx:store"].href&&this.currentUser===t["fx:user"].href)}__getGravatar(e){return o((function*(){yield d(R||(R=X` <div style="height:5rem;width:5rem;left:calc(50% - 2.5rem);top:-2.8rem" class="rounded-full absolute top-0 bg-contrast-5"></div> `)),e&&(yield d(G||(G=X` <img data-testid="gravatar" style="height:5rem;width:5rem;left:calc(50% - 2.5rem);top:-2.8rem" class="rounded-full absolute top-0 bg-contrast-5 shadow-xs" src="${0}" alt=""> `),yield i(_(e))))}))()}__renderAdminTemplateState(){var e;return d(B||(B=X` ${0} <foxy-internal-summary-control infer="" label="" helper-text=""> <foxy-internal-text-control layout="summary-item" infer="email"></foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-user-invitation-form-scope-control infer="scope" granter-scope="${0}"> </foxy-internal-user-invitation-form-scope-control> ${0} `),this.renderHeader(),c(null!==(e=this.currentUserScope)&&void 0!==e?e:void 0),super.renderBody())}__renderUserTemplateState(){return d(F||(F=X` <div class="p-xl flex items-center justify-center"> <foxy-spinner layout="vertical" infer="unavailable" state="empty"></foxy-spinner> </div> `))}__renderAdminSnapshotState({first_name:e,last_name:t,store_name:r}){var s,a,o,i,n,l,u,h,f,v;const _=(null==e?void 0:e.trim())||(null==t?void 0:t.trim()),x={first_name:e,last_name:t,context:_?"":"empty"},g=null===(s=this.data)||void 0===s?void 0:s.status,b=this.hiddenSelector;return d(H||(H=X` <div style="padding-top:3.5rem" class="grid gap-m"> <div class="relative"> <div class="inner-curve bg-contrast-5 absolute inset-0"></div> ${0} <div class="relative pb-m px-m leading-xs grid gap-m" style="padding-top:calc(2.5rem + var(--lumo-space-m))"> <div> <foxy-i18n class="block text-xl font-medium text-center" infer="" key="full_name" .options="${0}"> </foxy-i18n> <div class="text-m text-center text-secondary">${0}</div> </div> <div style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" class="${0}"> <p class="font-medium flex items-center gap-s"> ${0} <foxy-i18n infer="" key="admin_status_title" .options="${0}"> </foxy-i18n> </p> <p class="text-body" style="padding-left:calc((1.25 * var(--lumo-font-size-m)) + var(--lumo-space-s))"> <foxy-i18n infer="" key="admin_status_text" .options="${0}"> </foxy-i18n> </p> </div> <div class="flex gap-m" ?hidden="${0}"> ${0} <foxy-internal-user-invitation-form-async-action infer="resend" class="flex-1" href="${0}"> </foxy-internal-user-invitation-form-async-action> <foxy-internal-delete-control infer="delete" class="flex-1"> </foxy-internal-delete-control> </div> </div> </div> <foxy-internal-user-invitation-form-scope-control infer="scope" granter-scope="${0}"> </foxy-internal-user-invitation-form-scope-control> <foxy-internal-submit-control infer="submit"></foxy-internal-submit-control> </div> `),p(this.__getGravatar(null===(a=this.data)||void 0===a?void 0:a.email)),x,null===(o=this.data)||void 0===o?void 0:o.email,y({"border rounded":!0,"border-contrast text-contrast":"revoked"===g||"expired"===g,"border-success text-success":"accepted"===g,"border-primary text-primary":"sent"===g,"border-error text-error":"rejected"===g}),"revoked"===g?m(P||(P=X`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" style="width: 1.25em; height: 1.25em"><path fill-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm3 10.5a.75.75 0 0 0 0-1.5H9a.75.75 0 0 0 0 1.5h6Z" clip-rule="evenodd" /></svg>`)):"sent"===g?m(O||(O=X`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" style="width: 1.25em; height: 1.25em"><path fill-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25ZM12.75 6a.75.75 0 0 0-1.5 0v6c0 .414.336.75.75.75h4.5a.75.75 0 0 0 0-1.5h-3.75V6Z" clip-rule="evenodd" /></svg>`)):"rejected"===g?m(D||(D=X`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" style="width: 1.25em; height: 1.25em"><path fill-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z" clip-rule="evenodd" /></svg>`)):"accepted"===g?m(I||(I=X`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" style="width: 1.25em; height: 1.25em"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z" clip-rule="evenodd" /></svg>`)):"expired"===g?m(T||(T=X`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" style="width: 1.25em; height: 1.25em"><path d="M3.375 3C2.339 3 1.5 3.84 1.5 4.875v.75c0 1.036.84 1.875 1.875 1.875h17.25c1.035 0 1.875-.84 1.875-1.875v-.75C22.5 3.839 21.66 3 20.625 3H3.375Z" /><path fill-rule="evenodd" d="m3.087 9 .54 9.176A3 3 0 0 0 6.62 21h10.757a3 3 0 0 0 2.995-2.824L20.913 9H3.087Zm6.133 2.845a.75.75 0 0 1 1.06 0l1.72 1.72 1.72-1.72a.75.75 0 1 1 1.06 1.06l-1.72 1.72 1.72 1.72a.75.75 0 1 1-1.06 1.06L12 15.685l-1.72 1.72a.75.75 0 1 1-1.06-1.06l1.72-1.72-1.72-1.72a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" /></svg>`)):"",{context:g},{context:g},b.matches("revoke",!0)&&b.matches("resend",!0)&&b.matches("delete",!0),this.__isOwnInvitationForCurrentStore?d(q||(q=X` <foxy-internal-post-action-control message-options="${0}" infer="revoke" class="flex-1" theme="error" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),JSON.stringify({store_domain:this.__storeDomainGetValue(),store_name:r}),c(null===(n=null===(i=this.data)||void 0===i?void 0:i._links["fx:revoke"])||void 0===n?void 0:n.href),(()=>this.dispatchEvent(new CustomEvent("selfrevoked")))):d(N||(N=X` <foxy-internal-user-invitation-form-async-action infer="revoke" class="flex-1" theme="error" href="${0}"> </foxy-internal-user-invitation-form-async-action> `),c(null===(u=null===(l=this.data)||void 0===l?void 0:l._links["fx:revoke"])||void 0===u?void 0:u.href)),c(null===(f=null===(h=this.data)||void 0===h?void 0:h._links["fx:resend"])||void 0===f?void 0:f.href),c(null!==(v=this.currentUserScope)&&void 0!==v?v:void 0))}__renderUserSnapshotState({status:e,store_name:t}){var r,a,o,i,n,l,u,h,f,v,p;const _=null===(r=this.data)||void 0===r?void 0:r._links,x=this.hiddenSelector,g={"text-primary":"sent"===e,"text-success":"accepted"===e,"text-error":"rejected"===e};return d(z||(z=X` <div class="${0}"> <div class="border-t flex-1"></div> ${0} <div class="border-t flex-1"></div> </div> <foxy-i18n infer="" class="${0}" key="user_status_title" .options="${0}"> </foxy-i18n> <foxy-internal-summary-control infer="store"> <foxy-internal-text-control layout="summary-item" infer="store-domain" .getValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="store-url"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="store-email"> </foxy-internal-text-control> ${0} </foxy-internal-summary-control> <foxy-i18n class="block text-secondary text-center" infer="" key="user_status_text" .options="${0}"> </foxy-i18n> ${0} <div class="grid grid-cols-2 gap-m" ?hidden="${0}"> <foxy-internal-user-invitation-form-async-action theme="error primary" infer="reject" href="${0}"> </foxy-internal-user-invitation-form-async-action> <foxy-internal-user-invitation-form-async-action theme="success primary" infer="accept" href="${0}"> </foxy-internal-user-invitation-form-async-action> </div> <foxy-internal-delete-control infer="delete"></foxy-internal-delete-control> `),y(s({"flex items-center gap-m":!0},g)),m(J||(J=X`<svg style="height: 5rem; width: 5rem" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 256 256"><path fill="currentColor" fill-rule="evenodd" d="M128 250c67.38 0 122-54.62 122-122S195.38 6 128 6 6 60.62 6 128s54.62 122 122 122Zm0 6c70.7 0 128-57.3 128-128S198.7 0 128 0 0 57.3 0 128s57.3 128 128 128Z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M128.5 218a89.5 89.5 0 1 0 0-179 89.5 89.5 0 0 0 0 179Zm23.8-46.25-5.13-3.08-54.48-32.91a3.6 3.6 0 0 1-1.69-3.12V78l5.07 3.02c1.06.6 1.78 1.8 1.78 3.15v46.4l52.75 31.87a3.63 3.63 0 0 1 1.72 3.17l-.01 6.14ZM166 180l-5.17-3.11a3.62 3.62 0 0 1-1.7-3.1v-46.47l-47.64-28.8v25.92l-.02 6.14-5.09-3.09a3.5 3.5 0 0 1-1.71-3.05V92.38a3.6 3.6 0 0 1 1.71-3.09 3.3 3.3 0 0 1 3.44.01l54.47 32.9a3.62 3.62 0 0 1 1.7 3.11v48.47L166 180Zm-46.1-44.34c.53.34 5.2 3.17 5.2 3.17s.04-4.24.04-6.22v-15.57c0-1.32-.68-2.48-1.7-3.1-.5-.31-5.14-3.06-5.14-3.06v21.73c0 1.29.64 2.41 1.6 3.05Zm18.86 11.42-5.17-3.14a3.62 3.62 0 0 1-1.66-3.08v-21.77l5.1 3.07a3.62 3.62 0 0 1 1.75 3.13v15.57l-.02 6.22Zm8.46 5.1 5.15 3.12v-21.78a3.6 3.6 0 0 0-1.8-3.16c-.48-.28-5.06-3.08-5.06-3.08v21.8c0 1.33.7 2.48 1.71 3.1Z" clip-rule="evenodd"/><path fill="currentColor" d="M132.57 222a2.96 2.96 0 0 1 2.96 2.96v15.86a3 3 0 0 1-3 3h-9.95a2.39 2.39 0 1 1 0-4.78h5.15a1.88 1.88 0 0 0 0-3.75h-4.22a2.39 2.39 0 1 1 0-4.77h3.1a3 3 0 0 0 3-3v-2.56a2.96 2.96 0 0 1 2.96-2.96Zm-37.07 6.3c.5-2.37 1.39-4.28 2.66-5.71a9.51 9.51 0 0 1 4.52-2.9c1.75-.5 3.59-.55 5.52-.14a11.1 11.1 0 0 1 5 2.38 9.6 9.6 0 0 1 2.95 4.5c.57 1.83.6 3.93.1 6.29a12.33 12.33 0 0 1-2.65 5.7 9.44 9.44 0 0 1-4.52 2.91c-1.75.51-3.6.56-5.54.14a11.2 11.2 0 0 1-4.98-2.37 9.42 9.42 0 0 1-2.96-4.5 12.25 12.25 0 0 1-.1-6.3Zm5.95 1.27a9.13 9.13 0 0 0-.17 3.34c.14.95.5 1.73 1.06 2.32.56.6 1.31 1 2.27 1.2.96.2 1.82.15 2.58-.17a4.27 4.27 0 0 0 1.91-1.69 9.2 9.2 0 0 0 1.19-3.12c.27-1.28.33-2.4.19-3.35a4.33 4.33 0 0 0-1.07-2.31 4.28 4.28 0 0 0-2.28-1.2 4.24 4.24 0 0 0-2.56.17c-.76.31-1.4.88-1.92 1.68a9.23 9.23 0 0 0-1.2 3.13Zm-15.5 6.41a2.84 2.84 0 0 1-1.67-2.33l-.52-5.52c0-.05-.04-.1-.09-.12a.14.14 0 0 0-.15.02l-4.5 3.3a2.82 2.82 0 1 1-3.29-4.57l4.84-3.4a3 3 0 0 0 1.24-2.87l-.8-5.83a2.85 2.85 0 1 1 5.65-.68l.58 5.7c0 .05.04.1.09.12.05.02.1.01.14-.02l4.63-3.38a2.85 2.85 0 1 1 3.29 4.64l-4.87 3.34a3 3 0 0 0-1.28 2.83l.69 5.84a2.84 2.84 0 0 1-3.98 2.93Zm-16.33-12.59a2.87 2.87 0 1 1-5.67-.91l1.42-7.81a.14.14 0 0 0-.2-.15l-6.99 3.77a2.87 2.87 0 1 1-2.61-5.11l10.27-4.98a3 3 0 0 0 1.12-.94l1.86-2.56a2.94 2.94 0 1 1 4.76 3.46l-1.86 2.56a3 3 0 0 0-.55 1.36l-1.55 11.3Zm-11.39-33.1a2.93 2.93 0 0 1-.22 4.21c-.6.55-1.3.8-2.12.75a2.93 2.93 0 0 1-2.06-1 2.89 2.89 0 0 1-.74-2.11 2.8 2.8 0 0 1 2.35-2.76 3.2 3.2 0 0 1 1.52.09c.5.16.92.43 1.27.82ZM34.2 187.3a2.39 2.39 0 1 1-4.14 2.39l-4.37-7.57a2.39 2.39 0 1 1 4.13-2.38l4.37 7.56Zm14.75-8.52a2.39 2.39 0 0 1-4.13 2.38l-4.37-7.56a2.39 2.39 0 1 1 4.13-2.39l4.37 7.57Zm-21.08 7.13a2.96 2.96 0 0 1 1.09-4.05l13.76-7.95a2.96 2.96 0 0 1 2.96 5.13L31.92 187a2.96 2.96 0 0 1-4.05-1.09Zm-2.9-36.06c2.3-.75 4.4-.94 6.28-.56a9.51 9.51 0 0 1 4.78 2.47 11.27 11.27 0 0 1 2.88 4.71c.61 1.9.76 3.74.44 5.53a9.6 9.6 0 0 1-2.43 4.8c-1.3 1.4-3.1 2.48-5.4 3.23-2.3.75-4.4.94-6.26.56a9.44 9.44 0 0 1-4.78-2.46 11.24 11.24 0 0 1-2.9-4.73 11.2 11.2 0 0 1-.43-5.5 9.42 9.42 0 0 1 2.42-4.81 12.26 12.26 0 0 1 5.4-3.24Zm1.88 5.8c-1.24.4-2.23.9-2.98 1.5a4.2 4.2 0 0 0-1.47 2.09 4.2 4.2 0 0 0 .1 2.57c.3.93.77 1.64 1.43 2.14.64.5 1.45.77 2.41.82.96.05 2.06-.13 3.3-.54 1.25-.4 2.24-.9 3-1.5a4.34 4.34 0 0 0 1.47-2.09 4.3 4.3 0 0 0-.1-2.57 4.24 4.24 0 0 0-1.43-2.14 4.24 4.24 0 0 0-2.42-.82 9.24 9.24 0 0 0-3.3.53Zm3.91-38.41a4.55 4.55 0 0 1-.87 2.28 4.9 4.9 0 0 1-1.87 1.52c-.75.34-1.55.46-2.4.37a4.52 4.52 0 0 1-2.28-.87 4.81 4.81 0 0 1-1.9-4.28 4.72 4.72 0 0 1 5.15-4.17 4.8 4.8 0 0 1 3.8 2.74c.34.75.46 1.55.37 2.41ZM44.58 84.8a2.96 2.96 0 0 1-4.05 1.09L26.8 77.96a3 3 0 0 1-1.1-4.1l4.98-8.62a2.39 2.39 0 1 1 4.13 2.39l-2.58 4.46a1.88 1.88 0 0 0 3.25 1.88l2.1-3.66a2.39 2.39 0 1 1 4.14 2.39l-1.54 2.68a3 3 0 0 0 1.1 4.1l2.21 1.28a2.96 2.96 0 0 1 1.09 4.04Zm13.07-35.26a12.31 12.31 0 0 1 3.62 5.17c.6 1.81.69 3.6.25 5.37a11.27 11.27 0 0 1-2.64 4.85 11.24 11.24 0 0 1-4.56 3.14c-1.72.6-3.5.7-5.37.3a12.34 12.34 0 0 1-5.5-3.06 12.33 12.33 0 0 1-3.62-5.15 9.46 9.46 0 0 1-.25-5.36c.43-1.77 1.31-3.4 2.64-4.87a11.2 11.2 0 0 1 4.56-3.13 9.4 9.4 0 0 1 5.37-.31c1.86.4 3.7 1.43 5.5 3.05Zm-4.07 4.53a9.15 9.15 0 0 0-2.8-1.82 4.18 4.18 0 0 0-2.55-.24 4.2 4.2 0 0 0-2.17 1.37 4.24 4.24 0 0 0-1.14 2.31c-.1.8.06 1.64.5 2.5a9.33 9.33 0 0 0 2.11 2.6c.97.87 1.9 1.48 2.8 1.83.9.34 1.75.42 2.54.24a4.3 4.3 0 0 0 2.18-1.38 4.24 4.24 0 0 0 1.14-2.3c.1-.82-.06-1.65-.5-2.5a9.24 9.24 0 0 0-2.11-2.61Zm2.2-16.63c.83-.6 1.92-.7 2.85-.28l5.04 2.3a.15.15 0 0 0 .2-.15l-.6-5.55a2.82 2.82 0 1 1 5.6-.56l.53 5.89a3 3 0 0 0 1.86 2.5l5.45 2.23a2.85 2.85 0 1 1-2.24 5.24l-5.22-2.35a.15.15 0 0 0-.2.15l.61 5.7a2.85 2.85 0 1 1-5.66.52l-.46-5.88a3 3 0 0 0-1.8-2.52l-5.42-2.33a2.84 2.84 0 0 1-.54-4.9Zm19.07-7.84a2.87 2.87 0 1 1 3.62-4.47l6.06 5.14a.14.14 0 0 0 .22-.1l.23-7.93a2.87 2.87 0 1 1 5.74.29l-.83 11.38a3 3 0 0 0 .25 1.44l1.29 2.9a2.94 2.94 0 1 1-5.37 2.39l-1.3-2.9a3 3 0 0 0-.9-1.14l-9.01-7Zm34.35 6.68a2.93 2.93 0 0 1-3.53-2.3 2.78 2.78 0 0 1 .41-2.2 2.93 2.93 0 0 1 1.9-1.3 2.9 2.9 0 0 1 2.2.42 2.8 2.8 0 0 1 1.21 3.41c-.18.5-.46.93-.84 1.28-.38.35-.83.58-1.34.7Zm14.61-19.33a2.39 2.39 0 0 1 0-4.77h8.74a2.39 2.39 0 0 1 0 4.77h-8.74Zm0 17.05a2.39 2.39 0 0 1 0-4.77h8.74a2.39 2.39 0 0 1 0 4.77h-8.74Zm4.37-21.82a2.96 2.96 0 0 1 2.97 2.96v15.9a2.96 2.96 0 0 1-5.93 0v-15.9a2.96 2.96 0 0 1 2.96-2.96Zm32.68 15.52a12.24 12.24 0 0 1-2.66 5.71 9.5 9.5 0 0 1-4.53 2.9c-1.74.5-3.58.55-5.52.14a11.24 11.24 0 0 1-5-2.38 9.6 9.6 0 0 1-2.94-4.5 12.4 12.4 0 0 1-.1-6.29c.5-2.37 1.38-4.28 2.65-5.7a9.44 9.44 0 0 1 4.51-2.91c1.75-.51 3.6-.56 5.54-.14 1.94.4 3.6 1.2 4.99 2.37a9.42 9.42 0 0 1 2.95 4.5c.58 1.82.62 3.92.11 6.3Zm-5.96-1.27c.27-1.28.33-2.4.18-3.34a4.18 4.18 0 0 0-1.07-2.32 4.2 4.2 0 0 0-2.27-1.2 4.24 4.24 0 0 0-2.57.17c-.75.31-1.39.88-1.92 1.69a9.2 9.2 0 0 0-1.18 3.12 9.4 9.4 0 0 0-.2 3.35 4.4 4.4 0 0 0 1.07 2.31c.57.6 1.33 1 2.29 1.2.96.2 1.8.15 2.56-.17.75-.31 1.4-.88 1.91-1.68.53-.81.93-1.85 1.2-3.13Zm31.3 22.59a4.54 4.54 0 0 1-1.53-1.9 4.9 4.9 0 0 1-.38-2.38 4.5 4.5 0 0 1 .88-2.27c.5-.7 1.14-1.21 1.89-1.54a4.81 4.81 0 0 1 4.65.5 4.72 4.72 0 0 1 1.04 6.55 4.8 4.8 0 0 1-4.27 1.91 4.51 4.51 0 0 1-2.28-.87Zm21.19 28.18a2.96 2.96 0 0 1 1.08-4.05l13.73-7.93a3 3 0 0 1 4.1 1.1l4.98 8.62a2.39 2.39 0 0 1-4.13 2.39l-2.58-4.47a1.87 1.87 0 1 0-3.25 1.88l2.11 3.65a2.39 2.39 0 1 1-4.13 2.39l-1.55-2.68a3 3 0 0 0-4.1-1.1l-2.22 1.28a2.96 2.96 0 0 1-4.04-1.08Zm24 28.95c-2.31.75-4.4.94-6.29.56a9.5 9.5 0 0 1-4.78-2.47 11.26 11.26 0 0 1-2.87-4.71c-.61-1.9-.76-3.74-.44-5.53a9.6 9.6 0 0 1 2.43-4.8 12.5 12.5 0 0 1 5.39-3.23c2.31-.75 4.4-.94 6.27-.56a9.44 9.44 0 0 1 4.78 2.46 11.23 11.23 0 0 1 2.89 4.73c.6 1.88.75 3.71.43 5.5a9.43 9.43 0 0 1-2.41 4.81 12.26 12.26 0 0 1-5.4 3.24Zm-1.89-5.8c1.25-.4 2.24-.9 2.98-1.5a4.17 4.17 0 0 0 1.48-2.09 4.2 4.2 0 0 0-.1-2.57 4.25 4.25 0 0 0-1.43-2.14 4.27 4.27 0 0 0-2.42-.82 9.32 9.32 0 0 0-3.3.54c-1.24.4-2.24.9-2.99 1.5a4.34 4.34 0 0 0-1.47 2.09 4.3 4.3 0 0 0 .1 2.57c.3.93.78 1.65 1.43 2.14.65.5 1.46.77 2.41.82.97.05 2.07-.13 3.31-.53Zm13.3 10.23a2.84 2.84 0 0 1-1.18 2.61l-4.52 3.21a.15.15 0 0 0-.06.14c.01.05.04.1.1.12l5.1 2.24a2.82 2.82 0 1 1-2.31 5.14l-5.37-2.48a3 3 0 0 0-3.1.35l-4.65 3.61a2.85 2.85 0 1 1-3.41-4.56l4.64-3.35a.15.15 0 0 0 .06-.13c0-.06-.04-.1-.08-.12l-5.25-2.31a2.84 2.84 0 1 1 2.38-5.17l5.32 2.54a3 3 0 0 0 3.1-.3l4.71-3.52a2.84 2.84 0 0 1 4.52 1.98Zm-2.74 20.44a2.87 2.87 0 1 1 2.06 5.36l-7.48 2.68a.13.13 0 0 0-.1.11c0 .06.03.1.07.13l6.76 4.17a2.87 2.87 0 1 1-3.12 4.83l-9.45-6.42a3 3 0 0 0-1.37-.5l-3.15-.33a2.94 2.94 0 0 1 .62-5.85l3.14.33a3 3 0 0 0 1.45-.2l10.57-4.31Zm-22.96 26.41a2.93 2.93 0 0 1 3.75-1.92 2.8 2.8 0 0 1 1.71 1.47c.37.74.42 1.5.17 2.28-.24.74-.73 1.3-1.46 1.7a2.8 2.8 0 0 1-3.56-.66c-.34-.4-.57-.85-.7-1.36-.1-.5-.08-1.01.09-1.51Zm9.43 22.32a2.39 2.39 0 1 1 4.13 2.38l-4.37 7.57a2.39 2.39 0 1 1-4.13-2.39l4.37-7.56Zm-14.77-8.53a2.39 2.39 0 1 1 4.14 2.39l-4.37 7.56a2.39 2.39 0 0 1-4.13-2.38l4.36-7.57Zm16.72 14.7a2.96 2.96 0 0 1-4.05 1.08l-13.76-7.95a2.96 2.96 0 1 1 2.96-5.13l13.76 7.95a2.96 2.96 0 0 1 1.09 4.04Zm-29.78 20.54a12.3 12.3 0 0 1-3.62-5.17 9.5 9.5 0 0 1-.25-5.37 11.27 11.27 0 0 1 2.64-4.85 11.25 11.25 0 0 1 4.57-3.14 9.6 9.6 0 0 1 5.37-.3c1.87.43 3.7 1.44 5.5 3.06a12.33 12.33 0 0 1 3.61 5.15c.61 1.82.7 3.6.26 5.36a11.24 11.24 0 0 1-2.65 4.87 11.2 11.2 0 0 1-4.55 3.13 9.4 9.4 0 0 1-5.37.31 12.26 12.26 0 0 1-5.5-3.05Zm4.08-4.53c.97.88 1.9 1.48 2.8 1.82.9.35 1.75.43 2.54.24a4.2 4.2 0 0 0 2.18-1.37 4.24 4.24 0 0 0 1.14-2.31c.1-.8-.07-1.64-.5-2.5a9.33 9.33 0 0 0-2.12-2.6 9.4 9.4 0 0 0-2.8-1.83 4.34 4.34 0 0 0-2.54-.24c-.8.2-1.52.66-2.17 1.39a4.24 4.24 0 0 0-1.14 2.3c-.1.81.06 1.64.5 2.5a9.21 9.21 0 0 0 2.11 2.6Zm-35.21 15.81a4.54 4.54 0 0 1 2.4-.38c.83.1 1.58.39 2.25.86a4.55 4.55 0 0 1 1.54 1.9c.35.79.48 1.6.38 2.4a4.81 4.81 0 0 1-2.76 3.79 4.73 4.73 0 0 1-6.19-2.38 4.81 4.81 0 0 1 .48-4.66 4.51 4.51 0 0 1 1.9-1.53Z"/></svg>`)),y(s({"block text-center text-xl font-medium":!0},g)),{context:e,store_name:t},this.__storeDomainGetValue,"accepted"===e&&this.getStorePageHref&&this.data?d(K||(K=X` <div ?hidden="${0}"> <a class="text-primary font-medium cursor-pointer rounded transition-opacity hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="" key="store_link"></foxy-i18n> </a> </div> `),"accepted"!==e||!this.getStorePageHref,this.getStorePageHref(this.data._links["fx:store"].href)):"",{context:e,store_name:t},this.__isOwnInvitationForCurrentStore?d(Q||(Q=X` <foxy-internal-post-action-control message-options="${0}" infer="leave" class="flex-1" theme="error" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),JSON.stringify({store_domain:this.__storeDomainGetValue(),store_name:t}),c(null!==(o=null===(a=null==_?void 0:_["fx:revoke"])||void 0===a?void 0:a.href)&&void 0!==o?o:null===(i=null==_?void 0:_["fx:reject"])||void 0===i?void 0:i.href),(()=>this.dispatchEvent(new CustomEvent("selfrevoked")))):d(W||(W=X` <foxy-internal-user-invitation-form-async-action theme="error" class="flex-1" infer="leave" href="${0}"> </foxy-internal-user-invitation-form-async-action> `),c(null!==(l=null===(n=null==_?void 0:_["fx:revoke"])||void 0===n?void 0:n.href)&&void 0!==l?l:null===(u=null==_?void 0:_["fx:reject"])||void 0===u?void 0:u.href)),x.matches("reject",!0)&&x.matches("accept",!0),c(null===(f=null===(h=this.data)||void 0===h?void 0:h._links["fx:reject"])||void 0===f?void 0:f.href),c(null===(p=null===(v=this.data)||void 0===v?void 0:v._links["fx:accept"])||void 0===p?void 0:p.href))}}customElements.define("foxy-user-invitation-form",ee);export{ee as UserInvitationForm};
1
+ import"./shared-88f841ff.js";import"./shared-8be109a9.js";import{I as e}from"./shared-9b290320.js";import"./shared-091e97f3.js";import"./shared-a8ae24f0.js";import{a as t,I as r}from"./shared-4ab85bea.js";import"./shared-c066b7fd.js";import{_ as s,B as a,aT as o,aU as i}from"./shared-8f9014ff.js";import{N as n,i as l}from"./shared-c85c1864.js";import{i as c}from"./shared-53e42a77.js";import{h as d,c as u,s as m}from"./shared-ba5c42c7.js";import"./shared-a95a66b8.js";import"./shared-7b15217c.js";import{C as h,R as f}from"./shared-87e17c02.js";import{a as v}from"./shared-5b8c7250.js";import{a as p,g as _}from"./shared-37bdd118.js";import{c as y}from"./shared-4e709717.js";import"./foxy-spinner.js";import"./shared-c59277a4.js";import"./shared-c3d6bcc0.js";import"./shared-f410644a.js";import"./shared-cf1965cb.js";import"./shared-930e68b7.js";import"./shared-41f93e6c.js";import"./shared-69c98b7b.js";import"./shared-222b23bb.js";import"./shared-cda51ccf.js";import"./foxy-copy-to-clipboard.js";import"./shared-affe06c0.js";import"./shared-f77994ad.js";import"./shared-dc6e5879.js";import"./shared-cfc6735e.js";import"./shared-bab2ea2c.js";import"./shared-53a5212e.js";import"./shared-c56c3e1e.js";import"./shared-28cc8aa1.js";import"./shared-e9f51baa.js";import"./shared-d0aed1c1.js";import"./shared-5212ef4f.js";import"./shared-791b4510.js";import"./shared-9496e995.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-0e19bda5.js";import"./shared-d8b880bb.js";import"./shared-6262e0d6.js";import"./shared-2fbfbe12.js";let x,g=e=>e;customElements.define("foxy-internal-user-invitation-form-async-action",class extends t{constructor(){super(...arguments),this.theme=null,this.href=null,this.__state="idle"}static get properties(){return s(s({},super.properties),{},{__state:{type:String},theme:{type:String},href:{type:String}})}renderControl(){const e=this.__state,t="fail"===e||"access_denied"===e?"error":"idle"===e?this.theme:"";return d(x||(x=g` <vaadin-button theme="${0}" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n key="${0}" infer=""></foxy-i18n> </vaadin-button> `),c(null!=t?t:void 0),"busy"===e||this.disabled,this.__submit,e)}async __submit(){var e;if("busy"!==this.__state)try{this.__state="busy";const t=new n.API(this),r=await t.fetch(null!==(e=this.href)&&void 0!==e?e:"",{method:"POST"});r.ok?(await this.__share(t),this.__state="idle"):this.__state=await l(r)?"access_denied":"fail"}catch(e){this.__state="fail"}}async __share(e){const t=this.nucleon;if(null==t?void 0:t.href)try{const r={"cache-control":"no-cache"},s=await e.fetch(t.href,{headers:r});if(!s.ok)return;const a=await s.json(),o=[...t.related,t.parent].filter(Boolean);n.Rumour(t.group).share({related:o,source:t.href,data:a})}catch(e){}}});const b=e=>new Set((null!=e?e:"").split(/\s+/).filter((e=>e.length>0)));function $(e){const t=b(e),r=new Set,s={};h.forEach((e=>{const a=`${e}_read`,o=`${e}_write`;t.has(o)?s[e]="full":t.has(a)?s[e]="read":s[e]="none",t.has(a)&&r.add(a),t.has(o)&&r.add(o)}));const a=f.filter((e=>{const s=`${e}_resend`;return!!t.has(s)&&(r.add(s),!0)})),o=t.has("store_full_access");o&&r.add("store_full_access");const i=[...t].filter((e=>!r.has(e)));let n;return n=o?"store":t.size?a.length||i.length||!h.every((e=>"read"===s[e]))?"custom":"read":null,{preset:n,levels:s,resend:a,extra:[...i]}}function w(e){if("store"===e.preset)return["store_full_access",...e.extra].join(" ");const t=[];return h.forEach((r=>{var s;const a=null!==(s=e.levels[r])&&void 0!==s?s:"none";"full"===a?t.push(`${r}_read`,`${r}_write`):"read"===a&&t.push(`${r}_read`)})),f.forEach((r=>{e.resend.includes(r)&&t.push(`${r}_resend`)})),[...t,...e.extra].join(" ")}function S(e){const t=b(e);return{storeFullAccess:t.has("store_full_access"),tokens:t}}function j(e,t,r){if("none"===r)return!0;if(e.storeFullAccess)return!0;const s=e.tokens.has(`${t}_write`);return"read"===r?s||e.tokens.has(`${t}_read`):s}function Z(e,t){return e.storeFullAccess||e.tokens.has(`${t}_write`)||e.tokens.has(`${t}_resend`)}let k,C,L,U,V,E,M=e=>e;customElements.define("foxy-internal-user-invitation-form-scope-control",class extends r{constructor(){super(...arguments),this.granterScope=null,this.__customSelected=!1,this.__isLocked=!1}static get properties(){return s(s({},super.properties),{},{granterScope:{attribute:"granter-scope"},__customSelected:{attribute:!1}})}static get styles(){return[...super.styles,u(k||(k=M`.matrix{display:grid;grid-template-columns:minmax(0,1fr);gap:1px;border-radius:var(--lumo-border-radius);overflow:hidden}@media all and (min-width:640px){.matrix{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}.matrix>foxy-internal-select-control{background-color:var(--lumo-contrast-5pct);padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)}`))]}renderControl(){var e;const t=$(this.__scope),r=S(null!==(e=this.granterScope)&&void 0!==e?e:void 0),s=this.__preset(t),a=[];r.storeFullAccess&&a.push("store"),function(e){return h.every((t=>j(e,t,"read")))}(r)&&a.push("read"),a.push("custom");const o=s&&!a.includes(s)?s:null,i=["store","read","custom"].filter((e=>a.includes(e)||e===o)),n=this.__hasUnreachableGrant(t,r,!!o);this.__isLocked=n;const l=this.readonly||n,c=n?this.t("helper_text_locked"):this.helperText,u=i.map((e=>({label:`preset_${e}`,value:e})));return d(C||(C=M` <div class="grid gap-m"> <foxy-internal-summary-control infer="" label="${0}" helper-text="${0}"> <foxy-internal-select-control layout="summary-item" infer="" label="${0}" helper-text="" data-preset="" ?disabled="${0}" ?readonly="${0}" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-select-control> </foxy-internal-summary-control> ${0} </div> `),this.label,c,this.t("preset_label"),this.disabled,l,u,(()=>null!=s?s:void 0),(e=>this.__selectPreset(e)),"custom"===s?d(L||(L=M` <div class="matrix"> ${0} </div> ${0} `),h.map((e=>this.__renderLevelControl(e,t,r,l))),this.__renderResendSwitches(t,r,l)):"")}updated(e){super.updated(e),this.__isLocked&&!this.readonly&&(this.readonly=!0)}get readonlySelector(){return new a(`${super.readonlySelector.toString()} included-resend`.trim())}__hasUnreachableGrant(e,t,r){if(r)return!0;return!!h.some((r=>{var s;return!j(t,r,null!==(s=e.levels[r])&&void 0!==s?s:"none")}))||e.resend.some((e=>!Z(t,e)))}__renderLevelControl(e,t,r,s){var a;const o=["none","read","full"],i=null!==(a=t.levels[e])&&void 0!==a?a:"none",n=("stores"===e?["read","full"]:o).filter((t=>j(r,e,t))),l=n.includes(i)?null:i,c=o.filter((e=>n.includes(e)||e===l)).map((e=>({label:`level_${e}`,value:e})));return d(U||(U=M` <foxy-internal-select-control layout="summary-item" infer="" label="${0}" helper-text="" data-collection="${0}" ?disabled="${0}" ?readonly="${0}" .options="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-select-control> `),this.t(`scopes.${e}`),e,this.disabled,s,c,(()=>i),(t=>{this.__setLevel(e,t||"none")}))}__renderResendSwitches(e,t,r){const s=f.map((r=>{const s="full"===e.levels[r],a=e.resend.includes(r),o=Z(t,r),i=a&&!o;return{collection:r,included:s,hasResend:a||s,mismatchedResend:i,show:o||i||s}})).filter((e=>e.show));return s.length?d(V||(V=M` <foxy-internal-summary-control infer="" label="" helper-text=""> ${0} </foxy-internal-summary-control> `),s.map((({collection:e,included:t,hasResend:s})=>d(E||(E=M` <foxy-internal-switch-control infer="${0}" label="${0}" helper-text="" data-resend="${0}" ?disabled="${0}" ?readonly="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> `),t?"included-resend":"",`${this.t("resend")} ${this.t(`scopes.${e}`).toLowerCase()}`,e,this.disabled,r,(()=>s),(t=>this.__setResend(e,!!t)))))):""}__setLevel(e,t){this.__customSelected=!0;const r=$(this.__scope),a="full"===t||"full"===r.levels[e];r.levels[e]=t;const o=a?r.resend.filter((t=>t!==e)):r.resend;this._value=w(s(s({},r),{},{preset:"custom",resend:o}))}__setResend(e,t){this.__customSelected=!0;const r=$(this.__scope),a=t?[...r.resend,e]:r.resend.filter((t=>t!==e));this._value=w(s(s({},r),{},{preset:"custom",resend:a}))}get __scope(){var e,t;const r=null!==(e=this._value)&&void 0!==e?e:void 0;return!(null==r?void 0:r.trim())&&(null===(t=this.nucleon)||void 0===t?void 0:t.data)?"store_full_access":r}__preset(e){return this.__customSelected?"custom":e.preset}__selectPreset(e){if(this.__customSelected="custom"===e,"custom"===e){const e=$(this.__scope);if("store"!==e.preset)return;return h.forEach((t=>e.levels[t]="full")),void(this._value=w(s(s({},e),{},{preset:"custom"})))}if("store"===e)this._value="store_full_access";else{const e=$("");h.forEach((t=>e.levels[t]="read")),this._value=w(e)}}});let R,A,G,B,F,H,P,O,D,I,T,q,N,z,J,K,Q,W,X=e=>e;const Y=v(e,"user-invitation-form");class ee extends Y{constructor(){super(...arguments),this.getStorePageHref=null,this.defaultDomain=null,this.currentStore=null,this.currentUser=null,this.layout=null,this.__storeDomainGetValue=()=>{var e;const t=this.defaultDomain,r=null===(e=this.data)||void 0===e?void 0:e.store_domain;return(null==r?void 0:r.includes("."))||!t?r:`${r}.${t}`}}static get properties(){return s(s({},super.properties),{},{getStorePageHref:{attribute:!1},defaultDomain:{attribute:"default-domain"},currentStore:{attribute:"current-store"},currentUser:{attribute:"current-user"},layout:{}})}static get styles(){return[...super.styles,u(R||(R=X`.inner-curve{--r:var(--lumo-border-radius-l);--s:3rem;--a:12deg;--m:0/calc(2 * var(--r)) var(--r) no-repeat radial-gradient(50% 100% at bottom, #000 calc(100% - 1px), #0000);--d:(var(--s) + var(--r)) * cos(var(--a));border-radius:var(--r);width:100%;mask:calc(50% + var(--d)) var(--m),calc(50% - var(--d)) var(--m),radial-gradient(var(--s) at 50% calc(-1 * sin(var(--a)) * var(--s)),#0000 100%,#000 calc(100% + 1px)) 0 calc(var(--r) * (1 - sin(var(--a)))) no-repeat,linear-gradient(90deg,#000 calc(50% - var(--d)),#0000 0 calc(50% + var(--d)),#000 0)}`))]}static get v8n(){return[({email:e})=>!!e||"email:v8n_required",({scope:e,status:t},r)=>!!r.__isScopeGated(t)||(!!(null==e?void 0:e.trim())||(void 0===e?"scope:v8n_required":"scope:v8n_required_custom_empty"))]}get scopeRules(){if("admin"!==this.layout)return super.scopeRules;const e=e=>({path:e,collection:"user_invitations",need:"write"}),t=[...super.scopeRules,e("resend"),e("create")];return this.__isOwnInvitationForCurrentStore||t.push(e("revoke"),e("delete")),t}get readonlySelector(){var e;const t=["store",super.readonlySelector.toString()];if(this.data){const{storeFullAccess:r,tokens:s}=S(null!==(e=this.currentUserScope)&&void 0!==e?e:void 0);r||s.has("user_invitations_write")||t.unshift("scope")}return new a(t.join(" ").trim())}get hiddenSelector(){var e,t;const r=["timestamps","undo",super.hiddenSelector.toString()],s=null===(e=this.data)||void 0===e?void 0:e.status,o=null!==(t=this.layout)&&void 0!==t?t:"user";return"accepted"!==s&&"sent"!==s&&r.unshift("revoke"),"accepted"!==s&&r.unshift("leave"),"sent"!==s&&r.unshift("accept","reject"),"rejected"===s&&"user"===o||"expired"===s&&"admin"===o||"revoked"===s&&"admin"===o||r.unshift("delete"),"sent"===s&&"admin"===o||r.unshift("resend"),this.__isScopeGated(s)&&r.unshift("scope"),new a(r.join(" ").trim())}renderBody(){const{layout:e,data:t}=this;return"admin"===e?t?this.__renderAdminSnapshotState(t):this.__renderAdminTemplateState():t?this.__renderUserSnapshotState(t):this.__renderUserTemplateState()}async _fetch(...e){try{return await super._fetch(...e)}catch(e){let t;try{t=(await e.json())._embedded["fx:errors"][0].message}catch(t){throw e}const r=[["already been created for this email and store","error:invitation_exists"],["already has access to this store","error:already_has_access"],["give more permission than you have","error:scope_too_broad"],["permission to edit scope","error:scope_edit_forbidden"],["Only the inviter can change the scope","error:scope_inviter_only"],["nobody will have full access","error:scope_last_admin"]].find((([e])=>t.includes(e)));if(r)throw[r[1]];throw e}}__isScopeGated(e){var t;const r="sent"===e||"accepted"===e;return!0===(null===(t=this.hiddenControls)||void 0===t?void 0:t.matches("scope",!0))||!this.currentUserScope||!!e&&!r}get __isOwnInvitationForCurrentStore(){var e;const t=null===(e=this.data)||void 0===e?void 0:e._links;return!!(this.currentStore&&this.currentUser&&(null==t?void 0:t["fx:store"])&&(null==t?void 0:t["fx:user"])&&this.currentStore===t["fx:store"].href&&this.currentUser===t["fx:user"].href)}__getGravatar(e){return o((function*(){yield d(A||(A=X` <div style="height:5rem;width:5rem;left:calc(50% - 2.5rem);top:-2.8rem" class="rounded-full absolute top-0 bg-contrast-5"></div> `)),e&&(yield d(G||(G=X` <img data-testid="gravatar" style="height:5rem;width:5rem;left:calc(50% - 2.5rem);top:-2.8rem" class="rounded-full absolute top-0 bg-contrast-5 shadow-xs" src="${0}" alt=""> `),yield i(_(e))))}))()}__renderAdminTemplateState(){var e;return d(B||(B=X` ${0} <foxy-internal-summary-control infer="" label="" helper-text=""> <foxy-internal-text-control layout="summary-item" infer="email"></foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-user-invitation-form-scope-control infer="scope" granter-scope="${0}"> </foxy-internal-user-invitation-form-scope-control> ${0} `),this.renderHeader(),c(null!==(e=this.currentUserScope)&&void 0!==e?e:void 0),super.renderBody())}__renderUserTemplateState(){return d(F||(F=X` <div class="p-xl flex items-center justify-center"> <foxy-spinner layout="vertical" infer="unavailable" state="empty"></foxy-spinner> </div> `))}__renderAdminSnapshotState({first_name:e,last_name:t,store_name:r}){var s,a,o,i,n,l,u,h,f,v;const _=(null==e?void 0:e.trim())||(null==t?void 0:t.trim()),x={first_name:e,last_name:t,context:_?"":"empty"},g=null===(s=this.data)||void 0===s?void 0:s.status,b=this.hiddenSelector;return d(H||(H=X` <div style="padding-top:3.5rem" class="grid gap-m"> <div class="relative"> <div class="inner-curve bg-contrast-5 absolute inset-0"></div> ${0} <div class="relative pb-m px-m leading-xs grid gap-m" style="padding-top:calc(2.5rem + var(--lumo-space-m))"> <div> <foxy-i18n class="block text-xl font-medium text-center" infer="" key="full_name" .options="${0}"> </foxy-i18n> <div class="text-m text-center text-secondary">${0}</div> </div> <div style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" class="${0}"> <p class="font-medium flex items-center gap-s"> ${0} <foxy-i18n infer="" key="admin_status_title" .options="${0}"> </foxy-i18n> </p> <p class="text-body" style="padding-left:calc((1.25 * var(--lumo-font-size-m)) + var(--lumo-space-s))"> <foxy-i18n infer="" key="admin_status_text" .options="${0}"> </foxy-i18n> </p> </div> <div class="flex gap-m" ?hidden="${0}"> ${0} <foxy-internal-user-invitation-form-async-action infer="resend" class="flex-1" href="${0}"> </foxy-internal-user-invitation-form-async-action> <foxy-internal-delete-control infer="delete" class="flex-1"> </foxy-internal-delete-control> </div> </div> </div> <foxy-internal-user-invitation-form-scope-control infer="scope" granter-scope="${0}"> </foxy-internal-user-invitation-form-scope-control> <foxy-internal-submit-control infer="submit"></foxy-internal-submit-control> </div> `),p(this.__getGravatar(null===(a=this.data)||void 0===a?void 0:a.email)),x,null===(o=this.data)||void 0===o?void 0:o.email,y({"border rounded":!0,"border-contrast text-contrast":"revoked"===g||"expired"===g,"border-success text-success":"accepted"===g,"border-primary text-primary":"sent"===g,"border-error text-error":"rejected"===g}),"revoked"===g?m(P||(P=X`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" style="width: 1.25em; height: 1.25em"><path fill-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm3 10.5a.75.75 0 0 0 0-1.5H9a.75.75 0 0 0 0 1.5h6Z" clip-rule="evenodd" /></svg>`)):"sent"===g?m(O||(O=X`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" style="width: 1.25em; height: 1.25em"><path fill-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25ZM12.75 6a.75.75 0 0 0-1.5 0v6c0 .414.336.75.75.75h4.5a.75.75 0 0 0 0-1.5h-3.75V6Z" clip-rule="evenodd" /></svg>`)):"rejected"===g?m(D||(D=X`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" style="width: 1.25em; height: 1.25em"><path fill-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z" clip-rule="evenodd" /></svg>`)):"accepted"===g?m(I||(I=X`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" style="width: 1.25em; height: 1.25em"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z" clip-rule="evenodd" /></svg>`)):"expired"===g?m(T||(T=X`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" style="width: 1.25em; height: 1.25em"><path d="M3.375 3C2.339 3 1.5 3.84 1.5 4.875v.75c0 1.036.84 1.875 1.875 1.875h17.25c1.035 0 1.875-.84 1.875-1.875v-.75C22.5 3.839 21.66 3 20.625 3H3.375Z" /><path fill-rule="evenodd" d="m3.087 9 .54 9.176A3 3 0 0 0 6.62 21h10.757a3 3 0 0 0 2.995-2.824L20.913 9H3.087Zm6.133 2.845a.75.75 0 0 1 1.06 0l1.72 1.72 1.72-1.72a.75.75 0 1 1 1.06 1.06l-1.72 1.72 1.72 1.72a.75.75 0 1 1-1.06 1.06L12 15.685l-1.72 1.72a.75.75 0 1 1-1.06-1.06l1.72-1.72-1.72-1.72a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" /></svg>`)):"",{context:g},{context:g},b.matches("revoke",!0)&&b.matches("resend",!0)&&b.matches("delete",!0),this.__isOwnInvitationForCurrentStore?d(q||(q=X` <foxy-internal-post-action-control message-options="${0}" infer="revoke" class="flex-1" theme="error" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),JSON.stringify({store_domain:this.__storeDomainGetValue(),store_name:r}),c(null===(n=null===(i=this.data)||void 0===i?void 0:i._links["fx:revoke"])||void 0===n?void 0:n.href),(()=>this.dispatchEvent(new CustomEvent("selfrevoked")))):d(N||(N=X` <foxy-internal-user-invitation-form-async-action infer="revoke" class="flex-1" theme="error" href="${0}"> </foxy-internal-user-invitation-form-async-action> `),c(null===(u=null===(l=this.data)||void 0===l?void 0:l._links["fx:revoke"])||void 0===u?void 0:u.href)),c(null===(f=null===(h=this.data)||void 0===h?void 0:h._links["fx:resend"])||void 0===f?void 0:f.href),c(null!==(v=this.currentUserScope)&&void 0!==v?v:void 0))}__renderUserSnapshotState({status:e,store_name:t}){var r,a,o,i,n,l,u,h,f,v,p;const _=null===(r=this.data)||void 0===r?void 0:r._links,x=this.hiddenSelector,g={"text-primary":"sent"===e,"text-success":"accepted"===e,"text-error":"rejected"===e};return d(z||(z=X` <div class="${0}"> <div class="border-t flex-1"></div> ${0} <div class="border-t flex-1"></div> </div> <foxy-i18n infer="" class="${0}" key="user_status_title" .options="${0}"> </foxy-i18n> <foxy-internal-summary-control infer="store"> <foxy-internal-text-control layout="summary-item" infer="store-domain" .getValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="store-url"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="store-email"> </foxy-internal-text-control> ${0} </foxy-internal-summary-control> <foxy-i18n class="block text-secondary text-center" infer="" key="user_status_text" .options="${0}"> </foxy-i18n> ${0} <div class="grid grid-cols-2 gap-m" ?hidden="${0}"> <foxy-internal-user-invitation-form-async-action theme="error primary" infer="reject" href="${0}"> </foxy-internal-user-invitation-form-async-action> <foxy-internal-user-invitation-form-async-action theme="success primary" infer="accept" href="${0}"> </foxy-internal-user-invitation-form-async-action> </div> <foxy-internal-delete-control infer="delete"></foxy-internal-delete-control> `),y(s({"flex items-center gap-m":!0},g)),m(J||(J=X`<svg style="height: 5rem; width: 5rem" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 256 256"><path fill="currentColor" fill-rule="evenodd" d="M128 250c67.38 0 122-54.62 122-122S195.38 6 128 6 6 60.62 6 128s54.62 122 122 122Zm0 6c70.7 0 128-57.3 128-128S198.7 0 128 0 0 57.3 0 128s57.3 128 128 128Z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M128.5 218a89.5 89.5 0 1 0 0-179 89.5 89.5 0 0 0 0 179Zm23.8-46.25-5.13-3.08-54.48-32.91a3.6 3.6 0 0 1-1.69-3.12V78l5.07 3.02c1.06.6 1.78 1.8 1.78 3.15v46.4l52.75 31.87a3.63 3.63 0 0 1 1.72 3.17l-.01 6.14ZM166 180l-5.17-3.11a3.62 3.62 0 0 1-1.7-3.1v-46.47l-47.64-28.8v25.92l-.02 6.14-5.09-3.09a3.5 3.5 0 0 1-1.71-3.05V92.38a3.6 3.6 0 0 1 1.71-3.09 3.3 3.3 0 0 1 3.44.01l54.47 32.9a3.62 3.62 0 0 1 1.7 3.11v48.47L166 180Zm-46.1-44.34c.53.34 5.2 3.17 5.2 3.17s.04-4.24.04-6.22v-15.57c0-1.32-.68-2.48-1.7-3.1-.5-.31-5.14-3.06-5.14-3.06v21.73c0 1.29.64 2.41 1.6 3.05Zm18.86 11.42-5.17-3.14a3.62 3.62 0 0 1-1.66-3.08v-21.77l5.1 3.07a3.62 3.62 0 0 1 1.75 3.13v15.57l-.02 6.22Zm8.46 5.1 5.15 3.12v-21.78a3.6 3.6 0 0 0-1.8-3.16c-.48-.28-5.06-3.08-5.06-3.08v21.8c0 1.33.7 2.48 1.71 3.1Z" clip-rule="evenodd"/><path fill="currentColor" d="M132.57 222a2.96 2.96 0 0 1 2.96 2.96v15.86a3 3 0 0 1-3 3h-9.95a2.39 2.39 0 1 1 0-4.78h5.15a1.88 1.88 0 0 0 0-3.75h-4.22a2.39 2.39 0 1 1 0-4.77h3.1a3 3 0 0 0 3-3v-2.56a2.96 2.96 0 0 1 2.96-2.96Zm-37.07 6.3c.5-2.37 1.39-4.28 2.66-5.71a9.51 9.51 0 0 1 4.52-2.9c1.75-.5 3.59-.55 5.52-.14a11.1 11.1 0 0 1 5 2.38 9.6 9.6 0 0 1 2.95 4.5c.57 1.83.6 3.93.1 6.29a12.33 12.33 0 0 1-2.65 5.7 9.44 9.44 0 0 1-4.52 2.91c-1.75.51-3.6.56-5.54.14a11.2 11.2 0 0 1-4.98-2.37 9.42 9.42 0 0 1-2.96-4.5 12.25 12.25 0 0 1-.1-6.3Zm5.95 1.27a9.13 9.13 0 0 0-.17 3.34c.14.95.5 1.73 1.06 2.32.56.6 1.31 1 2.27 1.2.96.2 1.82.15 2.58-.17a4.27 4.27 0 0 0 1.91-1.69 9.2 9.2 0 0 0 1.19-3.12c.27-1.28.33-2.4.19-3.35a4.33 4.33 0 0 0-1.07-2.31 4.28 4.28 0 0 0-2.28-1.2 4.24 4.24 0 0 0-2.56.17c-.76.31-1.4.88-1.92 1.68a9.23 9.23 0 0 0-1.2 3.13Zm-15.5 6.41a2.84 2.84 0 0 1-1.67-2.33l-.52-5.52c0-.05-.04-.1-.09-.12a.14.14 0 0 0-.15.02l-4.5 3.3a2.82 2.82 0 1 1-3.29-4.57l4.84-3.4a3 3 0 0 0 1.24-2.87l-.8-5.83a2.85 2.85 0 1 1 5.65-.68l.58 5.7c0 .05.04.1.09.12.05.02.1.01.14-.02l4.63-3.38a2.85 2.85 0 1 1 3.29 4.64l-4.87 3.34a3 3 0 0 0-1.28 2.83l.69 5.84a2.84 2.84 0 0 1-3.98 2.93Zm-16.33-12.59a2.87 2.87 0 1 1-5.67-.91l1.42-7.81a.14.14 0 0 0-.2-.15l-6.99 3.77a2.87 2.87 0 1 1-2.61-5.11l10.27-4.98a3 3 0 0 0 1.12-.94l1.86-2.56a2.94 2.94 0 1 1 4.76 3.46l-1.86 2.56a3 3 0 0 0-.55 1.36l-1.55 11.3Zm-11.39-33.1a2.93 2.93 0 0 1-.22 4.21c-.6.55-1.3.8-2.12.75a2.93 2.93 0 0 1-2.06-1 2.89 2.89 0 0 1-.74-2.11 2.8 2.8 0 0 1 2.35-2.76 3.2 3.2 0 0 1 1.52.09c.5.16.92.43 1.27.82ZM34.2 187.3a2.39 2.39 0 1 1-4.14 2.39l-4.37-7.57a2.39 2.39 0 1 1 4.13-2.38l4.37 7.56Zm14.75-8.52a2.39 2.39 0 0 1-4.13 2.38l-4.37-7.56a2.39 2.39 0 1 1 4.13-2.39l4.37 7.57Zm-21.08 7.13a2.96 2.96 0 0 1 1.09-4.05l13.76-7.95a2.96 2.96 0 0 1 2.96 5.13L31.92 187a2.96 2.96 0 0 1-4.05-1.09Zm-2.9-36.06c2.3-.75 4.4-.94 6.28-.56a9.51 9.51 0 0 1 4.78 2.47 11.27 11.27 0 0 1 2.88 4.71c.61 1.9.76 3.74.44 5.53a9.6 9.6 0 0 1-2.43 4.8c-1.3 1.4-3.1 2.48-5.4 3.23-2.3.75-4.4.94-6.26.56a9.44 9.44 0 0 1-4.78-2.46 11.24 11.24 0 0 1-2.9-4.73 11.2 11.2 0 0 1-.43-5.5 9.42 9.42 0 0 1 2.42-4.81 12.26 12.26 0 0 1 5.4-3.24Zm1.88 5.8c-1.24.4-2.23.9-2.98 1.5a4.2 4.2 0 0 0-1.47 2.09 4.2 4.2 0 0 0 .1 2.57c.3.93.77 1.64 1.43 2.14.64.5 1.45.77 2.41.82.96.05 2.06-.13 3.3-.54 1.25-.4 2.24-.9 3-1.5a4.34 4.34 0 0 0 1.47-2.09 4.3 4.3 0 0 0-.1-2.57 4.24 4.24 0 0 0-1.43-2.14 4.24 4.24 0 0 0-2.42-.82 9.24 9.24 0 0 0-3.3.53Zm3.91-38.41a4.55 4.55 0 0 1-.87 2.28 4.9 4.9 0 0 1-1.87 1.52c-.75.34-1.55.46-2.4.37a4.52 4.52 0 0 1-2.28-.87 4.81 4.81 0 0 1-1.9-4.28 4.72 4.72 0 0 1 5.15-4.17 4.8 4.8 0 0 1 3.8 2.74c.34.75.46 1.55.37 2.41ZM44.58 84.8a2.96 2.96 0 0 1-4.05 1.09L26.8 77.96a3 3 0 0 1-1.1-4.1l4.98-8.62a2.39 2.39 0 1 1 4.13 2.39l-2.58 4.46a1.88 1.88 0 0 0 3.25 1.88l2.1-3.66a2.39 2.39 0 1 1 4.14 2.39l-1.54 2.68a3 3 0 0 0 1.1 4.1l2.21 1.28a2.96 2.96 0 0 1 1.09 4.04Zm13.07-35.26a12.31 12.31 0 0 1 3.62 5.17c.6 1.81.69 3.6.25 5.37a11.27 11.27 0 0 1-2.64 4.85 11.24 11.24 0 0 1-4.56 3.14c-1.72.6-3.5.7-5.37.3a12.34 12.34 0 0 1-5.5-3.06 12.33 12.33 0 0 1-3.62-5.15 9.46 9.46 0 0 1-.25-5.36c.43-1.77 1.31-3.4 2.64-4.87a11.2 11.2 0 0 1 4.56-3.13 9.4 9.4 0 0 1 5.37-.31c1.86.4 3.7 1.43 5.5 3.05Zm-4.07 4.53a9.15 9.15 0 0 0-2.8-1.82 4.18 4.18 0 0 0-2.55-.24 4.2 4.2 0 0 0-2.17 1.37 4.24 4.24 0 0 0-1.14 2.31c-.1.8.06 1.64.5 2.5a9.33 9.33 0 0 0 2.11 2.6c.97.87 1.9 1.48 2.8 1.83.9.34 1.75.42 2.54.24a4.3 4.3 0 0 0 2.18-1.38 4.24 4.24 0 0 0 1.14-2.3c.1-.82-.06-1.65-.5-2.5a9.24 9.24 0 0 0-2.11-2.61Zm2.2-16.63c.83-.6 1.92-.7 2.85-.28l5.04 2.3a.15.15 0 0 0 .2-.15l-.6-5.55a2.82 2.82 0 1 1 5.6-.56l.53 5.89a3 3 0 0 0 1.86 2.5l5.45 2.23a2.85 2.85 0 1 1-2.24 5.24l-5.22-2.35a.15.15 0 0 0-.2.15l.61 5.7a2.85 2.85 0 1 1-5.66.52l-.46-5.88a3 3 0 0 0-1.8-2.52l-5.42-2.33a2.84 2.84 0 0 1-.54-4.9Zm19.07-7.84a2.87 2.87 0 1 1 3.62-4.47l6.06 5.14a.14.14 0 0 0 .22-.1l.23-7.93a2.87 2.87 0 1 1 5.74.29l-.83 11.38a3 3 0 0 0 .25 1.44l1.29 2.9a2.94 2.94 0 1 1-5.37 2.39l-1.3-2.9a3 3 0 0 0-.9-1.14l-9.01-7Zm34.35 6.68a2.93 2.93 0 0 1-3.53-2.3 2.78 2.78 0 0 1 .41-2.2 2.93 2.93 0 0 1 1.9-1.3 2.9 2.9 0 0 1 2.2.42 2.8 2.8 0 0 1 1.21 3.41c-.18.5-.46.93-.84 1.28-.38.35-.83.58-1.34.7Zm14.61-19.33a2.39 2.39 0 0 1 0-4.77h8.74a2.39 2.39 0 0 1 0 4.77h-8.74Zm0 17.05a2.39 2.39 0 0 1 0-4.77h8.74a2.39 2.39 0 0 1 0 4.77h-8.74Zm4.37-21.82a2.96 2.96 0 0 1 2.97 2.96v15.9a2.96 2.96 0 0 1-5.93 0v-15.9a2.96 2.96 0 0 1 2.96-2.96Zm32.68 15.52a12.24 12.24 0 0 1-2.66 5.71 9.5 9.5 0 0 1-4.53 2.9c-1.74.5-3.58.55-5.52.14a11.24 11.24 0 0 1-5-2.38 9.6 9.6 0 0 1-2.94-4.5 12.4 12.4 0 0 1-.1-6.29c.5-2.37 1.38-4.28 2.65-5.7a9.44 9.44 0 0 1 4.51-2.91c1.75-.51 3.6-.56 5.54-.14 1.94.4 3.6 1.2 4.99 2.37a9.42 9.42 0 0 1 2.95 4.5c.58 1.82.62 3.92.11 6.3Zm-5.96-1.27c.27-1.28.33-2.4.18-3.34a4.18 4.18 0 0 0-1.07-2.32 4.2 4.2 0 0 0-2.27-1.2 4.24 4.24 0 0 0-2.57.17c-.75.31-1.39.88-1.92 1.69a9.2 9.2 0 0 0-1.18 3.12 9.4 9.4 0 0 0-.2 3.35 4.4 4.4 0 0 0 1.07 2.31c.57.6 1.33 1 2.29 1.2.96.2 1.8.15 2.56-.17.75-.31 1.4-.88 1.91-1.68.53-.81.93-1.85 1.2-3.13Zm31.3 22.59a4.54 4.54 0 0 1-1.53-1.9 4.9 4.9 0 0 1-.38-2.38 4.5 4.5 0 0 1 .88-2.27c.5-.7 1.14-1.21 1.89-1.54a4.81 4.81 0 0 1 4.65.5 4.72 4.72 0 0 1 1.04 6.55 4.8 4.8 0 0 1-4.27 1.91 4.51 4.51 0 0 1-2.28-.87Zm21.19 28.18a2.96 2.96 0 0 1 1.08-4.05l13.73-7.93a3 3 0 0 1 4.1 1.1l4.98 8.62a2.39 2.39 0 0 1-4.13 2.39l-2.58-4.47a1.87 1.87 0 1 0-3.25 1.88l2.11 3.65a2.39 2.39 0 1 1-4.13 2.39l-1.55-2.68a3 3 0 0 0-4.1-1.1l-2.22 1.28a2.96 2.96 0 0 1-4.04-1.08Zm24 28.95c-2.31.75-4.4.94-6.29.56a9.5 9.5 0 0 1-4.78-2.47 11.26 11.26 0 0 1-2.87-4.71c-.61-1.9-.76-3.74-.44-5.53a9.6 9.6 0 0 1 2.43-4.8 12.5 12.5 0 0 1 5.39-3.23c2.31-.75 4.4-.94 6.27-.56a9.44 9.44 0 0 1 4.78 2.46 11.23 11.23 0 0 1 2.89 4.73c.6 1.88.75 3.71.43 5.5a9.43 9.43 0 0 1-2.41 4.81 12.26 12.26 0 0 1-5.4 3.24Zm-1.89-5.8c1.25-.4 2.24-.9 2.98-1.5a4.17 4.17 0 0 0 1.48-2.09 4.2 4.2 0 0 0-.1-2.57 4.25 4.25 0 0 0-1.43-2.14 4.27 4.27 0 0 0-2.42-.82 9.32 9.32 0 0 0-3.3.54c-1.24.4-2.24.9-2.99 1.5a4.34 4.34 0 0 0-1.47 2.09 4.3 4.3 0 0 0 .1 2.57c.3.93.78 1.65 1.43 2.14.65.5 1.46.77 2.41.82.97.05 2.07-.13 3.31-.53Zm13.3 10.23a2.84 2.84 0 0 1-1.18 2.61l-4.52 3.21a.15.15 0 0 0-.06.14c.01.05.04.1.1.12l5.1 2.24a2.82 2.82 0 1 1-2.31 5.14l-5.37-2.48a3 3 0 0 0-3.1.35l-4.65 3.61a2.85 2.85 0 1 1-3.41-4.56l4.64-3.35a.15.15 0 0 0 .06-.13c0-.06-.04-.1-.08-.12l-5.25-2.31a2.84 2.84 0 1 1 2.38-5.17l5.32 2.54a3 3 0 0 0 3.1-.3l4.71-3.52a2.84 2.84 0 0 1 4.52 1.98Zm-2.74 20.44a2.87 2.87 0 1 1 2.06 5.36l-7.48 2.68a.13.13 0 0 0-.1.11c0 .06.03.1.07.13l6.76 4.17a2.87 2.87 0 1 1-3.12 4.83l-9.45-6.42a3 3 0 0 0-1.37-.5l-3.15-.33a2.94 2.94 0 0 1 .62-5.85l3.14.33a3 3 0 0 0 1.45-.2l10.57-4.31Zm-22.96 26.41a2.93 2.93 0 0 1 3.75-1.92 2.8 2.8 0 0 1 1.71 1.47c.37.74.42 1.5.17 2.28-.24.74-.73 1.3-1.46 1.7a2.8 2.8 0 0 1-3.56-.66c-.34-.4-.57-.85-.7-1.36-.1-.5-.08-1.01.09-1.51Zm9.43 22.32a2.39 2.39 0 1 1 4.13 2.38l-4.37 7.57a2.39 2.39 0 1 1-4.13-2.39l4.37-7.56Zm-14.77-8.53a2.39 2.39 0 1 1 4.14 2.39l-4.37 7.56a2.39 2.39 0 0 1-4.13-2.38l4.36-7.57Zm16.72 14.7a2.96 2.96 0 0 1-4.05 1.08l-13.76-7.95a2.96 2.96 0 1 1 2.96-5.13l13.76 7.95a2.96 2.96 0 0 1 1.09 4.04Zm-29.78 20.54a12.3 12.3 0 0 1-3.62-5.17 9.5 9.5 0 0 1-.25-5.37 11.27 11.27 0 0 1 2.64-4.85 11.25 11.25 0 0 1 4.57-3.14 9.6 9.6 0 0 1 5.37-.3c1.87.43 3.7 1.44 5.5 3.06a12.33 12.33 0 0 1 3.61 5.15c.61 1.82.7 3.6.26 5.36a11.24 11.24 0 0 1-2.65 4.87 11.2 11.2 0 0 1-4.55 3.13 9.4 9.4 0 0 1-5.37.31 12.26 12.26 0 0 1-5.5-3.05Zm4.08-4.53c.97.88 1.9 1.48 2.8 1.82.9.35 1.75.43 2.54.24a4.2 4.2 0 0 0 2.18-1.37 4.24 4.24 0 0 0 1.14-2.31c.1-.8-.07-1.64-.5-2.5a9.33 9.33 0 0 0-2.12-2.6 9.4 9.4 0 0 0-2.8-1.83 4.34 4.34 0 0 0-2.54-.24c-.8.2-1.52.66-2.17 1.39a4.24 4.24 0 0 0-1.14 2.3c-.1.81.06 1.64.5 2.5a9.21 9.21 0 0 0 2.11 2.6Zm-35.21 15.81a4.54 4.54 0 0 1 2.4-.38c.83.1 1.58.39 2.25.86a4.55 4.55 0 0 1 1.54 1.9c.35.79.48 1.6.38 2.4a4.81 4.81 0 0 1-2.76 3.79 4.73 4.73 0 0 1-6.19-2.38 4.81 4.81 0 0 1 .48-4.66 4.51 4.51 0 0 1 1.9-1.53Z"/></svg>`)),y(s({"block text-center text-xl font-medium":!0},g)),{context:e,store_name:t},this.__storeDomainGetValue,"accepted"===e&&this.getStorePageHref&&this.data?d(K||(K=X` <div ?hidden="${0}"> <a class="text-primary font-medium cursor-pointer rounded transition-opacity hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="" key="store_link"></foxy-i18n> </a> </div> `),"accepted"!==e||!this.getStorePageHref,this.getStorePageHref(this.data._links["fx:store"].href)):"",{context:e,store_name:t},this.__isOwnInvitationForCurrentStore?d(Q||(Q=X` <foxy-internal-post-action-control message-options="${0}" infer="leave" class="flex-1" theme="error" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),JSON.stringify({store_domain:this.__storeDomainGetValue(),store_name:t}),c(null!==(o=null===(a=null==_?void 0:_["fx:revoke"])||void 0===a?void 0:a.href)&&void 0!==o?o:null===(i=null==_?void 0:_["fx:reject"])||void 0===i?void 0:i.href),(()=>this.dispatchEvent(new CustomEvent("selfrevoked")))):d(W||(W=X` <foxy-internal-user-invitation-form-async-action theme="error" class="flex-1" infer="leave" href="${0}"> </foxy-internal-user-invitation-form-async-action> `),c(null!==(l=null===(n=null==_?void 0:_["fx:revoke"])||void 0===n?void 0:n.href)&&void 0!==l?l:null===(u=null==_?void 0:_["fx:reject"])||void 0===u?void 0:u.href)),x.matches("reject",!0)&&x.matches("accept",!0),c(null===(f=null===(h=this.data)||void 0===h?void 0:h._links["fx:reject"])||void 0===f?void 0:f.href),c(null===(p=null===(v=this.data)||void 0===v?void 0:v._links["fx:accept"])||void 0===p?void 0:p.href))}}customElements.define("foxy-user-invitation-form",ee);export{ee as UserInvitationForm};
@@ -1 +1 @@
1
- import"./shared-a8ae24f0.js";import"./foxy-form-dialog.js";import"./foxy-user-form.js";import"./foxy-spinner.js";import"./shared-c066b7fd.js";import{s as e,h as s}from"./shared-ba5c42c7.js";import{T as r}from"./shared-1e9df11c.js";import{a}from"./shared-5b8c7250.js";import"./shared-dc6e5879.js";import"./shared-f410644a.js";import"./shared-f77994ad.js";import"./shared-760a2243.js";import"./shared-8f9014ff.js";import"./shared-cb5305b9.js";import"./shared-69c98b7b.js";import"./shared-336e73ce.js";import"./shared-53e42a77.js";import"./shared-da3393a5.js";import"./shared-930e68b7.js";import"./shared-4e709717.js";import"./shared-cd96ff03.js";import"./shared-53e476fd.js";import"./shared-3eca56ee.js";import"./shared-45649d84.js";import"./shared-5212ef4f.js";import"./shared-50ef1d5a.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-59dfee2c.js";import"./shared-affe06c0.js";import"./shared-c59277a4.js";import"./shared-c3d6bcc0.js";import"./shared-cfc6735e.js";import"./shared-7b6a899b.js";import"./shared-53a5212e.js";import"./shared-c56c3e1e.js";import"./shared-28cc8aa1.js";import"./shared-e9f51baa.js";import"./shared-d0aed1c1.js";import"./shared-be20875c.js";import"./foxy-copy-to-clipboard.js";import"./shared-cf1965cb.js";import"./shared-bab2ea2c.js";import"./shared-b738ee96.js";import"./foxy-nucleon-element.js";let t,o,d,i,l=e=>e;const n=[{property:"is_merchant",icon:e(t||(t=l`<svg class="fill-current h-full w-full" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M22.8961 8.89L21.7932 4.52C21.5622 3.62 20.7429 3 19.7871 3H5.1979C4.25259 3 3.42283 3.63 3.20225 4.52L2.0994 8.89C1.84732 9.91 2.07839 10.95 2.75061 11.77C2.83464 11.88 2.95017 11.96 3.0447 12.06V19C3.0447 20.1 3.99001 21 5.14538 21H19.8501C21.0055 21 21.9508 20.1 21.9508 19V12.06C22.0453 11.97 22.1609 11.88 22.2449 11.78C22.9171 10.96 23.1587 9.91 22.8961 8.89ZM19.7556 4.99L20.8584 9.36C20.9635 9.78 20.8689 10.2 20.5958 10.53C20.4488 10.71 20.1337 11 19.6085 11C18.9678 11 18.4111 10.51 18.3376 9.86L17.7284 5L19.7556 4.99ZM13.5481 5H15.6067L16.1739 9.52C16.2264 9.91 16.1004 10.3 15.8273 10.59C15.5962 10.85 15.2601 11 14.8295 11C14.1258 11 13.5481 10.41 13.5481 9.69V5ZM8.81106 9.52L9.38874 5H11.4474V9.69C11.4474 10.41 10.8697 11 10.0925 11C9.73536 11 9.40975 10.85 9.15767 10.59C8.89509 10.3 8.76905 9.91 8.81106 9.52ZM4.13705 9.36L5.1979 5H7.26706L6.65787 9.86C6.57384 10.51 6.02766 11 5.38696 11C4.87229 11 4.54669 10.71 4.41014 10.53C4.12655 10.21 4.03202 9.78 4.13705 9.36ZM5.14538 19V12.97C5.22941 12.98 5.30293 13 5.38696 13C6.30075 13 7.13052 12.64 7.73971 12.05C8.36992 12.65 9.21019 13 10.166 13C11.0798 13 11.8991 12.64 12.5082 12.07C13.1279 12.64 13.9682 13 14.9135 13C15.7958 13 16.6361 12.65 17.2663 12.05C17.8755 12.64 18.7052 13 19.619 13C19.7031 13 19.7766 12.98 19.8606 12.97V19H5.14538Z" /></svg>`)),key:"merchant"},{property:"is_programmer",icon:e(o||(o=l`<svg class="fill-current h-full w-full" viewBox="0 0 20 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M0 3C0 1.34315 1.34315 0 3 0H17C18.6569 0 20 1.34315 20 3V15C20 16.6569 18.6569 18 17 18H3C1.34315 18 0 16.6569 0 15V3ZM3 2C2.44772 2 2 2.44772 2 3V15C2 15.5523 2.44772 16 3 16H17C17.5523 16 18 15.5523 18 15V3C18 2.44772 17.5523 2 17 2H3ZM4.29289 4.29289C4.68342 3.90237 5.31658 3.90237 5.70711 4.29289L9.70711 8.29289C9.89464 8.48043 10 8.73478 10 9C10 9.26522 9.89464 9.51957 9.70711 9.70711L5.70711 13.7071C5.31658 14.0976 4.68342 14.0976 4.29289 13.7071C3.90237 13.3166 3.90237 12.6834 4.29289 12.2929L7.58579 9L4.29289 5.70711C3.90237 5.31658 3.90237 4.68342 4.29289 4.29289ZM9 13C9 12.4477 9.44771 12 10 12H15C15.5523 12 16 12.4477 16 13C16 13.5523 15.5523 14 15 14H10C9.44771 14 9 13.5523 9 13Z"/></svg>`)),key:"backend_developer"},{property:"is_front_end_developer",icon:e(d||(d=l`<svg class="fill-current h-full w-full" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M14.2747 4.03847C14.8058 4.1902 15.1132 4.74368 14.9615 5.27472L10.9615 19.2747C10.8098 19.8058 10.2563 20.1132 9.72528 19.9615C9.19424 19.8098 8.88675 19.2563 9.03848 18.7253L13.0385 4.72528C13.1902 4.19424 13.7437 3.88675 14.2747 4.03847ZM6.70711 7.29289C7.09763 7.68342 7.09763 8.31658 6.70711 8.7071L3.41421 12L6.70711 15.2929C7.09763 15.6834 7.09763 16.3166 6.70711 16.7071C6.31658 17.0976 5.68342 17.0976 5.29289 16.7071L1.29289 12.7071C0.902369 12.3166 0.902369 11.6834 1.29289 11.2929L5.29289 7.29289C5.68342 6.90237 6.31658 6.90237 6.70711 7.29289ZM17.2929 7.29289C17.6834 6.90237 18.3166 6.90237 18.7071 7.29289L22.7071 11.2929C22.8946 11.4804 23 11.7348 23 12C23 12.2652 22.8946 12.5196 22.7071 12.7071L18.7071 16.7071C18.3166 17.0976 17.6834 17.0976 17.2929 16.7071C16.9024 16.3166 16.9024 15.6834 17.2929 15.2929L20.5858 12L17.2929 8.70711C16.9024 8.31658 16.9024 7.68342 17.2929 7.29289Z" /></svg>`)),key:"frontend_developer"},{property:"is_designer",icon:e(i||(i=l`<svg class="fill-current h-full w-full" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10 20C4.49 20 0 15.51 0 10C0 4.49 4.49 0 10 0C15.51 0 20 4.04 20 9C20 12.31 17.31 15 14 15H12.23C11.95 15 11.73 15.22 11.73 15.5C11.73 15.62 11.78 15.73 11.86 15.83C12.27 16.3 12.5 16.89 12.5 17.5C12.5 18.88 11.38 20 10 20ZM10 2C5.59 2 2 5.59 2 10C2 14.41 5.59 18 10 18C10.28 18 10.5 17.78 10.5 17.5C10.5 17.34 10.42 17.22 10.36 17.15C9.95 16.69 9.73 16.1 9.73 15.5C9.73 14.12 10.85 13 12.23 13H14C16.21 13 18 11.21 18 9C18 5.14 14.41 2 10 2Z" /><path d="M4.5 11C5.32843 11 6 10.3284 6 9.5C6 8.67157 5.32843 8 4.5 8C3.67157 8 3 8.67157 3 9.5C3 10.3284 3.67157 11 4.5 11Z" /><path d="M7.5 7C8.32843 7 9 6.32843 9 5.5C9 4.67157 8.32843 4 7.5 4C6.67157 4 6 4.67157 6 5.5C6 6.32843 6.67157 7 7.5 7Z" /><path d="M12.5 7C13.3284 7 14 6.32843 14 5.5C14 4.67157 13.3284 4 12.5 4C11.6716 4 11 4.67157 11 5.5C11 6.32843 11.6716 7 12.5 7Z" /><path d="M15.5 11C16.3284 11 17 10.3284 17 9.5C17 8.67157 16.3284 8 15.5 8C14.6716 8 14 8.67157 14 9.5C14 10.3284 14.6716 11 15.5 11Z" /></svg>`)),key:"designer"}];let m,C,p,c,f,h,j,u=e=>e;class g extends(a(r,"users-table")){constructor(){super(...arguments),this.columns=[g.nameColumn,g.emailColumn,g.rolesColumn,g.lastUpdatedColumn,g.actionsColumn]}render(){return s(m||(m=u` <foxy-form-dialog .currentUserScope="${0}" parent="${0}" form="foxy-user-form" lang="${0}" ns="${0}" id="form"> </foxy-form-dialog> ${0} `),this.currentUserScope,this.href,this.lang,this.ns,super.render())}}g.nameColumn={cell:e=>s(C||(C=u` <span data-testclass="name" class="text-m font-medium"> ${0} ${0} </span> `),e.data.first_name,e.data.last_name)},g.emailColumn={hideBelow:"md",cell:e=>s(p||(p=u` <span data-testclass="email" class="text-m text-secondary">${0}</span> `),e.data.email)},g.rolesColumn={cell:e=>s(c||(c=u` <div data-testclass="roles" class="flex space-x-s"> ${0} </div> `),["is_merchant","is_programmer","is_front_end_developer","is_designer"].map((r=>s(f||(f=u` <div class="${0}" style="width:1rem;height:1rem"> ${0} </div> `),e.data[r]?"":"text-disabled",n.find((e=>e.property===r)).icon))))},g.lastUpdatedColumn={hideBelow:"lg",cell:e=>s(h||(h=u` <span data-testclass="lastUpdated" class="text-m text-secondary font-tnum"> <foxy-i18n options="${0}" lang="${0}" key="date" ns="${0}"> </foxy-i18n> <foxy-i18n options="${0}" lang="${0}" key="time" ns="${0}"> </foxy-i18n> </span> `),JSON.stringify({value:e.data.date_modified}),e.lang,e.ns,JSON.stringify({value:e.data.date_modified}),e.lang,e.ns)},g.actionsColumn={cell:e=>s(j||(j=u` <vaadin-button data-testclass="actions" theme="tertiary small" @click="${0}"> <foxy-i18n lang="${0}" key="update" ns="${0}"></foxy-i18n> </vaadin-button> `),(s=>{const r=s.target,a=r.getRootNode().querySelector("#form");a.href=e.data._links.self.href,a.show(r)}),e.lang,e.ns)},customElements.define("foxy-users-table",g);export{g as UsersTable};
1
+ import"./shared-a8ae24f0.js";import"./foxy-form-dialog.js";import"./foxy-user-form.js";import"./foxy-spinner.js";import"./shared-c066b7fd.js";import{s as e,h as s}from"./shared-ba5c42c7.js";import{T as r}from"./shared-3ef23488.js";import{a}from"./shared-5b8c7250.js";import"./shared-dc6e5879.js";import"./shared-f410644a.js";import"./shared-f77994ad.js";import"./shared-cda51ccf.js";import"./shared-8f9014ff.js";import"./shared-41f93e6c.js";import"./shared-69c98b7b.js";import"./shared-222b23bb.js";import"./shared-53e42a77.js";import"./shared-87e17c02.js";import"./shared-930e68b7.js";import"./shared-4e709717.js";import"./shared-cd96ff03.js";import"./shared-53e476fd.js";import"./shared-8be109a9.js";import"./shared-4ab85bea.js";import"./shared-5212ef4f.js";import"./shared-c85c1864.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-7b15217c.js";import"./shared-affe06c0.js";import"./shared-c59277a4.js";import"./shared-c3d6bcc0.js";import"./shared-cfc6735e.js";import"./shared-091e97f3.js";import"./shared-53a5212e.js";import"./shared-c56c3e1e.js";import"./shared-28cc8aa1.js";import"./shared-e9f51baa.js";import"./shared-d0aed1c1.js";import"./shared-9b290320.js";import"./foxy-copy-to-clipboard.js";import"./shared-cf1965cb.js";import"./shared-bab2ea2c.js";import"./shared-b738ee96.js";import"./foxy-nucleon-element.js";let t,o,d,i,l=e=>e;const n=[{property:"is_merchant",icon:e(t||(t=l`<svg class="fill-current h-full w-full" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M22.8961 8.89L21.7932 4.52C21.5622 3.62 20.7429 3 19.7871 3H5.1979C4.25259 3 3.42283 3.63 3.20225 4.52L2.0994 8.89C1.84732 9.91 2.07839 10.95 2.75061 11.77C2.83464 11.88 2.95017 11.96 3.0447 12.06V19C3.0447 20.1 3.99001 21 5.14538 21H19.8501C21.0055 21 21.9508 20.1 21.9508 19V12.06C22.0453 11.97 22.1609 11.88 22.2449 11.78C22.9171 10.96 23.1587 9.91 22.8961 8.89ZM19.7556 4.99L20.8584 9.36C20.9635 9.78 20.8689 10.2 20.5958 10.53C20.4488 10.71 20.1337 11 19.6085 11C18.9678 11 18.4111 10.51 18.3376 9.86L17.7284 5L19.7556 4.99ZM13.5481 5H15.6067L16.1739 9.52C16.2264 9.91 16.1004 10.3 15.8273 10.59C15.5962 10.85 15.2601 11 14.8295 11C14.1258 11 13.5481 10.41 13.5481 9.69V5ZM8.81106 9.52L9.38874 5H11.4474V9.69C11.4474 10.41 10.8697 11 10.0925 11C9.73536 11 9.40975 10.85 9.15767 10.59C8.89509 10.3 8.76905 9.91 8.81106 9.52ZM4.13705 9.36L5.1979 5H7.26706L6.65787 9.86C6.57384 10.51 6.02766 11 5.38696 11C4.87229 11 4.54669 10.71 4.41014 10.53C4.12655 10.21 4.03202 9.78 4.13705 9.36ZM5.14538 19V12.97C5.22941 12.98 5.30293 13 5.38696 13C6.30075 13 7.13052 12.64 7.73971 12.05C8.36992 12.65 9.21019 13 10.166 13C11.0798 13 11.8991 12.64 12.5082 12.07C13.1279 12.64 13.9682 13 14.9135 13C15.7958 13 16.6361 12.65 17.2663 12.05C17.8755 12.64 18.7052 13 19.619 13C19.7031 13 19.7766 12.98 19.8606 12.97V19H5.14538Z" /></svg>`)),key:"merchant"},{property:"is_programmer",icon:e(o||(o=l`<svg class="fill-current h-full w-full" viewBox="0 0 20 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M0 3C0 1.34315 1.34315 0 3 0H17C18.6569 0 20 1.34315 20 3V15C20 16.6569 18.6569 18 17 18H3C1.34315 18 0 16.6569 0 15V3ZM3 2C2.44772 2 2 2.44772 2 3V15C2 15.5523 2.44772 16 3 16H17C17.5523 16 18 15.5523 18 15V3C18 2.44772 17.5523 2 17 2H3ZM4.29289 4.29289C4.68342 3.90237 5.31658 3.90237 5.70711 4.29289L9.70711 8.29289C9.89464 8.48043 10 8.73478 10 9C10 9.26522 9.89464 9.51957 9.70711 9.70711L5.70711 13.7071C5.31658 14.0976 4.68342 14.0976 4.29289 13.7071C3.90237 13.3166 3.90237 12.6834 4.29289 12.2929L7.58579 9L4.29289 5.70711C3.90237 5.31658 3.90237 4.68342 4.29289 4.29289ZM9 13C9 12.4477 9.44771 12 10 12H15C15.5523 12 16 12.4477 16 13C16 13.5523 15.5523 14 15 14H10C9.44771 14 9 13.5523 9 13Z"/></svg>`)),key:"backend_developer"},{property:"is_front_end_developer",icon:e(d||(d=l`<svg class="fill-current h-full w-full" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M14.2747 4.03847C14.8058 4.1902 15.1132 4.74368 14.9615 5.27472L10.9615 19.2747C10.8098 19.8058 10.2563 20.1132 9.72528 19.9615C9.19424 19.8098 8.88675 19.2563 9.03848 18.7253L13.0385 4.72528C13.1902 4.19424 13.7437 3.88675 14.2747 4.03847ZM6.70711 7.29289C7.09763 7.68342 7.09763 8.31658 6.70711 8.7071L3.41421 12L6.70711 15.2929C7.09763 15.6834 7.09763 16.3166 6.70711 16.7071C6.31658 17.0976 5.68342 17.0976 5.29289 16.7071L1.29289 12.7071C0.902369 12.3166 0.902369 11.6834 1.29289 11.2929L5.29289 7.29289C5.68342 6.90237 6.31658 6.90237 6.70711 7.29289ZM17.2929 7.29289C17.6834 6.90237 18.3166 6.90237 18.7071 7.29289L22.7071 11.2929C22.8946 11.4804 23 11.7348 23 12C23 12.2652 22.8946 12.5196 22.7071 12.7071L18.7071 16.7071C18.3166 17.0976 17.6834 17.0976 17.2929 16.7071C16.9024 16.3166 16.9024 15.6834 17.2929 15.2929L20.5858 12L17.2929 8.70711C16.9024 8.31658 16.9024 7.68342 17.2929 7.29289Z" /></svg>`)),key:"frontend_developer"},{property:"is_designer",icon:e(i||(i=l`<svg class="fill-current h-full w-full" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10 20C4.49 20 0 15.51 0 10C0 4.49 4.49 0 10 0C15.51 0 20 4.04 20 9C20 12.31 17.31 15 14 15H12.23C11.95 15 11.73 15.22 11.73 15.5C11.73 15.62 11.78 15.73 11.86 15.83C12.27 16.3 12.5 16.89 12.5 17.5C12.5 18.88 11.38 20 10 20ZM10 2C5.59 2 2 5.59 2 10C2 14.41 5.59 18 10 18C10.28 18 10.5 17.78 10.5 17.5C10.5 17.34 10.42 17.22 10.36 17.15C9.95 16.69 9.73 16.1 9.73 15.5C9.73 14.12 10.85 13 12.23 13H14C16.21 13 18 11.21 18 9C18 5.14 14.41 2 10 2Z" /><path d="M4.5 11C5.32843 11 6 10.3284 6 9.5C6 8.67157 5.32843 8 4.5 8C3.67157 8 3 8.67157 3 9.5C3 10.3284 3.67157 11 4.5 11Z" /><path d="M7.5 7C8.32843 7 9 6.32843 9 5.5C9 4.67157 8.32843 4 7.5 4C6.67157 4 6 4.67157 6 5.5C6 6.32843 6.67157 7 7.5 7Z" /><path d="M12.5 7C13.3284 7 14 6.32843 14 5.5C14 4.67157 13.3284 4 12.5 4C11.6716 4 11 4.67157 11 5.5C11 6.32843 11.6716 7 12.5 7Z" /><path d="M15.5 11C16.3284 11 17 10.3284 17 9.5C17 8.67157 16.3284 8 15.5 8C14.6716 8 14 8.67157 14 9.5C14 10.3284 14.6716 11 15.5 11Z" /></svg>`)),key:"designer"}];let m,C,p,c,f,h,j,u=e=>e;class g extends(a(r,"users-table")){constructor(){super(...arguments),this.columns=[g.nameColumn,g.emailColumn,g.rolesColumn,g.lastUpdatedColumn,g.actionsColumn]}render(){return s(m||(m=u` <foxy-form-dialog .currentUserScope="${0}" parent="${0}" form="foxy-user-form" lang="${0}" ns="${0}" id="form"> </foxy-form-dialog> ${0} `),this.currentUserScope,this.href,this.lang,this.ns,super.render())}}g.nameColumn={cell:e=>s(C||(C=u` <span data-testclass="name" class="text-m font-medium"> ${0} ${0} </span> `),e.data.first_name,e.data.last_name)},g.emailColumn={hideBelow:"md",cell:e=>s(p||(p=u` <span data-testclass="email" class="text-m text-secondary">${0}</span> `),e.data.email)},g.rolesColumn={cell:e=>s(c||(c=u` <div data-testclass="roles" class="flex space-x-s"> ${0} </div> `),["is_merchant","is_programmer","is_front_end_developer","is_designer"].map((r=>s(f||(f=u` <div class="${0}" style="width:1rem;height:1rem"> ${0} </div> `),e.data[r]?"":"text-disabled",n.find((e=>e.property===r)).icon))))},g.lastUpdatedColumn={hideBelow:"lg",cell:e=>s(h||(h=u` <span data-testclass="lastUpdated" class="text-m text-secondary font-tnum"> <foxy-i18n options="${0}" lang="${0}" key="date" ns="${0}"> </foxy-i18n> <foxy-i18n options="${0}" lang="${0}" key="time" ns="${0}"> </foxy-i18n> </span> `),JSON.stringify({value:e.data.date_modified}),e.lang,e.ns,JSON.stringify({value:e.data.date_modified}),e.lang,e.ns)},g.actionsColumn={cell:e=>s(j||(j=u` <vaadin-button data-testclass="actions" theme="tertiary small" @click="${0}"> <foxy-i18n lang="${0}" key="update" ns="${0}"></foxy-i18n> </vaadin-button> `),(s=>{const r=s.target,a=r.getRootNode().querySelector("#form");a.href=e.data._links.self.href,a.show(r)}),e.lang,e.ns)},customElements.define("foxy-users-table",g);export{g as UsersTable};
@@ -1 +1 @@
1
- import"./shared-559b648a.js";import"./foxy-nucleon-element.js";import"./shared-c066b7fd.js";import{_ as s}from"./shared-8f9014ff.js";import{C as e}from"./shared-336e73ce.js";import{a as t}from"./shared-5b8c7250.js";import{g as r}from"./shared-bab2ea2c.js";import{c as a}from"./shared-da3393a5.js";import{I as o}from"./shared-20841d9c.js";import{i}from"./shared-53e42a77.js";import{c as d}from"./shared-4e709717.js";import{h as n}from"./shared-ba5c42c7.js";import"./foxy-spinner.js";import"./shared-c59277a4.js";import"./shared-c3d6bcc0.js";import"./shared-f410644a.js";import"./shared-cf1965cb.js";import"./shared-930e68b7.js";import"./shared-50ef1d5a.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";let c,l,u,p,h=s=>s;class m extends(e(t(o,"webhook-card"))){constructor(){super(...arguments),this.resourceUri=null}static get properties(){return s(s({},super.properties),{},{resourceUri:{attribute:"resource-uri"}})}get scopeCollection(){return"webhooks"}get isBodyReady(){var s;return(!!(null===(s=this.__statusesLoader)||void 0===s?void 0:s.data)||!this.__canReadStatuses)&&super.isBodyReady}renderBody(){var s,e,t,a,o,m,f,v,j,x,y;const _=this.__canReadStatuses;let b;try{const a=new URL(null!==(e=null===(s=this.data)||void 0===s?void 0:s._links["fx:statuses"].href)&&void 0!==e?e:"");a.searchParams.set("order","date_created desc"),a.searchParams.set("limit","1");const o=r(null!==(t=this.resourceUri)&&void 0!==t?t:"");null!==o&&a.searchParams.set("resource_id",String(o)),b=a.toString()}catch(s){b=void 0}const g=null===(o=null===(a=this.__statusesLoader)||void 0===a?void 0:a.data)||void 0===o?void 0:o._embedded["fx:webhook_statuses"],$=null==g?void 0:g[0],S=g?null!==(m=null==$?void 0:$.status)&&void 0!==m?m:"none":"loading",k=!!(null===(f=this.data)||void 0===f?void 0:f.is_active),w=null!==(j=null===(v=this.data)||void 0===v?void 0:v.event_resource)&&void 0!==j?j:"";return n(c||(c=h` <div class="grid grid-cols-1 leading-s -my-xs"> <p class="flex items-center gap-s justify-between"> <span class="text-m truncate text-body font-medium"> ${0}&ZeroWidthSpace; </span> <span class="text-s text-tertiary"> <foxy-i18n class="${0}" infer="" key="is_active_${0}"> </foxy-i18n> </span> </p> <p class="text-s truncate text-secondary">${0}&ZeroWidthSpace;</p> <p class="text-s truncate text-tertiary"> ${0} ${0} </p> </div> <foxy-nucleon class="hidden" infer="" href="${0}" id="statusesLoader" @update="${0}"> </foxy-nucleon> `),null===(x=this.data)||void 0===x?void 0:x.name,d({"text-success":k}),k,null===(y=this.data)||void 0===y?void 0:y.url,this.resourceUri?"":n(_?l||(l=h`<span class="capitalize">${0}</span> &bull;`):u||(u=h`<span class="capitalize">${0}</span>`),w.replace(/_/g," ")),_?n(p||(p=h` <foxy-i18n class="${0}" infer="" key="status_${0}" .options="${0}"> </foxy-i18n> `),d({"text-error":k&&"failed"===S}),S,$):"",i(_?b:void 0),(()=>this.requestUpdate()))}get __canReadStatuses(){return a(this.currentUserScope,"webhooks")}get __statusesLoader(){return this.renderRoot.querySelector("#statusesLoader")}}customElements.define("foxy-webhook-card",m);export{m as WebhookCard};
1
+ import"./shared-0996f4d0.js";import"./foxy-nucleon-element.js";import"./shared-c066b7fd.js";import{_ as s}from"./shared-8f9014ff.js";import{C as e}from"./shared-222b23bb.js";import{a as t}from"./shared-5b8c7250.js";import{g as r}from"./shared-bab2ea2c.js";import{c as a}from"./shared-87e17c02.js";import{I as o}from"./shared-56278a3c.js";import{i}from"./shared-53e42a77.js";import{c as d}from"./shared-4e709717.js";import{h as c}from"./shared-ba5c42c7.js";import"./foxy-spinner.js";import"./shared-c59277a4.js";import"./shared-c3d6bcc0.js";import"./shared-f410644a.js";import"./shared-cf1965cb.js";import"./shared-930e68b7.js";import"./shared-c85c1864.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";let n,l,u,p,h=s=>s;class m extends(e(t(o,"webhook-card"))){constructor(){super(...arguments),this.resourceUri=null}static get properties(){return s(s({},super.properties),{},{resourceUri:{attribute:"resource-uri"}})}get scopeCollection(){return"webhooks"}get isBodyReady(){var s;return(!!(null===(s=this.__statusesLoader)||void 0===s?void 0:s.data)||!this.__canReadStatuses)&&super.isBodyReady}renderBody(){var s,e,t,a,o,m,f,v,j,b,x;const y=this.__canReadStatuses;let _;try{const a=new URL(null!==(e=null===(s=this.data)||void 0===s?void 0:s._links["fx:statuses"].href)&&void 0!==e?e:"");a.searchParams.set("order","date_created desc"),a.searchParams.set("limit","1");const o=r(null!==(t=this.resourceUri)&&void 0!==t?t:"");null!==o&&a.searchParams.set("resource_id",String(o)),_=a.toString()}catch(s){_=void 0}const g=null===(o=null===(a=this.__statusesLoader)||void 0===a?void 0:a.data)||void 0===o?void 0:o._embedded["fx:webhook_statuses"],$=null==g?void 0:g[0],S=g?null!==(m=null==$?void 0:$.status)&&void 0!==m?m:"none":"loading",k=!!(null===(f=this.data)||void 0===f?void 0:f.is_active),w=null!==(j=null===(v=this.data)||void 0===v?void 0:v.event_resource)&&void 0!==j?j:"";return c(n||(n=h` <div class="grid grid-cols-1 leading-s -my-xs"> <p class="flex items-center gap-s justify-between"> <span class="text-m truncate text-body font-medium"> ${0}&ZeroWidthSpace; </span> <span class="text-s text-tertiary"> <foxy-i18n class="${0}" infer="" key="is_active_${0}"> </foxy-i18n> </span> </p> <p class="text-s truncate text-secondary">${0}&ZeroWidthSpace;</p> <p class="text-s truncate text-tertiary"> ${0} ${0} </p> </div> <foxy-nucleon class="hidden" infer="" href="${0}" id="statusesLoader" @update="${0}"> </foxy-nucleon> `),null===(b=this.data)||void 0===b?void 0:b.name,d({"text-success":k}),k,null===(x=this.data)||void 0===x?void 0:x.url,this.resourceUri?"":c(y?l||(l=h`<span class="capitalize">${0}</span> &bull;`):u||(u=h`<span class="capitalize">${0}</span>`),w.replace(/_/g," ")),y?c(p||(p=h` <foxy-i18n class="${0}" infer="" key="status_${0}" .options="${0}"> </foxy-i18n> `),d({"text-error":k&&"failed"===S}),S,$):"",i(y?_:void 0),(()=>this.requestUpdate()))}get __canReadStatuses(){return a(this.currentUserScope,"webhooks")}get __statusesLoader(){return this.renderRoot.querySelector("#statusesLoader")}}customElements.define("foxy-webhook-card",m);export{m as WebhookCard};