@wisemen/wise-invoicing-web 0.17.0 → 0.18.0

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 (51) hide show
  1. package/dist/{ApprovalReminderSettingsViewDataProvider-CSvHKx35.js → ApprovalReminderSettingsViewDataProvider-BZBuz6EF.js} +4 -4
  2. package/dist/{BillingDocumentDetailViewDataProvider-BSZiFFDZ.js → BillingDocumentDetailViewDataProvider-BCADHPFR.js} +1080 -1079
  3. package/dist/BillingDocumentDetailViewDataProvider.css +1 -1
  4. package/dist/{BillingDocumentPdf-DQWebrh4.js → BillingDocumentPdf-ddBlGdIN.js} +4 -4
  5. package/dist/{CreditNoteDetailViewDataProvider-Bs8kadYX.js → CreditNoteDetailViewDataProvider-Donn5pVv.js} +222 -205
  6. package/dist/{CreditNotePdfViewDataProvider-DxojGCdS.js → CreditNotePdfViewDataProvider-c-apCeCW.js} +3 -3
  7. package/dist/{DunningCaseSendDialog-MJ8KSI2s.js → DunningCaseSendDialog-fgL9OsV8.js} +3 -3
  8. package/dist/{InvoiceApprovalOutOfSyncIndicator-BNlaBokg.js → InvoiceApprovalOutOfSyncIndicator-BoPBNXx1.js} +1 -1
  9. package/dist/{InvoiceApprovalOverviewView-2zmnNJJM.js → InvoiceApprovalOverviewView-BIiJ6gen.js} +9 -9
  10. package/dist/{InvoiceApprovalStatusBadge-C7-CrTtD.js → InvoiceApprovalStatusBadge-CaVSCtI0.js} +4 -4
  11. package/dist/{InvoiceApproveDialogDataProvider-CclSNBDj.js → InvoiceApproveDialogDataProvider-C9NhZX-D.js} +7 -7
  12. package/dist/{InvoiceDeliverySendDialog-BjFaLTOg.js → InvoiceDeliverySendDialog-BICcd6Cf.js} +186 -114
  13. package/dist/{InvoiceDetailViewDataProvider-DK5Tandr.js → InvoiceDetailViewDataProvider-BppXFT6D.js} +609 -600
  14. package/dist/{InvoicePdfView-DA34o3C4.js → InvoicePdfView-BRJaAErd.js} +2 -2
  15. package/dist/{InvoicePdfViewDataProvider-Bl7a578G.js → InvoicePdfViewDataProvider-J7NP1Dhh.js} +3 -3
  16. package/dist/{InvoicePublicProFormaPdfViewDataProvider-DljBWIFb.js → InvoicePublicProFormaPdfViewDataProvider-mZaggXYf.js} +3 -3
  17. package/dist/{InvoicingFileUploadProvider-B3ZzLMR8.js → InvoicingFileUploadProvider-rU9APFrt.js} +2 -2
  18. package/dist/{IssuerSettingsViewDataProvider-BgpoLQZL.js → IssuerSettingsViewDataProvider-D13f6rvi.js} +4 -4
  19. package/dist/{PeppolSettingsViewDataProvider-BD2CGw2K.js → PeppolSettingsViewDataProvider-DymLdaRM.js} +3 -3
  20. package/dist/{api.util-BMza-ojm.js → api.util-sW4gNny-.js} +1 -0
  21. package/dist/{billingDocumentDetail.transformer-D8lwLPds.js → billingDocumentDetail.transformer-DcNMzl46.js} +3 -2
  22. package/dist/client/types.gen.d.ts +1 -0
  23. package/dist/client/zod.gen.d.ts +35 -0
  24. package/dist/{creditNoteDetail.query-8g2bZ21Y.js → creditNoteDetail.query-DiS_-xFz.js} +5 -3
  25. package/dist/{deliveryReason.util-B9ZPSt7J.js → deliveryReason.util-KBh3q_-P.js} +2 -2
  26. package/dist/{dist-Ck8ZEByl.js → dist-C99_-gWv.js} +2 -2
  27. package/dist/{dist-ByzJNujV.js → dist-CyUNvdkD.js} +1 -1
  28. package/dist/{documentTitle.composable-QdSLs6eT.js → documentTitle.composable-Dl8Cm3v3.js} +1 -1
  29. package/dist/{i18n.lib-Bs40rct-.js → i18n.lib-DckceEsg.js} +4 -0
  30. package/dist/index.d.ts +4 -0
  31. package/dist/index.js +320 -392
  32. package/dist/{invoice.service-Dqj-rXA5.js → invoice.service-2QiktTs9.js} +5 -3
  33. package/dist/{invoiceApproval.service-C4ZxwGB8.js → invoiceApproval.service-DXIKgCI_.js} +2 -2
  34. package/dist/{invoiceApprovalStatus.util-B6IhZXLq.js → invoiceApprovalStatus.util-CB5pi_hm.js} +2 -2
  35. package/dist/{invoiceCustomer.service-BNekA43U.js → invoiceCustomer.service-BNQJt1KV.js} +2 -2
  36. package/dist/{invoiceDeliveryStatus.util-CJGCDiFf.js → invoiceDeliveryStatus.util-Dp9hD1Tj.js} +3 -3
  37. package/dist/{invoiceDetail.query-xl08jVB3.js → invoiceDetail.query-MIrBYgNS.js} +1 -1
  38. package/dist/{invoicingConfig.composable-B0Kj9ini.js → invoicingConfig.composable-D-hxnEnh.js} +2 -2
  39. package/dist/{issuerSettings.query-Cmt5oUiJ.js → issuerSettings.query-CR7EtvNm.js} +2 -2
  40. package/dist/libs/i18n.lib.d.ts +4 -0
  41. package/dist/locales/en-US.json.d.ts +2 -0
  42. package/dist/locales/nl-BE.json.d.ts +2 -0
  43. package/dist/models/billing-document/billingDocumentDetail.model.d.ts +1 -0
  44. package/dist/modules/credit-note/api/mutations/creditNoteUpdate.mutation.d.ts +1 -0
  45. package/dist/modules/credit-note/models/update/creditNoteUpdateForm.model.d.ts +1 -0
  46. package/dist/modules/invoice/api/mutations/invoiceUpdate.mutation.d.ts +1 -0
  47. package/dist/modules/invoice/models/invoice/payment/invoicePaymentCreateForm.model.d.ts +1 -1
  48. package/dist/modules/invoice/models/invoice/update/invoiceUpdateForm.model.d.ts +1 -0
  49. package/dist/{reminderConfig.query-DDLxE3no.js → reminderConfig.query-DJmhJp6W.js} +2 -2
  50. package/dist/style.css +1 -1
  51. package/package.json +4 -4
