@wisemen/wise-crm-web 3.0.0-alpha.0 → 3.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +1,18 @@
1
- import { defineComponent as $, useModel as pe, openBlock as a, createElementBlock as g, createVNode as i, unref as t, withCtx as p, Fragment as B, renderList as F, createBlock as h, createElementVNode as s, renderSlot as U, mergeModels as fe, createStaticVNode as _e, resolveDynamicComponent as P, toDisplayString as k, computed as v, mergeProps as J, normalizeClass as ye, normalizeStyle as R, toValue as q, createCommentVNode as b, useSlots as he } from "vue";
2
- import { UITabs as xe, UITabsList as ge, UITabsItem as ve, UITextareaField as ee, toFormField as te, UIIconButton as S, UIDropdownMenu as ne, UIDropdownMenuGroup as H, UIDropdownMenuItem as T, UILoader as be, useToast as we, UIFormDialog as ke, UIDialogHeader as $e, UIDialogBody as Ce, UIDialogFooter as Ue, UIDialogFooterCancel as Ie, UIDialogFooterSubmit as De, UIDashboardPage as Se, UITabsRouterLink as Te, UITabsRouterLinkItem as Ae, UITooltip as Ne, UITooltipContent as Pe, UIRowLayout as Be, UIText as Ee, UISeparator as Ve, UIDropdownMenuSeparator as ze, UIBadge as N, UISkeletonItem as He } from "@wisemen/vue-core-design-system";
3
- import { ApiUtil as C, useMutation as oe, useQuery as Me } from "@wisemen/vue-core-api-utils";
4
- import { K as Fe, Z as Le, L as Re, N as qe, O as je, P as We, Q as Ge, R as Ke, k as Oe, S as Qe, J as Xe, E as Ye, i as Ze, U as le, H as E, h as ae, u as Je, X as et, b as ie, Y as tt, $ as nt, a0 as j, a1 as M, g as re, a2 as se, a3 as ot, a4 as W, a5 as G, a6 as K, w as lt, a7 as at, a8 as it, a9 as rt } from "./index-BddOTAwb.js";
5
- import { useI18n as I } from "vue-i18n";
6
- import { useForm as ce } from "formango";
7
- import { Temporal as st } from "temporal-polyfill";
8
- import { z as O } from "zod";
9
- import { onKeyStroke as ct, useClipboard as ue } from "@vueuse/core";
10
- import { useRoute as ut, RouterView as dt } from "vue-router";
11
- import { bs as mt } from "./uuid.util-DUuuAgdg.js";
12
- import { Motion as pt } from "motion-v";
13
- const ft = { class: "mt-lg flex h-full flex-1 flex-col overflow-hidden" }, _t = { class: "min-h-0 flex-1 overflow-y-auto px-lg py-lg" }, kn = /* @__PURE__ */ $({
1
+ import { defineComponent as $, useModel as re, openBlock as a, createElementBlock as g, createVNode as i, unref as t, withCtx as y, Fragment as P, renderList as H, createBlock as h, createElementVNode as s, renderSlot as U, mergeModels as ce, createStaticVNode as ue, resolveDynamicComponent as de, toDisplayString as C, computed as b, mergeProps as Y, normalizeClass as me, normalizeStyle as F, toValue as L, createCommentVNode as v, useSlots as pe } from "vue";
2
+ import { UITabs as fe, UITabsList as _e, UITabsItem as ye, UITextareaField as Z, toFormField as J, UIIconButton as S, UIDropdownMenu as ee, UIDropdownMenuGroup as z, UIDropdownMenuItem as T, UILoader as xe, useToast as he, UIFormDialog as ge, UIDialogHeader as be, UIDialogBody as ve, UIDialogFooter as we, UIDialogFooterCancel as ke, UIDialogFooterSubmit as $e, UIDashboardPage as Ce, UITabsRouterLink as Ue, UITabsRouterLinkItem as Ie, UIText as De, UISeparator as Se, UIDropdownMenuSeparator as Te, UIBadge as N, UISkeletonItem as Ae } from "@wisemen/vue-core-design-system";
3
+ import { ApiUtil as k, useMutation as te, useQuery as Ne } from "@wisemen/vue-core-api-utils";
4
+ import { K as Pe, Z as Be, L as Ee, N as Ve, O as ze, P as He, Q as Me, R as Fe, k as Le, S as Re, J as je, E as qe, i as We, U as ne, H as B, h as oe, u as Ge, X as Ke, b as le, Y as Oe, $ as Qe, a0 as R, a1 as E, a2 as j, a3 as q, a4 as W, g as Xe, a5 as Ye, a6 as Ze, w as Je, a7 as et, a8 as tt, a9 as nt } from "./index-BocNglY-.js";
5
+ import { useI18n as D } from "vue-i18n";
6
+ import { useForm as ie } from "formango";
7
+ import { Temporal as ot } from "temporal-polyfill";
8
+ import { z as G } from "zod";
9
+ import { onKeyStroke as lt, useClipboard as it } from "@vueuse/core";
10
+ import { useRoute as at, RouterView as st } from "vue-router";
11
+ import { bs as rt } from "./uuid.util-DUuuAgdg.js";
12
+ import { Motion as ct } from "motion-v";
13
+ const ut = { class: "mt-lg flex h-full flex-1 flex-col overflow-hidden" }, dt = { class: "min-h-0 flex-1 overflow-y-auto px-lg py-lg" }, yn = /* @__PURE__ */ $({
14
14
  __name: "CrmDetailSidebarTabs",
15
- props: /* @__PURE__ */ fe({
15
+ props: /* @__PURE__ */ ce({
16
16
  tabs: {}
17
17
  }, {
18
18
  modelValue: {
@@ -21,20 +21,20 @@ const ft = { class: "mt-lg flex h-full flex-1 flex-col overflow-hidden" }, _t =
21
21
  modelModifiers: {}
22
22
  }),
23
23
  emits: ["update:modelValue"],
24
- setup(r) {
25
- const e = r, n = pe(r, "modelValue");
26
- return (l, o) => (a(), g("div", ft, [
27
- i(t(xe), {
24
+ setup(c) {
25
+ const e = c, n = re(c, "modelValue");
26
+ return (l, o) => (a(), g("div", ut, [
27
+ i(t(fe), {
28
28
  modelValue: n.value,
29
29
  "onUpdate:modelValue": o[0] || (o[0] = (f) => n.value = f),
30
30
  "is-full-width": !0,
31
31
  "underline-tabs-horizontal-list-padding": "lg",
32
32
  class: "flex h-full flex-1 flex-col"
33
33
  }, {
34
- default: p(() => [
35
- i(t(ge), { class: "py-xxs" }, {
36
- default: p(() => [
37
- (a(!0), g(B, null, F(e.tabs, (f) => (a(), h(t(ve), {
34
+ default: y(() => [
35
+ i(t(_e), { class: "py-xxs" }, {
36
+ default: y(() => [
37
+ (a(!0), g(P, null, H(e.tabs, (f) => (a(), h(t(ye), {
38
38
  key: f.value,
39
39
  value: f.value,
40
40
  icon: f.icon,
@@ -43,7 +43,7 @@ const ft = { class: "mt-lg flex h-full flex-1 flex-col overflow-hidden" }, _t =
43
43
  ]),
44
44
  _: 1
45
45
  }),
46
- s("div", _t, [
46
+ s("div", dt, [
47
47
  U(l.$slots, "default")
48
48
  ])
49
49
  ]),
@@ -51,39 +51,39 @@ const ft = { class: "mt-lg flex h-full flex-1 flex-col overflow-hidden" }, _t =
51
51
  }, 8, ["modelValue"])
52
52
  ]));
53
53
  }
54
- }), yt = {}, ht = {
54
+ }), mt = {}, pt = {
55
55
  fill: "none",
56
56
  height: "100%",
57
57
  viewBox: "0 0 756 560",
58
58
  width: "100%",
59
59
  xmlns: "http://www.w3.org/2000/svg"
60
60
  };
61
- function xt(r, e) {
62
- return a(), g("svg", ht, [...e[0] || (e[0] = [
63
- _e('<mask id="mask0_2103_18170" height="768" maskUnits="userSpaceOnUse" style="mask-type:alpha;" width="768" x="-6" y="-208"><rect fill="url(#paint0_radial_2103_18170)" height="768" transform="translate(-6 -208)" width="768"></rect></mask><g mask="url(#mask0_2103_18170)"><g clip-path="url(#clip0_2103_18170)"><g clip-path="url(#clip1_2103_18170)"><line stroke="currentColor" x1="42.5" x2="42.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="90.5" x2="90.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="138.5" x2="138.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="186.5" x2="186.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="234.5" x2="234.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="282.5" x2="282.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="330.5" x2="330.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="378.5" x2="378.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="426.5" x2="426.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="474.5" x2="474.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="522.5" x2="522.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="570.5" x2="570.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="618.5" x2="618.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="666.5" x2="666.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="714.5" x2="714.5" y1="-208" y2="560"></line></g><rect height="767" stroke="currentColor" width="767" x="-5.5" y="-207.5"></rect><g clip-path="url(#clip2_2103_18170)"><line stroke="currentColor" x1="-6" x2="762" y1="31.5" y2="31.5"></line><line stroke="currentColor" x1="-6" x2="762" y1="79.5" y2="79.5"></line><line stroke="currentColor" x1="-6" x2="762" y1="127.5" y2="127.5"></line><line stroke="currentColor" x1="-6" x2="762" y1="175.5" y2="175.5"></line><line stroke="currentColor" x1="-6" x2="762" y1="223.5" y2="223.5"></line><line stroke="currentColor" x1="-6" x2="762" y1="271.5" y2="271.5"></line><line stroke="currentColor" x1="-6" x2="762" y1="319.5" y2="319.5"></line><line stroke="currentColor" x1="-6" x2="762" y1="367.5" y2="367.5"></line><line stroke="currentColor" x1="-6" x2="762" y1="415.5" y2="415.5"></line><line stroke="currentColor" x1="-6" x2="762" y1="463.5" y2="463.5"></line><line stroke="currentColor" x1="-6" x2="762" y1="511.5" y2="511.5"></line><line stroke="currentColor" x1="-6" x2="762" y1="559.5" y2="559.5"></line></g><rect height="767" stroke="currentColor" width="767" x="-5.5" y="-207.5"></rect></g></g><defs><radialGradient id="paint0_radial_2103_18170" cx="0" cy="0" gradientTransform="translate(384 384) rotate(90) scale(384 384)" gradientUnits="userSpaceOnUse" r="1"><stop></stop><stop offset="1" stop-opacity="0"></stop></radialGradient><clipPath id="clip0_2103_18170"><rect fill="white" height="768" transform="translate(-6 -208)" width="768"></rect></clipPath><clipPath id="clip1_2103_18170"><rect fill="white" height="768" width="768" x="-6" y="-208"></rect></clipPath><clipPath id="clip2_2103_18170"><rect fill="white" height="768" width="768" x="-6" y="-208"></rect></clipPath></defs>', 3)
61
+ function ft(c, e) {
62
+ return a(), g("svg", pt, [...e[0] || (e[0] = [
63
+ ue('<mask id="mask0_2103_18170" height="768" maskUnits="userSpaceOnUse" style="mask-type:alpha;" width="768" x="-6" y="-208"><rect fill="url(#paint0_radial_2103_18170)" height="768" transform="translate(-6 -208)" width="768"></rect></mask><g mask="url(#mask0_2103_18170)"><g clip-path="url(#clip0_2103_18170)"><g clip-path="url(#clip1_2103_18170)"><line stroke="currentColor" x1="42.5" x2="42.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="90.5" x2="90.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="138.5" x2="138.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="186.5" x2="186.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="234.5" x2="234.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="282.5" x2="282.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="330.5" x2="330.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="378.5" x2="378.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="426.5" x2="426.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="474.5" x2="474.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="522.5" x2="522.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="570.5" x2="570.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="618.5" x2="618.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="666.5" x2="666.5" y1="-208" y2="560"></line><line stroke="currentColor" x1="714.5" x2="714.5" y1="-208" y2="560"></line></g><rect height="767" stroke="currentColor" width="767" x="-5.5" y="-207.5"></rect><g clip-path="url(#clip2_2103_18170)"><line stroke="currentColor" x1="-6" x2="762" y1="31.5" y2="31.5"></line><line stroke="currentColor" x1="-6" x2="762" y1="79.5" y2="79.5"></line><line stroke="currentColor" x1="-6" x2="762" y1="127.5" y2="127.5"></line><line stroke="currentColor" x1="-6" x2="762" y1="175.5" y2="175.5"></line><line stroke="currentColor" x1="-6" x2="762" y1="223.5" y2="223.5"></line><line stroke="currentColor" x1="-6" x2="762" y1="271.5" y2="271.5"></line><line stroke="currentColor" x1="-6" x2="762" y1="319.5" y2="319.5"></line><line stroke="currentColor" x1="-6" x2="762" y1="367.5" y2="367.5"></line><line stroke="currentColor" x1="-6" x2="762" y1="415.5" y2="415.5"></line><line stroke="currentColor" x1="-6" x2="762" y1="463.5" y2="463.5"></line><line stroke="currentColor" x1="-6" x2="762" y1="511.5" y2="511.5"></line><line stroke="currentColor" x1="-6" x2="762" y1="559.5" y2="559.5"></line></g><rect height="767" stroke="currentColor" width="767" x="-5.5" y="-207.5"></rect></g></g><defs><radialGradient id="paint0_radial_2103_18170" cx="0" cy="0" gradientTransform="translate(384 384) rotate(90) scale(384 384)" gradientUnits="userSpaceOnUse" r="1"><stop></stop><stop offset="1" stop-opacity="0"></stop></radialGradient><clipPath id="clip0_2103_18170"><rect fill="white" height="768" transform="translate(-6 -208)" width="768"></rect></clipPath><clipPath id="clip1_2103_18170"><rect fill="white" height="768" width="768" x="-6" y="-208"></rect></clipPath><clipPath id="clip2_2103_18170"><rect fill="white" height="768" width="768" x="-6" y="-208"></rect></clipPath></defs>', 3)
64
64
  ])]);
65
65
  }
66
- const gt = /* @__PURE__ */ Fe(yt, [["render", xt]]), vt = { class: "relative flex h-full flex-col items-center justify-center text-center" }, bt = { class: "relative z-1 flex flex-col items-center gap-lg" }, wt = { class: "flex size-12 items-center justify-center rounded-full border-3 border-solid border-white bg-brand-200 p-md shadow-md" }, kt = { class: "flex flex-col gap-sm" }, $t = { class: "text-md font-semibold" }, Ct = { class: "text-sm text-tertiary" }, Ut = { class: "absolute inset-x-0 scale-140 opacity-10" }, It = /* @__PURE__ */ $({
66
+ const _t = /* @__PURE__ */ Pe(mt, [["render", ft]]), yt = { class: "relative flex h-full flex-col items-center justify-center text-center" }, xt = { class: "relative z-1 flex flex-col items-center gap-lg" }, ht = { class: "flex size-12 items-center justify-center rounded-full border-3 border-solid border-white bg-brand-200 p-md shadow-md" }, gt = { class: "flex flex-col gap-sm" }, bt = { class: "text-md font-semibold" }, vt = { class: "text-sm text-tertiary" }, wt = { class: "absolute inset-x-0 scale-140 opacity-10" }, kt = /* @__PURE__ */ $({
67
67
  __name: "AppEmptyState",
68
68
  props: {
69
69
  title: {},
70
70
  description: {},
71
71
  icon: {}
72
72
  },
73
- setup(r) {
74
- const e = r;
75
- return (n, l) => (a(), g("div", vt, [
76
- s("div", bt, [
77
- s("div", wt, [
78
- (a(), h(P(e.icon), { class: "size-full text-brand-600" }))
73
+ setup(c) {
74
+ const e = c;
75
+ return (n, l) => (a(), g("div", yt, [
76
+ s("div", xt, [
77
+ s("div", ht, [
78
+ (a(), h(de(e.icon), { class: "size-full text-brand-600" }))
79
79
  ]),
80
- s("div", kt, [
81
- s("h3", $t, k(e.title), 1),
82
- s("p", Ct, k(e.description), 1)
80
+ s("div", gt, [
81
+ s("h3", bt, C(e.title), 1),
82
+ s("p", vt, C(e.description), 1)
83
83
  ])
84
84
  ]),
85
- s("div", Ut, [
86
- i(gt)
85
+ s("div", wt, [
86
+ i(_t)
87
87
  ])
88
88
  ]));
89
89
  }
@@ -93,13 +93,13 @@ class V {
93
93
  return {
94
94
  uuid: e.uuid,
95
95
  lastUpdatedByUserUuid: e.lastUpdatedByUserUuid,
96
- updatedAt: Le.fromDto(e.updatedAt),
96
+ updatedAt: Be.fromDto(e.updatedAt),
97
97
  content: e.content,
98
98
  lastUpdatedByUser: e.lastUpdatedByUser
99
99
  };
100
100
  }
101
101
  }
102
- class Dt {
102
+ class $t {
103
103
  static toDto(e, n, l, o) {
104
104
  return {
105
105
  businessUuid: n ?? null,
@@ -109,28 +109,28 @@ class Dt {
109
109
  };
110
110
  }
111
111
  }
112
- class de {
112
+ class ae {
113
113
  static async create(e, n) {
114
- const l = await C.fromPromise(Re({
115
- body: Dt.toDto(
114
+ const l = await k.fromPromise(Ee({
115
+ body: $t.toDto(
116
116
  e,
117
117
  n.businessUuid,
118
118
  n.individualUuid,
119
119
  n.dealUuid
120
120
  )
121
121
  }));
122
- return C.void(l);
122
+ return k.void(l);
123
123
  }
124
124
  static async delete(e) {
125
- const n = await C.fromPromise(qe({
125
+ const n = await k.fromPromise(Ve({
126
126
  path: {
127
127
  uuid: e
128
128
  }
129
129
  }));
130
- return C.void(n);
130
+ return k.void(n);
131
131
  }
132
132
  static async getBusinessNotes(e, n) {
133
- return (await C.fromPromise(je({
133
+ return (await k.fromPromise(ze({
134
134
  query: e,
135
135
  path: {
136
136
  businessUuid: n
@@ -143,7 +143,7 @@ class de {
143
143
  }));
144
144
  }
145
145
  static async getDealNotes(e, n) {
146
- return (await C.fromPromise(We({
146
+ return (await k.fromPromise(He({
147
147
  query: e,
148
148
  path: {
149
149
  dealUuid: n
@@ -156,7 +156,7 @@ class de {
156
156
  }));
157
157
  }
158
158
  static async getIndividualNotes(e, n) {
159
- return (await C.fromPromise(Ge({
159
+ return (await k.fromPromise(Me({
160
160
  query: e,
161
161
  path: {
162
162
  individualUuid: n
@@ -169,7 +169,7 @@ class de {
169
169
  }));
170
170
  }
171
171
  static async update(e, n) {
172
- const l = await C.fromPromise(Ke({
172
+ const l = await k.fromPromise(Fe({
173
173
  body: {
174
174
  content: n
175
175
  },
@@ -177,14 +177,14 @@ class de {
177
177
  uuid: e
178
178
  }
179
179
  }));
180
- return C.void(l);
180
+ return k.void(l);
181
181
  }
182
182
  }
183
- function $n() {
184
- return oe({
183
+ function xn() {
184
+ return te({
185
185
  queryFn: async ({
186
- params: r
187
- }) => await de.delete(r.noteUuid),
186
+ params: c
187
+ }) => await ae.delete(c.noteUuid),
188
188
  queryKeysToInvalidate: {
189
189
  noteBusinessIndex: {},
190
190
  noteDealIndex: {},
@@ -192,50 +192,50 @@ function $n() {
192
192
  }
193
193
  });
194
194
  }
195
- const me = O.object({
196
- note: O.string().trim().min(1)
197
- }), St = { class: "flex justify-end p-md" }, Tt = /* @__PURE__ */ $({
195
+ const se = G.object({
196
+ note: G.string().trim().min(1)
197
+ }), Ct = { class: "flex justify-end p-md" }, Ut = /* @__PURE__ */ $({
198
198
  __name: "NoteForm",
199
199
  props: {
200
200
  content: {},
201
201
  onSubmit: { type: Function }
202
202
  },
203
- setup(r) {
204
- const e = r, n = I(), l = ce({
203
+ setup(c) {
204
+ const e = c, n = D(), l = ie({
205
205
  initialState: {
206
206
  note: e.content ?? null
207
207
  },
208
- schema: me,
209
- onSubmit: async (u) => {
210
- await e.onSubmit(u), l.reset();
208
+ schema: se,
209
+ onSubmit: async (d) => {
210
+ await e.onSubmit(d), l.reset();
211
211
  }
212
- }), o = l.register("note"), f = v(() => o.modelValue.value === null || o.modelValue.value.trim().length === 0);
213
- async function m(u) {
214
- !l.isValid.value || l.isSubmitting.value || u.key === "Enter" && !u.shiftKey && (u.preventDefault(), await l.submit(), o.setValue(null));
212
+ }), o = l.register("note"), f = b(() => o.modelValue.value === null || o.modelValue.value.trim().length === 0);
213
+ async function p(d) {
214
+ !l.isValid.value || l.isSubmitting.value || d.key === "Enter" && !d.shiftKey && (d.preventDefault(), await l.submit(), o.setValue(null));
215
215
  }
216
- return (u, x) => (a(), g("div", null, [
217
- i(Oe, {
216
+ return (d, x) => (a(), g("div", null, [
217
+ i(Le, {
218
218
  "can-exit-when-dirty": !0,
219
219
  form: t(l),
220
220
  class: "w-full"
221
221
  }, {
222
- default: p(() => [
223
- i(t(ee), J(t(te)(t(o)), {
222
+ default: y(() => [
223
+ i(t(Z), Y(t(J)(t(o)), {
224
224
  errors: [],
225
225
  "error-message": null,
226
226
  placeholder: t(n).t("wise_crm.note.create_placeholder"),
227
227
  "class-config": {
228
228
  input: "h-20"
229
229
  },
230
- onKeydown: m
230
+ onKeydown: p
231
231
  }), {
232
- bottom: p(() => [
233
- s("div", St, [
232
+ bottom: y(() => [
233
+ s("div", Ct, [
234
234
  i(t(S), {
235
235
  "is-loading": t(l).isSubmitting.value,
236
236
  "is-disabled": f.value,
237
237
  label: t(n).t("wise_crm.info_dialog.notes.submit_note_label"),
238
- icon: t(Qe),
238
+ icon: t(Re),
239
239
  class: "rounded-full shadow-none",
240
240
  type: "submit",
241
241
  size: "sm"
@@ -249,67 +249,67 @@ const me = O.object({
249
249
  }, 8, ["form"])
250
250
  ]));
251
251
  }
252
- }), At = { class: "flex flex-col gap-md" }, Nt = { class: "relative flex flex-1 flex-col gap-sm overflow-hidden rounded-lg border border-primary p-lg" }, Pt = { class: "mr-3xl max-w-full text-sm text-wrap wrap-break-word whitespace-pre-wrap" }, Bt = { class: "flex items-center gap-sm text-xs text-placeholder" }, Et = { class: "absolute top-1 right-1" }, Vt = /* @__PURE__ */ $({
252
+ }), It = { class: "flex flex-col gap-md" }, Dt = { class: "relative flex flex-1 flex-col gap-sm overflow-hidden rounded-lg border border-primary p-lg" }, St = { class: "mr-3xl max-w-full text-sm text-wrap wrap-break-word whitespace-pre-wrap" }, Tt = { class: "flex items-center gap-sm text-xs text-placeholder" }, At = { class: "absolute top-1 right-1" }, Nt = /* @__PURE__ */ $({
253
253
  __name: "NoteList",
254
254
  props: {
255
255
  notes: {}
256
256
  },
257
257
  emits: ["delete", "next", "update"],
258
- setup(r, { emit: e }) {
259
- const n = r, l = e, o = I();
260
- function f(y) {
261
- const _ = y.updatedAt, c = _.toInstant(), d = st.Now.instant(), w = E.diffInSeconds(c, d), D = E.diffInMinutes(c, d), L = E.diffInHours(c, d);
262
- return w < 60 ? o.t("wise_crm.note.just_now") : D < 60 ? o.t("wise_crm.note.minutes_ago", {
263
- count: Math.round(D)
264
- }) : L < 24 ? o.t("wise_crm.note.hours_ago", {
265
- count: Math.round(L)
266
- }) : ae().toDateTime(_);
258
+ setup(c, { emit: e }) {
259
+ const n = c, l = e, o = D();
260
+ function f(_) {
261
+ const m = _.updatedAt, r = m.toInstant(), u = ot.Now.instant(), w = B.diffInSeconds(r, u), I = B.diffInMinutes(r, u), M = B.diffInHours(r, u);
262
+ return w < 60 ? o.t("wise_crm.note.just_now") : I < 60 ? o.t("wise_crm.note.minutes_ago", {
263
+ count: Math.round(I)
264
+ }) : M < 24 ? o.t("wise_crm.note.hours_ago", {
265
+ count: Math.round(M)
266
+ }) : oe().toDateTime(m);
267
267
  }
268
- function m() {
268
+ function p() {
269
269
  l("next");
270
270
  }
271
- function u(y) {
272
- l("delete", y);
271
+ function d(_) {
272
+ l("delete", _);
273
273
  }
274
- function x(y) {
275
- l("update", y);
274
+ function x(_) {
275
+ l("update", _);
276
276
  }
277
- return (y, _) => (a(), h(Xe, { "on-next": m }, {
278
- default: p(() => [
279
- s("div", At, [
280
- (a(!0), g(B, null, F(n.notes, (c) => (a(), g("div", {
281
- key: c.content,
277
+ return (_, m) => (a(), h(je, { "on-next": p }, {
278
+ default: y(() => [
279
+ s("div", It, [
280
+ (a(!0), g(P, null, H(n.notes, (r) => (a(), g("div", {
281
+ key: r.content,
282
282
  class: "flex gap-sm"
283
283
  }, [
284
- s("div", Nt, [
285
- s("p", Pt, k(c.content), 1),
286
- s("div", Bt, [
287
- s("span", null, k(f(c)), 1),
288
- _[0] || (_[0] = s("div", { class: "size-1 rounded-full bg-gray-400" }, null, -1)),
289
- s("span", null, k(c.lastUpdatedByUser), 1)
284
+ s("div", Dt, [
285
+ s("p", St, C(r.content), 1),
286
+ s("div", Tt, [
287
+ s("span", null, C(f(r)), 1),
288
+ m[0] || (m[0] = s("div", { class: "size-1 rounded-full bg-gray-400" }, null, -1)),
289
+ s("span", null, C(r.lastUpdatedByUser), 1)
290
290
  ]),
291
- s("div", Et, [
292
- i(t(ne), { "popover-align": "end" }, {
293
- trigger: p(() => [
291
+ s("div", At, [
292
+ i(t(ee), { "popover-align": "end" }, {
293
+ trigger: y(() => [
294
294
  i(t(S), {
295
295
  label: t(o).t("wise_crm.info_dialog.notes.action_button_label"),
296
- icon: t(le),
296
+ icon: t(ne),
297
297
  variant: "tertiary",
298
298
  size: "sm"
299
299
  }, null, 8, ["label", "icon"])
300
300
  ]),
301
- content: p(() => [
302
- i(t(H), null, {
303
- default: p(() => [
301
+ content: y(() => [
302
+ i(t(z), null, {
303
+ default: y(() => [
304
304
  i(t(T), {
305
305
  label: t(o).t("wise_crm.info_dialog.notes.update_note"),
306
306
  config: {
307
307
  left: {
308
308
  type: "icon",
309
- icon: t(Ye)
309
+ icon: t(qe)
310
310
  }
311
311
  },
312
- onSelect: (d) => x(c)
312
+ onSelect: (u) => x(r)
313
313
  }, null, 8, ["label", "config", "onSelect"]),
314
314
  i(t(T), {
315
315
  "is-destructive": !0,
@@ -317,10 +317,10 @@ const me = O.object({
317
317
  config: {
318
318
  left: {
319
319
  type: "icon",
320
- icon: t(Ze)
320
+ icon: t(We)
321
321
  }
322
322
  },
323
- onSelect: (d) => u(c.uuid)
323
+ onSelect: (u) => d(r.uuid)
324
324
  }, null, 8, ["label", "config", "onSelect"])
325
325
  ]),
326
326
  _: 2
@@ -336,10 +336,10 @@ const me = O.object({
336
336
  _: 1
337
337
  }));
338
338
  }
339
- }), zt = { class: "flex h-full flex-col justify-between gap-lg" }, Ht = {
339
+ }), Pt = { class: "flex h-full flex-col justify-between gap-lg" }, Bt = {
340
340
  key: 0,
341
341
  class: "flex h-70 flex-col items-center justify-center gap-md text-quaternary"
342
- }, Mt = { class: "text-xs" }, Cn = /* @__PURE__ */ $({
342
+ }, Et = { class: "text-xs" }, hn = /* @__PURE__ */ $({
343
343
  __name: "CrmDetailSidebarNotesView",
344
344
  props: {
345
345
  hasNextPage: { type: Boolean },
@@ -348,50 +348,50 @@ const me = O.object({
348
348
  onSubmit: { type: Function }
349
349
  },
350
350
  emits: ["delete", "next", "update"],
351
- setup(r, { emit: e }) {
352
- const n = r, l = e, o = I(), f = Je();
353
- async function m(_) {
351
+ setup(c, { emit: e }) {
352
+ const n = c, l = e, o = D(), f = Ge();
353
+ async function p(m) {
354
354
  try {
355
- await n.onSubmit(_);
356
- } catch (c) {
357
- f.show(c);
355
+ await n.onSubmit(m);
356
+ } catch (r) {
357
+ f.show(r);
358
358
  }
359
359
  }
360
- function u() {
360
+ function d() {
361
361
  l("next");
362
362
  }
363
- function x(_) {
364
- l("delete", _);
363
+ function x(m) {
364
+ l("delete", m);
365
365
  }
366
- function y(_) {
367
- l("update", _);
366
+ function _(m) {
367
+ l("update", m);
368
368
  }
369
- return (_, c) => (a(), g("div", zt, [
370
- n.isLoading ? (a(), g("div", Ht, [
371
- i(t(be), { class: "size-4" }),
372
- s("p", Mt, k(t(o).t("wise_crm.shared.loading")), 1)
373
- ])) : n.notes.length === 0 ? (a(), h(It, {
369
+ return (m, r) => (a(), g("div", Pt, [
370
+ n.isLoading ? (a(), g("div", Bt, [
371
+ i(t(xe), { class: "size-4" }),
372
+ s("p", Et, C(t(o).t("wise_crm.shared.loading")), 1)
373
+ ])) : n.notes.length === 0 ? (a(), h(kt, {
374
374
  key: 1,
375
375
  title: t(o).t("wise_crm.info_dialog.notes.empty_state.title"),
376
376
  description: t(o).t("wise_crm.info_dialog.notes.empty_state.description"),
377
- icon: t(et)
378
- }, null, 8, ["title", "description", "icon"])) : (a(), h(Vt, {
377
+ icon: t(Ke)
378
+ }, null, 8, ["title", "description", "icon"])) : (a(), h(Nt, {
379
379
  key: 2,
380
380
  notes: n.notes,
381
381
  onDelete: x,
382
- onUpdate: y,
383
- onNext: u
382
+ onUpdate: _,
383
+ onNext: d
384
384
  }, null, 8, ["notes"])),
385
- i(Tt, { "on-submit": m })
385
+ i(Ut, { "on-submit": p })
386
386
  ]));
387
387
  }
388
388
  });
389
- function Ft() {
390
- return oe({
389
+ function Vt() {
390
+ return te({
391
391
  queryFn: async ({
392
- body: r,
392
+ body: c,
393
393
  params: e
394
- }) => await de.update(e.noteUuid, r.note),
394
+ }) => await ae.update(e.noteUuid, c.note),
395
395
  queryKeysToInvalidate: {
396
396
  noteBusinessIndex: {},
397
397
  noteDealIndex: {},
@@ -399,7 +399,7 @@ function Ft() {
399
399
  }
400
400
  });
401
401
  }
402
- const Un = /* @__PURE__ */ $({
402
+ const gn = /* @__PURE__ */ $({
403
403
  __name: "NoteUpdateDialog",
404
404
  props: {
405
405
  businessUuid: {},
@@ -407,16 +407,16 @@ const Un = /* @__PURE__ */ $({
407
407
  note: {}
408
408
  },
409
409
  emits: ["close"],
410
- setup(r, { emit: e }) {
411
- const n = r, l = e, o = I(), f = we(), m = Ft(), u = ce({
410
+ setup(c, { emit: e }) {
411
+ const n = c, l = e, o = D(), f = he(), p = Vt(), d = ie({
412
412
  initialState: {
413
413
  note: n.note.content ?? null
414
414
  },
415
- schema: me,
416
- onSubmit: async (_) => {
417
- const c = await m.execute({
415
+ schema: se,
416
+ onSubmit: async (m) => {
417
+ const r = await p.execute({
418
418
  body: {
419
- note: _.note
419
+ note: m.note
420
420
  },
421
421
  params: {
422
422
  businessUuid: n.businessUuid,
@@ -424,8 +424,8 @@ const Un = /* @__PURE__ */ $({
424
424
  noteUuid: n.note.uuid
425
425
  }
426
426
  });
427
- if (c.isErr()) {
428
- f.apiError(c.error);
427
+ if (r.isErr()) {
428
+ f.apiError(r.error);
429
429
  return;
430
430
  }
431
431
  l("close");
@@ -433,33 +433,33 @@ const Un = /* @__PURE__ */ $({
433
433
  onSubmitError: () => {
434
434
  f.unableToSave();
435
435
  }
436
- }), x = u.register("note");
437
- function y() {
436
+ }), x = d.register("note");
437
+ function _() {
438
438
  l("close");
439
439
  }
440
- return (_, c) => (a(), h(t(ke), {
441
- form: t(u),
440
+ return (m, r) => (a(), h(t(ge), {
441
+ form: t(d),
442
442
  size: "sm",
443
- onClose: y
443
+ onClose: _
444
444
  }, {
445
- default: p(() => [
446
- i(t($e), {
445
+ default: y(() => [
446
+ i(t(be), {
447
447
  title: t(o).t("wise_crm.note.update_dialog.title"),
448
448
  description: t(o).t("wise_crm.note.update_dialog.description")
449
449
  }, null, 8, ["title", "description"]),
450
- i(t(Ce), null, {
451
- default: p(() => [
452
- i(t(ee), J(t(te)(t(x)), {
450
+ i(t(ve), null, {
451
+ default: y(() => [
452
+ i(t(Z), Y(t(J)(t(x)), {
453
453
  label: t(o).t("wise_crm.note.form.note.label"),
454
454
  "class-config": { input: "h-32" }
455
455
  }), null, 16, ["label"])
456
456
  ]),
457
457
  _: 1
458
458
  }),
459
- i(t(Ue), null, {
460
- default: p(() => [
461
- i(t(Ie)),
462
- i(t(De), {
459
+ i(t(we), null, {
460
+ default: y(() => [
461
+ i(t(ke)),
462
+ i(t($e), {
463
463
  label: t(o).t("shared.update")
464
464
  }, null, 8, ["label"])
465
465
  ]),
@@ -469,28 +469,28 @@ const Un = /* @__PURE__ */ $({
469
469
  _: 1
470
470
  }, 8, ["form"]));
471
471
  }
472
- }), Lt = ["width", "height", "viewBox"], Rt = ["d"], Q = 0.5523, A = 24, qt = 26, jt = /* @__PURE__ */ $({
472
+ }), zt = ["width", "height", "viewBox"], Ht = ["d"], K = 0.5523, A = 24, Mt = 26, Ft = /* @__PURE__ */ $({
473
473
  __name: "CrmDetailViewFolderNotchSvg",
474
474
  props: {
475
475
  bodyWidth: {},
476
476
  curveHeight: {}
477
477
  },
478
- setup(r) {
479
- const e = r, n = v(() => Math.max(e.bodyWidth, A)), l = v(() => n.value + e.curveHeight), o = v(() => e.curveHeight + qt), f = v(() => {
480
- const m = n.value, u = e.curveHeight, x = u / 2, y = x * Q, _ = A * (1 - Q), c = m + x, d = m + u;
478
+ setup(c) {
479
+ const e = c, n = b(() => Math.max(e.bodyWidth, A)), l = b(() => n.value + e.curveHeight), o = b(() => e.curveHeight + Mt), f = b(() => {
480
+ const p = n.value, d = e.curveHeight, x = d / 2, _ = x * K, m = A * (1 - K), r = p + x, u = p + d;
481
481
  return [
482
482
  `M0 ${A}`,
483
- `C0 ${_} ${_} 0 ${A} 0`,
484
- `H${m}`,
485
- `C${m + y} 0 ${c} ${x - y} ${c} ${x}`,
486
- `C${c} ${x + y} ${d - y} ${u} ${d} ${u}`,
483
+ `C0 ${m} ${m} 0 ${A} 0`,
484
+ `H${p}`,
485
+ `C${p + _} 0 ${r} ${x - _} ${r} ${x}`,
486
+ `C${r} ${x + _} ${u - _} ${d} ${u} ${d}`,
487
487
  `V${o.value}`,
488
488
  "H0",
489
489
  `V${A}`,
490
490
  "Z"
491
491
  ].join(" ");
492
492
  });
493
- return (m, u) => (a(), g("svg", {
493
+ return (p, d) => (a(), g("svg", {
494
494
  width: l.value,
495
495
  height: o.value,
496
496
  viewBox: `0 0 ${l.value} ${o.value}`,
@@ -499,12 +499,12 @@ const Un = /* @__PURE__ */ $({
499
499
  }, [
500
500
  s("path", {
501
501
  d: f.value,
502
- fill: "white"
503
- }, null, 8, Rt)
504
- ], 8, Lt));
502
+ class: "fill-(--bg-primary)"
503
+ }, null, 8, Ht)
504
+ ], 8, zt));
505
505
  }
506
506
  });
507
- class X {
507
+ class O {
508
508
  /**
509
509
  * Checks if the element accepts text input (input, textarea, select or contenteditable).
510
510
  * @param element The element to check, usually `document.activeElement`.
@@ -528,10 +528,10 @@ class X {
528
528
  return !1;
529
529
  }
530
530
  }
531
- const Wt = { class: "relative isolate flex size-full flex-col px-md pt-12 pb-md md:px-6xl md:pb-xl" }, Gt = { class: "relative isolate mx-auto flex min-h-0 w-full max-w-7xl flex-1 flex-col rounded-3xl rounded-tl-none bg-white shadow-lg" }, Kt = { class: "relative shrink-0 px-3xl pt-3xl pb-xl" }, Ot = { class: "shrink-0 px-3xl" }, Qt = { class: "min-h-0 flex-1 overflow-y-auto p-3xl" }, Xt = {
531
+ const Lt = { class: "relative isolate flex size-full flex-col px-md pt-12 pb-md md:px-6xl md:pb-xl" }, Rt = { class: "relative isolate mx-auto flex min-h-0 w-full max-w-7xl flex-1 flex-col rounded-3xl rounded-tl-none bg-primary shadow-lg" }, jt = { class: "relative shrink-0 px-3xl pt-3xl pb-xl" }, qt = { class: "shrink-0 px-3xl" }, Wt = { class: "min-h-0 flex-1 overflow-y-auto p-3xl" }, Gt = {
532
532
  key: 0,
533
533
  class: "shrink-0 px-3xl py-xl text-sm text-tertiary"
534
- }, Y = 160, Z = 32, In = /* @__PURE__ */ $({
534
+ }, Q = 160, X = 32, bn = /* @__PURE__ */ $({
535
535
  __name: "CrmDetailView",
536
536
  props: {
537
537
  title: {},
@@ -541,74 +541,74 @@ const Wt = { class: "relative isolate flex size-full flex-col px-md pt-12 pb-md
541
541
  entityType: {},
542
542
  tabs: {}
543
543
  },
544
- setup(r) {
545
- const e = r, n = I(), l = ie(), o = ut(), f = ae(), m = v(() => e.backgroundColor === void 0 ? l.getEntityConfig(e.entityType)?.color ?? null : e.backgroundColor), u = v(() => e.backgroundColor !== null), x = {
544
+ setup(c) {
545
+ const e = c, n = D(), l = le(), o = at(), f = oe(), p = b(() => e.backgroundColor === void 0 ? l.getEntityConfig(e.entityType)?.color ?? null : e.backgroundColor), d = b(() => e.backgroundColor !== null), x = {
546
546
  isResizable: !0,
547
547
  defaultWidth: "25rem",
548
548
  variant: "bordered-overlay"
549
- }, y = {
550
- icon: nt,
549
+ }, _ = {
550
+ icon: Qe,
551
551
  label: n.t("wise_crm.shared.back"),
552
552
  onClick: l.goToReturnRoute
553
553
  };
554
- return ct("Escape", (_) => {
555
- if (_.defaultPrevented)
554
+ return lt("Escape", (m) => {
555
+ if (m.defaultPrevented)
556
556
  return;
557
- const c = document.activeElement;
558
- c && X.parentHasAriaHidden(c) || c && X.isEditable(c) || l.goToReturnRoute();
559
- }), (_, c) => (a(), h(tt, {
560
- "primary-action": y,
557
+ const r = document.activeElement;
558
+ r && O.parentHasAriaHidden(r) || r && O.isEditable(r) || l.goToReturnRoute();
559
+ }), (m, r) => (a(), h(Oe, {
560
+ "primary-action": _,
561
561
  class: "size-full"
562
562
  }, {
563
- default: p(() => [
564
- i(t(Se), {
563
+ default: y(() => [
564
+ i(t(Ce), {
565
565
  title: e.title ?? "",
566
566
  "detail-pane": x,
567
567
  "is-detail-pane-open": !0,
568
568
  class: "size-full",
569
569
  "is-title-hidden": ""
570
570
  }, {
571
- default: p(() => [
572
- i(j, {
571
+ default: y(() => [
572
+ i(R, {
573
573
  color: t(l).getEntityConfig(e.entityType)?.color ?? null,
574
574
  class: "size-full"
575
575
  }, {
576
- default: p(() => [
577
- s("div", Wt, [
578
- i(j, {
579
- color: m.value,
580
- class: ye([u.value ? "opacity-100" : "opacity-0", "pointer-events-none absolute inset-0 -z-10 transition-opacity duration-300"]),
576
+ default: y(() => [
577
+ s("div", Lt, [
578
+ i(R, {
579
+ color: p.value,
580
+ class: me([d.value ? "opacity-100" : "opacity-0", "pointer-events-none absolute inset-0 -z-10 transition-opacity duration-300"]),
581
581
  "aria-hidden": "true"
582
582
  }, {
583
- default: p(() => [...c[0] || (c[0] = [
584
- s("div", { class: "size-full bg-linear-to-b from-brand-200 to-transparent to-40%" }, null, -1)
583
+ default: y(() => [...r[0] || (r[0] = [
584
+ s("div", { class: "size-full bg-linear-to-b from-brand-200 to-transparent to-40% dark:from-brand-900/60" }, null, -1)
585
585
  ])]),
586
586
  _: 1
587
587
  }, 8, ["color", "class"]),
588
- s("div", Gt, [
588
+ s("div", Rt, [
589
589
  s("div", {
590
- style: R({ left: `${Y}px` }),
590
+ style: F({ left: `${Q}px` }),
591
591
  "aria-hidden": "true",
592
- class: "pointer-events-none absolute right-7 bottom-full h-4 rounded-t-2xl bg-white/50"
592
+ class: "pointer-events-none absolute right-7 bottom-full h-4 rounded-t-2xl bg-primary/50"
593
593
  }, null, 4),
594
- i(jt, {
595
- "body-width": Y,
596
- "curve-height": Z,
597
- style: R({ transform: `translateY(-${Z}px)` }),
594
+ i(Ft, {
595
+ "body-width": Q,
596
+ "curve-height": X,
597
+ style: F({ transform: `translateY(-${X}px)` }),
598
598
  "aria-hidden": "true",
599
599
  class: "pointer-events-none absolute top-0 left-0 block h-auto"
600
600
  }, null, 8, ["style"]),
601
- s("div", Kt, [
602
- U(_.$slots, "header")
601
+ s("div", jt, [
602
+ U(m.$slots, "header")
603
603
  ]),
604
- s("div", Ot, [
605
- i(t(Te), { variant: "underline" }, {
606
- default: p(() => [
607
- (a(!0), g(B, null, F(e.tabs, (d) => (a(), h(t(Ae), {
608
- key: q(d.label),
609
- label: q(d.label),
604
+ s("div", qt, [
605
+ i(t(Ue), { variant: "underline" }, {
606
+ default: y(() => [
607
+ (a(!0), g(P, null, H(e.tabs, (u) => (a(), h(t(Ie), {
608
+ key: L(u.label),
609
+ label: L(u.label),
610
610
  to: {
611
- name: d.to,
611
+ name: u.to,
612
612
  params: t(o).params
613
613
  }
614
614
  }, null, 8, ["label", "to"]))), 128))
@@ -616,21 +616,21 @@ const Wt = { class: "relative isolate flex size-full flex-col px-md pt-12 pb-md
616
616
  _: 1
617
617
  })
618
618
  ]),
619
- s("div", Qt, [
620
- i(t(dt))
619
+ s("div", Wt, [
620
+ i(t(st))
621
621
  ]),
622
- e.createdAt !== null && e.lastActivityAt !== null ? (a(), g("p", Xt, k(t(n).t("wise_crm.detail_view.footer", {
622
+ e.createdAt !== null && e.lastActivityAt !== null ? (a(), g("p", Gt, C(t(n).t("wise_crm.detail_view.footer", {
623
623
  createdAt: t(f).toDate(e.createdAt.toPlainDate()),
624
624
  lastActivityAt: t(f).toDate(e.lastActivityAt.toPlainDate())
625
- })), 1)) : b("", !0)
625
+ })), 1)) : v("", !0)
626
626
  ])
627
627
  ])
628
628
  ]),
629
629
  _: 3
630
630
  }, 8, ["color"])
631
631
  ]),
632
- "detail-pane": p(() => [
633
- U(_.$slots, "sidebar")
632
+ "detail-pane": y(() => [
633
+ U(m.$slots, "sidebar")
634
634
  ]),
635
635
  _: 3
636
636
  }, 8, ["title"])
@@ -638,115 +638,13 @@ const Wt = { class: "relative isolate flex size-full flex-col px-md pt-12 pb-md
638
638
  _: 3
639
639
  }));
640
640
  }
641
- }), Yt = ["href"], Zt = ["href"], Jt = { key: 2 }, z = /* @__PURE__ */ $({
642
- __name: "CrmDetailHeaderContactTooltip",
643
- props: {
644
- type: {},
645
- value: {}
646
- },
647
- setup(r) {
648
- const e = r, n = I(), l = v(() => {
649
- switch (e.type) {
650
- case "address":
651
- return se;
652
- case "email":
653
- return re;
654
- case "phone":
655
- return M;
656
- default:
657
- return M;
658
- }
659
- }), o = v(() => {
660
- switch (e.type) {
661
- case "email":
662
- return `mailto:${e.value}`;
663
- case "phone":
664
- return `tel:${e.value}`;
665
- case "address":
666
- return `https://maps.google.com/?q=${encodeURIComponent(e.value)}`;
667
- default:
668
- return null;
669
- }
670
- }), f = v(() => {
671
- switch (e.type) {
672
- case "email":
673
- return n.t("component.contact_tooltip.aria_label.email", {
674
- value: e.value
675
- });
676
- case "phone":
677
- return n.t("component.contact_tooltip.aria_label.phone", {
678
- value: e.value
679
- });
680
- case "address":
681
- return n.t("component.contact_tooltip.aria_label.address", {
682
- value: e.value
683
- });
684
- default:
685
- return e.value;
686
- }
687
- }), m = ue({
688
- source: e.value
689
- });
690
- function u() {
691
- m.copy(e.value);
692
- }
693
- return (x, y) => (a(), h(t(Ne), null, {
694
- trigger: p(() => [
695
- (a(), h(P(o.value ? "a" : "div"), {
696
- href: o.value,
697
- "aria-label": f.value,
698
- target: r.type === "address" ? "_blank" : void 0,
699
- rel: r.type === "address" ? "noopener noreferrer" : void 0,
700
- 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"
701
- }, {
702
- default: p(() => [
703
- (a(), h(P(l.value), { class: "size-4 shrink-0 text-brand-700 dark:text-brand-200" }))
704
- ]),
705
- _: 1
706
- }, 8, ["href", "aria-label", "target", "rel"]))
707
- ]),
708
- content: p(() => [
709
- i(t(Pe), null, {
710
- default: p(() => [
711
- i(t(Be), {
712
- gap: "xs",
713
- class: "text-xs text-brand-500"
714
- }, {
715
- default: p(() => [
716
- (a(), h(P(l.value), { class: "size-3.5 shrink-0" })),
717
- r.type === "email" ? (a(), g("a", {
718
- key: 0,
719
- href: `mailto:${e.value}`,
720
- class: "underline ring-brand-500 ring-offset-1 duration-200 outline-none focus-visible:ring-2"
721
- }, k(e.value), 9, Yt)) : r.type === "phone" ? (a(), g("a", {
722
- key: 1,
723
- href: `tel:${e.value}`,
724
- class: "underline ring-brand-500 ring-offset-1 duration-200 outline-none focus-visible:ring-2"
725
- }, k(e.value), 9, Zt)) : (a(), g("p", Jt, k(e.value), 1)),
726
- i(t(S), {
727
- label: t(n).t("wise_crm.info_dialog.copy_to_clipboard"),
728
- icon: t(ot),
729
- variant: "tertiary",
730
- size: "xs",
731
- onClick: u
732
- }, null, 8, ["label", "icon"])
733
- ]),
734
- _: 1
735
- })
736
- ]),
737
- _: 1
738
- })
739
- ]),
740
- _: 1
741
- }));
742
- }
743
- }), en = { class: "flex flex-col gap-lg" }, tn = { class: "group/header-row flex items-center justify-between gap-lg" }, nn = { class: "flex min-w-0 flex-1 items-center gap-lg" }, on = {
641
+ }), Kt = { class: "flex flex-col gap-lg" }, Ot = { class: "group/header-row flex items-center justify-between gap-lg" }, Qt = { class: "flex min-w-0 flex-1 items-center gap-lg" }, Xt = {
744
642
  class: "flex size-14 shrink-0 items-center justify-center rounded-xl bg-brand-100 text-lg font-semibold text-brand-700 dark:bg-brand-900 dark:text-brand-200",
745
643
  "aria-hidden": "true"
746
- }, ln = { class: "flex min-w-0 flex-1 flex-col" }, an = {
644
+ }, Yt = { class: "flex min-w-0 flex-1 flex-col" }, Zt = {
747
645
  key: 0,
748
646
  class: "font-mono text-xs text-tertiary"
749
- }, rn = { class: "flex shrink-0 items-center group-has-data-name-editing/header-row:hidden" }, sn = { class: "hidden items-center gap-sm md:flex" }, cn = { class: "flex items-center gap-xs md:hidden" }, un = { class: "flex flex-wrap items-center gap-sm" }, Dn = /* @__PURE__ */ $({
647
+ }, Jt = { class: "flex shrink-0 items-center group-has-data-name-editing/header-row:hidden" }, en = { class: "hidden items-center gap-sm md:flex" }, tn = { class: "flex items-center gap-xs md:hidden" }, nn = { class: "flex flex-wrap items-center gap-sm" }, vn = /* @__PURE__ */ $({
750
648
  __name: "CrmDetailHeader",
751
649
  props: {
752
650
  createdAt: {},
@@ -761,201 +659,201 @@ const Wt = { class: "relative isolate flex size-full flex-col px-md pt-12 pb-md
761
659
  phone: {},
762
660
  status: {}
763
661
  },
764
- setup(r) {
765
- const e = r, n = I(), l = ie(), o = ue(), f = he(), m = v(() => e.name.split(" ").filter((d) => d.length > 0).slice(0, 2).map((d) => d.charAt(0).toUpperCase()).join("")), u = v(() => new Intl.DateTimeFormat(n.locale.value, {
662
+ setup(c) {
663
+ const e = c, n = D(), l = le(), o = it(), f = pe(), p = b(() => e.name.split(" ").filter((u) => u.length > 0).slice(0, 2).map((u) => u.charAt(0).toUpperCase()).join("")), d = b(() => new Intl.DateTimeFormat(n.locale.value, {
766
664
  month: "short",
767
665
  year: "numeric"
768
666
  }).format(e.createdAt.epochMilliseconds));
769
667
  function x() {
770
668
  o.copy(window.location.href);
771
669
  }
772
- function y(d) {
670
+ function _(u) {
773
671
  return {
774
672
  left: {
775
- icon: d,
673
+ icon: u,
776
674
  type: "icon"
777
675
  }
778
676
  };
779
677
  }
780
- function _(d) {
781
- window.location.href = d;
678
+ function m(u) {
679
+ window.location.href = u;
782
680
  }
783
- function c(d) {
784
- window.open(`https://maps.google.com/?q=${encodeURIComponent(W.format(d))}`, "_blank", "noopener,noreferrer");
681
+ function r(u) {
682
+ window.open(`https://maps.google.com/?q=${encodeURIComponent(j.format(u))}`, "_blank", "noopener,noreferrer");
785
683
  }
786
- return (d, w) => (a(), g("div", en, [
787
- s("div", tn, [
788
- s("div", nn, [
789
- s("div", on, k(m.value), 1),
790
- s("div", ln, [
791
- U(d.$slots, "name", {}, () => [
792
- i(t(Ee), {
684
+ return (u, w) => (a(), g("div", Kt, [
685
+ s("div", Ot, [
686
+ s("div", Qt, [
687
+ s("div", Xt, C(p.value), 1),
688
+ s("div", Yt, [
689
+ U(u.$slots, "name", {}, () => [
690
+ i(t(De), {
793
691
  text: e.name,
794
692
  as: "h1",
795
693
  class: "text-lg font-semibold text-primary"
796
694
  }, null, 8, ["text"])
797
695
  ]),
798
- e.identifier !== null ? (a(), g("span", an, k(t(n).t("wise_crm.detail_view.identifier", { value: e.identifier })), 1)) : b("", !0)
696
+ e.identifier !== null ? (a(), g("span", Zt, C(t(n).t("wise_crm.detail_view.identifier", { value: e.identifier })), 1)) : v("", !0)
799
697
  ])
800
698
  ]),
801
- s("div", rn, [
802
- s("div", sn, [
803
- e.email !== null ? (a(), h(z, {
699
+ s("div", Jt, [
700
+ s("div", en, [
701
+ e.email !== null ? (a(), h(E, {
804
702
  key: 0,
805
703
  value: e.email,
806
704
  type: "email"
807
- }, null, 8, ["value"])) : b("", !0),
808
- e.mobilePhone !== null || e.phone !== null ? (a(), h(z, {
705
+ }, null, 8, ["value"])) : v("", !0),
706
+ e.mobilePhone !== null || e.phone !== null ? (a(), h(E, {
809
707
  key: 1,
810
708
  value: e.mobilePhone ?? e.phone ?? "",
811
709
  type: "phone"
812
- }, null, 8, ["value"])) : b("", !0),
813
- e.address !== null ? (a(), h(z, {
710
+ }, null, 8, ["value"])) : v("", !0),
711
+ e.address !== null ? (a(), h(E, {
814
712
  key: 2,
815
- value: t(W).format(e.address),
713
+ value: t(j).format(e.address),
816
714
  type: "address"
817
- }, null, 8, ["value"])) : b("", !0),
818
- U(d.$slots, "actions"),
715
+ }, null, 8, ["value"])) : v("", !0),
716
+ U(u.$slots, "actions"),
819
717
  i(t(S), {
820
- icon: t(G),
718
+ icon: t(q),
821
719
  label: t(n).t("wise_crm.detail_view.copy_link"),
822
720
  variant: "tertiary",
823
721
  size: "sm",
824
722
  onClick: x
825
723
  }, null, 8, ["icon", "label"]),
826
- i(t(Ve), {
724
+ i(t(Se), {
827
725
  orientation: "vertical",
828
726
  class: "mx-xs h-5"
829
727
  }),
830
728
  i(t(S), {
831
- icon: t(K),
729
+ icon: t(W),
832
730
  label: t(n).t("wise_crm.detail_view.close"),
833
731
  variant: "tertiary",
834
732
  size: "sm",
835
- onClick: w[0] || (w[0] = (D) => t(l).goToReturnRoute())
733
+ onClick: w[0] || (w[0] = (I) => t(l).goToReturnRoute())
836
734
  }, null, 8, ["icon", "label"])
837
735
  ]),
838
- s("div", cn, [
839
- i(t(ne), { "popover-align": "end" }, {
840
- trigger: p(() => [
736
+ s("div", tn, [
737
+ i(t(ee), { "popover-align": "end" }, {
738
+ trigger: y(() => [
841
739
  i(t(S), {
842
- icon: t(le),
740
+ icon: t(ne),
843
741
  label: t(n).t("wise_crm.detail_view.more_actions"),
844
742
  variant: "tertiary",
845
743
  size: "sm"
846
744
  }, null, 8, ["icon", "label"])
847
745
  ]),
848
- content: p(() => [
849
- i(t(H), null, {
850
- default: p(() => [
746
+ content: y(() => [
747
+ i(t(z), null, {
748
+ default: y(() => [
851
749
  e.email !== null ? (a(), h(t(T), {
852
750
  key: 0,
853
- config: y(t(re)),
751
+ config: _(t(Xe)),
854
752
  label: t(n).t("wise_crm.detail_view.send_email"),
855
- onSelect: w[1] || (w[1] = (D) => _(`mailto:${e.email}`))
856
- }, null, 8, ["config", "label"])) : b("", !0),
753
+ onSelect: w[1] || (w[1] = (I) => m(`mailto:${e.email}`))
754
+ }, null, 8, ["config", "label"])) : v("", !0),
857
755
  e.mobilePhone !== null || e.phone !== null ? (a(), h(t(T), {
858
756
  key: 1,
859
- config: y(t(M)),
757
+ config: _(t(Ye)),
860
758
  label: t(n).t("wise_crm.detail_view.call"),
861
- onSelect: w[2] || (w[2] = (D) => _(`tel:${e.mobilePhone ?? e.phone}`))
862
- }, null, 8, ["config", "label"])) : b("", !0),
759
+ onSelect: w[2] || (w[2] = (I) => m(`tel:${e.mobilePhone ?? e.phone}`))
760
+ }, null, 8, ["config", "label"])) : v("", !0),
863
761
  e.address !== null ? (a(), h(t(T), {
864
762
  key: 2,
865
- config: y(t(se)),
763
+ config: _(t(Ze)),
866
764
  label: t(n).t("wise_crm.detail_view.open_address"),
867
- onSelect: w[3] || (w[3] = (D) => c(e.address))
868
- }, null, 8, ["config", "label"])) : b("", !0),
765
+ onSelect: w[3] || (w[3] = (I) => r(e.address))
766
+ }, null, 8, ["config", "label"])) : v("", !0),
869
767
  i(t(T), {
870
- config: y(t(G)),
768
+ config: _(t(q)),
871
769
  label: t(n).t("wise_crm.detail_view.copy_link"),
872
770
  onSelect: x
873
771
  }, null, 8, ["config", "label"])
874
772
  ]),
875
773
  _: 1
876
774
  }),
877
- t(f)["menu-actions"] !== void 0 ? (a(), g(B, { key: 0 }, [
878
- i(t(ze)),
879
- i(t(H), null, {
880
- default: p(() => [
881
- U(d.$slots, "menu-actions")
775
+ t(f)["menu-actions"] !== void 0 ? (a(), g(P, { key: 0 }, [
776
+ i(t(Te)),
777
+ i(t(z), null, {
778
+ default: y(() => [
779
+ U(u.$slots, "menu-actions")
882
780
  ]),
883
781
  _: 3
884
782
  })
885
- ], 64)) : b("", !0)
783
+ ], 64)) : v("", !0)
886
784
  ]),
887
785
  _: 3
888
786
  }),
889
787
  i(t(S), {
890
- icon: t(K),
788
+ icon: t(W),
891
789
  label: t(n).t("wise_crm.detail_view.close"),
892
790
  variant: "tertiary",
893
791
  size: "sm",
894
- onClick: w[4] || (w[4] = (D) => t(l).goToReturnRoute())
792
+ onClick: w[4] || (w[4] = (I) => t(l).goToReturnRoute())
895
793
  }, null, 8, ["icon", "label"])
896
794
  ])
897
795
  ])
898
796
  ]),
899
- s("div", un, [
797
+ s("div", nn, [
900
798
  e.entityLabel !== null ? (a(), h(t(N), {
901
799
  key: 0,
902
- icon: e.entityType === t(mt).BUSINESS ? t(lt) : t(at),
800
+ icon: e.entityType === t(rt).BUSINESS ? t(Je) : t(et),
903
801
  label: e.entityLabel,
904
802
  variant: "translucent",
905
803
  color: "brand"
906
- }, null, 8, ["icon", "label"])) : b("", !0),
804
+ }, null, 8, ["icon", "label"])) : v("", !0),
907
805
  e.status !== null ? (a(), h(t(N), {
908
806
  key: 1,
909
807
  label: e.status.label,
910
808
  color: e.status.color,
911
809
  variant: "translucent"
912
- }, null, 8, ["label", "color"])) : b("", !0),
913
- U(d.$slots, "badges"),
810
+ }, null, 8, ["label", "color"])) : v("", !0),
811
+ U(u.$slots, "badges"),
914
812
  i(t(N), {
915
- label: t(n).t("wise_crm.detail_view.since", { date: u.value }),
813
+ label: t(n).t("wise_crm.detail_view.since", { date: d.value }),
916
814
  variant: "outline",
917
815
  color: "gray"
918
816
  }, null, 8, ["label"]),
919
- U(d.$slots, "owner", {}, () => [
817
+ U(u.$slots, "owner", {}, () => [
920
818
  e.owner !== null ? (a(), h(t(N), {
921
819
  key: 0,
922
- icon: t(it),
820
+ icon: t(tt),
923
821
  label: e.owner,
924
822
  variant: "outline",
925
823
  color: "gray"
926
- }, null, 8, ["icon", "label"])) : b("", !0)
824
+ }, null, 8, ["icon", "label"])) : v("", !0)
927
825
  ])
928
826
  ])
929
827
  ]));
930
828
  }
931
- }), Sn = /* @__PURE__ */ $({
829
+ }), wn = /* @__PURE__ */ $({
932
830
  __name: "CrmDetailHeaderBadge",
933
831
  props: {
934
832
  uuid: {},
935
833
  badge: {},
936
834
  entity: {}
937
835
  },
938
- setup(r) {
939
- const e = r, n = I(), l = Me("wiseCrmHeaderBadge", {
836
+ setup(c) {
837
+ const e = c, n = D(), l = Ne("wiseCrmHeaderBadge", {
940
838
  params: {
941
- uuid: v(() => e.uuid),
942
- badgeKey: v(() => e.badge.key),
943
- entity: v(() => e.entity),
839
+ uuid: b(() => e.uuid),
840
+ badgeKey: b(() => e.badge.key),
841
+ entity: b(() => e.entity),
944
842
  // Labels are translated by the host app, so refetch them in the new locale
945
- locale: v(() => n.locale.value)
843
+ locale: b(() => n.locale.value)
946
844
  },
947
- queryFn: () => C.fromPromise(f())
948
- }), o = v(() => {
845
+ queryFn: () => k.fromPromise(f())
846
+ }), o = b(() => {
949
847
  if (!l.result.value.isOk())
950
848
  return null;
951
- const m = l.result.value.getValue();
952
- if (m === null)
849
+ const p = l.result.value.getValue();
850
+ if (p === null)
953
851
  return null;
954
- const u = typeof m == "string" ? {
955
- label: m
956
- } : m, x = u.label.trim();
852
+ const d = typeof p == "string" ? {
853
+ label: p
854
+ } : p, x = d.label.trim();
957
855
  return x === "" ? null : {
958
- ...u,
856
+ ...d,
959
857
  label: x
960
858
  };
961
859
  });
@@ -964,24 +862,24 @@ const Wt = { class: "relative isolate flex size-full flex-col px-md pt-12 pb-md
964
862
  return await e.badge.getData({
965
863
  uuid: e.uuid
966
864
  });
967
- } catch (m) {
968
- return rt.error(new Error(`[wise-crm] Header badge "${e.badge.key}" failed to load`, {
969
- cause: m
865
+ } catch (p) {
866
+ return nt.error(new Error(`[wise-crm] Header badge "${e.badge.key}" failed to load`, {
867
+ cause: p
970
868
  })), null;
971
869
  }
972
870
  }
973
- return (m, u) => t(l).isLoading.value ? (a(), h(t(He), {
871
+ return (p, d) => t(l).isLoading.value ? (a(), h(t(Ae), {
974
872
  key: 0,
975
873
  "is-animated": !0,
976
874
  class: "h-6 w-16"
977
- })) : o.value !== null ? (a(), h(t(pt), {
875
+ })) : o.value !== null ? (a(), h(t(ct), {
978
876
  key: 1,
979
877
  initial: { opacity: 0 },
980
878
  animate: { opacity: 1 },
981
879
  transition: { duration: 0.15 },
982
880
  class: "flex max-w-full min-w-0"
983
881
  }, {
984
- default: p(() => [
882
+ default: y(() => [
985
883
  i(t(N), {
986
884
  label: o.value.label,
987
885
  icon: o.value.icon ?? e.badge.icon,
@@ -992,17 +890,17 @@ const Wt = { class: "relative isolate flex size-full flex-col px-md pt-12 pb-md
992
890
  }, null, 8, ["label", "icon", "color", "dot", "variant"])
993
891
  ]),
994
892
  _: 1
995
- })) : b("", !0);
893
+ })) : v("", !0);
996
894
  }
997
895
  });
998
896
  export {
999
- de as N,
1000
- Un as _,
1001
- Cn as a,
1002
- kn as b,
1003
- In as c,
1004
- Dn as d,
1005
- Sn as e,
1006
- It as f,
1007
- $n as u
897
+ ae as N,
898
+ gn as _,
899
+ hn as a,
900
+ yn as b,
901
+ bn as c,
902
+ vn as d,
903
+ wn as e,
904
+ kt as f,
905
+ xn as u
1008
906
  };