@solvimon/solvimon-web 0.1.0-alpha.28 → 0.1.0-alpha.29

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 (189) hide show
  1. package/README.md +26 -1
  2. package/dist/{Alert.vue.es-lIiAWf2S.mjs → Alert.vue.es-CNrEaLvh.mjs} +58 -46
  3. package/dist/AuthProvider.handle-DKfNs8rr.mjs +50 -0
  4. package/dist/{Avatar.vue.es-Beg7umjO.mjs → Avatar.vue.es-r0NbcIib.mjs} +1 -1
  5. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-DBGe1PvD.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-Cp4yGqaw.mjs} +8 -8
  6. package/dist/{Button.vue.es-rh6mITmN.mjs → Button.vue.es-Zw--kuaU.mjs} +4 -4
  7. package/dist/{ChargeOnDemandModal-CPjPa_uq.mjs → ChargeOnDemandModal-B8FDkS9U.mjs} +35 -34
  8. package/dist/Checkout.entry.ce-DsGl-5aR.mjs +4202 -0
  9. package/dist/CheckoutAddressFields.vue_vue_type_script_setup_true_lang-2D8VM_7W.mjs +828 -0
  10. package/dist/{Chip.vue.es-Cn2R_0mE.mjs → Chip.vue.es-D3UDSyXC.mjs} +3 -3
  11. package/dist/ContentWithAsideLayout-Bnbsq8_5.mjs +32 -0
  12. package/dist/{ContextMenu.vue.es-DRxsa7bZ.mjs → ContextMenu.vue.es-B9mFpUQK.mjs} +87 -88
  13. package/dist/{CustomerBillingInformation.vue.es-DQfL5RMR.mjs → CustomerBillingInformation.vue.es-B8NiQaJs.mjs} +3 -3
  14. package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-Ct-eYaEN.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-DBivC5Eb.mjs} +21 -20
  15. package/dist/CustomerShippingAddresses-Bj8Y17O8.mjs +397 -0
  16. package/dist/{CustomerWalletBalances.vue_vue_type_script_setup_true_lang-BzTSwo4i.mjs → CustomerWalletBalances.vue_vue_type_script_setup_true_lang-BmPKfIjT.mjs} +798 -792
  17. package/dist/{DividerText.vue.es-M0XqSz55.mjs → DividerText.vue.es-CNbgif-3.mjs} +1 -1
  18. package/dist/EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-CVP-7ne3.mjs +55 -0
  19. package/dist/{ErrorNotification.vue.es-CKlt4hr2.mjs → ErrorNotification.vue.es-DNd65mQq.mjs} +2 -2
  20. package/dist/FormMessage.vue.es-Cjv358Ab.mjs +39 -0
  21. package/dist/{IconButton.vue.es-oe4MVBK1.mjs → IconButton.vue.es-C8lYFx5_.mjs} +2 -2
  22. package/dist/{IconTitle.vue.es-BO6KBS4v.mjs → IconTitle.vue.es-O2kcqgKm.mjs} +3 -3
  23. package/dist/{Input.vue.es-DAlPmtE_.mjs → Input.vue.es-D8Oj8MWv.mjs} +23 -22
  24. package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-CCTl5GWa.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-rhqYVdfV.mjs} +2 -2
  25. package/dist/{InvoiceEntryView.vue_vue_type_script_setup_true_lang-DMGqj_Uk.mjs → InvoiceEntryView.vue_vue_type_script_setup_true_lang-06R-M8Q3.mjs} +4 -4
  26. package/dist/InvoicePreview.vue.es-4Q2hzaFS.mjs +286 -0
  27. package/dist/InvoicePricingClauseChip.vue.es-DKU0xu0t.mjs +124 -0
  28. package/dist/Label.vue.es-DtpLM1KH.mjs +113 -0
  29. package/dist/{Modal.vue.es-CTNACAst.mjs → Modal.vue.es-C8ZcO117.mjs} +109 -103
  30. package/dist/OrderSummaryInvoice.vue_vue_type_script_setup_true_lang-3DQLCR3U.mjs +441 -0
  31. package/dist/PaymentCompletedCard.vue_vue_type_script_setup_true_lang-DfTb9psX.mjs +48 -0
  32. package/dist/{PaymentErrorCard.vue_vue_type_script_setup_true_lang-DLfAfB_m.mjs → PaymentErrorCard.vue_vue_type_script_setup_true_lang-BoGTtg5G.mjs} +46 -88
  33. package/dist/{PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-CKm-XYuF.mjs → PaymentFeedbackCard.vue_vue_type_script_setup_true_lang-BIAm22Kq.mjs} +3 -3
  34. package/dist/{PaymentHistoryBlock-BmA8jbMb.mjs → PaymentHistoryBlock-BvY2nXGV.mjs} +1 -1
  35. package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-BDMse2lO.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-bQKhUonq.mjs} +4 -4
  36. package/dist/{PaymentIntegrationForm-D1Xw-xIt.mjs → PaymentIntegrationForm-CcfQSzKM.mjs} +1 -1
  37. package/dist/{PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CCxw0PCv.mjs → PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CvzcLJVq.mjs} +68 -69
  38. package/dist/{PaymentIntegrationFormAdyen-CfT5aD4L.mjs → PaymentIntegrationFormAdyen-DqgDfO6K.mjs} +126 -117
  39. package/dist/{PaymentIntegrationFormStripe-DKXJ-mjd.mjs → PaymentIntegrationFormStripe-BYdAkvLt.mjs} +193 -179
  40. package/dist/{PaymentMethod.vue.es-Cauxx4Xr.mjs → PaymentMethod.vue.es-b0p3a0L-.mjs} +7 -7
  41. package/dist/{PaymentMethodForm-CypZOYUZ.mjs → PaymentMethodForm-BsTrTwCg.mjs} +1 -1
  42. package/dist/{PaymentMethodForm.vue_vue_type_script_setup_true_lang-De8FgdYD.mjs → PaymentMethodForm.vue_vue_type_script_setup_true_lang-sUOmLORl.mjs} +7 -7
  43. package/dist/{PaymentMethodSelector.vue_vue_type_script_setup_true_lang-Dw28tfpD.mjs → PaymentMethodSelector.vue_vue_type_script_setup_true_lang-DsnAhR79.mjs} +36 -35
  44. package/dist/{PaymentMethodsList.vue_vue_type_script_setup_true_lang-OtjVO7lR.mjs → PaymentMethodsList.vue_vue_type_script_setup_true_lang-CSW4LfmH.mjs} +7 -7
  45. package/dist/{PlanCustomizationEditor-Xtww2r9K.mjs → PlanCustomizationEditor-D29N4HUM.mjs} +9 -9
  46. package/dist/PortalLinkUnverified-B_EE2wTJ.mjs +52 -0
  47. package/dist/{PortalNotAvailable-B_59GUwN.mjs → PortalNotAvailable-DPE9y37H.mjs} +2 -2
  48. package/dist/{PricingGroupRangeInput.vue.es-C9LJW3b8.mjs → PricingGroupRangeInput.vue.es-tIMXIhpZ.mjs} +14 -13
  49. package/dist/{PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-DdWxoB8q.mjs → PricingGroupSingleEditor.vue_vue_type_script_setup_true_lang-DqxWxSQe.mjs} +32 -32
  50. package/dist/RadioGroupExtended.vue.es-3nDXqIGi.mjs +176 -0
  51. package/dist/{Section.vue.es-iS8hVGWA.mjs → Section.vue.es-CvX9tg2f.mjs} +1 -1
  52. package/dist/SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-Cl7I1Apo.mjs +60 -0
  53. package/dist/ShippingAddressesModal-C4p1IXXk.mjs +418 -0
  54. package/dist/{StepInput.vue.es-Dpan1RQd.mjs → StepInput.vue.es-DweyzpkL.mjs} +4 -4
  55. package/dist/{SubscriptionDetails.entry.ce-DufQX3uI.mjs → SubscriptionDetails.entry.ce-D5SwM0YS.mjs} +230 -225
  56. package/dist/{SubscriptionSchedules-DAahcNoI.mjs → SubscriptionSchedules-BZqlpAtk.mjs} +1 -1
  57. package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-BH7DdOWK.mjs +5185 -0
  58. package/dist/{SubscriptionSummary.vue_vue_type_script_setup_true_lang-Wmjqy7RZ.mjs → SubscriptionSummary.vue_vue_type_script_setup_true_lang-DoJxiqVB.mjs} +3 -3
  59. package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-BeRLuEyR.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-BbjdBHSQ.mjs} +23 -22
  60. package/dist/TooltipParagraph.vue.es-Dw0ndjle.mjs +132 -0
  61. package/dist/TranslationOverride.vue_vue_type_script_setup_true_lang-BhjZVMSx.mjs +31 -0
  62. package/dist/{TrialChip.vue.es-B-XBSHWE.mjs → TrialChip.vue.es-DOopmaXA.mjs} +2 -2
  63. package/dist/{api.es-QaC926Xu.mjs → api.es-qgvzNMU-.mjs} +2 -2
  64. package/dist/{cn.es-2bVdkiFV.mjs → cn.es-B8acFrov.mjs} +380 -476
  65. package/dist/components/BillingInformation/BillingInformation.mjs +9 -7
  66. package/dist/components/BillingInformationForm/BillingInformationForm.mjs +57 -54
  67. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.mjs +20 -18
  68. package/dist/components/Invoice/Invoice.mjs +2660 -193
  69. package/dist/components/InvoiceDetails/InvoiceDetails.mjs +6 -4
  70. package/dist/components/InvoiceHeader/InvoiceHeader.mjs +18 -17
  71. package/dist/components/InvoicesList/InvoicesList.mjs +13 -11
  72. package/dist/components/PaymentHistory/PaymentHistory.mjs +8 -6
  73. package/dist/components/PaymentMethodForm/PaymentMethodForm.mjs +19 -17
  74. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.mjs +19 -17
  75. package/dist/components/SubscriptionsList/SubscriptionsList.mjs +20 -18
  76. package/dist/components/WalletBalances/WalletBalances.mjs +17 -15
  77. package/dist/customElements-BTj4ii4f.mjs +5072 -0
  78. package/dist/{customer-CqddTiOr.mjs → customer-BIjC0CWJ.mjs} +1 -1
  79. package/dist/customer.es-DQKl6wFt.mjs +24 -0
  80. package/dist/{de-DE-BW8dMvhW.mjs → de-DE-DBbERiFr.mjs} +38 -0
  81. package/dist/{de-DE-BNMj3boy.mjs → de-DE-UJ6X6jXu.mjs} +1 -1
  82. package/dist/floating-ui.vue.es-BvAf8-si.mjs +1003 -0
  83. package/dist/{formControl-CsITfsBk.mjs → formControl-BZQLHnOO.mjs} +5 -5
  84. package/dist/fr-FR-Cvvbkwlj.mjs +307 -0
  85. package/dist/fr-FR-IWJE-urI.mjs +431 -0
  86. package/dist/icon-sprite.svg.es-BWBB8SGw.mjs +4 -0
  87. package/dist/{index.es-CXkP_k3u.mjs → index.es-C7J3WGGo.mjs} +4 -4
  88. package/dist/index.es-CpmQmvOg.mjs +633 -0
  89. package/dist/index.mjs +2 -2
  90. package/dist/{invoices-Cf1qDAv4.mjs → invoices-e1sKLgxg.mjs} +3 -3
  91. package/dist/{it-IT-Byg06KWc.mjs → it-IT-B7ui2oxO.mjs} +38 -0
  92. package/dist/{it-IT-DRvuxM1F.mjs → it-IT-DnJP5URH.mjs} +1 -1
  93. package/dist/{nl-NL-x3zQqzZ7.mjs → nl-NL-Bafh2xoT.mjs} +38 -0
  94. package/dist/{nl-NL-DLUwWbMG.mjs → nl-NL-q9xfTZF0.mjs} +1 -1
  95. package/dist/{paymentMethods-BUuOmDq9.mjs → paymentMethods-B_82JGk_.mjs} +2 -2
  96. package/dist/paymentMethods-Nfv9HdkS.mjs +61 -0
  97. package/dist/{paymentOutcome-D17VD4MV.mjs → paymentOutcome-BXEU5-84.mjs} +5 -5
  98. package/dist/payments-BnxbzQUC.mjs +68 -0
  99. package/dist/pricing-BOhvWWMj.mjs +29 -0
  100. package/dist/{pricingPlanScheduleOverrides-COr9F8DO.mjs → pricingPlanScheduleOverrides-Dxv5FOBd.mjs} +2 -2
  101. package/dist/{pricingPlanSchedules-BK_o9p6h.mjs → pricingPlanSchedules-Dv7ZCgNp.mjs} +1 -1
  102. package/dist/screens/Checkout/Checkout.mjs +2 -2
  103. package/dist/screens/CustomerOverview/CustomerOverview.mjs +128 -83
  104. package/dist/screens/PayInvoice/PayInvoice.mjs +572 -218
  105. package/dist/screens/PaymentMethodsManagement/PaymentMethodsManagement.mjs +21 -19
  106. package/dist/screens/SubscriptionDetails/SubscriptionDetails.mjs +2 -2
  107. package/dist/screens/SubscriptionManagement/SubscriptionManagement.mjs +261 -266
  108. package/dist/{sorting.es-qtEN8J8T.mjs → sorting.es-CVyKw23D.mjs} +1 -1
  109. package/dist/subscriptions-BWXZGK0E.mjs +66 -0
  110. package/dist/taxId.es-DkD3Ltr8.mjs +243 -0
  111. package/dist/types/components/customer/CheckoutForm/CheckoutAddressFields.types.d.ts +2 -0
  112. package/dist/types/components/customer/ShippingAddressForm/ShippingAddressForm.types.d.ts +9 -0
  113. package/dist/types/components/customer/ShippingAddresses/ShippingAddressCard.types.d.ts +11 -0
  114. package/dist/types/components/customer/ShippingAddresses/ShippingAddressList.types.d.ts +9 -0
  115. package/dist/types/components/customer/ShippingAddresses/ShippingAddressesModal.types.d.ts +26 -0
  116. package/dist/types/components/invoices/InvoiceOrderSummary/InvoiceOrderSummary.types.d.ts +5 -0
  117. package/dist/types/components/payments/PayButton/PayButton.types.d.ts +2 -0
  118. package/dist/types/components/payments/PaymentIntegrationForm/PaymentIntegrationForm.types.d.ts +11 -0
  119. package/dist/types/components/payments/PaymentIntegrationFormStripe/PaymentIntegrationFormStripeFrame.types.d.ts +4 -1
  120. package/dist/types/components/providers/AuthProvider/AuthProvider.handle.d.ts +17 -0
  121. package/dist/types/components/providers/AuthProvider/AuthProvider.lib.d.ts +23 -1
  122. package/dist/types/components/providers/AuthProvider/AuthProvider.types.d.ts +12 -0
  123. package/dist/types/components/providers/AuthProvider/AuthProvider.vue.d.ts +3 -1
  124. package/dist/types/components/providers/LoggerProvider/LoggerProvider.types.d.ts +2 -2
  125. package/dist/types/components/providers/Provider/Provider.types.d.ts +1 -1
  126. package/dist/types/components/providers/Provider/Provider.vue.d.ts +3 -1
  127. package/dist/types/components/subscriptions/OrderSummaryInvoice.types.d.ts +16 -0
  128. package/dist/types/components/subscriptions/SubscriptionManagement/SubscriptionManagementForm.types.d.ts +2 -0
  129. package/dist/types/public/components/CustomerShippingAddresses/CustomerShippingAddresses.types.d.ts +12 -0
  130. package/dist/types/public/core/types.d.ts +5 -0
  131. package/dist/types/public/screens/PayInvoice/PayInvoice.types.d.ts +3 -1
  132. package/dist/types/translations/supported.d.ts +1 -1
  133. package/dist/types/types/portalAuthentication.d.ts +2 -0
  134. package/dist/types/types/portalToken.d.ts +9 -0
  135. package/dist/types/types/shippingAddress.d.ts +9 -0
  136. package/dist/types/vendor/@solvimon/solvimon-types/index.d.ts +2 -0
  137. package/dist/types/vendor/@solvimon/solvimon-types/types/ApprovalPolicies.d.ts +1 -1
  138. package/dist/types/vendor/@solvimon/solvimon-types/types/ApprovalRequests.d.ts +27 -6
  139. package/dist/types/vendor/@solvimon/solvimon-types/types/ConfigMeterProperties.d.ts +3 -0
  140. package/dist/types/vendor/@solvimon/solvimon-types/types/Entitlement.d.ts +6 -0
  141. package/dist/types/vendor/@solvimon/solvimon-types/types/Integrations.d.ts +9 -1
  142. package/dist/types/vendor/@solvimon/solvimon-types/types/Invoice.d.ts +16 -1
  143. package/dist/types/vendor/@solvimon/solvimon-types/types/JWT.d.ts +10 -0
  144. package/dist/types/vendor/@solvimon/solvimon-types/types/MeterPropertyVariable.d.ts +16 -0
  145. package/dist/types/vendor/@solvimon/solvimon-types/types/PaymentAcceptor.d.ts +6 -0
  146. package/dist/types/vendor/@solvimon/solvimon-types/types/Permission.d.ts +1 -1
  147. package/dist/types/vendor/@solvimon/solvimon-types/types/Platform.d.ts +12 -3
  148. package/dist/types/vendor/@solvimon/solvimon-types/types/Portal.d.ts +71 -0
  149. package/dist/types/vendor/@solvimon/solvimon-types/types/PricingPlanSubscription.d.ts +14 -0
  150. package/dist/types/vendor/@solvimon/solvimon-types/types/QuoteTemplates.d.ts +1 -0
  151. package/dist/types/vendor/@solvimon/solvimon-types/types/QuoteVersions.d.ts +35 -0
  152. package/dist/types/vendor/@solvimon/solvimon-types/types/Quotes.d.ts +16 -0
  153. package/dist/types/vendor/@solvimon/solvimon-types/types/ShippingAddress.d.ts +54 -0
  154. package/dist/{useActionDispatchProvider-DC_fUykI.mjs → useActionDispatchProvider-3W2vEyIg.mjs} +1 -1
  155. package/dist/{useCustomer-C3kTh7wn.mjs → useCustomer-cObBvDOu.mjs} +2 -2
  156. package/dist/useCustomerFormLabels-DJWf2O17.mjs +1173 -0
  157. package/dist/{useIncrementalLoading-C_sHmW7d.mjs → useIncrementalLoading-CATuO36d.mjs} +2 -2
  158. package/dist/{useInvoiceData-BIh8-h8b.mjs → useInvoiceData-DD44HTl7.mjs} +2 -2
  159. package/dist/{useInvoicesList-Y6p0Pqpy.mjs → useInvoicesList-CpB-41MQ.mjs} +10 -10
  160. package/dist/useLazyFloating.es-CycqRyeb.mjs +68 -0
  161. package/dist/useLoadInitialData-qzdnBoui.mjs +15 -0
  162. package/dist/{usePaymentFormHold-FfNc578l.mjs → usePaymentFormHold-ByUZi3A-.mjs} +28 -36
  163. package/dist/{usePaymentMethodAvailability-CnYTvG15.mjs → usePaymentMethodAvailability-DUdrs0Ji.mjs} +4 -4
  164. package/dist/usePaymentMethods-ByaKF7mf.mjs +21 -0
  165. package/dist/{usePayments-CykCZPG2.mjs → usePayments-BXABv-lF.mjs} +9 -9
  166. package/dist/{usePortal-CxzKGhbK.mjs → usePortal-CwR_FxTb.mjs} +1 -1
  167. package/dist/{useService-B0OQJmif.mjs → useService-BZcbUZHI.mjs} +3 -3
  168. package/dist/{useTimePeriod.es-JkXdHNWr.mjs → useTimePeriod.es-BpdiVwg8.mjs} +1 -1
  169. package/package.json +7 -7
  170. package/dist/Checkbox.vue.es-DsyiJ-VY.mjs +0 -50
  171. package/dist/Checkout.entry.ce-BZ1rYQvt.mjs +0 -5279
  172. package/dist/ContentWithAsideLayout-BCM8tmZN.mjs +0 -38
  173. package/dist/EmptyStatePlaceholder.vue_vue_type_script_setup_true_lang-Bk4zwyWa.mjs +0 -362
  174. package/dist/FormMessage.vue.es-jG3fQZms.mjs +0 -29
  175. package/dist/InvoiceSummary.vue.es-DbNoGfYN.mjs +0 -2596
  176. package/dist/RadioGroupExtended.vue.es-UtKsdmiv.mjs +0 -163
  177. package/dist/SecurePaymentsKPI.vue_vue_type_script_setup_true_lang-Djc1SkEU.mjs +0 -688
  178. package/dist/SubscriptionSchedules.vue_vue_type_script_setup_true_lang-DNr1CqVj.mjs +0 -5221
  179. package/dist/TooltipParagraph.vue.es-BjCn2BF6.mjs +0 -129
  180. package/dist/customElements-Di3zwlEU.mjs +0 -6447
  181. package/dist/customer.es-B5ppZf0j.mjs +0 -20
  182. package/dist/floating-ui.vue.es-CYt0fSY7.mjs +0 -1108
  183. package/dist/icon-sprite.svg.es-BZIz7-0d.mjs +0 -4
  184. package/dist/payments-Ci8bF4C6.mjs +0 -45
  185. package/dist/subscriptions-CwogJODR.mjs +0 -54
  186. package/dist/useCustomerFormLabels-CK7K50nB.mjs +0 -1369
  187. package/dist/useLoadInitialData-4k_Cyqef.mjs +0 -15
  188. package/dist/usePaymentMethodOptions-1QBcmgUf.mjs +0 -40
  189. package/dist/usePaymentMethods-gvr-rmwE.mjs +0 -15