@@ -1,7 +1,7 @@
1
- import { n as e } from "./invoicingConfig.composable-B0Kj9ini.js";
1
+ import { n as e } from "./invoicingConfig.composable-D-hxnEnh.js";
2
2
  import { t } from "./DataProvider-BtnD-BzI.js";
3
- import { t as n } from "./InvoicePdfView-DA34o3C4.js";
4
- import { t as r } from "./creditNoteDetail.query-8g2bZ21Y.js";
3
+ import { t as n } from "./InvoicePdfView-BRJaAErd.js";
4
+ import { t as r } from "./creditNoteDetail.query-DiS_-xFz.js";
5
5
  import { useI18n as i } from "vue-i18n";
6
6
  import { computed as a, createBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, openBlock as u, resolveDynamicComponent as d, unref as f, withCtx as p } from "vue";
7
7
  import { UIText as m } from "@wisemen/vue-core-design-system";
@@ -1,7 +1,7 @@
1
- import { it as e, rt as t, t as n } from "./api.util-BMza-ojm.js";
1
+ import { it as e, rt as t, t as n } from "./api.util-sW4gNny-.js";
2
2
  import { r } from "./useCurrencyFormat.composable-MtZaqKnO.js";
3
- import { n as i } from "./invoicingConfig.composable-B0Kj9ini.js";
4
- import { n as a, r as o, t as s } from "./reminderConfig.query-DDLxE3no.js";
3
+ import { n as i } from "./invoicingConfig.composable-D-hxnEnh.js";
4
+ import { n as a, r as o, t as s } from "./reminderConfig.query-DJmhJp6W.js";
5
5
  import { Tt as c, ft as l, m as u } from "./dist-B33lNwLw.js";
6
6
  import { t as d } from "./customerUuid.model-ClN4Vi9n.js";
7
7
  import { z as f } from "zod";
@@ -1,5 +1,5 @@
1
1
  import { ft as e } from "./dist-B33lNwLw.js";
2
- import { t } from "./invoiceCustomer.service-BNekA43U.js";
2
+ import { t } from "./invoiceCustomer.service-BNQJt1KV.js";
3
3
  import { useI18n as n } from "vue-i18n";
4
4
  import { computed as r, createBlock as i, createVNode as a, defineComponent as o, openBlock as s, unref as c, withCtx as l } from "vue";
5
5
  import { useOffsetInfiniteQuery as u } from "@wisemen/vue-core-api-utils";
@@ -1,15 +1,15 @@
1
- import "./api.util-BMza-ojm.js";
2
- import { a as e, o as t, t as n, y as r } from "./documentTitle.composable-QdSLs6eT.js";
1
+ import "./api.util-sW4gNny-.js";
2
+ import { a as e, o as t, t as n, y as r } from "./documentTitle.composable-Dl8Cm3v3.js";
3
3
  import { r as i } from "./useCurrencyFormat.composable-MtZaqKnO.js";
4
4
  import { t as a } from "./search.composable-CU9OpyUB.js";
5
5
  import { Ct as o, G as s, H as c, Q as l, R as u, S as d, Tt as f, W as p, Y as m, et as h, ft as ee, i as g, l as te } from "./dist-B33lNwLw.js";
6
- import { r as _ } from "./dist-ByzJNujV.js";
7
- import { f as v, i as y, n as ne, o as re, r as b, s as ie } from "./dist-Ck8ZEByl.js";
8
- import { t as x } from "./invoiceApprovalStatus.util-B6IhZXLq.js";
9
- import { n as ae, t as S } from "./InvoiceApprovalOutOfSyncIndicator-BNlaBokg.js";
10
- import { t as C } from "./InvoiceApprovalStatusBadge-C7-CrTtD.js";
11
- import { i as w, n as T, r as E, t as D } from "./InvoiceApproveDialogDataProvider-CclSNBDj.js";
12
- import { t as O } from "./invoiceApproval.service-C4ZxwGB8.js";
6
+ import { r as _ } from "./dist-CyUNvdkD.js";
7
+ import { f as v, i as y, n as ne, o as re, r as b, s as ie } from "./dist-C99_-gWv.js";
8
+ import { t as x } from "./invoiceApprovalStatus.util-CB5pi_hm.js";
9
+ import { n as ae, t as S } from "./InvoiceApprovalOutOfSyncIndicator-BoPBNXx1.js";
10
+ import { t as C } from "./InvoiceApprovalStatusBadge-CaVSCtI0.js";
11
+ import { i as w, n as T, r as E, t as D } from "./InvoiceApproveDialogDataProvider-C9NhZX-D.js";
12
+ import { t as O } from "./invoiceApproval.service-DXIKgCI_.js";
13
13
  import { useI18n as k } from "vue-i18n";
