@wisemen/wise-crm-web 2.0.0-alpha.43 → 2.0.0-alpha.45

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.
@@ -0,0 +1,771 @@
1
+ import { defineComponent as b, computed as P, openBlock as n, createBlock as c, unref as e, withCtx as s, createElementVNode as d, resolveDynamicComponent as F, createElementBlock as _, toDisplayString as m, createVNode as a, renderSlot as J, createCommentVNode as p, Fragment as C, renderList as j, createTextVNode as z, ref as ce, mergeProps as y } from "vue";
2
+ import { UITooltip as H, UIIconButton as Q, UIText as ue, UIBadgeGroup as de, UIBadge as G, UITimeline as me, UITimelineItem as pe, UIDialogBody as Z, UIFormLayout as X, UIFormFieldGroup as Y, UIFormFieldGrid as T, UITextField as U, toFormField as v, UIPhoneNumberField as B, UIDialogFooter as ee, UIDialogFooterSubmit as te, UIDialogFooterCancel as fe, UIDropdownMenu as _e, UIDropdownMenuGroup as ge, UIDropdownMenuItem as R } from "@wisemen/vue-core-design-system";
3
+ import { q as O, p as oe, W as K, ai as be, r as le, j as he, aj as ye, f as ve, ak as xe, I as ae, al as we, t as W, am as ke, z as Pe, u as Ce, a3 as $e, a9 as ne, A as E, a4 as Ie, a5 as Ne, a7 as Se, a6 as A, a8 as re, $ as Ue, a0 as Fe, a1 as Ae, a2 as De, an as ze } from "./index-DSFHgVvi.js";
4
+ import { bs as se } from "./uuid.util-DUuuAgdg.js";
5
+ import { useClipboard as Ve } from "@vueuse/core";
6
+ import { useI18n as $ } from "vue-i18n";
7
+ import { m as Me, C as q, f as M, c as Te, l as Be } from "./CrmDetailView.vue_vue_type_script_setup_true_lang-7UUg6E4g.js";
8
+ import { RouterLink as Ee } from "vue-router";
9
+ import V, { z as f } from "zod";
10
+ import { GoogleMap as Le } from "vue3-google-map";
11
+ const je = { class: "flex items-center gap-sm p-sm px-md text-brand-500" }, Ge = ["href"], Oe = ["href"], Ke = { key: 2 }, L = /* @__PURE__ */ b({
12
+ __name: "CrmDetailHeaderContactTooltip",
13
+ props: {
14
+ type: {},
15
+ value: {}
16
+ },
17
+ setup(l) {
18
+ const t = l, o = $(), i = P(() => {
19
+ switch (t.type) {
20
+ case "address":
21
+ return K;
22
+ case "email":
23
+ return oe;
24
+ case "phone":
25
+ return O;
26
+ default:
27
+ return O;
28
+ }
29
+ }), r = P(() => {
30
+ switch (t.type) {
31
+ case "email":
32
+ return `mailto:${t.value}`;
33
+ case "phone":
34
+ return `tel:${t.value}`;
35
+ case "address":
36
+ return `https://maps.google.com/?q=${encodeURIComponent(t.value)}`;
37
+ default:
38
+ return null;
39
+ }
40
+ }), h = P(() => {
41
+ switch (t.type) {
42
+ case "email":
43
+ return o.t("component.contact_tooltip.aria_label.email", {
44
+ value: t.value
45
+ });
46
+ case "phone":
47
+ return o.t("component.contact_tooltip.aria_label.phone", {
48
+ value: t.value
49
+ });
50
+ case "address":
51
+ return o.t("component.contact_tooltip.aria_label.address", {
52
+ value: t.value
53
+ });
54
+ default:
55
+ return t.value;
56
+ }
57
+ }), u = Ve({
58
+ source: t.value
59
+ });
60
+ function g() {
61
+ u.copy(t.value);
62
+ }
63
+ return (x, I) => (n(), c(e(H), null, {
64
+ trigger: s(() => [
65
+ (n(), c(F(r.value ? "a" : "div"), {
66
+ href: r.value,
67
+ "aria-label": h.value,
68
+ target: l.type === "address" ? "_blank" : void 0,
69
+ rel: l.type === "address" ? "noopener noreferrer" : void 0,
70
+ class: "flex aspect-square size-8 items-center justify-center rounded-full border-none bg-gray-50/50 p-xs ring-brand-500 ring-offset-2 duration-300 outline-none focus-visible:ring-2 data-[loading=false]:not-disabled:hover:bg-gray-50/30 dark:bg-brand-950"
71
+ }, {
72
+ default: s(() => [
73
+ (n(), c(F(i.value), { class: "size-4 shrink-0 text-brand-700 dark:text-brand-200" }))
74
+ ]),
75
+ _: 1
76
+ }, 8, ["href", "aria-label", "target", "rel"]))
77
+ ]),
78
+ content: s(() => [
79
+ d("div", je, [
80
+ (n(), c(F(i.value), { class: "size-4" })),
81
+ l.type === "email" ? (n(), _("a", {
82
+ key: 0,
83
+ href: `mailto:${t.value}`,
84
+ class: "underline ring-brand-500 ring-offset-1 duration-200 outline-none focus-visible:ring-2"
85
+ }, m(t.value), 9, Ge)) : l.type === "phone" ? (n(), _("a", {
86
+ key: 1,
87
+ href: `tel:${t.value}`,
88
+ class: "underline ring-brand-500 ring-offset-1 duration-200 outline-none focus-visible:ring-2"
89
+ }, m(t.value), 9, Oe)) : (n(), _("p", Ke, m(t.value), 1)),
90
+ a(e(Q), {
91
+ label: e(o).t("wise_crm.info_dialog.copy_to_clipboard"),
92
+ icon: e(be),
93
+ variant: "tertiary",
94
+ size: "sm",
95
+ onClick: g
96
+ }, null, 8, ["label", "icon"])
97
+ ])
98
+ ]),
99
+ _: 1
100
+ }));
101
+ }
102
+ }), qe = { class: "flex flex-col gap-xl rounded-2xl border border-brand-300 bg-linear-to-r from-brand-50 to-brand-200 p-xl shadow-[0px_8px_12px_0px_rgba(104,186,246,0.12)] dark:from-brand-800 dark:to-brand-900" }, Je = { class: "flex justify-between gap-sm" }, Re = { class: "flex h-fit shrink-0 gap-sm" }, Nt = /* @__PURE__ */ b({
103
+ __name: "CrmDetailHeaderCard",
104
+ props: {
105
+ name: {},
106
+ address: {},
107
+ email: {},
108
+ entityName: {},
109
+ entityType: {},
110
+ mobilePhone: {},
111
+ phone: {}
112
+ },
113
+ setup(l) {
114
+ const t = l;
115
+ return (o, i) => (n(), _("div", qe, [
116
+ d("div", Je, [
117
+ a(e(ue), {
118
+ text: t.name,
119
+ as: "h2",
120
+ class: "min-w-0 flex-1 text-xl font-bold text-primary"
121
+ }, null, 8, ["text"]),
122
+ d("div", Re, [
123
+ J(o.$slots, "actions"),
124
+ t.email !== null ? (n(), c(L, {
125
+ key: 0,
126
+ value: t.email,
127
+ type: "email"
128
+ }, null, 8, ["value"])) : p("", !0),
129
+ t.mobilePhone !== null || t.phone !== null ? (n(), c(L, {
130
+ key: 1,
131
+ value: t.mobilePhone ?? t.phone ?? "",
132
+ type: "phone"
133
+ }, null, 8, ["value"])) : p("", !0),
134
+ t.address !== null ? (n(), c(L, {
135
+ key: 2,
136
+ value: e(le).format(t.address),
137
+ type: "address"
138
+ }, null, 8, ["value"])) : p("", !0)
139
+ ])
140
+ ]),
141
+ a(e(de), null, {
142
+ default: s(() => [
143
+ a(e(G), {
144
+ icon: t.entityType === e(se).BUSINESS ? e(he) : e(ye),
145
+ label: t.entityName ?? "-",
146
+ variant: "translucent",
147
+ color: "brand"
148
+ }, null, 8, ["icon", "label"]),
149
+ J(o.$slots, "badges")
150
+ ]),
151
+ _: 3
152
+ })
153
+ ]));
154
+ }
155
+ }), We = { class: "flex flex-wrap items-center gap-xs" }, He = {
156
+ key: 0,
157
+ class: "shrink-0 text-sm text-primary"
158
+ }, Qe = { class: "flex flex-wrap items-center gap-md text-sm" }, Ze = { class: "text-brand text-xs" }, Xe = /* @__PURE__ */ b({
159
+ __name: "ActivityListItemMessage",
160
+ props: {
161
+ activity: {}
162
+ },
163
+ setup(l) {
164
+ const t = l;
165
+ function o(r) {
166
+ return r === null ? "" : typeof r == "object" ? JSON.stringify(r) : r.toString();
167
+ }
168
+ const i = P(() => t.activity.message.split(" ").map((r) => r === "[note]" ? {
169
+ text: t.activity.content?.note?.name ?? "",
170
+ type: "text"
171
+ } : r === "[contactPerson]" ? {
172
+ route: {
173
+ query: {
174
+ individualUuid: t.activity.content?.contactPerson?.uuid
175
+ }
176
+ },
177
+ text: t.activity.content?.contactPerson?.name ?? "",
178
+ type: "link"
179
+ } : {
180
+ text: r,
181
+ type: "text"
182
+ }));
183
+ return (r, h) => (n(), _("div", We, [
184
+ (n(!0), _(C, null, j(i.value, (u) => (n(), _(C, { key: u }, [
185
+ u.type === "text" ? (n(), _("span", He, m(u.text), 1)) : p("", !0),
186
+ u.type === "link" && u.route !== void 0 ? (n(), c(e(Ee), {
187
+ key: 1,
188
+ to: u.route,
189
+ class: "hover:text-brand text-sm font-medium text-primary hover:underline"
190
+ }, {
191
+ default: s(() => [
192
+ z(m(u.text), 1)
193
+ ]),
194
+ _: 2
195
+ }, 1032, ["to"])) : p("", !0)
196
+ ], 64))), 128)),
197
+ t.activity.changes.length > 0 ? (n(), c(e(H), { key: 0 }, {
198
+ trigger: s(() => [
199
+ (n(), c(F(e(ae)), { class: "size-3 text-tertiary" }))
200
+ ]),
201
+ content: s(() => [
202
+ a(ve, {
203
+ cols: 1,
204
+ class: "max-w-80 p-lg"
205
+ }, {
206
+ default: s(() => [
207
+ (n(!0), _(C, null, j(t.activity.changes, (u) => (n(), _("div", {
208
+ key: JSON.stringify(u),
209
+ class: "flex flex-col gap-sm"
210
+ }, [
211
+ d("div", Qe, [
212
+ d("p", Ze, m(u.key) + ": ", 1),
213
+ u.oldValue !== null ? (n(), c(e(G), {
214
+ key: 0,
215
+ "class-config": {
216
+ root: "rounded-sm border-none whitespace-pre-wrap"
217
+ },
218
+ label: o(u.oldValue),
219
+ size: "sm",
220
+ variant: "translucent",
221
+ color: "error"
222
+ }, null, 8, ["label"])) : p("", !0),
223
+ u.oldValue !== null && u.value !== null ? (n(), c(F(e(xe)), {
224
+ key: 1,
225
+ class: "size-3"
226
+ })) : p("", !0),
227
+ a(e(G), {
228
+ "class-config": {
229
+ root: "rounded-sm border-none whitespace-pre-wrap"
230
+ },
231
+ label: o(u.value),
232
+ size: "sm",
233
+ variant: "translucent",
234
+ color: "success"
235
+ }, null, 8, ["label"])
236
+ ])
237
+ ]))), 128))
238
+ ]),
239
+ _: 1
240
+ })
241
+ ]),
242
+ _: 1
243
+ })) : p("", !0)
244
+ ]));
245
+ }
246
+ }), Ye = { class: "text-xs text-tertiary" }, et = /* @__PURE__ */ b({
247
+ __name: "ActivityListItem",
248
+ props: {
249
+ activity: {}
250
+ },
251
+ setup(l) {
252
+ const t = l;
253
+ function o(i) {
254
+ return we.isToday(i) ? W().fromNow(i.toInstant()) : W().toDate(i.toPlainDate());
255
+ }
256
+ return (i, r) => (n(), _(C, null, [
257
+ a(Xe, {
258
+ activity: t.activity
259
+ }, null, 8, ["activity"]),
260
+ d("p", Ye, m(o(t.activity.createdAt)) + " · " + m(t.activity.changedBy), 1)
261
+ ], 64));
262
+ }
263
+ }), St = /* @__PURE__ */ b({
264
+ __name: "ActivityList",
265
+ props: {
266
+ isLoading: { type: Boolean },
267
+ activities: {},
268
+ onNext: { type: Function }
269
+ },
270
+ setup(l) {
271
+ const t = l, o = $(), i = P(() => !t.isLoading && t.activities.length === 0);
272
+ async function r() {
273
+ await t.onNext();
274
+ }
275
+ return (h, u) => (n(), c(ke, {
276
+ "on-next": r,
277
+ class: "h-full"
278
+ }, {
279
+ default: s(() => [
280
+ t.activities.length > 0 ? (n(), c(e(me), {
281
+ key: 0,
282
+ size: "md"
283
+ }, {
284
+ default: s(() => [
285
+ (n(!0), _(C, null, j(l.activities, (g, x) => (n(), c(e(pe), {
286
+ key: JSON.stringify(g),
287
+ icon: e(ae),
288
+ "is-last": x === l.activities.length - 1
289
+ }, {
290
+ default: s(() => [
291
+ a(et, { activity: g }, null, 8, ["activity"])
292
+ ]),
293
+ _: 2
294
+ }, 1032, ["icon", "is-last"]))), 128))
295
+ ]),
296
+ _: 1
297
+ })) : p("", !0),
298
+ i.value ? (n(), c(Me, {
299
+ key: 1,
300
+ title: e(o).t("wise_crm.info_dialog.activity.empty_state.title"),
301
+ description: e(o).t("wise_crm.info_dialog.activity.empty_state.description"),
302
+ icon: e(Pe)
303
+ }, null, 8, ["title", "description", "icon"])) : p("", !0)
304
+ ]),
305
+ _: 1
306
+ }));
307
+ }
308
+ }), tt = /* @__PURE__ */ b({
309
+ __name: "ContactPersonCreateExisitngForm",
310
+ props: {
311
+ form: {}
312
+ },
313
+ emits: ["createNewContactPerson"],
314
+ setup(l, { emit: t }) {
315
+ const o = l, i = t, r = $(), h = Ce(), u = o.form.register("position"), g = o.form.register("email"), x = o.form.register("phone"), I = o.form.register("mobile"), w = o.form.register("existingContactPerson"), N = ce(null);
316
+ async function ie(D) {
317
+ if (N.value = D, D === null) {
318
+ w.setValue(null);
319
+ return;
320
+ }
321
+ w.setValue(D.uuid);
322
+ const k = await Ie.getByUuid(D.uuid);
323
+ if (k.isErr()) {
324
+ h.show(k.error);
325
+ return;
326
+ }
327
+ const S = k.value;
328
+ g.setValue(S.email), x.setValue(S.phone), I.setValue(S.mobilePhone);
329
+ }
330
+ return (D, k) => (n(), _(C, null, [
331
+ a(e(Z), null, {
332
+ default: s(() => [
333
+ a(e(X), null, {
334
+ default: s(() => [
335
+ a(e(Y), null, {
336
+ default: s(() => [
337
+ a(e(T), {
338
+ sm: 1,
339
+ lg: 1
340
+ }, {
341
+ default: s(() => [
342
+ a($e, {
343
+ modelValue: N.value,
344
+ "onUpdate:modelValue": [
345
+ k[0] || (k[0] = (S) => N.value = S),
346
+ ie
347
+ ],
348
+ "is-touched": e(w).isTouched.value,
349
+ "error-message": e(w).isTouched.value ? e(w).errors.value[0]?.message ?? null : null,
350
+ label: e(r).t("wise_crm.contact.create_dialog.form.fields.contact_person"),
351
+ onBlur: e(w).onBlur,
352
+ onCreateNew: k[1] || (k[1] = (S) => i("createNewContactPerson"))
353
+ }, null, 8, ["modelValue", "is-touched", "error-message", "label", "onBlur"]),
354
+ N.value !== null ? (n(), c(e(U), y({ key: 0 }, e(v)(e(u)), {
355
+ label: e(r).t("wise_crm.contact.create_dialog.form.fields.position"),
356
+ placeholder: e(r).t("wise_crm.contact.create_dialog.form.fields.position")
357
+ }), null, 16, ["label", "placeholder"])) : p("", !0)
358
+ ]),
359
+ _: 1
360
+ })
361
+ ]),
362
+ _: 1
363
+ }),
364
+ N.value !== null ? (n(), c(ne, {
365
+ key: 0,
366
+ title: e(r).t("wise_crm.shared.contact_info")
367
+ }, {
368
+ default: s(() => [
369
+ a(e(T), {
370
+ sm: 1,
371
+ lg: 1,
372
+ variant: "card"
373
+ }, {
374
+ default: s(() => [
375
+ a(e(U), y(e(v)(e(g)), {
376
+ label: e(r).t("wise_crm.contact.create_dialog.form.fields.email"),
377
+ placeholder: e(r).t("wise_crm.contact.create_dialog.form.fields.email")
378
+ }), null, 16, ["label", "placeholder"]),
379
+ a(E, null, {
380
+ default: s(() => [
381
+ z(m(e(r).t("wise_crm.contact.create_dialog.form.seperator_label")), 1)
382
+ ]),
383
+ _: 1
384
+ }),
385
+ a(e(B), y(e(v)(e(I)), {
386
+ label: e(r).t("wise_crm.contact.create_dialog.form.fields.mobile_phone"),
387
+ placeholder: e(r).t("wise_crm.contact.create_dialog.form.fields.mobile_phone")
388
+ }), null, 16, ["label", "placeholder"]),
389
+ a(E, null, {
390
+ default: s(() => [
391
+ z(m(e(r).t("wise_crm.contact.create_dialog.form.seperator_label")), 1)
392
+ ]),
393
+ _: 1
394
+ }),
395
+ a(e(B), y(e(v)(e(x)), {
396
+ label: e(r).t("wise_crm.contact.create_dialog.form.fields.phone"),
397
+ placeholder: e(r).t("wise_crm.contact.create_dialog.form.fields.phone")
398
+ }), null, 16, ["label", "placeholder"])
399
+ ]),
400
+ _: 1
401
+ })
402
+ ]),
403
+ _: 1
404
+ }, 8, ["title"])) : p("", !0)
405
+ ]),
406
+ _: 1
407
+ })
408
+ ]),
409
+ _: 1
410
+ }),
411
+ a(e(ee), null, {
412
+ right: s(() => [
413
+ a(e(te), {
414
+ "is-loading": o.form.isSubmitting.value,
415
+ label: e(r).t("wise_crm.shared.add")
416
+ }, null, 8, ["is-loading", "label"])
417
+ ]),
418
+ _: 1
419
+ })
420
+ ], 64));
421
+ }
422
+ }), ot = /* @__PURE__ */ b({
423
+ __name: "ContactPersonCreateNewForm",
424
+ props: {
425
+ form: {}
426
+ },
427
+ setup(l) {
428
+ const t = l, o = $(), i = t.form.register("firstName"), r = t.form.register("lastName"), h = t.form.register("email"), u = t.form.register("mobilePhone"), g = t.form.register("position"), x = t.form.register("phone");
429
+ return (I, w) => (n(), c(e(Z), null, {
430
+ default: s(() => [
431
+ a(e(X), null, {
432
+ default: s(() => [
433
+ a(e(Y), null, {
434
+ default: s(() => [
435
+ a(e(T), {
436
+ sm: 1,
437
+ lg: 2
438
+ }, {
439
+ default: s(() => [
440
+ a(e(U), y(e(v)(e(i)), {
441
+ label: e(o).t("wise_crm.contact.create_dialog.form.fields.first_name"),
442
+ placeholder: e(o).t("wise_crm.contact.create_dialog.form.fields.first_name")
443
+ }), null, 16, ["label", "placeholder"]),
444
+ a(e(U), y(e(v)(e(r)), {
445
+ label: e(o).t("wise_crm.contact.create_dialog.form.fields.last_name"),
446
+ placeholder: e(o).t("wise_crm.contact.create_dialog.form.fields.last_name")
447
+ }), null, 16, ["label", "placeholder"]),
448
+ a(e(U), y(e(v)(e(g)), {
449
+ label: e(o).t("wise_crm.contact.create_dialog.form.fields.position"),
450
+ placeholder: e(o).t("wise_crm.contact.create_dialog.form.fields.position"),
451
+ class: "col-span-2"
452
+ }), null, 16, ["label", "placeholder"])
453
+ ]),
454
+ _: 1
455
+ })
456
+ ]),
457
+ _: 1
458
+ }),
459
+ a(ne, {
460
+ title: e(o).t("wise_crm.shared.contact_info")
461
+ }, {
462
+ default: s(() => [
463
+ a(e(T), {
464
+ sm: 1,
465
+ lg: 1,
466
+ variant: "card"
467
+ }, {
468
+ default: s(() => [
469
+ a(e(U), y(e(v)(e(h)), {
470
+ label: e(o).t("wise_crm.contact.create_dialog.form.fields.email"),
471
+ placeholder: e(o).t("wise_crm.contact.create_dialog.form.fields.email")
472
+ }), null, 16, ["label", "placeholder"]),
473
+ a(E, null, {
474
+ default: s(() => [
475
+ z(m(e(o).t("wise_crm.contact.create_dialog.form.seperator_label")), 1)
476
+ ]),
477
+ _: 1
478
+ }),
479
+ a(e(B), y(e(v)(e(u)), {
480
+ label: e(o).t("wise_crm.contact.create_dialog.form.fields.mobile_phone"),
481
+ placeholder: e(o).t("wise_crm.contact.create_dialog.form.fields.mobile_phone")
482
+ }), null, 16, ["label", "placeholder"]),
483
+ a(E, null, {
484
+ default: s(() => [
485
+ z(m(e(o).t("wise_crm.contact.create_dialog.form.seperator_label")), 1)
486
+ ]),
487
+ _: 1
488
+ }),
489
+ a(e(B), y(e(v)(e(x)), {
490
+ label: e(o).t("wise_crm.contact.create_dialog.form.fields.phone"),
491
+ placeholder: e(o).t("wise_crm.contact.create_dialog.form.fields.phone")
492
+ }), null, 16, ["label", "placeholder"])
493
+ ]),
494
+ _: 1
495
+ }),
496
+ a(Ne, {
497
+ form: t.form
498
+ }, null, 8, ["form"])
499
+ ]),
500
+ _: 1
501
+ }, 8, ["title"])
502
+ ]),
503
+ _: 1
504
+ })
505
+ ]),
506
+ _: 1
507
+ }));
508
+ }
509
+ }), Ut = /* @__PURE__ */ b({
510
+ __name: "ContactPersonCreateForm",
511
+ props: {
512
+ isNewMode: { type: Boolean },
513
+ createForm: {},
514
+ existingForm: {}
515
+ },
516
+ emits: ["update:isNewMode"],
517
+ setup(l, { emit: t }) {
518
+ const o = l, i = t, r = $();
519
+ return (h, u) => (n(), _(C, null, [
520
+ o.isNewMode ? (n(), c(ot, {
521
+ key: 0,
522
+ form: o.createForm
523
+ }, null, 8, ["form"])) : (n(), c(tt, {
524
+ key: 1,
525
+ form: o.existingForm,
526
+ onCreateNewContactPerson: u[0] || (u[0] = (g) => i("update:isNewMode", !0))
527
+ }, null, 8, ["form"])),
528
+ o.isNewMode ? (n(), c(e(ee), { key: 2 }, {
529
+ right: s(() => [
530
+ a(e(fe), {
531
+ label: e(r).t("wise_crm.contact.create_dialog.form.back"),
532
+ onClick: u[1] || (u[1] = (g) => i("update:isNewMode", !1))
533
+ }, null, 8, ["label"]),
534
+ a(e(te), {
535
+ "is-loading": o.createForm.isSubmitting.value,
536
+ label: e(r).t("wise_crm.shared.create")
537
+ }, null, 8, ["is-loading", "label"])
538
+ ]),
539
+ _: 1
540
+ })) : p("", !0)
541
+ ], 64));
542
+ }
543
+ }), Ft = V.object({
544
+ email: V.literal("").or(V.email()).nullable(),
545
+ existingContactPerson: Se,
546
+ mobile: A.nullable(),
547
+ phone: A.nullable(),
548
+ position: V.string().nullable()
549
+ }), At = f.object({
550
+ email: f.literal("").or(f.email()).nullable(),
551
+ firstName: f.string().min(1),
552
+ lastName: f.string().min(1),
553
+ mobilePhone: A.nullable(),
554
+ phone: A.nullable(),
555
+ position: f.string().nullable()
556
+ }).superRefine((l, t) => {
557
+ l.email !== null && l.email !== "" || l.mobilePhone !== null && l.mobilePhone !== "" || l.phone !== null && l.phone !== "" || t.addIssue({
558
+ code: f.ZodIssueCode.custom,
559
+ message: re.global.t("wise_crm.form.errors.at_least_one")
560
+ });
561
+ }), Dt = f.object({
562
+ email: f.literal("").or(f.email()).nullable(),
563
+ firstName: f.string().min(1),
564
+ lastName: f.string().min(1),
565
+ mobilePhone: A.nullable(),
566
+ phone: A.nullable(),
567
+ position: f.string().nullable()
568
+ }).superRefine((l, t) => {
569
+ l.email !== null && l.email !== "" || l.mobilePhone !== null && l.mobilePhone !== "" || l.phone !== null && l.phone !== "" || t.addIssue({
570
+ code: f.ZodIssueCode.custom,
571
+ message: re.global.t("wise_crm.form.errors.at_least_one")
572
+ });
573
+ }), lt = { class: "font-semibold text-primary" }, at = { class: "flex flex-col gap-sm" }, zt = /* @__PURE__ */ b({
574
+ __name: "CrmDetailSidebarAccordionBillingInformation",
575
+ props: {
576
+ invoiceAddress: {},
577
+ invoiceEmail: {}
578
+ },
579
+ setup(l) {
580
+ const t = l;
581
+ return (o, i) => (n(), c(q, { class: "flex flex-col gap-md" }, {
582
+ default: s(() => [
583
+ d("p", lt, m(t.invoiceEmail), 1),
584
+ d("div", at, [
585
+ a(M, {
586
+ label: t.invoiceAddress !== null ? e(le).formatShort(t.invoiceAddress) : "-",
587
+ icon: e(K)
588
+ }, null, 8, ["label", "icon"])
589
+ ])
590
+ ]),
591
+ _: 1
592
+ }));
593
+ }
594
+ }), nt = { class: "flex items-start justify-between" }, rt = { class: "flex flex-col items-start gap-sm" }, st = { class: "text-brand-700" }, it = { class: "-mt-2 -mr-2 flex items-center justify-end" }, ct = { class: "grid gap-lg" }, Vt = /* @__PURE__ */ b({
595
+ __name: "CrmDetailSidebarAccordionContactPersonInfo",
596
+ props: {
597
+ contactPerson: {},
598
+ onToggleIsPrimary: { type: Function }
599
+ },
600
+ emits: ["delete", "update"],
601
+ setup(l, { emit: t }) {
602
+ const o = l, i = t, r = $(), h = {
603
+ left: {
604
+ icon: Ue,
605
+ type: "icon"
606
+ }
607
+ }, u = {
608
+ left: {
609
+ icon: Fe,
610
+ type: "icon"
611
+ }
612
+ };
613
+ function g() {
614
+ i("update");
615
+ }
616
+ function x() {
617
+ i("delete");
618
+ }
619
+ function I() {
620
+ o.onToggleIsPrimary();
621
+ }
622
+ return (w, N) => (n(), c(q, { class: "flex flex-col gap-lg" }, {
623
+ default: s(() => [
624
+ d("div", nt, [
625
+ d("div", rt, [
626
+ a(Te, {
627
+ "entity-type": e(se).INDIVIDUAL,
628
+ uuid: o.contactPerson.uuid,
629
+ label: `${o.contactPerson.firstName} ${o.contactPerson.lastName}`,
630
+ class: "-ml-xs"
631
+ }, null, 8, ["entity-type", "uuid", "label"]),
632
+ d("p", st, m(o.contactPerson.position), 1)
633
+ ]),
634
+ d("div", it, [
635
+ a(Be, {
636
+ "is-active": o.contactPerson.isPrimary,
637
+ onClick: I
638
+ }, null, 8, ["is-active"]),
639
+ a(e(_e), { "popover-align": "end" }, {
640
+ trigger: s(() => [
641
+ a(e(Q), {
642
+ icon: e(Ae),
643
+ variant: "tertiary",
644
+ size: "sm",
645
+ label: "actionMenu"
646
+ }, null, 8, ["icon"])
647
+ ]),
648
+ content: s(() => [
649
+ a(e(ge), null, {
650
+ default: s(() => [
651
+ a(e(R), {
652
+ config: h,
653
+ label: e(r).t("wise_crm.info_dialog.sidebar.overview.update_contact_person"),
654
+ onSelect: g
655
+ }, null, 8, ["label"]),
656
+ a(e(R), {
657
+ "is-destructive": !0,
658
+ config: u,
659
+ label: e(r).t("wise_crm.info_dialog.sidebar.overview.delete_contact_person"),
660
+ onSelect: x
661
+ }, null, 8, ["label"])
662
+ ]),
663
+ _: 1
664
+ })
665
+ ]),
666
+ _: 1
667
+ })
668
+ ])
669
+ ]),
670
+ d("div", ct, [
671
+ o.contactPerson.email !== null ? (n(), c(M, {
672
+ key: 0,
673
+ label: o.contactPerson.email,
674
+ icon: e(oe)
675
+ }, null, 8, ["label", "icon"])) : p("", !0),
676
+ o.contactPerson.mobilePhone !== null ? (n(), c(M, {
677
+ key: 1,
678
+ label: o.contactPerson.mobilePhone,
679
+ icon: e(De)
680
+ }, null, 8, ["label", "icon"])) : p("", !0),
681
+ o.contactPerson.phone !== null ? (n(), c(M, {
682
+ key: 2,
683
+ label: o.contactPerson.phone,
684
+ icon: e(O)
685
+ }, null, 8, ["label", "icon"])) : p("", !0)
686
+ ])
687
+ ]),
688
+ _: 1
689
+ }));
690
+ }
691
+ });
692
+ function Mt(l, t) {
693
+ const o = new Map(
694
+ l.value.map((i) => [
695
+ i.key,
696
+ i.useIsVisible?.(t) ?? P(() => !0)
697
+ ])
698
+ );
699
+ return P(() => l.value.filter((i) => o.get(i.key)?.value ?? !0));
700
+ }
701
+ const ut = /* @__PURE__ */ b({
702
+ __name: "AppGoogleMaps",
703
+ props: {
704
+ center: {},
705
+ zoom: {}
706
+ },
707
+ setup(l) {
708
+ const t = l, o = ze();
709
+ return (i, r) => e(o).googleMapsApiKey.value ? (n(), c(e(Le), {
710
+ key: 0,
711
+ "api-key": e(o).googleMapsApiKey.value,
712
+ zoom: t.zoom,
713
+ center: {
714
+ lat: t.center.lat,
715
+ lng: t.center.lng
716
+ },
717
+ "disable-default-ui": !0
718
+ }, null, 8, ["api-key", "zoom", "center"])) : p("", !0);
719
+ }
720
+ }), dt = { class: "absolute top-3 left-3 z-2 rounded-full bg-brand-500 px-md py-xxs font-medium text-(--brand-contrast)" }, mt = { class: "absolute inset-0 z-1 flex flex-col items-center justify-center bg-linear-to-t from-primary from-10% to-transparent" }, pt = { class: "flex flex-col items-center gap-md" }, ft = { class: "rounded-full border border-secondary bg-primary p-sm" }, _t = { class: "text-center" }, gt = { class: "font-semibold text-primary" }, bt = { class: "text-primary" }, Tt = /* @__PURE__ */ b({
721
+ __name: "CrmDetailSidebarMapCard",
722
+ props: {
723
+ address: {}
724
+ },
725
+ setup(l) {
726
+ const t = l, o = $();
727
+ return (i, r) => t.address !== null ? (n(), c(q, {
728
+ key: 0,
729
+ class: "relative overflow-hidden p-0!"
730
+ }, {
731
+ default: s(() => [
732
+ d("div", dt, [
733
+ d("p", null, m(e(o).t("wise_crm.shared.home_address")), 1)
734
+ ]),
735
+ d("div", mt, [
736
+ d("div", pt, [
737
+ d("div", ft, [
738
+ (n(), c(F(e(K)), { class: "size-4 text-brand-500" }))
739
+ ]),
740
+ d("div", _t, [
741
+ d("p", gt, m(t.address?.street) + " " + m(t.address?.streetNumber), 1),
742
+ d("p", bt, m(t.address?.postalCode) + " " + m(t.address?.city), 1)
743
+ ])
744
+ ])
745
+ ]),
746
+ a(ut, {
747
+ center: {
748
+ lat: t.address?.coordinates.lat ?? 0,
749
+ lng: t.address?.coordinates.lng ?? 0
750
+ },
751
+ zoom: 14,
752
+ class: "h-30 w-full rounded-2xl"
753
+ }, null, 8, ["center"])
754
+ ]),
755
+ _: 1
756
+ })) : p("", !0);
757
+ }
758
+ });
759
+ export {
760
+ St as _,
761
+ Ft as a,
762
+ Ut as b,
763
+ At as c,
764
+ ot as d,
765
+ Dt as e,
766
+ Tt as f,
767
+ zt as g,
768
+ Vt as h,
769
+ Nt as i,
770
+ Mt as u
771
+ };