@@ -1,1369 +0,0 @@
1
- import { a as Se, d as Ke, i as xl } from "./useService-B0OQJmif.mjs";
2
- import { defineComponent as J, openBlock as s, createElementBlock as I, createVNode as F, unref as w, withCtx as L, renderSlot as H, toDisplayString as z, createCommentVNode as p, createElementVNode as k, computed as f, withKeys as yl, withModifiers as qe, normalizeClass as P, Fragment as ee, mergeProps as V, createBlock as x, resolveDynamicComponent as R, normalizeProps as T, renderList as Ze, createTextVNode as Q, inject as je, getCurrentInstance as gl, ref as G, watch as ge, useModel as Xe, useSlots as Cl, createSlots as Ee, guardReactiveProps as Pe, Teleport as Sl, normalizeStyle as De, mergeModels as Ie, isRef as Ne, useId as Il } from "vue";
3
- import { u as re, d as kl, c as wl } from "./index.es-CXkP_k3u.mjs";
4
- import { c as Ye } from "./countryData.es-BegoD-cZ.mjs";
5
- import { u as Ll, a as El, o as $l, f as Ml, s as Al, b as Rl } from "./floating-ui.vue.es-CYt0fSY7.mjs";
6
- import { _ as ke, S as Tl, I as Ol, a as Bl } from "./customElements-Di3zwlEU.mjs";
7
- import { e as we } from "./sanitization.es-C6dbuxUJ.mjs";
8
- import { _ as W, s as Ue, u as Vl } from "./sorting.es-qtEN8J8T.mjs";
9
- import { _ as ze } from "./IconButton.vue.es-oe4MVBK1.mjs";
10
- import { a as Fe, _ as Ce } from "./Button.vue.es-rh6mITmN.mjs";
11
- import { _ as Pl } from "./Chip.vue.es-Cn2R_0mE.mjs";
12
- import { c as Dl } from "./cn.es-2bVdkiFV.mjs";
13
- import { _ as We } from "./Input.vue.es-DAlPmtE_.mjs";
14
- import { d as Nl } from "./formControl-CsITfsBk.mjs";
15
- import { _ as Ul } from "./FormMessage.vue.es-jG3fQZms.mjs";
16
- const Le = (e) => Se(e) && typeof e != "boolean" ? null : e, se = (e) => typeof e == "object" && e !== null, zl = ({
17
- from: e,
18
- to: i,
19
- nullifyEmptyValues: r = !1
20
- }) => {
21
- const o = Object.fromEntries(
22
- Object.entries(i).filter(([t, d]) => !Ke(d, e[t]))
23
- );
24
- return r ? Object.entries(o).reduce(
25
- (t, [d, u]) => ({ ...t, [d]: Le(u) }),
26
- {}
27
- ) : o;
28
- }, Fl = ({
29
- from: e,
30
- to: i,
31
- nullifyEmptyValues: r = !1
32
- }) => {
33
- const o = {}, t = (u, c, a) => {
34
- const y = c[a];
35
- return u === void 0 ? Array.isArray(y) ? o[a] = [] : se(y) && (o[a] = {}) : Array.isArray(y) ? u[a] = [] : se(y) && (u[a] = {}), [u === void 0 ? o : u, a];
36
- }, d = (u, c, a) => {
37
- for (const y of Object.keys(u)) {
38
- const g = t(a, u, y);
39
- y in c || (g[0][g[1]] = {
40
- from: u[y]
41
- });
42
- }
43
- for (const [y, g] of Object.entries(c)) {
44
- const O = y in u, m = t(a, u, y);
45
- if (O) {
46
- const C = u[y];
47
- Ke(C, g) ? delete m[0][m[1]] : se(g) && se(C) ? d(C, g, m[0][m[1]]) : m[0][m[1]] = r && typeof g != "boolean" ? Le(g) : g;
48
- } else
49
- m[0][m[1]] = r ? Le(g) : g;
50
- }
51
- };
52
- return d(e, i), o;
53
- }, jt = ({
54
- from: e,
55
- to: i,
56
- mode: r = "shallow",
57
- nullifyEmptyValues: o = !1
58
- }) => r === "deep" ? Fl({ from: e, to: i, nullifyEmptyValues: o }) : zl({ from: e, to: i, nullifyEmptyValues: o });
59
- function Gl(e, i, r = []) {
60
- return [...e].sort((o, t) => {
61
- for (let d = 0; d < i.length; d++) {
62
- const u = i[d], c = typeof u == "function" ? u : (O) => O[u], a = r[d] === "desc" ? -1 : 1, y = c(o), g = c(t);
63
- if (!(y == null && g == null)) {
64
- if (y == null) return a;
65
- if (g == null || y < g) return -a;
66
- if (y > g) return a;
67
- }
68
- }
69
- return 0;
70
- });
71
- }
72
- const Hl = { class: "flex items-center pt-1" }, Kl = {
73
- key: 0,
74
- class: "ml-1 normal-case"
75
- }, ql = /* @__PURE__ */ J({
76
- __name: "SearchSelectInputOptionsDivider",
77
- props: {
78
- suffix: {}
79
- },
80
- setup(e) {
81
- return (i, r) => (s(), I("div", Hl, [
82
- F(w(ke), {
83
- tag: "span",
84
- variant: "caps-heading",
85
- "no-spacing": "",
86
- class: "pl-4 pr-1.5"
87
- }, {
88
- default: L(() => [
89
- H(i.$slots, "default"),
90
- e.suffix ? (s(), I("span", Kl, z(e.suffix), 1)) : p("", !0)
91
- ]),
92
- _: 3
93
- }),
94
- r[0] || (r[0] = k("div", { class: "grow border-t" }, null, -1))
95
- ]));
96
- }
97
- }), Zl = (e) => `checkbox-item-${e}`, jl = "select-search-done-button", Xl = ["aria-selected", "aria-disabled", "data-testid", "onKeydown"], Yl = ["id", "value", "checked", "disabled"], Wl = ["for"], Ql = { class: "flex min-w-0 items-center gap-1" }, Jl = { class: "flex min-w-0 flex-grow flex-col" }, _l = { class: "flex min-w-0 flex-grow gap-2" }, et = { class: "mr-8 flex min-w-0 flex-grow flex-col" }, lt = { class: "flex min-w-0 flex-grow items-center gap-2" }, tt = /* @__PURE__ */ J({
98
- __name: "SearchSelectInputOption",
99
- props: {
100
- multiple: { type: Boolean },
101
- search: {},
102
- condensed: { type: Boolean },
103
- label: {},
104
- checked: { type: Boolean },
105
- disabled: { type: Boolean },
106
- subLabel: {},
107
- labelPrefixComponent: {},
108
- labelSuffixComponent: {},
109
- labelInlineComponent: {},
110
- labelBeforeSuffixComponent: {},
111
- value: {},
112
- labelSrOnly: { type: Boolean }
113
- },
114
- emits: ["value-changed"],
115
- setup(e, { emit: i }) {
116
- const r = i, o = e, t = (a) => {
117
- const y = a.target, g = {
118
- value: y.value,
119
- checked: y.checked
120
- };
121
- r("value-changed", g);
122
- }, d = () => {
123
- o.multiple || o.disabled || r("value-changed", {
124
- value: o.value
125
- });
126
- }, u = f(() => Zl(o.value)), c = f(() => we(o.search ?? ""));
127
- return (a, y) => (s(), I("li", {
128
- role: "option",
129
- "aria-selected": e.checked,
130
- "aria-disabled": e.disabled,
131
- class: P([{ "hover:bg-gray-100": !e.disabled }, "relative flex"]),
132
- "data-testid": u.value,
133
- tabindex: "0",
134
- onClick: d,
135
- onKeydown: yl(qe(d, ["prevent"]), ["enter"])
136
- }, [
137
- e.multiple ? (s(), I(ee, { key: 0 }, [
138
- k("input", V(a.$attrs, {
139
- id: u.value,
140
- ref: "inputRef",
141
- value: e.value,
142
- checked: e.checked,
143
- disabled: e.disabled,
144
- type: "checkbox",
145
- class: ["absolute left-3.5 top-1/2 h-4 w-4 -translate-y-2 rounded border-gray-300 bg-gray-100 focus:ring-2 focus:ring-primary-500", e.disabled ? "text-disabled" : "text-primary-600"],
146
- tabindex: "-1",
147
- onChange: t
148
- }), null, 16, Yl),
149
- k("label", {
150
- for: u.value,
151
- class: P([e.disabled ? "text-disabled" : "rounded text-default", "w-full px-4 py-3 pl-10 text-sm font-medium"])
152
- }, [
153
- k("div", Ql, [
154
- e.labelPrefixComponent ? (s(), x(R(e.labelPrefixComponent.component), T(V({ key: 0 }, e.labelPrefixComponent.props)), null, 16)) : p("", !0),
155
- k("div", Jl, [
156
- k("div", _l, [
157
- F(W, {
158
- text: e.label,
159
- search: c.value,
160
- title: e.label,
161
- class: P(["truncate font-semibold", { "sr-only": e.labelSrOnly }])
162
- }, null, 8, ["text", "search", "title", "class"]),
163
- e.labelInlineComponent ? (s(), x(R(e.labelInlineComponent.component), T(V({ key: 0 }, e.labelInlineComponent.props)), null, 16)) : p("", !0),
164
- e.subLabel && e.condensed ? (s(), x(W, {
165
- key: 1,
166
- class: "truncate text-xs text-subtle",
167
- text: e.subLabel,
168
- title: e.subLabel,
169
- search: c.value
170
- }, null, 8, ["text", "title", "search"])) : p("", !0)
171
- ]),
172
- e.subLabel && !e.condensed ? (s(), x(W, {
173
- key: 0,
174
- class: "truncate text-xs text-subtle",
175
- text: e.subLabel,
176
- title: e.subLabel,
177
- search: c.value
178
- }, null, 8, ["text", "title", "search"])) : p("", !0)
179
- ]),
180
- e.labelBeforeSuffixComponent ? (s(), x(R(e.labelBeforeSuffixComponent.component), T(V({ key: 1 }, e.labelBeforeSuffixComponent.props)), null, 16)) : p("", !0),
181
- e.labelSuffixComponent ? (s(), x(R(e.labelSuffixComponent.component), T(V({ key: 2 }, e.labelSuffixComponent.props)), null, 16)) : p("", !0)
182
- ])
183
- ], 10, Wl)
184
- ], 64)) : (s(), I("div", {
185
- key: 1,
186
- class: P(["flex w-full min-w-0 items-center gap-3 px-4 text-sm font-medium", [
187
- e.condensed ? "p-2" : "py-2",
188
- e.disabled ?? "cursor-not-allowed",
189
- !e.disabled && "cursor-pointer"
190
- ]])
191
- }, [
192
- e.labelPrefixComponent ? (s(), x(R(e.labelPrefixComponent.component), T(V({ key: 0 }, e.labelPrefixComponent.props)), null, 16)) : p("", !0),
193
- k("div", et, [
194
- k("div", lt, [
195
- F(W, {
196
- text: e.label,
197
- search: w(we)(e.search ?? ""),
198
- title: e.label,
199
- class: P(["truncate font-semibold", { "text-disabled": e.disabled }])
200
- }, null, 8, ["text", "search", "title", "class"]),
201
- e.labelInlineComponent ? (s(), x(R(e.labelInlineComponent.component), T(V({ key: 0 }, e.labelInlineComponent.props)), null, 16)) : p("", !0),
202
- e.subLabel && e.condensed ? (s(), x(W, {
203
- key: 1,
204
- class: "truncate text-xs text-subtle",
205
- text: e.subLabel,
206
- title: e.subLabel,
207
- search: c.value
208
- }, null, 8, ["text", "title", "search"])) : p("", !0)
209
- ]),
210
- e.subLabel && !e.condensed ? (s(), x(W, {
211
- key: 0,
212
- class: "truncate text-xs text-subtle",
213
- text: e.subLabel,
214
- title: e.subLabel,
215
- search: c.value
216
- }, null, 8, ["text", "title", "search"])) : p("", !0)
217
- ]),
218
- e.labelBeforeSuffixComponent ? (s(), x(R(e.labelBeforeSuffixComponent.component), T(V({ key: 1 }, e.labelBeforeSuffixComponent.props)), null, 16)) : p("", !0),
219
- e.labelSuffixComponent ? (s(), x(R(e.labelSuffixComponent.component), T(V({ key: 2 }, e.labelSuffixComponent.props)), null, 16)) : p("", !0)
220
- ], 2))
221
- ], 42, Xl));
222
- }
223
- }), at = { class: "flex flex-col rounded-bl rounded-br" }, nt = {
224
- key: 0,
225
- class: "px-5 py-5 text-sm text-secondary"
226
- }, ot = { key: 0 }, st = ["innerHTML"], it = { key: 0 }, rt = { class: "mt-1 px-3 py-2 text-sm text-secondary" }, ut = /* @__PURE__ */ J({
227
- __name: "SearchSelectInputOptions",
228
- props: {
229
- i18n: {},
230
- model: {},
231
- search: {},
232
- multiple: { type: Boolean },
233
- condensed: { type: Boolean },
234
- hasLargeDropdown: { type: Boolean },
235
- addOnly: { type: Boolean },
236
- options: {}
237
- },
238
- emits: ["value-changed"],
239
- setup(e, { emit: i }) {
240
- const r = i, o = e, t = (m) => r("value-changed", m), d = f(() => {
241
- var m, C;
242
- const S = o.search ? `<span class="font-bold">"${we(o.search)}"</span>` : "";
243
- return ((C = (m = o.i18n) == null ? void 0 : m.noResults) == null ? void 0 : C.call(m, S)) ?? `No matches found for ${S}.`;
244
- }), u = f(() => o.search === ""), c = f(() => o.options.filter((m) => !m.hidden)), a = f(() => c.value.length > 0), y = f(() => a.value ? !1 : u.value ? !0 : !!d.value), g = f(
245
- () => Ue(o.options, "group").reduce(
246
- (m, C) => C.value === "" ? m : {
247
- ...m,
248
- [C.value]: C.group
249
- },
250
- {}
251
- )
252
- ), O = f(
253
- () => Ue(o.options, "group").reduce(
254
- (m, C) => C.value === "" ? m : {
255
- ...m,
256
- [C.value]: C.groupSuffix
257
- },
258
- {}
259
- )
260
- );
261
- return (m, C) => {
262
- var S, le;
263
- return s(), I("div", at, [
264
- y.value ? (s(), I("div", nt, [
265
- u.value ? (s(), I("span", ot, z(((S = o.i18n) == null ? void 0 : S.noOptionsAvailable) ?? "No available options."), 1)) : (s(), I("span", {
266
- key: 1,
267
- innerHTML: d.value
268
- }, null, 8, st))
269
- ])) : a.value ? (s(), I("ul", {
270
- key: 1,
271
- class: P(["list-none overflow-y-auto", [e.hasLargeDropdown ? "max-h-[19rem]" : "max-h-48"]])
272
- }, [
273
- e.addOnly ? (s(), I("div", it, [
274
- k("p", rt, z(((le = e.i18n) == null ? void 0 : le.addOnly) ?? "You can only select currently unselected options."), 1)
275
- ])) : p("", !0),
276
- (s(!0), I(ee, null, Ze(c.value, ({
277
- label: te,
278
- subLabel: ae,
279
- value: K,
280
- checked: de,
281
- disabled: M,
282
- labelInlineComponent: ce,
283
- labelSuffixComponent: fe,
284
- labelSrOnly: me,
285
- labelPrefixComponent: h,
286
- labelBeforeSuffixComponent: q,
287
- searchValues: D
288
- }) => (s(), I(ee, { key: K }, [
289
- g.value[K] ? (s(), x(ql, {
290
- key: 0,
291
- suffix: O.value[K]
292
- }, {
293
- default: L(() => [
294
- Q(z(g.value[K]), 1)
295
- ]),
296
- _: 2
297
- }, 1032, ["suffix"])) : p("", !0),
298
- F(tt, {
299
- label: te,
300
- "sub-label": ae,
301
- value: K,
302
- checked: de,
303
- disabled: M,
304
- search: D ? "" : e.search,
305
- multiple: e.multiple,
306
- condensed: e.condensed,
307
- "label-suffix-component": fe,
308
- "label-prefix-component": h,
309
- "label-before-suffix-component": q,
310
- "label-inline-component": ce,
311
- "label-sr-only": me,
312
- onValueChanged: t
313
- }, null, 8, ["label", "sub-label", "value", "checked", "disabled", "search", "multiple", "condensed", "label-suffix-component", "label-prefix-component", "label-before-suffix-component", "label-inline-component", "label-sr-only"])
314
- ], 64))), 128))
315
- ], 2)) : p("", !0),
316
- m.$slots["list-footer-content"] ? (s(), I("div", {
317
- key: 2,
318
- class: P({ "border-t border-gray-200": a.value })
319
- }, [
320
- H(m.$slots, "list-footer-content")
321
- ], 2)) : p("", !0)
322
- ]);
323
- };
324
- }
325
- }), dt = { class: "flex flex-col gap-2" }, ct = ["aria-expanded"], ft = { class: "flex items-center gap-2" }, mt = { key: 2 }, vt = { class: "flex items-center gap-2 self-stretch" }, pt = { class: "flex items-center" }, ht = {
326
- key: 0,
327
- class: "flex flex-wrap gap-2"
328
- }, bt = ["innerHTML"], xt = /* @__PURE__ */ J({
329
- __name: "SearchSelectInput",
330
- props: /* @__PURE__ */ Ie({
331
- addOnly: { type: Boolean, default: !1 },
332
- disabled: { type: Boolean },
333
- i18n: {},
334
- label: {},
335
- labelScreenReaderOnly: { type: Boolean },
336
- singleModelValue: {},
337
- multiModelValue: {},
338
- options: { default: () => [] },
339
- optionsOrder: { default: () => ["asc", "asc"] },
340
- optionsOrderProperties: { default: () => ["group", "label"] },
341
- required: { type: Boolean, default: !1 },
342
- rootClass: {},
343
- wrapperClass: {},
344
- inputClass: {},
345
- dropdownWidth: {},
346
- invalid: { type: Boolean },
347
- size: { default: "md" },
348
- withChips: { type: Boolean, default: !1 },
349
- error: {},
350
- hasReset: { type: Boolean },
351
- name: {},
352
- hasLargeDropdown: { type: Boolean, default: !1 },
353
- showSuffixInClosedInput: { type: Boolean },
354
- showSuffixLabelInInput: { type: Boolean },
355
- showSelectionInClosedInput: { type: Boolean },
356
- condensed: { type: Boolean },
357
- form: {},
358
- prefix: {}
359
- }, {
360
- search: { default: "" },
361
- searchModifiers: {}
362
- }),
363
- emits: /* @__PURE__ */ Ie(["update:singleModelValue", "update:multiModelValue", "blur", "change", "focus", "add-option"], ["update:search"]),
364
- setup(e, { expose: i, emit: r }) {
365
- var o;
366
- const t = e, d = je(Tl), u = (o = gl()) == null ? void 0 : o.vnode.props, c = !(u != null && u["onUpdate:search"]), a = f(() => Array.isArray(t.multiModelValue)), y = G(t.singleModelValue), g = r, O = re(t, "singleModelValue", g), m = re(t, "multiModelValue", g), C = G(m.value ?? []);
367
- ge(
368
- () => t.multiModelValue,
369
- (l) => {
370
- l && (C.value = l);
371
- }
372
- );
373
- const S = Xe(e, "search"), le = Cl(), te = f(() => !!le.prefix), ae = f(() => !!t.prefix), K = f(() => te.value || ae.value), de = f(() => K.value || !ye.value), M = f({
374
- get: () => a.value ? C.value ?? [] : typeof O.value == "string" ? [O.value] : [],
375
- set(l) {
376
- a.value ? C.value = l : O.value = (l == null ? void 0 : l[0]) ?? "";
377
- }
378
- }), ce = f(
379
- () => Z.value.filter((l) => {
380
- var n;
381
- return (n = M.value) == null ? void 0 : n.includes(l.value);
382
- })
383
- ), fe = f(() => ce.value[0]), me = Vl(), h = G(!1), q = G(), D = G(), ll = G(), $e = () => q.value ? Array.from(
384
- q.value.querySelectorAll('li[tabindex="0"], button:not([disabled])')
385
- ) : [], Me = () => {
386
- var l;
387
- let n = document.activeElement;
388
- for (; (l = n == null ? void 0 : n.shadowRoot) != null && l.activeElement; )
389
- n = n.shadowRoot.activeElement;
390
- return n;
391
- }, ve = () => {
392
- if (!D.value) return null;
393
- let l = D.value.querySelector("input");
394
- if (l) return l;
395
- const n = D.value.querySelectorAll("*");
396
- for (const v of n)
397
- if (v.shadowRoot && (l = v.shadowRoot.querySelector("input"), l))
398
- return l;
399
- return null;
400
- };
401
- let pe = !1;
402
- const he = () => {
403
- var l;
404
- pe = !0, (l = ve()) == null || l.focus(), pe = !1;
405
- }, be = (l) => (l == null ? void 0 : l.selectedLabel) ?? (l == null ? void 0 : l.label) ?? "", N = G(""), _ = G(!1), tl = () => {
406
- pe || (h.value = !0);
407
- }, al = (l) => {
408
- var n;
409
- t.disabled || (n = l.target) != null && n.closest("button") || (h.value = !0);
410
- }, nl = () => {
411
- t.disabled || (_.value = !0, h.value = !0);
412
- }, ol = (l) => {
413
- var n;
414
- if (!h.value) return;
415
- const v = $e(), $ = ve();
416
- if (Me() === $)
417
- switch (l.key) {
418
- case "ArrowDown":
419
- v.length > 0 && (l.preventDefault(), (n = v[0]) == null || n.focus());
420
- break;
421
- case "Tab":
422
- U();
423
- break;
424
- case "Escape":
425
- l.preventDefault(), U();
426
- break;
427
- }
428
- }, sl = (l) => {
429
- var n, v, $;
430
- const B = $e(), b = Me(), A = B.indexOf(b), Y = ve();
431
- switch (l.key) {
432
- case "ArrowDown":
433
- A < B.length - 1 && (l.preventDefault(), (n = B[A + 1]) == null || n.focus());
434
- break;
435
- case "ArrowUp":
436
- l.preventDefault(), A <= 0 ? Y == null || Y.focus() : (v = B[A - 1]) == null || v.focus();
437
- break;
438
- case "Tab":
439
- if (l.preventDefault(), l.shiftKey && A > 0) {
440
- ($ = B[A - 1]) == null || $.focus();
441
- break;
442
- }
443
- U(), he();
444
- break;
445
- case "Escape":
446
- l.preventDefault(), U(), he();
447
- break;
448
- }
449
- }, { floatingStyles: il } = Ll(D, q, {
450
- whileElementsMounted: El,
451
- // Matches `bottom` while the dropdown is as wide as the input, and keeps a wider
452
- // `dropdownWidth` dropdown aligned to the input's left edge.
453
- placement: "bottom-start",
454
- middleware: [
455
- $l(4),
456
- Ml({
457
- mainAxis: !0
458
- }),
459
- Al({ padding: 8 }),
460
- Rl({
461
- padding: 8,
462
- apply({ availableHeight: l, elements: n }) {
463
- Object.assign(n.floating.style, {
464
- maxHeight: `${l}px`
465
- });
466
- }
467
- })
468
- ]
469
- }), { width: rl } = kl(D), Ae = (l) => {
470
- var n;
471
- return t.disabled || !t.disabled && t.addOnly && !!((n = y.value) != null && n.includes(l));
472
- }, Z = f(() => {
473
- const l = t.options.map((v) => ({
474
- ...v,
475
- checked: M.value.includes(v.value),
476
- disabled: v.disabled ?? Ae(v.value)
477
- })), n = [
478
- ...l,
479
- ...S.value.length === 0 && ne.value ? ne.value.filter(
480
- (v) => !l.some(($) => $.value === v.value)
481
- ) : []
482
- ];
483
- return t.optionsOrderProperties && !Se(t.optionsOrderProperties) ? Gl(n, t.optionsOrderProperties, t.optionsOrder) : n;
484
- }), Re = (l) => Z.value.filter((n) => l.some((v) => n.value === v)), j = f(() => Re(M.value)), E = f(() => j.value[0]), xe = f(() => {
485
- var l;
486
- if (!(h.value || !t.showSuffixInClosedInput) && !(a.value && j.value.length !== 1))
487
- return (l = E.value) == null ? void 0 : l.labelSuffixComponent;
488
- }), X = f(() => {
489
- var l;
490
- if (!t.showSelectionInClosedInput || h.value || !a.value)
491
- return;
492
- const n = (l = E.value) == null ? void 0 : l.labelPrefixComponent;
493
- if (n)
494
- return { component: n, extraCount: j.value.length - 1 };
495
- }), ul = f(() => t.size === "xs" ? "px-1" : t.size === "sm" ? "px-2" : "px-4"), ne = G([]);
496
- ge(
497
- () => {
498
- if (a.value) return null;
499
- const l = O.value ?? "";
500
- return {
501
- selectedValue: l,
502
- label: be(t.options.find((n) => n.value === l))
503
- };
504
- },
505
- (l) => {
506
- if (l) {
507
- if (!l.selectedValue) {
508
- N.value = "", h.value || (S.value = "");
509
- return;
510
- }
511
- l.label && (N.value = l.label, h.value || (S.value = l.label));
512
- }
513
- },
514
- { immediate: !0 }
515
- );
516
- const Te = ({
517
- value: l,
518
- checked: n
519
- }) => {
520
- let v;
521
- a.value ? v = n ? [...M.value, l] : M.value.filter(($) => $ !== l) : (v = [l], N.value = be(
522
- Z.value.find(($) => $.value === l)
523
- ), S.value = N.value, _.value = !1, h.value = !1, he()), ne.value = Re(v), M.value = v, g("change");
524
- }, Oe = f(
525
- () => M.value.length > 0 && !t.disabled && !(M.value.length === 1 && M.value[0] === "")
526
- ), oe = () => {
527
- M.value = [], C.value = [], a.value || (N.value = "", S.value = "", _.value = !1);
528
- }, dl = () => {
529
- if (!a.value && N.value && S.value === N.value) {
530
- oe();
531
- return;
532
- }
533
- S.value = "";
534
- }, cl = f(() => {
535
- if (!c || !a.value && !_.value)
536
- return Z.value;
537
- const l = S.value.toLowerCase();
538
- return Z.value.filter((n) => n.searchValues ? n.searchValues.some(
539
- (v) => v.toLowerCase().includes(l)
540
- ) : (n.label ?? "").toLowerCase().includes(l));
541
- }), U = () => {
542
- a.value ? (m.value = C.value, S.value = "") : S.value === "" && t.hasReset ? oe() : (S.value = N.value, _.value = !1), h.value = !1;
543
- };
544
- ge(C, () => {
545
- !h.value && !xl(m.value, C.value) && a.value && (m.value = C.value);
546
- }), wl("mousedown", (l) => {
547
- const n = l.composedPath();
548
- q.value && n.includes(q.value) || D.value && n.includes(D.value) || h.value && U();
549
- });
550
- const fl = f(() => {
551
- var l, n, v, $, B, b;
552
- return a.value && h.value ? ((l = t.i18n) == null ? void 0 : l.placeholderSearch) ?? "Search" : X.value ? "" : a.value && j.value.length === 1 ? (n = E.value) == null ? void 0 : n.label : a.value && j.value.length >= 2 ? `${(v = E.value) == null ? void 0 : v.label} +${j.value.length - 1}` : !O.value && !E.value ? h.value ? (($ = t.i18n) == null ? void 0 : $.placeholderSearch) ?? "Search" : ((B = t.i18n) == null ? void 0 : B.placeholderDefault) ?? "Select an option" : h.value ? ((b = t.i18n) == null ? void 0 : b.placeholderSearch) ?? "Search" : !t.singleModelValue && !E.value ? "" : be(
553
- Z.value.find((A) => {
554
- var Y;
555
- return A.value === ((Y = fe.value) == null ? void 0 : Y.value);
556
- })
557
- );
558
- }), ml = f(() => {
559
- const l = !h.value && (!a.value && !!O.value || a.value && !Se(t.multiModelValue));
560
- return Dl(t.inputClass, {
561
- "text-ellipsis placeholder:text-default": l
562
- });
563
- }), Be = f(() => S.value === ""), vl = f(() => !(Be.value || !a.value && N.value !== "" && S.value === N.value && !t.hasReset)), pl = f(
564
- () => Oe.value && !!t.hasReset && Be.value && (a.value || !h.value)
565
- ), hl = !!(u != null && u.onAddOption), bl = () => {
566
- g("add-option"), U();
567
- }, ye = f(
568
- () => {
569
- var l;
570
- return !h.value && !a.value && ((l = E.value) == null ? void 0 : l.labelPrefixComponent);
571
- }
572
- ), Ve = `search-select-options-${Math.random().toString(36).substring(2, 9)}`;
573
- return i({
574
- flushMemoryCachedSelectedOptions: () => ne.value = [],
575
- close: U
576
- }), (l, n) => {
577
- var v, $, B;
578
- return s(), I(ee, null, [
579
- k("div", dt, [
580
- k("div", {
581
- ref_key: "wrapperRef",
582
- ref: D,
583
- class: P(["relative flex items-end", {
584
- [`${e.rootClass}`]: e.rootClass,
585
- "z-30": h.value
586
- }]),
587
- role: "combobox",
588
- "aria-expanded": h.value,
589
- "aria-haspopup": !0,
590
- "aria-controls": Ve,
591
- onKeydown: ol
592
- }, [
593
- F(w(We), {
594
- ref_key: "inputRef",
595
- ref: ll,
596
- modelValue: S.value,
597
- "onUpdate:modelValue": n[1] || (n[1] = (b) => S.value = b),
598
- required: e.required,
599
- label: e.label,
600
- name: e.name,
601
- form: e.form,
602
- "label-screen-reader-only": e.labelScreenReaderOnly,
603
- placeholder: fl.value,
604
- class: "grow",
605
- "wrapper-class": [
606
- {
607
- "border-transparent border border-b-gray-200 focus-within:border-b relative z-10 rounded-b-none": h.value
608
- },
609
- e.wrapperClass
610
- ],
611
- "input-class": ml.value,
612
- "suffix-class": "border-l-0",
613
- disabled: e.disabled,
614
- size: e.size,
615
- error: e.error,
616
- invalid: e.invalid,
617
- "prefix-has-border": de.value,
618
- "aria-autocomplete": "list",
619
- onFocus: tl,
620
- onClick: al,
621
- onInput: nl,
622
- onBlur: n[2] || (n[2] = (b) => l.$emit("blur"))
623
- }, Ee({
624
- suffix: L(() => {
625
- var b, A;
626
- return [
627
- k("div", vt, [
628
- !h.value && !a.value && ((b = E.value) != null && b.labelInlineComponent) && (!e.showSuffixInClosedInput || e.showSuffixLabelInInput) ? (s(), x(R(E.value.labelInlineComponent.component), T(V({ key: 0 }, E.value.labelInlineComponent.props)), null, 16)) : p("", !0),
629
- !h.value && !a.value && ((A = E.value) != null && A.labelBeforeSuffixComponent) && (!e.showSuffixInClosedInput || e.showSuffixLabelInInput) ? (s(), x(R(E.value.labelBeforeSuffixComponent.component), T(V({ key: 1 }, E.value.labelBeforeSuffixComponent.props)), null, 16)) : p("", !0),
630
- xe.value ? (s(), x(R(xe.value.component), T(V({ key: 2 }, xe.value.props)), null, 16)) : p("", !0),
631
- k("div", pt, [
632
- pl.value ? (s(), x(ze, {
633
- key: 0,
634
- icon: "close",
635
- size: "sm",
636
- intent: "subtle",
637
- type: "button",
638
- onMousedown: n[0] || (n[0] = qe(() => {
639
- }, ["prevent"])),
640
- onClick: oe
641
- })) : p("", !0),
642
- vl.value ? (s(), x(ze, {
643
- key: 1,
644
- icon: "close",
645
- size: "sm",
646
- intent: "subtle",
647
- type: "button",
648
- onClick: dl
649
- })) : p("", !0),
650
- F(Fe, {
651
- icon: h.value ? "keyboard_arrow_up" : "keyboard_arrow_down",
652
- size: e.size === "xs" || e.size === "sm" ? "xs" : "sm",
653
- class: P(e.disabled ? "text-disabled" : "text-secondary"),
654
- "aria-hidden": "true",
655
- "data-testid": "search-select-chevron"
656
- }, null, 8, ["icon", "size", "class"])
657
- ])
658
- ])
659
- ];
660
- }),
661
- _: 2
662
- }, [
663
- l.$slots["label-suffix"] ? {
664
- name: "label-suffix",
665
- fn: L(() => [
666
- H(l.$slots, "label-suffix")
667
- ]),
668
- key: "0"
669
- } : void 0,
670
- l.$slots.tooltip ? {
671
- name: "tooltip",
672
- fn: L(() => [
673
- H(l.$slots, "tooltip")
674
- ]),
675
- key: "1"
676
- } : void 0,
677
- X.value ? {
678
- name: "input",
679
- fn: L(() => [
680
- k("div", {
681
- class: P(["pointer-events-none absolute inset-0 flex items-center gap-1", ul.value])
682
- }, [
683
- (s(), x(R(X.value.component.component), T(Pe(X.value.component.props)), null, 16)),
684
- X.value.extraCount > 0 ? (s(), x(w(ke), {
685
- key: 0,
686
- variant: e.size === "xs" || e.size === "sm" ? "body-xs" : "body-sm",
687
- tag: "span",
688
- weight: "semibold",
689
- "no-spacing": ""
690
- }, {
691
- default: L(() => [
692
- Q(" +" + z(X.value.extraCount), 1)
693
- ]),
694
- _: 1
695
- }, 8, ["variant"])) : p("", !0)
696
- ], 2)
697
- ]),
698
- key: "2"
699
- } : void 0,
700
- K.value || ye.value || !c ? {
701
- name: "prefix",
702
- fn: L(() => {
703
- var b;
704
- return [
705
- k("div", ft, [
706
- te.value ? H(l.$slots, "prefix", {}, void 0, void 0, 0) : ae.value ? (s(), x(w(ke), {
707
- key: 1,
708
- variant: e.size === "xs" ? "body-xs" : "body-sm",
709
- tag: "span",
710
- weight: "semibold"
711
- }, {
712
- default: L(() => [
713
- Q(z(e.prefix), 1)
714
- ]),
715
- _: 1
716
- }, 8, ["variant"])) : ye.value && ((b = E.value) != null && b.labelPrefixComponent) ? (s(), I("div", mt, [
717
- (s(), x(R(E.value.labelPrefixComponent.component), T(Pe(E.value.labelPrefixComponent.props)), null, 16))
718
- ])) : c ? p("", !0) : (s(), x(Fe, {
719
- key: 3,
720
- icon: "search",
721
- size: "sm"
722
- }))
723
- ])
724
- ];
725
- }),
726
- key: "3"
727
- } : void 0,
728
- l.$slots.helper ? {
729
- name: "helper",
730
- fn: L(() => [
731
- H(l.$slots, "helper")
732
- ]),
733
- key: "4"
734
- } : void 0
735
- ]), 1032, ["modelValue", "required", "label", "name", "form", "label-screen-reader-only", "placeholder", "wrapper-class", "input-class", "disabled", "size", "error", "invalid", "prefix-has-border"])
736
- ], 42, ct),
737
- e.withChips ? (s(), I("div", ht, [
738
- (s(!0), I(ee, null, Ze(j.value, ({ value: b, label: A }) => (s(), x(Pl, {
739
- key: b,
740
- removable: !Ae(b),
741
- onRemoved: (Y) => Te({ value: b, checked: !1 })
742
- }, {
743
- default: L(() => [
744
- k("span", { innerHTML: A }, null, 8, bt)
745
- ]),
746
- _: 2
747
- }, 1032, ["removable", "onRemoved"]))), 128))
748
- ])) : p("", !0)
749
- ]),
750
- w(me) && w(d) ? (s(), x(Sl, {
751
- key: 0,
752
- to: w(d)
753
- }, [
754
- h.value && !e.disabled ? (s(), I("div", {
755
- key: 0,
756
- id: Ve,
757
- ref_key: "optionsRef",
758
- ref: q,
759
- role: "listbox",
760
- style: De(w(il)),
761
- class: "z-70 overflow-y-auto rounded border border-gray-200 bg-white drop-shadow-md",
762
- onMouseenter: n[3] || (n[3] = (b) => h.value = !0),
763
- onKeydown: sl
764
- }, [
765
- k("div", {
766
- class: "rounded pt-0",
767
- style: De({ width: `${e.dropdownWidth ?? w(rl)}px` })
768
- }, [
769
- F(ut, {
770
- i18n: {
771
- addOnly: (v = e.i18n) == null ? void 0 : v.addOnly,
772
- noResults: ($ = e.i18n) == null ? void 0 : $.noResults,
773
- noOptionsAvailable: (B = e.i18n) == null ? void 0 : B.noOptionsAvailable
774
- },
775
- options: cl.value,
776
- multiple: a.value,
777
- search: S.value,
778
- model: M.value,
779
- "add-only": e.addOnly,
780
- "allows-multiple-values": !!a.value,
781
- condensed: e.condensed,
782
- "has-large-dropdown": e.hasLargeDropdown,
783
- onValueChanged: Te
784
- }, {
785
- "list-footer-content": L(() => [
786
- hl ? (s(), x(Ce, {
787
- key: 0,
788
- intent: "subtle",
789
- class: "w-full rounded-t-none",
790
- type: "button",
791
- "icon-prefix": "add",
792
- onClick: bl
793
- }, {
794
- default: L(() => {
795
- var b;
796
- return [
797
- Q(z((b = e.i18n) == null ? void 0 : b.addOption), 1)
798
- ];
799
- }),
800
- _: 1
801
- })) : p("", !0),
802
- a.value ? (s(), I("div", {
803
- key: 1,
804
- class: P(["flex items-center justify-between", { "py-2": !l.$slots["list-footer-content"] }])
805
- }, [
806
- Oe.value ? (s(), x(Ce, {
807
- key: 0,
808
- type: "button",
809
- intent: "subtle",
810
- size: "xs",
811
- class: "ml-2",
812
- onClick: oe
813
- }, {
814
- default: L(() => {
815
- var b;
816
- return [
817
- Q(z(((b = e.i18n) == null ? void 0 : b.multipleValuesClearButtonText) ?? "Clear"), 1)
818
- ];
819
- }),
820
- _: 1
821
- })) : p("", !0),
822
- k("div", null, [
823
- H(l.$slots, "list-footer-content", { close: U })
824
- ]),
825
- F(Ce, {
826
- type: "button",
827
- intent: "secondary",
828
- size: "xs",
829
- class: "mr-2",
830
- "data-testid": w(jl),
831
- onClick: U
832
- }, {
833
- default: L(() => {
834
- var b;
835
- return [
836
- Q(z(((b = e.i18n) == null ? void 0 : b.multipleValuesDoneButtonText) ?? "Done"), 1)
837
- ];
838
- }),
839
- _: 1
840
- }, 8, ["data-testid"])
841
- ], 2)) : H(l.$slots, "list-footer-content", { close: U }, void 0, void 0, 2)
842
- ]),
843
- _: 3
844
- }, 8, ["i18n", "options", "multiple", "search", "model", "add-only", "allows-multiple-values", "condensed", "has-large-dropdown"])
845
- ], 4)
846
- ], 36)) : p("", !0)
847
- ], 8, ["to"])) : p("", !0)
848
- ], 64);
849
- };
850
- }
851
- }), Xt = /* @__PURE__ */ J({
852
- __name: "CountrySelect",
853
- props: {
854
- label: {},
855
- singleModelValue: {},
856
- multiModelValue: {},
857
- error: {},
858
- required: { type: Boolean, default: !0 },
859
- hasReset: { type: Boolean },
860
- disabled: { type: Boolean },
861
- size: {},
862
- labelScreenReaderOnly: { type: Boolean },
863
- i18n: {},
864
- name: {},
865
- form: {}
866
- },
867
- emits: ["update:modelValue", "update:singleModelValue"],
868
- setup(e, { emit: i }) {
869
- const r = e, o = re(r, "singleModelValue"), t = re(r, "multiModelValue"), d = i;
870
- return (u, c) => (s(), x(xt, {
871
- "multi-model-value": w(t),
872
- "onUpdate:multiModelValue": c[0] || (c[0] = (a) => Ne(t) ? t.value = a : null),
873
- "single-model-value": w(o),
874
- "onUpdate:singleModelValue": [
875
- c[1] || (c[1] = (a) => Ne(o) ? o.value = a : null),
876
- c[2] || (c[2] = (a) => {
877
- d("update:modelValue", a);
878
- })
879
- ],
880
- "root-class": u.$attrs.class,
881
- label: e.label,
882
- options: w(Ye).map(({ key: a, value: y }) => ({ label: y, value: a })),
883
- error: e.error,
884
- "has-reset": e.hasReset,
885
- disabled: e.disabled,
886
- required: e.required,
887
- "with-chips": !!e.multiModelValue,
888
- name: e.name,
889
- form: e.form,
890
- size: e.size,
891
- "label-screen-reader-only": e.labelScreenReaderOnly,
892
- i18n: e.i18n
893
- }, Ee({ _: 2 }, [
894
- u.$slots["label-suffix"] ? {
895
- name: "label-suffix",
896
- fn: L(() => [
897
- H(u.$slots, "label-suffix")
898
- ]),
899
- key: "0"
900
- } : void 0
901
- ]), 1032, ["multi-model-value", "single-model-value", "root-class", "label", "options", "error", "has-reset", "disabled", "required", "with-chips", "name", "form", "size", "label-screen-reader-only", "i18n"]));
902
- }
903
- });
904
- function Yt(e) {
905
- return !!Ye.find((i) => i.key === e);
906
- }
907
- const Qe = {
908
- AT: {
909
- regex: /^ATU\d{8}$/,
910
- prefix: "AT",
911
- example: "ATU12345678"
912
- },
913
- BE: {
914
- regex: /^BE0?\d{9}$/,
915
- prefix: "BE",
916
- example: "BE0123456789"
917
- },
918
- BG: {
919
- regex: /^BG\d{9,10}$/,
920
- prefix: "BG",
921
- example: "BG123456789"
922
- },
923
- HR: {
924
- regex: /^HR\d{11}$/,
925
- prefix: "HR",
926
- example: "HR12345678901"
927
- },
928
- CY: {
929
- regex: /^CY\d{8}[A-Z]$/,
930
- prefix: "CY",
931
- example: "CY12345678X"
932
- },
933
- CZ: {
934
- regex: /^CZ\d{8,10}$/,
935
- prefix: "CZ",
936
- example: "CZ12345678"
937
- },
938
- DE: {
939
- regex: /^DE\d{9}$/,
940
- prefix: "DE",
941
- example: "DE123456789"
942
- },
943
- DK: {
944
- regex: /^DK\d{8}$/,
945
- prefix: "DK",
946
- example: "DK12345678"
947
- },
948
- EE: {
949
- regex: /^EE\d{9}$/,
950
- prefix: "EE",
951
- example: "EE123456789"
952
- },
953
- GR: {
954
- regex: /^(EL|GR)\d{9}$/,
955
- prefix: "GR",
956
- example: "GR123456789"
957
- },
958
- ES: {
959
- regex: /^ES[A-Z0-9]\d{7}[A-Z0-9]$/,
960
- prefix: "ES",
961
- example: "ESX1234567X"
962
- },
963
- FI: {
964
- regex: /^FI\d{8}$/,
965
- prefix: "FI",
966
- example: "FI12345678"
967
- },
968
- FR: {
969
- regex: /^FR[0-9A-Z]{2}\d{9}$/,
970
- prefix: "FR",
971
- example: "FRXX123456789"
972
- },
973
- HU: {
974
- regex: /^HU\d{8}$/,
975
- prefix: "HU",
976
- example: "HU12345678"
977
- },
978
- IE: {
979
- regex: /^IE[0-9A-Z]{8,9}$/,
980
- prefix: "IE",
981
- example: "IE1234567A"
982
- },
983
- IS: {
984
- regex: /^IS\d{5}$/,
985
- prefix: "IS",
986
- example: "IS12345"
987
- },
988
- IT: {
989
- regex: /^IT\d{11}$/,
990
- prefix: "IT",
991
- example: "IT12345678901"
992
- },
993
- LT: {
994
- regex: /^LT(\d{9}|\d{12})$/,
995
- prefix: "LT",
996
- example: "LT123456789 or LT123456789012"
997
- },
998
- LU: {
999
- regex: /^LU\d{8}$/,
1000
- prefix: "LU",
1001
- example: "LU12345678"
1002
- },
1003
- LV: {
1004
- regex: /^LV\d{11}$/,
1005
- prefix: "LV",
1006
- example: "LV12345678901"
1007
- },
1008
- ME: {
1009
- regex: /^ME\d{9}$/,
1010
- prefix: "ME",
1011
- example: "ME123456789"
1012
- },
1013
- MT: {
1014
- regex: /^MT\d{8}$/,
1015
- prefix: "MT",
1016
- example: "MT12345678"
1017
- },
1018
- NL: {
1019
- regex: /^NL\d{9}B\d{2}$/,
1020
- prefix: "NL",
1021
- example: "NL123456789B01"
1022
- },
1023
- PL: {
1024
- regex: /^PL\d{10}$/,
1025
- prefix: "PL",
1026
- example: "PL1234567890"
1027
- },
1028
- PT: {
1029
- regex: /^PT\d{9}$/,
1030
- prefix: "PT",
1031
- example: "PT123456789"
1032
- },
1033
- RO: {
1034
- regex: /^RO\d{2,10}$/,
1035
- prefix: "RO",
1036
- example: "RO1234567890"
1037
- },
1038
- RU: {
1039
- regex: /^RU(\d{9}|\d{10}|\d{12})$/,
1040
- prefix: "RU",
1041
- example: "RU123456789 or RU1234567890 or RU123456789012"
1042
- },
1043
- SE: {
1044
- regex: /^SE\d{10}01$/,
1045
- prefix: "SE",
1046
- example: "SE123456789001"
1047
- },
1048
- SI: {
1049
- regex: /^SI\d{8}$/,
1050
- prefix: "SI",
1051
- example: "SI12345678"
1052
- },
1053
- SK: {
1054
- regex: /^SK\d{10}$/,
1055
- prefix: "SK",
1056
- example: "SK1234567890"
1057
- },
1058
- CH: {
1059
- regex: /^CHE\d{9}(MWST|TVA|IVA)?$/,
1060
- prefix: "CHE",
1061
- example: "CHE123456789MWST"
1062
- },
1063
- NO: {
1064
- regex: /^NO\d{9}MVA$/,
1065
- prefix: "NO",
1066
- example: "NO123456789MVA"
1067
- },
1068
- GB: {
1069
- regex: /^GB(\d{9}|\d{12}|GD\d{3}|HA\d{3})$/,
1070
- prefix: "GB",
1071
- example: "GB123456789"
1072
- },
1073
- XI: {
1074
- regex: /^XI(\d{9}|\d{12})$/,
1075
- prefix: "XI",
1076
- example: "XI123456789"
1077
- }
1078
- }, yt = (e) => !e || typeof e != "string" || e.trim() === "" ? !0 : Object.values(Qe).some((i) => i.regex.test(e)), gt = ({ $model: e }) => {
1079
- if (!e || typeof e != "string" || e.trim() === "")
1080
- return "";
1081
- const i = je(Ol, null);
1082
- if (!i)
1083
- return "Invalid tax ID";
1084
- const { formatMessage: r } = i, o = Object.values(Qe).find(
1085
- (t) => e.toUpperCase().startsWith(t.prefix.toUpperCase())
1086
- );
1087
- return o ? r(
1088
- {
1089
- defaultMessage: "Invalid tax ID format. Example: {example}",
1090
- id: "form_validation.tax_id.invalid_format",
1091
- description: "Error message when tax ID format is invalid but prefix matches"
1092
- },
1093
- { example: o.example }
1094
- ) : r({
1095
- defaultMessage: "Invalid tax ID",
1096
- id: "taxId.invalid",
1097
- description: "Error message when tax ID is invalid"
1098
- });
1099
- }, Wt = Nl.withMessage(gt, yt), Ge = ["email", "country"], Ct = "GENERIC_TAX_ID", He = {
1100
- US: ["addressLine1", "postalCode"],
1101
- CA: ["state"]
1102
- }, St = (e) => !e || !He[e] ? Ge : [...He[e], ...Ge], Je = (e) => e.type === "ORGANIZATION" && e.country !== "US", ue = {
1103
- BILLING: {
1104
- line1: "addressLine1",
1105
- line2: "addressLine2",
1106
- postalCode: "postalCode",
1107
- city: "city",
1108
- state: "state",
1109
- country: "country"
1110
- },
1111
- SHIPPING: {
1112
- line1: "shippingAddressLine1",
1113
- line2: "shippingAddressLine2",
1114
- postalCode: "shippingPostalCode",
1115
- city: "shippingCity",
1116
- state: "shippingState",
1117
- country: "shippingCountry"
1118
- }
1119
- }, It = ["line1", "line2", "postalCode", "city", "state", "country"], kt = ["A", "C", "S", "Z"], wt = {
1120
- A: ["line1", "line2"],
1121
- C: ["city"],
1122
- S: ["state"],
1123
- Z: ["postalCode"]
1124
- }, _e = (e) => kt.filter((i) => e.includes(i)).flatMap(
1125
- (i) => wt[i]
1126
- ), Lt = (e) => _e((e == null ? void 0 : e.fields) ?? "ACSZ"), Et = (e, i) => {
1127
- const r = St(i);
1128
- return It.filter((o) => r.includes(ue.BILLING[o])).map(
1129
- (o) => ue[e][o]
1130
- );
1131
- }, Qt = (e, i, r) => {
1132
- const o = r ? _e(r.required).filter((t) => t !== "line2") : ["line1", "postalCode", "city"];
1133
- return [
1134
- .../* @__PURE__ */ new Set([
1135
- ...o.map((t) => ue[e][t]),
1136
- ...Et(e, i)
1137
- ])
1138
- ];
1139
- }, ie = (e) => (e == null ? void 0 : e.trim()) || void 0, el = (e, i, r) => {
1140
- var c;
1141
- const o = ue[i], t = new Set(Lt(r)), d = (a) => t.has(a) ? ie(e[o[a]]) : void 0, u = (c = d("postalCode")) == null ? void 0 : c.toUpperCase();
1142
- return {
1143
- ...d("line1") && { line1: d("line1") },
1144
- ...d("line2") && { line2: d("line2") },
1145
- ...d("city") && { city: d("city") },
1146
- ...d("state") && { state: d("state") },
1147
- ...u && { postal_code: u },
1148
- country: e[o.country] ?? ""
1149
- };
1150
- }, $t = (e, i) => {
1151
- const r = el(e, "SHIPPING", i);
1152
- return {
1153
- addressLine1: r.line1,
1154
- addressLine2: r.line2,
1155
- postalCode: r.postal_code,
1156
- city: r.city,
1157
- state: r.state,
1158
- country: e.shippingCountry
1159
- };
1160
- }, Jt = (e, i, r) => {
1161
- var u;
1162
- const o = ie(e.shippingAttentionName), t = ie(e.shippingFirstName), d = ie(e.shippingLastName);
1163
- return {
1164
- reference: i,
1165
- recipient: {
1166
- type: e.type,
1167
- ...e.type === "ORGANIZATION" ? {
1168
- organization: {
1169
- company_name: e.companyLegalName ?? "",
1170
- ...o && { attention_name: o }
1171
- }
1172
- } : {
1173
- individual: {
1174
- name: {
1175
- ...t && { first_name: t },
1176
- ...d && { last_name: d }
1177
- }
1178
- }
1179
- },
1180
- phone_number: ((u = e.shippingPhoneNumber) == null ? void 0 : u.trim()) ?? "",
1181
- email: e.email ?? ""
1182
- },
1183
- address: el(e, "SHIPPING", r)
1184
- };
1185
- }, _t = (e, { isShipped: i, format: r }) => Mt(i ? { ...e, ...$t(e, r) } : e, {
1186
- withVatNumber: Je(e)
1187
- }), Mt = (e, { withVatNumber: i = Je(e) } = {}) => {
1188
- const r = {
1189
- ...e.addressLine1 && { line1: e.addressLine1 },
1190
- ...e.addressLine2 && { line2: e.addressLine2 },
1191
- ...e.city && { city: e.city },
1192
- ...e.state && { state: e.state },
1193
- ...e.postalCode && { postal_code: e.postalCode },
1194
- country: e.country ?? ""
1195
- };
1196
- return e.type === "ORGANIZATION" ? {
1197
- type: "ORGANIZATION",
1198
- organization: {
1199
- legal_name: e.companyLegalName ?? "",
1200
- registered_address: r,
1201
- ...e.companyVatNumber && i && {
1202
- tax_ids: [
1203
- { id: e.companyVatNumber, type: Ct }
1204
- ]
1205
- }
1206
- }
1207
- } : {
1208
- type: "INDIVIDUAL",
1209
- individual: {
1210
- residential_address: r
1211
- }
1212
- };
1213
- }, At = ["for"], ea = /* @__PURE__ */ J({
1214
- __name: "HiddenLabelInput",
1215
- props: /* @__PURE__ */ Ie({
1216
- label: { type: String },
1217
- name: { type: String },
1218
- placeholder: { type: String },
1219
- error: { type: [String, Array] },
1220
- autocomplete: { type: String }
1221
- }, {
1222
- modelValue: {},
1223
- modelModifiers: {}
1224
- }),
1225
- emits: ["update:modelValue"],
1226
- setup(e) {
1227
- const i = e, r = Xe(e, "modelValue"), o = Il(), t = f(
1228
- () => Array.isArray(i.error) ? !!i.error.length : !!i.error
1229
- );
1230
- return (d, u) => (s(), I("div", null, [
1231
- k("label", {
1232
- for: w(o),
1233
- class: "sr-only"
1234
- }, z(e.label), 9, At),
1235
- F(w(We), {
1236
- id: w(o),
1237
- modelValue: r.value,
1238
- "onUpdate:modelValue": u[0] || (u[0] = (c) => r.value = c),
1239
- name: e.name,
1240
- placeholder: e.placeholder,
1241
- error: e.error,
1242
- autocomplete: e.autocomplete
1243
- }, Ee({ _: 2 }, [
1244
- t.value ? {
1245
- name: "helper",
1246
- fn: L(() => [
1247
- F(w(Ul), { message: e.error }, null, 8, ["message"])
1248
- ]),
1249
- key: "0"
1250
- } : void 0
1251
- ]), 1032, ["id", "modelValue", "name", "placeholder", "error", "autocomplete"])
1252
- ]));
1253
- }
1254
- });
1255
- function la() {
1256
- const { $t: e } = Bl();
1257
- return {
1258
- contactInformationTitle: e({
1259
- defaultMessage: "Customer information",
1260
- id: "checkout.contact_information_block.title",
1261
- description: "The title of the contact information block in the checkout form"
1262
- }),
1263
- emailLabel: e({
1264
- defaultMessage: "Email address",
1265
- id: "checkout.email_address.label",
1266
- description: "The email address of the customer in the checkout form"
1267
- }),
1268
- emailPlaceholder: e({
1269
- defaultMessage: "Email address",
1270
- id: "checkout.email_address.placeholder",
1271
- description: "The email address of the customer in the checkout form"
1272
- }),
1273
- countryLabel: e({
1274
- defaultMessage: "Billing country",
1275
- id: "checkout.country.label",
1276
- description: "The country of the customer in the checkout form"
1277
- }),
1278
- countryPlaceholder: e({
1279
- defaultMessage: "Billing country",
1280
- id: "checkout.country.placeholder",
1281
- description: "Placeholder of the billing country select while no country is chosen"
1282
- }),
1283
- vatNumberLabel: e({
1284
- defaultMessage: "VAT number",
1285
- id: "checkout.vat_number.label",
1286
- description: "The label for the vat number in the checkout form"
1287
- }),
1288
- vatNumberPlaceholder: e({
1289
- defaultMessage: "VAT number",
1290
- id: "checkout.vat_number.placeholder",
1291
- description: "The label for the vat number in the checkout form"
1292
- }),
1293
- legalNameLabel: e({
1294
- defaultMessage: "Legal entity name",
1295
- id: "checkout.legal_name.label",
1296
- description: "The legal name of the organization customer in the checkout form"
1297
- }),
1298
- legalNamePlaceholder: e({
1299
- defaultMessage: "Legal entity name",
1300
- id: "checkout.legal_name.placeholder",
1301
- description: "The legal name of the organization customer in the checkout form"
1302
- }),
1303
- addressTitle: e({
1304
- defaultMessage: "Billing address",
1305
- id: "checkout.address.title",
1306
- description: "Label of the billing address, above its first line, in the checkout and billing information forms"
1307
- }),
1308
- addressLine1Label: e({
1309
- defaultMessage: "Address line 1",
1310
- id: "checkout.address.line1.label",
1311
- description: "Address line 1 of the customer address in the checkout form"
1312
- }),
1313
- addressLine2Label: e({
1314
- defaultMessage: "Address line 2",
1315
- id: "checkout.address.line2.label",
1316
- description: "Address line 2 of the customer address in the checkout form"
1317
- }),
1318
- postalCodeLabel: e({
1319
- defaultMessage: "Postal code",
1320
- id: "checkout.address.postal_code.label",
1321
- description: "Postal code of the customer address in the checkout form"
1322
- }),
1323
- cityLabel: e({
1324
- defaultMessage: "City",
1325
- id: "checkout.address.city.label",
1326
- description: "City of the customer address in the checkout form"
1327
- }),
1328
- stateLabel: e({
1329
- defaultMessage: "State",
1330
- id: "checkout.address.state.label",
1331
- description: "State of the customer address in the checkout form"
1332
- }),
1333
- postalCodePlaceholder: e({
1334
- defaultMessage: "Postal code",
1335
- id: "checkout.address.portal_code.placeholder",
1336
- description: "Postal code of the customer address in the checkout form"
1337
- }),
1338
- cityPlaceholder: e({
1339
- defaultMessage: "City",
1340
- id: "checkout.address.city.placeholder",
1341
- description: "City of the customer address in the checkout form"
1342
- }),
1343
- statePlaceholder: e({
1344
- defaultMessage: "State",
1345
- id: "checkout.address.state.placeholder",
1346
- description: "State of the customer address in the checkout form"
1347
- })
1348
- };
1349
- }
1350
- export {
1351
- ue as A,
1352
- Ct as D,
1353
- Xt as _,
1354
- ea as a,
1355
- xt as b,
1356
- Qt as c,
1357
- Je as d,
1358
- $t as e,
1359
- Et as f,
1360
- St as g,
1361
- Jt as h,
1362
- Yt as i,
1363
- _t as j,
1364
- Lt as k,
1365
- jt as o,
1366
- el as r,
1367
- Wt as t,
1368
- la as u
1369
- };