14
14
  import { Fragment as A, computed as j, createBlock as M, createCommentVNode as N, createElementBlock as P, createElementVNode as F, createVNode as I, defineComponent as L, isRef as oe, nextTick as R, normalizeClass as z, normalizeStyle as se, openBlock as B, ref as ce, renderList as V, resolveDynamicComponent as le, unref as H, withCtx as U } from "vue";
15
15
  import { useOffsetInfiniteQuery as ue } from "@wisemen/vue-core-api-utils";
@@ -1,8 +1,8 @@
1
- import "./api.util-BMza-ojm.js";
2
- import { a as e, o as t } from "./documentTitle.composable-QdSLs6eT.js";
1
+ import "./api.util-sW4gNny-.js";
2
+ import { a as e, o as t } from "./documentTitle.composable-Dl8Cm3v3.js";
3
3
  import { $ as n, S as r } from "./dist-B33lNwLw.js";
4
- import { r as i } from "./dist-ByzJNujV.js";
5
- import { t as a } from "./invoiceApprovalStatus.util-B6IhZXLq.js";
4
+ import { r as i } from "./dist-CyUNvdkD.js";
5
+ import { t as a } from "./invoiceApprovalStatus.util-CB5pi_hm.js";
6
6
  import { useI18n as o } from "vue-i18n";
7
7
  import { Fragment as s, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createVNode as p, defineComponent as m, normalizeClass as h, openBlock as g, renderList as _, unref as v, withCtx as y } from "vue";
8
8
  import { UIBadge as b, UIText as x, UITooltip as S, UITooltipContent as C } from "@wisemen/vue-core-design-system";
@@ -1,13 +1,13 @@
1
- import { t as e } from "./i18n.lib-Bs40rct-.js";
2
- import "./api.util-BMza-ojm.js";
3
- import { v as t } from "./documentTitle.composable-QdSLs6eT.js";
4
- import { t as n } from "./invoice.service-Dqj-rXA5.js";
1
+ import { t as e } from "./i18n.lib-DckceEsg.js";
2
+ import "./api.util-sW4gNny-.js";
3
+ import { v as t } from "./documentTitle.composable-Dl8Cm3v3.js";
4
+ import { t as n } from "./invoice.service-2QiktTs9.js";
5
5
  import { G as r, ft as i, xt as a } from "./dist-B33lNwLw.js";
6
6
  import { t as o } from "./DataProvider-BtnD-BzI.js";
7
7
  import { t as s } from "./formango.util-D5c2ql--.js";
8
- import { t as c } from "./invoiceApprovalStatus.util-B6IhZXLq.js";
9
- import { t as l } from "./issuerSettings.query-Cmt5oUiJ.js";
10
- import { n as u, r as d, t as f } from "./InvoicingFileUploadProvider-B3ZzLMR8.js";
8
+ import { t as c } from "./invoiceApprovalStatus.util-CB5pi_hm.js";
9
+ import { t as l } from "./issuerSettings.query-CR7EtvNm.js";
10
+ import { n as u, r as d, t as f } from "./InvoicingFileUploadProvider-rU9APFrt.js";
11
11
  import { z as p } from "zod";
12
12
  import { useI18n as m } from "vue-i18n";
13
13
  import { computed as h, createBlock as g, createVNode as _, defineComponent as v, mergeProps as y, openBlock as b, unref as x, withCtx as S } from "vue";
@@ -1,21 +1,21 @@
1
- import { B as e, N as t, V as n, ct as r, l as i, t as a, tt as o } from "./api.util-BMza-ojm.js";
2
- import { S as s, f as c, u as l, x as u } from "./documentTitle.composable-QdSLs6eT.js";
1
+ import { B as e, N as t, V as n, ct as r, l as i, t as a, tt as o } from "./api.util-sW4gNny-.js";
2
+ import { S as s, f as c, u as l, x as u } from "./documentTitle.composable-Dl8Cm3v3.js";
3
3
  import { r as d } from "./useCurrencyFormat.composable-MtZaqKnO.js";
4
- import { n as f } from "./invoicingConfig.composable-B0Kj9ini.js";
5
- import { r as p } from "./dist-ByzJNujV.js";
4
+ import { n as f } from "./invoicingConfig.composable-D-hxnEnh.js";
5
+ import { r as p } from "./dist-CyUNvdkD.js";
6
6
  import { t as m } from "./formango.util-D5c2ql--.js";
7
- import { n as h, t as g } from "./deliveryReason.util-B9ZPSt7J.js";
8
- import _ from "zod";
9
- import { useI18n as v } from "vue-i18n";
10
- import { Fragment as y, computed as b, createBlock as x, createCommentVNode as S, createElementBlock as C, createElementVNode as w, createTextVNode as T, createVNode as E, defineComponent as D, mergeProps as O, normalizeClass as k, onMounted as A, openBlock as j, ref as M, renderList as N, toDisplayString as P, unref as F, withCtx as I } from "vue";
11
- import { useMutation as L, useQuery as R } from "@wisemen/vue-core-api-utils";
12
- import { RouterLink as z } from "vue-router";
13
- import { UIButton as B, UICheckbox as V, UIDialogFooter as ee, UIDialogFooterCancel as te, UIDialogFooterSubmit as ne, UIDialogHeader as re, UIFormDialog as ie, UIText as H, useToast as U } from "@wisemen/vue-core-design-system";
14
- import { useForm as W } from "formango";
7
+ import { n as ee, t as te } from "./deliveryReason.util-KBh3q_-P.js";
8
+ import h from "zod";
9
+ import { useI18n as g } from "vue-i18n";
10
+ import { Fragment as _, computed as v, createBlock as y, createCommentVNode as b, createElementBlock as x, createElementVNode as S, createTextVNode as C, createVNode as w, defineComponent as T, mergeProps as E, normalizeClass as D, onMounted as ne, openBlock as O, ref as k, renderList as A, toDisplayString as j, unref as M, withCtx as N } from "vue";
11
+ import { QueryClient as P, getTanstackQueryClient as F, useMutation as I, useQuery as L } from "@wisemen/vue-core-api-utils";
12
+ import { RouterLink as R } from "vue-router";
13
+ import { UIButton as re, UICheckbox as z, UIDialogFooter as ie, UIDialogFooterCancel as ae, UIDialogFooterSubmit as oe, UIDialogHeader as se, UIFormDialog as ce, UIText as B, useToast as le } from "@wisemen/vue-core-design-system";
14
+ import { useForm as ue } from "formango";
15
15
  //#region src/modules/custom-field/models/custom-field-definition/customFieldViewKey.model.ts
16
- var G = /* @__PURE__ */ function(e) {
16
+ var V = /* @__PURE__ */ function(e) {
17
17
  return e.CREDIT_NOTE_DETAIL = "credit-note-detail", e.INVOICE_DETAIL = "invoice-detail", e.INVOICE_OVERVIEW = "invoice-overview", e;
18
- }({}), K = class {
18
+ }({}), de = class {
19
19
  static fromDto(e) {
20
20
  return {
21
21
  uuid: e.uuid,
@@ -31,28 +31,28 @@ var G = /* @__PURE__ */ function(e) {
31
31
  label: e.label,
32
32
  rules: e.rules,
33
33
  type: e.type,
34
- views: e.views.filter((e) => Object.values(G).includes(e.key)).map((e) => ({
34
+ views: e.views.filter((e) => Object.values(V).includes(e.key)).map((e) => ({
35
35
  key: e.key,
36
36
  order: e.order
37
37
  }))
38
38
  };
39
39
  }
40
- }, q = class {
40
+ }, fe = class {
41
41
  static async getAll(e) {
42
- return (await a.fromPromise(o({ query: e?.entityTypes === void 0 ? void 0 : { filter: { entityTypes: e.entityTypes } } }))).map((e) => e.data.map(K.fromDto));
42
+ return (await a.fromPromise(o({ query: e?.entityTypes === void 0 ? void 0 : { filter: { entityTypes: e.entityTypes } } }))).map((e) => e.data.map(de.fromDto));
43
43
  }
44
44
  };
45
45
  //#endregion
46
46
  //#region src/modules/custom-field/api/queries/customFieldDefinitionIndex.query.ts
47
- function J(e) {
48
- return R("customFieldDefinitionIndex", {
47
+ function pe(e) {
48
+ return L("customFieldDefinitionIndex", {
49
49
  params: { queryParams: e },
50
- queryFn: () => q.getAll(e?.value)
50
+ queryFn: () => fe.getAll(e?.value)
51
51
  });
52
52
  }
53
53
  //#endregion
54
54
  //#region src/modules/custom-field/models/custom-field-definition/customFieldDefinition.util.ts
55
- var Y = class {
55
+ var H = class {
56
56
  static filterByEntityType(e, t) {
57
57
  return e.filter((e) => e.entityType === t);
58
58
  }
@@ -76,7 +76,7 @@ var Y = class {
76
76
  let n = t.toLowerCase(), r = n.split("-")[0], i = e.items.find((e) => e.locale.toLowerCase() === n), a = e.items.find((e) => e.locale.toLowerCase().split("-")[0] === r);
77
77
  return i?.value ?? a?.value ?? e.items[0]?.value ?? "";
78
78
  }
79
- }, X = {
79
+ }, U = {
80
80
  [s.CREDITED]: {
81
81
  isEditable: !1,
82
82
  isRefreshable: !1,
@@ -161,21 +161,21 @@ var Y = class {
161
161
  tone: "purple",
162
162
  translationKey: "wise_invoicing.invoice.status.sent"
163
163
  }
164
- }, ae = {
165
- [u.DRAFT]: X[s.DRAFT],
166
- [u.FINALIZED]: X[s.FINALIZED],
167
- [u.READY]: X[s.READY]
168
- }, oe = class {
164
+ }, me = {
165
+ [u.DRAFT]: U[s.DRAFT],
166
+ [u.FINALIZED]: U[s.FINALIZED],
167
+ [u.READY]: U[s.READY]
168
+ }, he = class {
169
169
  static getLifecycleMetadata(e) {
170
- return ae[e];
170
+ return me[e];
171
171
  }
172
172
  static getMetadata(e) {
173
- return X[e];
173
+ return U[e];
174
174
  }
175
175
  static isEditable(e) {
176
- return X[e].isEditable;
176
+ return U[e].isEditable;
177
177
  }
178
- }, se = /* @__PURE__ */ D({
178
+ }, ge = /* @__PURE__ */ T({
179
179
  __name: "CustomFieldValueText",
180
180
  props: {
181
181
  definition: {},
@@ -183,7 +183,7 @@ var Y = class {
183
183
  value: {}
184
184
  },
185
185
  setup(e) {
186
- let t = e, n = v(), r = d(), i = p(), a = f(), o = b(() => {
186
+ let t = e, n = g(), r = d(), i = p(), a = f(), o = v(() => {
187
187
  switch (t.value.type) {
188
188
  case l.BOOLEAN: return t.value.value ? n.t("wise_invoicing.common.yes") : n.t("wise_invoicing.common.no");
189
189
  case l.DATE: return t.value.value === "infinity" ? n.t("wise_invoicing.custom_field.date.infinity") : t.value.value === "-infinity" ? n.t("wise_invoicing.custom_field.date.negative_infinity") : i.formatPlainDate(t.value.value);
@@ -197,28 +197,100 @@ var Y = class {
197
197
  case l.TIMESTAMP: return i.toDateTime(t.value.value);
198
198
  default: throw TypeError("Unsupported custom field value type");
199
199
  }
200
- }), s = b(() => t.value.type !== l.REFERENCE || t.definition === void 0 ? null : a.getCustomFieldReferenceRoute({
200
+ }), s = v(() => t.value.type !== l.REFERENCE || t.definition === void 0 ? null : a.getCustomFieldReferenceRoute({
201
201
  entityType: t.definition.entityType,
202
202
  key: t.definition.key,
203
203
  value: t.value.value
204
- })), c = b(() => t.size === "md" ? "min-w-0 text-sm/5 text-primary" : "min-w-0 text-xs text-primary");
204
+ })), c = v(() => t.size === "md" ? "min-w-0 text-sm/5 text-primary" : "min-w-0 text-xs text-primary");
205
205
  function u(e) {
206
- return t.definition === void 0 ? e : Y.getChoiceLabel(t.definition, e, n.locale.value);
206
+ return t.definition === void 0 ? e : H.getChoiceLabel(t.definition, e, n.locale.value);
207
207
  }
208
- return (e, r) => s.value !== null && t.definition !== void 0 ? (j(), x(F(z), {
208
+ return (e, r) => s.value !== null && t.definition !== void 0 ? (O(), y(M(R), {
209
209
  key: 0,
210
210
  to: s.value,
211
- class: k([c.value, "underline underline-offset-2 transition-colors hover:text-brand-700 focus-visible:text-brand-700 focus-visible:outline-none"])
211
+ class: D([c.value, "underline underline-offset-2 transition-colors hover:text-brand-700 focus-visible:text-brand-700 focus-visible:outline-none"])
212
212
  }, {
213
- default: I(() => [T(P(F(Y).getLabel(t.definition, F(n).locale.value)), 1)]),
213
+ default: N(() => [C(j(M(H).getLabel(t.definition, M(n).locale.value)), 1)]),
214
214
  _: 1
215
- }, 8, ["to", "class"])) : (j(), x(F(H), {
215
+ }, 8, ["to", "class"])) : (O(), y(M(B), {
216
216
  key: 1,
217
217
  text: o.value || "-",
218
- class: k(c.value)
218
+ class: D(c.value)
219
219
  }, null, 8, ["text", "class"]));
220
220
  }
221
- }), Z = class {
221
+ }), _e = 3e5, W = /* @__PURE__ */ new Map(), G = null, K = null;
222
+ function ve(e) {
223
+ return typeof e == "object" && !!e && "pages" in e && Array.isArray(e.pages);
224
+ }
225
+ function q(e) {
226
+ return ve(e) ? e.pages.flatMap((e) => e.isOk() ? e.getValue().data : []) : [];
227
+ }
228
+ function J(e) {
229
+ return Object.keys(e);
230
+ }
231
+ function Y(e, t) {
232
+ return JSON.stringify(e) === JSON.stringify(t);
233
+ }
234
+ function ye(e, t) {
235
+ let n = J(t.patch);
236
+ return n.every((n) => Y(e[n], t.patch[n])) ? !0 : n.some((n) => n in t.serverValues && !Y(e[n], t.serverValues[n]));
237
+ }
238
+ function be() {
239
+ return F().getQueryCache().findAll({ predicate: (e) => e.queryKey[0] === "invoiceIndex" }).flatMap((e) => q(e.state.data));
240
+ }
241
+ function xe(e, t) {
242
+ return e === void 0 ? {} : Object.fromEntries(J(t).map((t) => [t, e[t]]));
243
+ }
244
+ function X() {
245
+ new P(F()).update("invoiceIndex", {
246
+ by: (e) => W.has(e.uuid),
247
+ value: (e) => ({
248
+ ...e,
249
+ ...W.get(e.uuid)?.patch
250
+ })
251
+ });
252
+ }
253
+ function Se(e) {
254
+ let t = Date.now() - _e;
255
+ for (let [e, n] of W) n.patchedAt <= t && W.delete(e);
256
+ for (let t of e) {
257
+ let e = W.get(t.uuid);
258
+ e !== void 0 && ye(t, e) && W.delete(t.uuid);
259
+ }
260
+ }
261
+ function Z() {
262
+ K?.(), K = null, G = null;
263
+ }
264
+ function Ce(e) {
265
+ if (e.type !== "updated" || e.action.type !== "success" || e.action.manual === !0 || e.query.queryKey[0] !== "invoiceIndex") return;
266
+ let t = e.query.state.data;
267
+ Se(q(t)), W.size === 0 ? Z() : X();
268
+ }
269
+ function we() {
270
+ let e = F().getQueryCache();
271
+ G !== e && (Z(), G = e, K = e.subscribe(Ce));
272
+ }
273
+ var Te = class {
274
+ static reflectBulkAction(e, t) {
275
+ if (e.length === 0) return;
276
+ let n = Date.now(), r = new Map(be().map((e) => [e.uuid, e]));
277
+ for (let i of e) {
278
+ let e = W.get(i);
279
+ W.set(i, {
280
+ patchedAt: n,
281
+ patch: {
282
+ ...e?.patch,
283
+ ...t
284
+ },
285
+ serverValues: {
286
+ ...xe(r.get(i), t),
287
+ ...e?.serverValues
288
+ }
289
+ });
290
+ }
291
+ X(), we();
292
+ }
293
+ }, Q = class {
222
294
  static eligibilityFromDto(e) {
223
295
  return {
224
296
  ...e,
@@ -235,9 +307,9 @@ var Y = class {
235
307
  totalDocuments: e.totalDocuments
236
308
  };
237
309
  }
238
- }, Q = class {
310
+ }, $ = class {
239
311
  static async get(e) {
240
- return (await a.fromPromise(r({ path: { uuid: e } }))).map((e) => e.data.deliveries.map((e) => Z.fromDto(e)));
312
+ return (await a.fromPromise(r({ path: { uuid: e } }))).map((e) => e.data.deliveries.map((e) => Q.fromDto(e)));
241
313
  }
242
314
  static async preview(e) {
243
315
  return (await a.fromPromise(t({
@@ -246,7 +318,7 @@ var Y = class {
246
318
  invoiceUuids: e.invoiceUuids
247
319
  },
248
320
  query: e.query
249
- }))).map((e) => Z.resultFromDto(e.data));
321
+ }))).map((e) => Q.resultFromDto(e.data));
250
322
  }
251
323
  static async send(e) {
252
324
  return (await a.fromPromise(i({
@@ -255,13 +327,13 @@ var Y = class {
255
327
  invoiceUuids: e.invoiceUuids
256
328
  },
257
329
  query: e.query
258
- }))).map((e) => Z.resultFromDto(e.data));
330
+ }))).map((e) => Q.resultFromDto(e.data));
259
331
  }
260
332
  static async sendInvoice(e, t) {
261
333
  return (await a.fromPromise(n({
262
334
  body: { channels: t },
263
335
  path: { uuid: e }
264
- }))).map((e) => Z.resultFromDto(e.data));
336
+ }))).map((e) => Q.resultFromDto(e.data));
265
337
  }
266
338
  static async sendReminder(t) {
267
339
  return (await a.fromPromise(e({ path: { uuid: t } }))).map((e) => e.data.uuid);
@@ -269,9 +341,9 @@ var Y = class {
269
341
  };
270
342
  //#endregion
271
343
  //#region src/modules/invoice-delivery/api/mutations/invoiceDeliverySend.mutation.ts
272
- function ce() {
273
- return L({
274
- queryFn: (e) => e.params.invoiceUuid === void 0 ? Q.send(e.body) : Q.sendInvoice(e.params.invoiceUuid, e.body.channels),
344
+ function Ee() {
345
+ return I({
346
+ queryFn: (e) => e.params.invoiceUuid === void 0 ? $.send(e.body) : $.sendInvoice(e.params.invoiceUuid, e.body.channels),
275
347
  queryKeysToInvalidate: {
276
348
  creditNoteDetail: {},
277
349
  invoiceDeliveries: {},
@@ -282,37 +354,37 @@ function ce() {
282
354
  }
283
355
  //#endregion
284
356
  //#region src/modules/invoice-delivery/components/form/InvoiceDeliveryFormEmailField.vue
285
- var le = /* @__PURE__ */ D({
357
+ var De = /* @__PURE__ */ T({
286
358
  __name: "InvoiceDeliveryFormEmailField",
287
359
  props: { field: {} },
288
360
  setup(e) {
289
- let t = e, n = v();
290
- return (e, r) => (j(), x(F(V), O(F(m)(t.field), { label: F(n).t("wise_invoicing.delivery.channel.email") }), null, 16, ["label"]));
361
+ let t = e, n = g();
362
+ return (e, r) => (O(), y(M(z), E(M(m)(t.field), { label: M(n).t("wise_invoicing.delivery.channel.email") }), null, 16, ["label"]));
291
363
  }
292
- }), ue = /* @__PURE__ */ D({
364
+ }), Oe = /* @__PURE__ */ T({
293
365
  __name: "InvoiceDeliveryFormPeppolField",
294
366
  props: {
295
367
  connection: {},
296
368
  field: {}
297
369
  },
298
370
  setup(e) {
299
- let t = e, n = v();
300
- return (e, r) => (j(), x(F(V), O(F(m)(t.field), { label: F(n).t("wise_invoicing.delivery.send.peppol_label", { provider: F(n).t(`wise_invoicing.delivery.provider.${t.connection.provider}`) }) }), null, 16, ["label"]));
371
+ let t = e, n = g();
372
+ return (e, r) => (O(), y(M(z), E(M(m)(t.field), { label: M(n).t("wise_invoicing.delivery.send.peppol_label", { provider: M(n).t(`wise_invoicing.delivery.provider.${t.connection.provider}`) }) }), null, 16, ["label"]));
301
373
  }
302
- }), de = _.object({
303
- email: _.boolean(),
304
- peppol: _.boolean()
305
- }).refine((e) => e.email || e.peppol), fe = { class: "flex flex-col gap-lg p-lg" }, pe = { key: 1 }, $ = {
374
+ }), ke = h.object({
375
+ email: h.boolean(),
376
+ peppol: h.boolean()
377
+ }).refine((e) => e.email || e.peppol), Ae = { class: "flex flex-col gap-lg p-lg" }, je = { key: 1 }, Me = {
306
378
  key: 3,
307
379
  role: "alert"
308
- }, me = {
380
+ }, Ne = {
309
381
  key: 4,
310
382
  role: "alert"
311
- }, he = {
383
+ }, Pe = {
312
384
  key: 5,
313
385
  class: "flex max-h-80 flex-col gap-md overflow-y-auto",
314
386
  "aria-live": "polite"
315
- }, ge = { key: 0 }, _e = { key: 1 }, ve = { key: 0 }, ye = { key: 3 }, be = /* @__PURE__ */ D({
387
+ }, Fe = { key: 0 }, Ie = { key: 1 }, Le = { key: 0 }, Re = { key: 3 }, ze = /* @__PURE__ */ T({
316
388
  __name: "InvoiceDeliverySendDialog",
317
389
  props: {
318
390
  invoiceUuid: {},
@@ -324,19 +396,19 @@ var le = /* @__PURE__ */ D({
324
396
  },
325
397
  emits: ["close"],
326
398
  setup(e, { emit: t }) {
327
- let n = e, r = t, i = v(), a = U(), o = ce(), s = h(), l = M(null), u = M(!1), d = 0, f = M(!1), p = M(""), m = M(!1), _ = W({
399
+ let n = e, r = t, i = g(), a = le(), o = Ee(), s = ee(), l = k(null), u = k(!1), d = 0, f = k(!1), p = k(""), m = k(!1), h = ue({
328
400
  initialState: {
329
401
  email: !0,
330
402
  peppol: !1
331
403
  },
332
- schema: de,
333
- onSubmit: H,
404
+ schema: ke,
405
+ onSubmit: L,
334
406
  onSubmitError: () => a.unableToSave()
335
- }), T = _.register("email", !0), D = _.register("peppol", !1), O = b(() => {
407
+ }), C = h.register("email", !0), T = h.register("peppol", !1), E = v(() => {
336
408
  let e = s.result.value;
337
409
  return e.isOk() ? e.getValue().connection : null;
338
- }), k = b(() => {
339
- let e = [...T.modelValue.value ? [c.EMAIL] : [], ...D.modelValue.value ? [c.PEPPOL] : []];
410
+ }), D = v(() => {
411
+ let e = [...C.modelValue.value ? [c.EMAIL] : [], ...T.modelValue.value ? [c.PEPPOL] : []];
340
412
  return u.value && n.query !== void 0 ? {
341
413
  channels: e,
342
414
  query: n.query
@@ -347,14 +419,14 @@ var le = /* @__PURE__ */ D({
347
419
  channels: e,
348
420
  query: n.selectedQuery
349
421
  };
350
- }), L = b(() => JSON.stringify(k.value)), R = b(() => p.value === L.value), z = b(() => l.value?.items.filter((e) => e.eligible && e.delivery === null).length ?? 0);
351
- async function H() {
352
- if (!R.value || z.value === 0) {
353
- await q();
422
+ }), P = v(() => JSON.stringify(D.value)), F = v(() => p.value === P.value), I = v(() => l.value?.items.filter((e) => e.eligible && e.delivery === null).length ?? 0);
423
+ async function L() {
424
+ if (!F.value || I.value === 0) {
425
+ await V();
354
426
  return;
355
427
  }
356
428
  let e = await o.execute({
357
- body: k.value,
429
+ body: D.value,
358
430
  params: { invoiceUuid: n.invoiceUuid }
359
431
  });
360
432
  if (e.isErr()) {
@@ -365,74 +437,74 @@ var le = /* @__PURE__ */ D({
365
437
  let t = e.value.items.filter((e) => e.queued).length;
366
438
  t > 0 && (n.onSent?.(), a.show({ message: i.t("wise_invoicing.delivery.send.queued_count", { count: t }) }));
367
439
  }
368
- function G(e) {
440
+ function R(e) {
369
441
  return l.value?.items.find((t) => t.invoiceUuid === e)?.label ?? n.documents.find((t) => t.uuid === e)?.label ?? i.t("wise_invoicing.invoice.detail.fallback_title");
370
442
  }
371
- function K(e) {
372
- return i.t(g.translationKey(e));
443
+ function B(e) {
444
+ return i.t(te.translationKey(e));
373
445
  }
374
- async function q() {
375
- if (k.value.channels.length === 0) return;
376
- let e = L.value, t = ++d;
446
+ async function V() {
447
+ if (D.value.channels.length === 0) return;
448
+ let e = P.value, t = ++d;
377
449
  f.value = !0, m.value = !1;
378
- let n = await Q.preview(k.value);
379
- t === d && (f.value = !1, e === L.value && (p.value = e, n.isErr() ? (m.value = !0, l.value = null) : l.value = n.value));
450
+ let n = await $.preview(D.value);
451
+ t === d && (f.value = !1, e === P.value && (p.value = e, n.isErr() ? (m.value = !0, l.value = null) : l.value = n.value));
380
452
  }
381
- return A(q), (e, t) => (j(), x(F(ie), {
382
- form: F(_),
453
+ return ne(V), (e, t) => (O(), y(M(ce), {
454
+ form: M(h),
383
455
  onClose: t[1] ||= (e) => r("close")
384
456
  }, {
385
- default: I(() => [
386
- E(F(re), {
387
- title: F(i).t("wise_invoicing.delivery.send.title"),
388
- description: F(i).t("wise_invoicing.delivery.send.description")
457
+ default: N(() => [
458
+ w(M(se), {
459
+ title: M(i).t("wise_invoicing.delivery.send.title"),
460
+ description: M(i).t("wise_invoicing.delivery.send.description")
389
461
  }, null, 8, ["title", "description"]),
390
- w("div", fe, [
391
- n.query === void 0 ? S("", !0) : (j(), x(F(V), {
462
+ S("div", Ae, [
463
+ n.query === void 0 ? b("", !0) : (O(), y(M(z), {
392
464
  key: 0,
393
465
  modelValue: u.value,
394
466
  "onUpdate:modelValue": t[0] ||= (e) => u.value = e,
395
- label: F(i).t("wise_invoicing.delivery.send.all_matching"),
396
- "is-disabled": F(o).isLoading.value
467
+ label: M(i).t("wise_invoicing.delivery.send.all_matching"),
468
+ "is-disabled": M(o).isLoading.value
397
469
  }, null, 8, [
398
470
  "modelValue",
399
471
  "label",
400
472
  "is-disabled"
401
473
  ])),
402
- n.query !== void 0 && !u.value ? (j(), C("p", pe, P(F(i).t("wise_invoicing.delivery.send.selected_count", { count: n.selectedCount ?? n.documents.length })), 1)) : S("", !0),
403
- E(le, { field: F(T) }, null, 8, ["field"]),
404
- O.value?.enabled ? (j(), x(ue, {
474
+ n.query !== void 0 && !u.value ? (O(), x("p", je, j(M(i).t("wise_invoicing.delivery.send.selected_count", { count: n.selectedCount ?? n.documents.length })), 1)) : b("", !0),
475
+ w(De, { field: M(C) }, null, 8, ["field"]),
476
+ E.value?.enabled ? (O(), y(Oe, {
405
477
  key: 2,
406
- field: F(D),
407
- connection: O.value
408
- }, null, 8, ["field", "connection"])) : S("", !0),
409
- F(s).result.value.isErr() ? (j(), C("p", $, P(F(i).t("wise_invoicing.delivery.send.connection_error")), 1)) : S("", !0),
410
- m.value ? (j(), C("p", me, P(F(i).t("wise_invoicing.delivery.send.preview_error")), 1)) : S("", !0),
411
- E(F(B), {
412
- label: F(i).t("wise_invoicing.delivery.send.preview"),
478
+ field: M(T),
479
+ connection: E.value
480
+ }, null, 8, ["field", "connection"])) : b("", !0),
481
+ M(s).result.value.isErr() ? (O(), x("p", Me, j(M(i).t("wise_invoicing.delivery.send.connection_error")), 1)) : b("", !0),
482
+ m.value ? (O(), x("p", Ne, j(M(i).t("wise_invoicing.delivery.send.preview_error")), 1)) : b("", !0),
483
+ w(M(re), {
484
+ label: M(i).t("wise_invoicing.delivery.send.preview"),
413
485
  "is-loading": f.value,
414
- "is-disabled": k.value.channels.length === 0,
486
+ "is-disabled": D.value.channels.length === 0,
415
487
  type: "button",
416
488
  variant: "secondary",
417
- onClick: q
489
+ onClick: V
418
490
  }, null, 8, [
419
491
  "label",
420
492
  "is-loading",
421
493
  "is-disabled"
422
494
  ]),
423
- R.value && l.value !== null ? (j(), C("div", he, [
424
- w("p", null, P(F(i).t("wise_invoicing.delivery.send.document_count", { count: l.value.totalDocuments })), 1),
425
- (j(!0), C(y, null, N(l.value.channels, (e) => (j(), C("p", { key: e.channel }, P(F(i).t(`wise_invoicing.delivery.channel.${e.channel}`)) + ": " + P(F(i).t("wise_invoicing.delivery.send.summary", e)), 1))), 128)),
426
- (j(!0), C(y, null, N(l.value.items, (e) => (j(), C("div", {
495
+ F.value && l.value !== null ? (O(), x("div", Pe, [
496
+ S("p", null, j(M(i).t("wise_invoicing.delivery.send.document_count", { count: l.value.totalDocuments })), 1),
497
+ (O(!0), x(_, null, A(l.value.channels, (e) => (O(), x("p", { key: e.channel }, j(M(i).t(`wise_invoicing.delivery.channel.${e.channel}`)) + ": " + j(M(i).t("wise_invoicing.delivery.send.summary", e)), 1))), 128)),
498
+ (O(!0), x(_, null, A(l.value.items, (e) => (O(), x("div", {
427
499
  key: `${e.invoiceUuid}-${e.channel}`,
428
500
  class: "flex flex-col gap-xs border-b border-secondary pb-md text-sm"
429
- }, [w("strong", null, P(G(e.invoiceUuid)) + " · " + P(F(i).t(`wise_invoicing.delivery.channel.${e.channel}`)), 1), e.queued ? (j(), C("span", ge, P(F(i).t("wise_invoicing.delivery.send.queued")), 1)) : e.reason === null ? e.delivery === null ? (j(), C("span", ye, P(F(i).t("wise_invoicing.delivery.send.ready")), 1)) : (j(), C(y, { key: 2 }, [w("span", null, P(F(i).t(`wise_invoicing.delivery.state.${e.delivery.state}`)), 1), e.delivery.errorCode === null ? S("", !0) : (j(), C("span", ve, P(K(e.delivery.errorCode)), 1))], 64)) : (j(), C("span", _e, P(K(e.reason)), 1))]))), 128))
430
- ])) : S("", !0)
501
+ }, [S("strong", null, j(R(e.invoiceUuid)) + " · " + j(M(i).t(`wise_invoicing.delivery.channel.${e.channel}`)), 1), e.queued ? (O(), x("span", Fe, j(M(i).t("wise_invoicing.delivery.send.queued")), 1)) : e.reason === null ? e.delivery === null ? (O(), x("span", Re, j(M(i).t("wise_invoicing.delivery.send.ready")), 1)) : (O(), x(_, { key: 2 }, [S("span", null, j(M(i).t(`wise_invoicing.delivery.state.${e.delivery.state}`)), 1), e.delivery.errorCode === null ? b("", !0) : (O(), x("span", Le, j(B(e.delivery.errorCode)), 1))], 64)) : (O(), x("span", Ie, j(B(e.reason)), 1))]))), 128))
502
+ ])) : b("", !0)
431
503
  ]),
432
- E(F(ee), null, {
433
- right: I(() => [E(F(te)), E(F(ne), {
434
- label: F(i).t("wise_invoicing.delivery.send.confirm"),
435
- "is-disabled": !R.value || z.value === 0 || f.value || F(o).isLoading.value
504
+ w(M(ie), null, {
505
+ right: N(() => [w(M(ae)), w(M(oe), {
506
+ label: M(i).t("wise_invoicing.delivery.send.confirm"),
507
+ "is-disabled": !F.value || I.value === 0 || f.value || M(o).isLoading.value
436
508
  }, null, 8, ["label", "is-disabled"])]),
437
509
  _: 1
438
510
  })
@@ -442,4 +514,4 @@ var le = /* @__PURE__ */ D({
442
514
  }
443
515
  });
444
516
  //#endregion
445
- export { Y as a, oe as i, Q as n, J as o, se as r, G as s, be as t };
517
+ export { he as a, V as c, ge as i, $ as n, H as o, Te as r, pe as s, ze as t };