@wisemen/wise-crm-web 1.0.0 → 1.2.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 (97) hide show
  1. package/dist/ActivityIcon-DNdtN-M_.js +19 -0
  2. package/dist/AppSkeletonLoader-Dq6pKznm.js +1112 -0
  3. package/dist/{AttachmentIcon-CsucE3yf.js → AttachmentIcon-BLUd7LaN.js} +9 -7
  4. package/dist/BoldIcon-WRYUWz15.js +16 -0
  5. package/dist/{BookIcon-DgT3flV5.js → BookIcon-Bb3r5y_J.js} +9 -7
  6. package/dist/{BuildingIcon-Bm18omgW.js → BuildingIcon-DFutRg8d.js} +9 -7
  7. package/dist/{BuildingsIcon-D4X7QciL.js → BuildingsIcon-BVHy6yoa.js} +9 -7
  8. package/dist/{BulletListIcon-CNCV-cOS.js → BulletListIcon-BhOXLSBa.js} +9 -7
  9. package/dist/BusinessDetailSidebarProvider-a6VeNUii.js +2946 -0
  10. package/dist/BusinessDetailView-Dz3wDSx5.js +24 -0
  11. package/dist/ChevronDownIcon-BmyTSPND.js +19 -0
  12. package/dist/ClockIcon-BYfZAvIE.js +23 -0
  13. package/dist/ClockPlusIcon-BcNi0Y9I.js +23 -0
  14. package/dist/{CopyIcon-CUomKXdn.js → CopyIcon-2eV8MRv_.js} +9 -7
  15. package/dist/CrmDetailHeaderCard-BkA0Z-Cu.js +2523 -0
  16. package/dist/CrmDetailView-BhZEQqUH.js +67 -0
  17. package/dist/DealCommunicationTabView-Drp9MEPu.js +140 -0
  18. package/dist/DealDetailView-DWLudchX.js +1049 -0
  19. package/dist/DealExternalAttachment-B6l0gDqF.js +179 -0
  20. package/dist/{DealIcon-CpO-DkyS.js → DealIcon-BwUWYDxo.js} +9 -7
  21. package/dist/DealSendMailDialog-Dqei4933.js +1566 -0
  22. package/dist/DownloadCloudIcon-BSrLGGrY.js +19 -0
  23. package/dist/{EditWithLineIcon-C0WMD50F.js → EditWithLineIcon-BKYDPJOY.js} +9 -7
  24. package/dist/{Error-X0deDY-N.js → Error-za-wClcU.js} +2591 -2462
  25. package/dist/{FileIcon-3FebXgYQ.js → FileIcon-DL1e1tAu.js} +9 -7
  26. package/dist/FilterLinesIcon-DgVMySAE.js +22 -0
  27. package/dist/H1Icon-B6NEsEbj.js +17 -0
  28. package/dist/{H2Icon-CuEmp9I0.js → H2Icon-CNof5Ohu.js} +9 -7
  29. package/dist/{H3Icon-wAPhdYIf.js → H3Icon-B2F2Tb6r.js} +9 -7
  30. package/dist/HashIcon-C_XttKfW.js +19 -0
  31. package/dist/HomeFilledIcon-DtZ2eXxt.js +16 -0
  32. package/dist/IndividualDetailSidebarProvider-jjRoK1Av.js +609 -0
  33. package/dist/IndividualDetailView-BqIRHn-0.js +24 -0
  34. package/dist/ItalicIcon-DqBns3yy.js +17 -0
  35. package/dist/{LayersTreeIcon-Ct-owndO.js → LayersTreeIcon-DZZCSCY9.js} +10 -8
  36. package/dist/{LinkBrokenIcon-CTlqmapl.js → LinkBrokenIcon-BNBpWSi7.js} +9 -7
  37. package/dist/{LinkExternalIcon-LOVtSqBT.js → LinkExternalIcon-B7SHeB1_.js} +9 -7
  38. package/dist/LinkIcon-8bCrZEv9.js +17 -0
  39. package/dist/{LocationPinIcon-Cp-wRgk2.js → LocationPinIcon-UySRqSfG.js} +9 -7
  40. package/dist/{MailIcon-CnTrB1k3.js → MailIcon-BT7gSIZb.js} +9 -7
  41. package/dist/{MobilePhoneIcon-B747hmpS.js → MobilePhoneIcon-_KQGnCSS.js} +9 -7
  42. package/dist/NumberedListIcon-B-JVTSAe.js +17 -0
  43. package/dist/{PhoneIcon-94MYVL85.js → PhoneIcon-DGGW_MNR.js} +9 -7
  44. package/dist/{RefreshIcon-DRe3coBc.js → RefreshIcon-D1QWfdPD.js} +9 -7
  45. package/dist/{SendIcon-MYItp1xI.js → SendIcon-BtJ-NCec.js} +9 -7
  46. package/dist/{SettingsIcon-C0qTAv0w.js → SettingsIcon-CWFwJelS.js} +10 -8
  47. package/dist/{StarOutlineIcon-CiFLgepk.js → StarOutlineIcon-C-ELTCDQ.js} +9 -7
  48. package/dist/{StarYellowIcon-C0v_XGwI.js → StarYellowIcon-7wuNWaQO.js} +9 -7
  49. package/dist/{ThreeDotsIcon-lujOTU3G.js → ThreeDotsIcon-C56RWk-0.js} +12 -10
  50. package/dist/TimeLineMarkerIcon-DLmPwfs6.js +18 -0
  51. package/dist/{TrashIcon-v4L9SEK_.js → TrashIcon-o4PWmcYe.js} +9 -7
  52. package/dist/UploadCloudIcon-D2tWB0NP.js +19 -0
  53. package/dist/{UserCircleIcon-BjUt_2C4.js → UserCircleIcon-DiDajcIH.js} +10 -8
  54. package/dist/UserIcon-Bv1eF7ln.js +22 -0
  55. package/dist/{VerticalDotsIcon-Y3m6tlQ2.js → VerticalDotsIcon-YcD73UqY.js} +9 -7
  56. package/dist/{WalletIcon-pPsKbzmh.js → WalletIcon-CUh92U5K.js} +9 -7
  57. package/dist/_plugin-vue_export-helper-D3hKq4w_.js +8 -0
  58. package/dist/client-9P6xe_5g.js +4188 -0
  59. package/dist/components/auto-focus/AutoFocus.vue.d.ts +13 -0
  60. package/dist/components/column-layout/ColumnLayout.vue.d.ts +1 -1
  61. package/dist/components/row-layout/RowLayout.vue.d.ts +1 -1
  62. package/dist/components/text/Text.vue.d.ts +1 -1
  63. package/dist/index.js +1881 -1693
  64. package/dist/style.css +2 -2
  65. package/dist/testing.js +102 -98
  66. package/dist/utils/color.util.d.ts +6 -0
  67. package/dist/{uuid.util-C1p-yuFc.js → uuid.util-DpiDKVoj.js} +4 -2
  68. package/package.json +30 -30
  69. package/dist/ActivityIcon-DFD9ZhO0.js +0 -17
  70. package/dist/AppSkeletonLoader-BAhoOmFD.js +0 -1106
  71. package/dist/BoldIcon-DY2FlAS0.js +0 -14
  72. package/dist/BusinessDetailSidebarProvider-Dm6Dd7Nq.js +0 -2899
  73. package/dist/BusinessDetailView-BHVUfCpV.js +0 -24
  74. package/dist/ChevronDownIcon-CfBAAAca.js +0 -17
  75. package/dist/ClockIcon-Ckr1IQBt.js +0 -21
  76. package/dist/ClockPlusIcon-CVN69pCS.js +0 -21
  77. package/dist/CrmDetailHeaderCard-CiVLyIuw.js +0 -2516
  78. package/dist/CrmDetailView-DaAuWeiB.js +0 -65
  79. package/dist/DealCommunicationTabView-xq_zOAsr.js +0 -137
  80. package/dist/DealDetailView-C54XpYN1.js +0 -1021
  81. package/dist/DealExternalAttachment-Dp44vkgt.js +0 -177
  82. package/dist/DealSendMailDialog-D11Tgd_A.js +0 -1552
  83. package/dist/DownloadCloudIcon-VMmB9vit.js +0 -17
  84. package/dist/FilterLinesIcon-DHpRPKJB.js +0 -20
  85. package/dist/H1Icon-CPVGTTtl.js +0 -15
  86. package/dist/HashIcon-C2kfHjTC.js +0 -17
  87. package/dist/HomeFilledIcon-CxIazF0B.js +0 -14
  88. package/dist/IndividualDetailSidebarProvider-BvjhFng9.js +0 -608
  89. package/dist/IndividualDetailView-Cq8iAwQv.js +0 -24
  90. package/dist/ItalicIcon-DfV3EOdk.js +0 -15
  91. package/dist/LinkIcon-DqBbVrvs.js +0 -15
  92. package/dist/NumberedListIcon-amJxDaaD.js +0 -15
  93. package/dist/TimeLineMarkerIcon-C4LfErbc.js +0 -16
  94. package/dist/UploadCloudIcon-j1-1Rvqb.js +0 -17
  95. package/dist/UserIcon-Cb2jFKLr.js +0 -20
  96. package/dist/_plugin-vue_export-helper-BSi1g3Lh.js +0 -6
  97. package/dist/client-S6BLV3Ct.js +0 -4191
@@ -1,1552 +0,0 @@
1
- import { G as AppDialogContainer_default, H as AppForm_default, J as AppDialogActionCancel_default, K as AppDialogActions_default, L as useOffsetInfiniteQuery, V as toFormField, Y as useApiErrorToast, Z as createI18nKeyMap, at as StringUtil, p as AppUnstyledButton_default, q as AppDialogActionPrimary_default, z as AppDialogHeader_default } from "./Error-X0deDY-N.js";
2
- import { a as AppGroup_default, l as He, s as ZonedDateTimeTransformer, t as AppSkeletonLoader_default, u as ze } from "./AppSkeletonLoader-BAhoOmFD.js";
3
- import { A as updateMailTemplateV1, D as updateDealV1, E as updateDealContactPersonV1, H as viewDealContactPersonDetailV1, S as unlinkContactPersonFromDealV1, U as viewDealDetailV1, W as viewDealIndexV1, _ as makeDealContactPersonPrimaryV1, at as viewUserIndexV1, b as transitionDealColumnV1, et as viewMailTemplateDetailByKeyV1, f as linkContactPersonToDealV1, h as listBoardColumnsV1, i as createFileV1, m as listBoardColumnTransitionsV1, nt as viewMailTemplateIndexV1, r as createDealV1, t as confirmFileUploadV2, tt as viewMailTemplateDetailV1, ut as ClientType, vt as SdkContentLocale } from "./client-S6BLV3Ct.js";
4
- import { t as __plugin_vue_export_helper_default } from "./_plugin-vue_export-helper-BSi1g3Lh.js";
5
- import { a as RevealOnHoverOrFocus_default, i as FileUtil, n as DealCommunicationMailListSectionContainer_default, o as FileReferenceTransformer, r as MailService, t as DealExternalAttachment_default } from "./DealExternalAttachment-Dp44vkgt.js";
6
- import z$1, { z } from "zod";
7
- import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeModels, mergeProps, normalizeClass, onBeforeUnmount, onMounted, openBlock, ref, renderList, renderSlot, toDisplayString, unref, useAttrs, useId, useModel, useTemplateRef, watch, withCtx } from "vue";
8
- import { useI18n } from "vue-i18n";
9
- import { FileUploadStatus, PaginationParamsBuilder, VcButton, VcDialog, VcDialogCloseButton, VcDialogContent, VcDialogDescription, VcDialogTitle, VcFileUploadDropzone, VcFileUploadItem, VcFileUploadItemRemove, VcFileUploadItemReplace, VcFileUploadRoot, VcFileUploadTrigger, VcFormField, VcFormFieldLabel, VcIcon, VcIconButton, VcKeyboardShortcut, VcSpinner, VcTextField, VcTooltipArrow, VcTooltipContent, VcTooltipInnerContent, VcTooltipPortal, VcTooltipRoot, VcTooltipTrigger, useDialog, useToast } from "@wisemen/vue-core-components";
10
- import { useElementSize } from "@vueuse/core";
11
- import { useForm } from "formango";
12
- import { AnimatePresence, Motion, MotionConfig, motion } from "motion-v";
13
- import { ListboxContent, ListboxItem, ListboxRoot, Primitive, TagsInputInput, TagsInputItem, TagsInputItemDelete, TagsInputItemText, TagsInputRoot } from "reka-ui";
14
- import Link from "@tiptap/extension-link";
15
- import { StarterKit } from "@tiptap/starter-kit";
16
- import { EditorContent, useEditor } from "@tiptap/vue-3";
17
- var AppTagsInputField_default = /* @__PURE__ */ defineComponent({
18
- __name: "AppTagsInputField",
19
- props: /* @__PURE__ */ mergeModels({
20
- isDisabled: { type: Boolean },
21
- isRequired: { type: Boolean },
22
- isTouched: { type: Boolean },
23
- errorMessage: {},
24
- label: {},
25
- placeholder: {}
26
- }, {
27
- modelValue: { required: !0 },
28
- modelModifiers: {}
29
- }),
30
- emits: /* @__PURE__ */ mergeModels(["blur"], ["update:modelValue"]),
31
- setup(i, { emit: N }) {
32
- let P = i, I = N, R = useModel(i, "modelValue"), B = useId();
33
- return (i, N) => (openBlock(), createBlock(unref(VcFormField), {
34
- "is-touched": P.isTouched,
35
- hint: null,
36
- label: P.label,
37
- "input-id": unref(B),
38
- "error-message": P.errorMessage,
39
- "is-required": P.isRequired,
40
- for: `tags-input-${unref(B)}`,
41
- class: "!mt-0 w-full"
42
- }, {
43
- label: withCtx(() => [renderSlot(i.$slots, "label")]),
44
- default: withCtx(() => [createVNode(unref(TagsInputRoot), {
45
- id: `tags-input-${P.placeholder}`,
46
- modelValue: R.value,
47
- "onUpdate:modelValue": N[1] ||= (i) => R.value = i,
48
- "add-on-blur": !0,
49
- "add-on-paste": !0,
50
- delimiter: ";",
51
- class: "gap-sm border-secondary bg-primary px-sm py-xxs flex max-h-50 min-h-10 w-full flex-wrap items-center overflow-y-auto rounded-md border"
52
- }, {
53
- default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(R.value, (i) => (openBlock(), createBlock(unref(TagsInputItem), {
54
- key: i,
55
- value: i,
56
- class: "gap-xs border-primary px-xs text-secondary my-[0.18rem] flex items-center justify-center rounded-sm border text-xs aria-[current=true]:bg-brand-500"
57
- }, {
58
- default: withCtx(() => [createVNode(unref(TagsInputItemText), { class: "pl-sm text-xs" }), createVNode(unref(TagsInputItemDelete), { class: "group p-xs rounded-full bg-transparent" }, {
59
- default: withCtx(() => [createVNode(unref(VcIcon), {
60
- icon: "close",
61
- class: "size-3 duration-200 group-hover:scale-110"
62
- })]),
63
- _: 1
64
- })]),
65
- _: 1
66
- }, 8, ["value"]))), 128)), createVNode(unref(TagsInputInput), {
67
- placeholder: P.placeholder,
68
- class: "px-sm h-8 flex-1 rounded-full bg-transparent text-sm placeholder:text-placeholder focus:outline-none",
69
- onBlur: N[0] ||= (i) => I("blur")
70
- }, null, 8, ["placeholder"])]),
71
- _: 1
72
- }, 8, ["id", "modelValue"])]),
73
- _: 3
74
- }, 8, [
75
- "is-touched",
76
- "label",
77
- "input-id",
78
- "error-message",
79
- "is-required",
80
- "for"
81
- ]));
82
- }
83
- }), _sfc_main = {}, _hoisted_1$12 = { class: "flex size-full items-center justify-center" };
84
- function _sfc_render(i, N) {
85
- return openBlock(), createElementBlock("div", _hoisted_1$12, [renderSlot(i.$slots, "default")]);
86
- }
87
- var CenterContent_default = /* @__PURE__ */ __plugin_vue_export_helper_default(_sfc_main, [["render", _sfc_render]]), AnimateHeight_default = /* @__PURE__ */ defineComponent({
88
- __name: "AnimateHeight",
89
- setup(i) {
90
- let N = ref(null), { height: P } = useElementSize(N), I = ref(!1);
91
- return onMounted(() => {
92
- setTimeout(() => {
93
- I.value = !0;
94
- }, 50);
95
- }), (i, R) => (openBlock(), createBlock(unref(Motion), {
96
- animate: { height: unref(P) },
97
- transition: {
98
- bounce: 0,
99
- duration: I.value ? .3 : 0,
100
- type: "spring"
101
- },
102
- tabindex: "-1",
103
- class: "relative overflow-clip"
104
- }, {
105
- default: withCtx(() => [createElementVNode("div", {
106
- ref_key: "el",
107
- ref: N
108
- }, [renderSlot(i.$slots, "default")], 512)]),
109
- _: 3
110
- }, 8, ["animate", "transition"]));
111
- }
112
- }), BoardColumnTransformer = class {
113
- static fromDto(i) {
114
- return {
115
- uuid: i.uuid,
116
- color: i.color,
117
- config: {
118
- maxDaysInColumnBeforeHighlight: i.config.maxDaysInColumnBeforeHighlight,
119
- onlyShowLeadInColumn: i.config.onlyShowLeadInColumn
120
- },
121
- displayName: i.displayName,
122
- position: i.position
123
- };
124
- }
125
- }, BoardColumnTransitionTransformer = class {
126
- static fromDto(i) {
127
- return {
128
- uuid: i.uuid,
129
- toColumnUuid: i.toColumnUuid,
130
- toColumnColor: i.toColumnColor,
131
- toColumnDisplayName: i.toColumnDisplayName,
132
- toColumnKey: i.toColumnKey,
133
- triggers: i.triggers.map((i) => ({
134
- uuid: i.uuid,
135
- config: i.config,
136
- triggerType: i.triggerType
137
- }))
138
- };
139
- }
140
- }, BoardService = class {
141
- static async getAllColumns() {
142
- return (await listBoardColumnsV1()).data.items.map(BoardColumnTransformer.fromDto);
143
- }
144
- static async getTransitions(i, N) {
145
- return (await listBoardColumnTransitionsV1({
146
- query: { triggerTypes: N },
147
- path: { boardColumnUuid: i }
148
- })).data.items.map(BoardColumnTransitionTransformer.fromDto);
149
- }
150
- }, UserIndexTransformer = class {
151
- static fromDto(i) {
152
- return {
153
- uuid: i.uuid,
154
- email: i.email,
155
- firstName: i.firstName,
156
- lastName: i.lastName,
157
- roles: i.roles.map((i) => ({
158
- uuid: i.uuid,
159
- name: i.name
160
- }))
161
- };
162
- }
163
- }, UserService = class {
164
- static async getAll(i) {
165
- let N = await viewUserIndexV1({ query: i });
166
- return {
167
- data: N.data.items.map(UserIndexTransformer.fromDto),
168
- meta: N.data.meta
169
- };
170
- }
171
- };
172
- function useUserIndexQuery(i) {
173
- return useOffsetInfiniteQuery({
174
- queryFn: (N) => UserService.getAll({
175
- pagination: N,
176
- search: i.params.search?.value
177
- }),
178
- queryKey: { userIndex: { params: i.params } }
179
- });
180
- }
181
- var _hoisted_1$11 = {
182
- key: 0,
183
- class: "text-secondary max-w-xs text-center text-xs"
184
- }, ButtonTooltip_default = /* @__PURE__ */ defineComponent({
185
- __name: "ButtonTooltip",
186
- props: {
187
- isDisabled: {
188
- type: Boolean,
189
- default: !1
190
- },
191
- keyboardKeys: { default: null },
192
- label: { default: null },
193
- side: { default: null }
194
- },
195
- setup(i) {
196
- let N = i;
197
- return (i, P) => (openBlock(), createBlock(unref(VcTooltipRoot), {
198
- "delay-duration": 400,
199
- "is-popover-arrow-hidden": !0,
200
- "disable-hoverable-content": !0,
201
- "popover-side": N.side ?? void 0,
202
- "is-disabled": N.isDisabled
203
- }, {
204
- default: withCtx(() => [createVNode(unref(VcTooltipTrigger), null, {
205
- default: withCtx(() => [renderSlot(i.$slots, "default")]),
206
- _: 3
207
- }), createVNode(unref(VcTooltipPortal), null, {
208
- default: withCtx(() => [createVNode(unref(VcTooltipContent), null, {
209
- default: withCtx(() => [createVNode(unref(Motion), {
210
- initial: {
211
- opacity: 0,
212
- filter: "blur(2px)"
213
- },
214
- animate: {
215
- opacity: 1,
216
- filter: "blur(0)"
217
- },
218
- exit: {
219
- opacity: 0,
220
- filter: "blur(2px)"
221
- },
222
- transition: { duration: .2 }
223
- }, {
224
- default: withCtx(() => [createVNode(unref(VcTooltipInnerContent), null, {
225
- default: withCtx(() => [createVNode(AppGroup_default, {
226
- gap: "sm",
227
- class: "p-xs"
228
- }, {
229
- default: withCtx(() => [N.label === null ? createCommentVNode("", !0) : (openBlock(), createElementBlock("span", _hoisted_1$11, toDisplayString(N.label), 1)), N.keyboardKeys === null ? createCommentVNode("", !0) : (openBlock(), createBlock(unref(VcKeyboardShortcut), {
230
- key: 1,
231
- "keyboard-keys": N.keyboardKeys
232
- }, null, 8, ["keyboard-keys"]))]),
233
- _: 1
234
- })]),
235
- _: 1
236
- }), createVNode(unref(VcTooltipArrow))]),
237
- _: 1
238
- })]),
239
- _: 1
240
- })]),
241
- _: 1
242
- })]),
243
- _: 3
244
- }, 8, ["popover-side", "is-disabled"]));
245
- }
246
- }), TruncateText_default = /* @__PURE__ */ defineComponent({
247
- inheritAttrs: !1,
248
- __name: "TruncateText",
249
- props: {
250
- as: { default: "span" },
251
- label: {}
252
- },
253
- setup(i) {
254
- let N = i, P = useAttrs(), I = useTemplateRef("primitiveRef"), R = ref(!1), B = null;
255
- function V(i) {
256
- R.value = i.scrollWidth > i.clientWidth;
257
- }
258
- return onMounted(() => {
259
- let i = I.value?.$el ?? null;
260
- i !== null && (V(i), B = new ResizeObserver(() => {
261
- V(i);
262
- }), B.observe(i));
263
- }), onBeforeUnmount(() => {
264
- B?.disconnect();
265
- }), (i, B) => (openBlock(), createBlock(ButtonTooltip_default, {
266
- "is-disabled": !R.value,
267
- label: N.label
268
- }, {
269
- default: withCtx(() => [createVNode(unref(Primitive), mergeProps({
270
- ref_key: "primitiveRef",
271
- ref: I,
272
- as: N.as,
273
- class: "max-w-full truncate"
274
- }, unref(P)), {
275
- default: withCtx(() => [createTextVNode(toDisplayString(N.label), 1)]),
276
- _: 1
277
- }, 16, ["as"])]),
278
- _: 1
279
- }, 8, ["is-disabled", "label"]));
280
- }
281
- }), DealContactPersonTransformer = class {
282
- static fromDto(i) {
283
- return {
284
- contactPersonUuid: i.contactPersonUuid,
285
- dealUuid: i.dealUuid,
286
- isPrimary: i.isPrimary,
287
- email: i.email,
288
- firstName: i.firstName,
289
- lastName: i.lastName,
290
- mobilePhone: i.mobilePhone,
291
- phone: i.phone
292
- };
293
- }
294
- }, DealContactPersonUpdateTransformer = class {
295
- static toDto(i) {
296
- return {
297
- email: StringUtil.trimOrNull(i.email),
298
- firstName: i.firstName,
299
- lastName: i.lastName,
300
- mobilePhone: i.mobilePhone,
301
- phone: i.phone
302
- };
303
- }
304
- }, DealCreateTransformer = class {
305
- static toDto(i) {
306
- return {
307
- clientId: {
308
- uuid: i.clientId.uuid,
309
- type: i.clientId.type
310
- },
311
- dealOwnerUuid: null,
312
- name: i.name,
313
- dealLanguage: i.dealLanguage,
314
- dealSource: i.dealSource
315
- };
316
- }
317
- }, NameUtil = class {
318
- static toFullName(i) {
319
- return `${i.firstName} ${i.lastName}`;
320
- }
321
- }, DealDetailTransformer = class {
322
- static fromDto(i) {
323
- return {
324
- uuid: i.uuid,
325
- createdAt: ZonedDateTimeTransformer.fromDto(i.createdAt),
326
- updatedAt: i.updatedAt,
327
- name: i.name,
328
- boardColumn: {
329
- uuid: i.boardColumn.uuid,
330
- color: i.boardColumn.color,
331
- displayName: i.boardColumn.displayName
332
- },
333
- client: i.client,
334
- contactPersons: i.contactPersons.map((i) => ({
335
- uuid: i.uuid,
336
- isPrimary: i.isPrimary,
337
- email: i.email,
338
- firstName: i.firstName,
339
- lastName: i.lastName,
340
- mobilePhone: i.mobilePhone,
341
- phone: i.phone
342
- })),
343
- createdBy: {
344
- uuid: i.createdBy.uuid,
345
- name: NameUtil.toFullName({
346
- firstName: i.createdBy.firstName ?? "",
347
- lastName: i.createdBy.lastName ?? ""
348
- })
349
- },
350
- dealLanguage: i.dealLanguage,
351
- dealSource: i.dealSource,
352
- owner: i.owner ? {
353
- uuid: i.owner.uuid,
354
- name: NameUtil.toFullName({
355
- firstName: i.owner.firstName ?? "",
356
- lastName: i.owner.lastName ?? ""
357
- })
358
- } : null
359
- };
360
- }
361
- }, DealIndexTransformer = class {
362
- static fromDto(i) {
363
- return {
364
- uuid: i.uuid,
365
- createdAt: ZonedDateTimeTransformer.fromDto(i.createdAt),
366
- name: i.name,
367
- boardColumn: i.boardColumn,
368
- client: i.client,
369
- createdBy: {
370
- uuid: i.createdBy.uuid,
371
- name: NameUtil.toFullName({
372
- firstName: i.createdBy.firstName ?? "",
373
- lastName: i.createdBy.lastName ?? ""
374
- })
375
- },
376
- dealLanguage: i.dealLanguage,
377
- dealSource: i.dealSource,
378
- owner: i.owner ? {
379
- uuid: i.owner.uuid,
380
- name: NameUtil.toFullName({
381
- firstName: i.owner.firstName ?? "",
382
- lastName: i.owner.lastName ?? ""
383
- })
384
- } : null
385
- };
386
- }
387
- }, DealIndexQueryParamsTransformer = class {
388
- static toDto(i) {
389
- return {
390
- filter: {
391
- boardColumnUuids: i.filters.boardColumnUuid,
392
- dealOwnerUuids: i.filters.dealOwnerUuids
393
- },
394
- pagination: i.pagination
395
- };
396
- }
397
- }, DealUpdateTransformer = class {
398
- static toDto(i) {
399
- return {
400
- dealOwnerUuid: i.dealOwner?.uuid ?? void 0,
401
- name: i?.name ?? void 0,
402
- dealLanguage: i?.dealLanguage ?? void 0,
403
- dealSource: i?.dealSource ?? void 0
404
- };
405
- }
406
- }, DealService = class {
407
- static async create(i) {
408
- return (await createDealV1({ body: DealCreateTransformer.toDto(i) })).data.uuid;
409
- }
410
- static async createContactPerson() {}
411
- static async getAll(i) {
412
- let N = await viewDealIndexV1({ query: DealIndexQueryParamsTransformer.toDto(i) });
413
- return {
414
- data: N.data.items.map(DealIndexTransformer.fromDto),
415
- meta: N.data.meta
416
- };
417
- }
418
- static async getBySearchTerm(i) {
419
- let N = await viewDealIndexV1({ query: new PaginationParamsBuilder().withLimit(5).withSearch(i).build() });
420
- return {
421
- data: N.data.items.map(DealIndexTransformer.fromDto),
422
- meta: N.data.meta
423
- };
424
- }
425
- static async getByUuid(i) {
426
- let N = await viewDealDetailV1({ path: { dealUuid: i } });
427
- return DealDetailTransformer.fromDto(N.data);
428
- }
429
- static async getContactPerson(i, N) {
430
- let P = await viewDealContactPersonDetailV1({ path: {
431
- contactPersonUuid: N,
432
- dealUuid: i
433
- } });
434
- return DealContactPersonTransformer.fromDto(P.data);
435
- }
436
- static async linkContactPerson(i, N, P) {
437
- await linkContactPersonToDealV1({
438
- body: {
439
- contactPersonUuid: N,
440
- email: StringUtil.trimOrNull(P.email),
441
- mobilePhone: P.mobilePhone,
442
- phone: P.phone
443
- },
444
- path: { dealUuid: i }
445
- });
446
- }
447
- static async setPrimaryContactPerson(i, N) {
448
- await makeDealContactPersonPrimaryV1({ path: {
449
- contactPersonUuid: N,
450
- dealUuid: i
451
- } });
452
- }
453
- static async transition(i, N) {
454
- await transitionDealColumnV1({
455
- body: { boardColumnUuid: N },
456
- path: { dealUuid: i }
457
- });
458
- }
459
- static async unlinkContactPerson(i, N) {
460
- await unlinkContactPersonFromDealV1({
461
- body: { contactPersonUuid: N },
462
- path: { dealUuid: i }
463
- });
464
- }
465
- static async update(i, N) {
466
- await updateDealV1({
467
- body: DealUpdateTransformer.toDto(N),
468
- path: { dealUuid: i }
469
- });
470
- }
471
- static async updateContactPerson(i, N, P) {
472
- await updateDealContactPersonV1({
473
- body: DealContactPersonUpdateTransformer.toDto(P),
474
- path: {
475
- contactPersonUuid: N,
476
- dealUuid: i
477
- }
478
- });
479
- }
480
- };
481
- z.enum(SdkContentLocale);
482
- var ContentLocaleUtil = class {
483
- static i18nKeys = createI18nKeyMap({
484
- "de-DE": "wise_crm.language.de",
485
- "en-US": "wise_crm.language.en",
486
- "fr-BE": "wise_crm.language.fr",
487
- "nl-BE": "wise_crm.language.nl"
488
- });
489
- static getI18nKey(i) {
490
- return this.i18nKeys.get(i);
491
- }
492
- }, DealSourceUtil = class {
493
- static i18nKeys = createI18nKeyMap({
494
- mail: "wise_crm.enum.source.mail",
495
- phone: "wise_crm.enum.source.phone",
496
- tender: "wise_crm.enum.source.tender",
497
- website: "wise_crm.enum.source.website"
498
- });
499
- static getI18nKey(i) {
500
- return this.i18nKeys.get(i);
501
- }
502
- }, MailTemplateDetailTransformer = class {
503
- static fromDto(i) {
504
- return {
505
- uuid: i.uuid,
506
- createdAt: ZonedDateTimeTransformer.fromDto(i.createdAt),
507
- updatedAt: ZonedDateTimeTransformer.fromDto(i.updatedAt),
508
- defaultBCC: i.defaultBCC,
509
- defaultCC: i.defaultCC,
510
- displayName: i.displayName,
511
- key: i.key,
512
- locales: i.locales.map((i) => ({
513
- uuid: i.uuid,
514
- createdAt: ZonedDateTimeTransformer.fromDto(i.createdAt),
515
- updatedAt: ZonedDateTimeTransformer.fromDto(i.updatedAt),
516
- attachments: i.attachments.map(FileReferenceTransformer.fromDto),
517
- language: i.language,
518
- message: i.message,
519
- subject: i.subject
520
- }))
521
- };
522
- }
523
- }, MailTemplateIndexTransformer = class {
524
- static fromDto(i) {
525
- return {
526
- uuid: i.uuid,
527
- createdAt: ZonedDateTimeTransformer.fromDto(i.createdAt),
528
- updatedAt: ZonedDateTimeTransformer.fromDto(i.updatedAt),
529
- name: i.name
530
- };
531
- }
532
- }, MailTemplateIndexQueryParamsTransformer = class {
533
- static toDto(i) {
534
- return { pagination: i.pagination };
535
- }
536
- }, MailTemplateUpdateTransformer = class {
537
- static toDto(i) {
538
- return {
539
- defaultBCC: i.defaultBCC,
540
- defaultCC: i.defaultCC,
541
- locales: i.locales.map((i) => ({
542
- attachments: i.attachments.map((i) => i.uuid),
543
- language: i.language,
544
- message: i.message,
545
- replyTo: i.replyTo,
546
- subject: i.subject
547
- }))
548
- };
549
- }
550
- }, MailTemplateService = class {
551
- static async getAll(i) {
552
- let N = await viewMailTemplateIndexV1({ query: MailTemplateIndexQueryParamsTransformer.toDto(i) });
553
- return {
554
- data: N.data.items.map(MailTemplateIndexTransformer.fromDto),
555
- meta: N.data.meta
556
- };
557
- }
558
- static async getByKey(i) {
559
- let N = await viewMailTemplateDetailByKeyV1({ path: { mailTemplateKey: i } });
560
- return MailTemplateDetailTransformer.fromDto(N.data);
561
- }
562
- static async getByUuid(i) {
563
- let N = await viewMailTemplateDetailV1({ path: { mailTemplateUuid: i } });
564
- return MailTemplateDetailTransformer.fromDto(N.data);
565
- }
566
- static async update(i, N) {
567
- await updateMailTemplateV1({
568
- body: MailTemplateUpdateTransformer.toDto(N),
569
- path: { mailTemplateUuid: i }
570
- });
571
- }
572
- };
573
- function useMailTemplateDetailQuery(i) {
574
- return He({
575
- queryFn: () => MailTemplateService.getByUuid(i.value),
576
- queryKey: { mailTemplateDetail: { mailTemplateUuid: i } }
577
- });
578
- }
579
- function useMailTemplateDetailByKeyQuery(i) {
580
- return He({
581
- queryFn: () => MailTemplateService.getByKey(i.value),
582
- queryKey: { mailTemplateDetailByKey: { mailTemplateKey: i } }
583
- });
584
- }
585
- var _hoisted_1$10 = { class: "p-xl w-96 max-w-full" }, AppRichTextFieldLinkDialog_default = /* @__PURE__ */ defineComponent({
586
- __name: "AppRichTextFieldLinkDialog",
587
- emits: ["close", "confirm"],
588
- setup(i, { emit: R }) {
589
- let V = R, H = useI18n(), U = useForm({
590
- schema: z.object({ url: z.string().url() }),
591
- onSubmit: (i) => {
592
- V("confirm", i.url);
593
- }
594
- }), W = U.register("url");
595
- function J() {
596
- V("close");
597
- }
598
- return (i, R) => (openBlock(), createBlock(unref(VcDialog), { onClose: J }, {
599
- default: withCtx(() => [createElementVNode("div", _hoisted_1$10, [createVNode(AppDialogHeader_default, {
600
- title: unref(H).t("rich_text.link_dialog.title"),
601
- icon: "link"
602
- }, {
603
- "closse-button": withCtx(() => [createVNode(unref(VcDialogCloseButton))]),
604
- _: 1
605
- }, 8, ["title"]), createVNode(AppForm_default, { form: unref(U) }, {
606
- default: withCtx(() => [createVNode(unref(VcTextField), mergeProps({ label: unref(H).t("rich_text.link_dialog.url") }, unref(toFormField)(unref(W))), null, 16, ["label"]), createVNode(AppDialogActions_default, null, {
607
- default: withCtx(() => [createVNode(AppDialogActionCancel_default, { label: unref(H).t("shared.cancel") }, null, 8, ["label"]), createVNode(AppDialogActionPrimary_default, {
608
- label: unref(H).t("shared.confirm"),
609
- onClick: R[0] ||= (i) => unref(U).submit()
610
- }, null, 8, ["label"])]),
611
- _: 1
612
- })]),
613
- _: 1
614
- }, 8, ["form"])])]),
615
- _: 1
616
- }));
617
- }
618
- }), _hoisted_1$9 = ["id"], _hoisted_2$5 = { class: "p-sm h-full" }, AppRichTextField_default = /* @__PURE__ */ defineComponent({
619
- __name: "AppRichTextField",
620
- props: /* @__PURE__ */ mergeModels({
621
- isDisabled: {
622
- type: Boolean,
623
- default: !1
624
- },
625
- isRequired: {
626
- type: Boolean,
627
- default: !1
628
- },
629
- isTouched: {
630
- type: Boolean,
631
- default: !1
632
- },
633
- errorMessage: { default: null },
634
- errors: {},
635
- label: {}
636
- }, {
637
- modelValue: { required: !0 },
638
- modelModifiers: {}
639
- }),
640
- emits: /* @__PURE__ */ mergeModels(["blur"], ["update:modelValue"]),
641
- setup(i, { emit: N }) {
642
- let P = i, I = N, R = useModel(i, "modelValue"), B = useId(), V = useEditor({
643
- content: R.value,
644
- editorProps: { attributes: { class: "bg-primary text-primary p-2xl prose prose-sm w-full max-w-none text-secondary outline-none focus-visible:ring-2 ring-offset-1 ring-fg-brand-secondary rounded-sm min-h-[15rem] h-full" } },
645
- extensions: [StarterKit, Link.configure({ defaultProtocol: "https" })],
646
- onBlur() {
647
- I("blur");
648
- },
649
- onUpdate({ editor: i }) {
650
- R.value = i.getHTML();
651
- }
652
- }), H = useDialog(AppRichTextFieldLinkDialog_default), U = computed(() => [
653
- {
654
- id: "bold",
655
- icon: "bold",
656
- onClick: () => void V.value?.chain().focus().toggleBold().run()
657
- },
658
- {
659
- id: "italic",
660
- icon: "italic",
661
- onClick: () => void V.value?.chain().focus().toggleItalic().run()
662
- },
663
- {
664
- id: "heading",
665
- isActiveOptions: { level: 1 },
666
- icon: "h1Icon",
667
- onClick: () => void V.value?.chain().focus().toggleHeading({ level: 1 }).run()
668
- },
669
- {
670
- id: "heading",
671
- isActiveOptions: { level: 2 },
672
- icon: "h2Icon",
673
- onClick: () => void V.value?.chain().focus().toggleHeading({ level: 2 }).run()
674
- },
675
- {
676
- id: "heading",
677
- isActiveOptions: { level: 3 },
678
- icon: "h3Icon",
679
- onClick: () => void V.value?.chain().focus().toggleHeading({ level: 3 }).run()
680
- },
681
- {
682
- id: "link",
683
- icon: "link",
684
- onClick: () => {
685
- H.open({ onConfirm: (i) => {
686
- V.value?.chain().focus().extendMarkRange("link").setLink({ href: i }).run(), H.close();
687
- } });
688
- }
689
- },
690
- {
691
- id: "bulletList",
692
- icon: "bulletList",
693
- onClick: () => void V.value?.chain().focus().toggleBulletList().run()
694
- },
695
- {
696
- id: "orderedList",
697
- icon: "numberedList",
698
- onClick: () => void V.value?.chain().focus().toggleOrderedList().run()
699
- }
700
- ]);
701
- return watch(R, (i) => {
702
- i !== V.value?.getHTML() && ((i === null || i === "") && V.value?.commands.clearContent(), V.value?.commands.setContent(i || ""));
703
- }), (i, N) => (openBlock(), createBlock(unref(VcFormField), {
704
- for: unref(B),
705
- "is-touched": P.isTouched,
706
- "error-message": P.errorMessage,
707
- hint: null,
708
- label: P.label,
709
- "is-required": P.isRequired,
710
- class: "h-full"
711
- }, {
712
- label: withCtx(() => [renderSlot(i.$slots, "label")]),
713
- default: withCtx(() => [createElementVNode("div", {
714
- id: unref(B),
715
- class: normalizeClass([{
716
- "border-error-subtle": P.errorMessage !== null && P.isTouched,
717
- "border-secondary": !(P.errorMessage !== null && P.isTouched)
718
- }, "bg-primary flex flex-col overflow-hidden rounded-lg border"])
719
- }, [createVNode(unref(ListboxRoot), { orientation: "horizontal" }, {
720
- default: withCtx(() => [createVNode(unref(ListboxContent), { class: "gap-sm p-sm border-secondary flex border-b" }, {
721
- default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(U.value, (i, N) => (openBlock(), createBlock(unref(ListboxItem), {
722
- key: N,
723
- value: N,
724
- class: normalizeClass([{
725
- "bg-tertiary text-primary": unref(V)?.isActive(i.id, i.isActiveOptions),
726
- "text-quaternary": !unref(V)?.isActive(i.id, i.isActiveOptions)
727
- }, "rounded-md"]),
728
- "as-child": !0
729
- }, {
730
- default: withCtx(() => [createVNode(AppUnstyledButton_default, { onClick: () => i.onClick() }, {
731
- default: withCtx(() => [createVNode(unref(VcIcon), {
732
- icon: i.icon,
733
- class: "text-primary size-8"
734
- }, null, 8, ["icon"])]),
735
- _: 2
736
- }, 1032, ["onClick"])]),
737
- _: 2
738
- }, 1032, ["value", "class"]))), 128))]),
739
- _: 1
740
- })]),
741
- _: 1
742
- }), createElementVNode("div", _hoisted_2$5, [createVNode(unref(EditorContent), {
743
- modelValue: R.value,
744
- "onUpdate:modelValue": N[0] ||= (i) => R.value = i,
745
- editor: unref(V),
746
- class: "h-full"
747
- }, null, 8, ["modelValue", "editor"])])], 10, _hoisted_1$9)]),
748
- _: 3
749
- }, 8, [
750
- "for",
751
- "is-touched",
752
- "error-message",
753
- "label",
754
- "is-required"
755
- ]));
756
- }
757
- }), FileUploadService = class {
758
- static async confirmUpload(i, N) {
759
- await confirmFileUploadV2({
760
- body: { blurHash: N },
761
- path: { file: i }
762
- });
763
- }
764
- static async getFileInfo(i, N) {
765
- let P = await createFileV1({ body: {
766
- name: i,
767
- mimeType: N
768
- } });
769
- return {
770
- uuid: P.data.uuid,
771
- uploadUrl: P.data.uploadUrl
772
- };
773
- }
774
- }, _hoisted_1$8 = { class: "text-brand-secondary text-sm font-medium" }, FormFileUploadDropzoneOverlay_default = /* @__PURE__ */ defineComponent({
775
- __name: "FormFileUploadDropzoneOverlay",
776
- props: {
777
- isHoveringOverDropzone: { type: Boolean },
778
- isHoveringOverPage: { type: Boolean }
779
- },
780
- setup(i) {
781
- let N = i, P = useI18n();
782
- return (i, I) => (openBlock(), createBlock(unref(AnimatePresence), null, {
783
- default: withCtx(() => [N.isHoveringOverPage ? (openBlock(), createBlock(unref(Motion), {
784
- key: 0,
785
- class: normalizeClass([{ "animate-pulse": !N.isHoveringOverDropzone }, "border-brand-500/50 pointer-events-none absolute inset-0 z-10 overflow-hidden rounded-xl border-[1.5px] border-dashed"]),
786
- initial: { opacity: 0 },
787
- animate: { opacity: 1 },
788
- exit: { opacity: 0 }
789
- }, {
790
- default: withCtx(() => [createVNode(unref(AnimatePresence), null, {
791
- default: withCtx(() => [N.isHoveringOverDropzone ? (openBlock(), createBlock(unref(Motion), {
792
- key: 0,
793
- initial: {
794
- opacity: 0,
795
- scale: 1.01
796
- },
797
- animate: {
798
- opacity: 1,
799
- scale: 1
800
- },
801
- exit: {
802
- opacity: 0,
803
- scale: 1.01
804
- },
805
- class: "bg-brand-primary/90 absolute inset-0"
806
- }, {
807
- default: withCtx(() => [createVNode(CenterContent_default, null, {
808
- default: withCtx(() => [createElementVNode("p", _hoisted_1$8, toDisplayString(unref(P).t("component.file_upload.dropzone.drop_files")), 1)]),
809
- _: 1
810
- })]),
811
- _: 1
812
- })) : createCommentVNode("", !0)]),
813
- _: 1
814
- })]),
815
- _: 1
816
- }, 8, ["class"])) : createCommentVNode("", !0)]),
817
- _: 1
818
- }));
819
- }
820
- }), _hoisted_1$7 = {
821
- width: "100%",
822
- height: "100%",
823
- viewBox: "0 0 12 12",
824
- fill: "none",
825
- xmlns: "http://www.w3.org/2000/svg",
826
- "aria-hidden": "true"
827
- }, FormFileUploadSuccessCheckmark_default = /* @__PURE__ */ defineComponent({
828
- __name: "FormFileUploadSuccessCheckmark",
829
- setup(i) {
830
- let N = {
831
- hidden: {
832
- opacity: 0,
833
- pathLength: 0
834
- },
835
- visible: {
836
- opacity: 1,
837
- pathLength: 1,
838
- transition: {
839
- opacity: { duration: .01 },
840
- pathLength: {
841
- bounce: 0,
842
- duration: .5,
843
- type: "spring"
844
- }
845
- }
846
- }
847
- };
848
- return (i, P) => (openBlock(), createElementBlock("svg", _hoisted_1$7, [createVNode(unref(motion).path, {
849
- variants: N,
850
- tabindex: "-1",
851
- initial: "hidden",
852
- d: "M2 6L4.5 8.5L10 3",
853
- stroke: "currentColor",
854
- "stroke-width": "1.5",
855
- "stroke-linecap": "round",
856
- "stroke-linejoin": "round",
857
- animate: "visible",
858
- exit: "hidden"
859
- })]));
860
- }
861
- }), FormFileUploadItemRight_default = /* @__PURE__ */ defineComponent({
862
- __name: "FormFileUploadItemRight",
863
- props: {
864
- isMultiple: { type: Boolean },
865
- item: {}
866
- },
867
- setup(i) {
868
- let N = i, P = ref(!1);
869
- function I(i) {
870
- i.url !== null && FileUtil.download(i.url, i.name);
871
- }
872
- return watch(() => N.item.status, (i) => {
873
- i === FileUploadStatus.SUCCESS && (P.value = !0, setTimeout(() => {
874
- P.value = !1;
875
- }, 2e3));
876
- }), (i, R) => (openBlock(), createBlock(unref(AnimatePresence), { mode: "popLayout" }, {
877
- default: withCtx(() => [P.value ? (openBlock(), createBlock(unref(Motion), {
878
- key: 0,
879
- variants: {
880
- hidden: {
881
- opacity: 0,
882
- scale: .95
883
- },
884
- visible: {
885
- opacity: 1,
886
- scale: 1
887
- }
888
- },
889
- initial: "hidden",
890
- animate: "visible",
891
- exit: "hidden",
892
- class: "flex size-8 items-center justify-center"
893
- }, {
894
- default: withCtx(() => [createVNode(FormFileUploadSuccessCheckmark_default, { class: "text-disabled size-4" })]),
895
- _: 1
896
- })) : N.item.status === unref(FileUploadStatus).SUCCESS ? (openBlock(), createBlock(unref(Motion), {
897
- key: 1,
898
- initial: {
899
- opacity: 0,
900
- scale: .95
901
- },
902
- animate: {
903
- opacity: 1,
904
- scale: 1
905
- }
906
- }, {
907
- default: withCtx(() => [createVNode(RevealOnHoverOrFocus_default, null, {
908
- default: withCtx(() => [createVNode(AppGroup_default, { gap: "none" }, {
909
- default: withCtx(() => [
910
- createVNode(ButtonTooltip_default, { label: "Replace" }, {
911
- default: withCtx(() => [createVNode(unref(VcFileUploadItemReplace), null, {
912
- default: withCtx(() => [createVNode(unref(VcIconButton), {
913
- "class-config": { root: "hover:!bg-tertiary" },
914
- icon: "refresh",
915
- label: "Replace",
916
- variant: "tertiary"
917
- })]),
918
- _: 1
919
- })]),
920
- _: 1
921
- }),
922
- createVNode(ButtonTooltip_default, { label: "Download" }, {
923
- default: withCtx(() => [N.item.url === null ? createCommentVNode("", !0) : (openBlock(), createBlock(unref(VcIconButton), {
924
- key: 0,
925
- "class-config": { root: "hover:!bg-tertiary" },
926
- icon: "downloadCloud",
927
- label: "Download",
928
- variant: "tertiary",
929
- onClick: R[0] ||= (i) => I(N.item)
930
- }))]),
931
- _: 1
932
- }),
933
- createVNode(ButtonTooltip_default, { label: "Remove" }, {
934
- default: withCtx(() => [createVNode(unref(VcFileUploadItemRemove), null, {
935
- default: withCtx(() => [createVNode(unref(VcIconButton), {
936
- icon: "trash",
937
- label: "Remove",
938
- variant: "destructive-tertiary"
939
- })]),
940
- _: 1
941
- })]),
942
- _: 1
943
- })
944
- ]),
945
- _: 1
946
- })]),
947
- _: 1
948
- })]),
949
- _: 1
950
- })) : N.item.status === unref(FileUploadStatus).PENDING || N.item.status === unref(FileUploadStatus).UPLOADING ? (openBlock(), createBlock(unref(Motion), {
951
- key: 2,
952
- initial: { opacity: 0 },
953
- animate: { opacity: 1 },
954
- exit: {
955
- opacity: 0,
956
- scale: .95
957
- },
958
- class: "flex size-8 items-center justify-center"
959
- }, {
960
- default: withCtx(() => [createVNode(unref(VcSpinner), { class: "text-tertiary size-4" })]),
961
- _: 1
962
- })) : createCommentVNode("", !0)]),
963
- _: 1
964
- }));
965
- }
966
- }), q = /* @__PURE__ */ "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz#$%*+,-.:;=?@[]^_{|}~".split(""), x = (i) => {
967
- let N = 0;
968
- for (let P = 0; P < i.length; P++) {
969
- let I = i[P], R = q.indexOf(I);
970
- N = N * 83 + R;
971
- }
972
- return N;
973
- }, f = (i) => {
974
- let N = i / 255;
975
- return N <= .04045 ? N / 12.92 : ((N + .055) / 1.055) ** 2.4;
976
- }, h$1 = (i) => {
977
- let N = Math.max(0, Math.min(1, i));
978
- return N <= .0031308 ? Math.trunc(N * 12.92 * 255 + .5) : Math.trunc((1.055 * N ** .4166666666666667 - .055) * 255 + .5);
979
- }, F = (i) => i < 0 ? -1 : 1, M = (i, N) => F(i) * Math.abs(i) ** +N, d = class extends Error {
980
- constructor(i) {
981
- super(i), this.name = "ValidationError", this.message = i;
982
- }
983
- }, C = (i) => {
984
- if (!i || i.length < 6) throw new d("The blurhash string must be at least 6 characters");
985
- let N = x(i[0]), P = Math.floor(N / 9) + 1, I = N % 9 + 1;
986
- if (i.length !== 4 + 2 * I * P) throw new d(`blurhash length mismatch: length is ${i.length} but it should be ${4 + 2 * I * P}`);
987
- }, z$2 = (i) => {
988
- let N = i >> 16, P = i >> 8 & 255, I = i & 255;
989
- return [
990
- f(N),
991
- f(P),
992
- f(I)
993
- ];
994
- }, L = (i, N) => {
995
- let P = Math.floor(i / 361), I = Math.floor(i / 19) % 19, R = i % 19;
996
- return [
997
- M((P - 9) / 9, 2) * N,
998
- M((I - 9) / 9, 2) * N,
999
- M((R - 9) / 9, 2) * N
1000
- ];
1001
- }, j = (i, N, P, I) => {
1002
- C(i), I |= 1;
1003
- let R = x(i[0]), B = Math.floor(R / 9) + 1, V = R % 9 + 1, H = (x(i[1]) + 1) / 166, U = Array(V * B);
1004
- for (let N = 0; N < U.length; N++) N === 0 ? U[N] = z$2(x(i.substring(2, 6))) : U[N] = L(x(i.substring(4 + N * 2, 6 + N * 2)), H * I);
1005
- let W = N * 4, G = new Uint8ClampedArray(W * P);
1006
- for (let i = 0; i < P; i++) for (let I = 0; I < N; I++) {
1007
- let R = 0, H = 0, K = 0;
1008
- for (let W = 0; W < B; W++) for (let B = 0; B < V; B++) {
1009
- let G = Math.cos(Math.PI * I * B / N) * Math.cos(Math.PI * i * W / P), J = U[B + W * V];
1010
- R += J[0] * G, H += J[1] * G, K += J[2] * G;
1011
- }
1012
- let J = h$1(R), Y = h$1(H), X = h$1(K);
1013
- G[4 * I + 0 + i * W] = J, G[4 * I + 1 + i * W] = Y, G[4 * I + 2 + i * W] = X, G[4 * I + 3 + i * W] = 255;
1014
- }
1015
- return G;
1016
- }, ImageBlurhash_default = /* @__PURE__ */ defineComponent({
1017
- __name: "ImageBlurhash",
1018
- props: { blurhash: {} },
1019
- setup(i) {
1020
- let N = i, P = ref(null);
1021
- function I(i, N) {
1022
- let { height: P, width: I } = N, R = j(i, I, P), B = N.getContext("2d"), V = B.createImageData(I, P);
1023
- V.data.set(R), B.putImageData(V, 0, 0);
1024
- }
1025
- function R() {
1026
- P.value !== null && I(N.blurhash, P.value);
1027
- }
1028
- return onMounted(() => {
1029
- R();
1030
- }), (i, N) => (openBlock(), createElementBlock("canvas", {
1031
- ref_key: "canvasRef",
1032
- ref: P,
1033
- width: "100%",
1034
- height: "100%"
1035
- }, null, 512));
1036
- }
1037
- }), _hoisted_1$6 = { class: "sr-only" }, _hoisted_2$4 = { class: "p-lg absolute top-0 left-0 z-1 flex w-full justify-end" }, _hoisted_3$4 = ["src", "alt"], ImageDialog_default = /* @__PURE__ */ defineComponent({
1038
- __name: "ImageDialog",
1039
- props: {
1040
- imageId: {},
1041
- fit: {},
1042
- imageAlt: {},
1043
- imageUrl: {}
1044
- },
1045
- setup(i) {
1046
- let N = i;
1047
- return (i, P) => (openBlock(), createBlock(unref(VcDialog), {
1048
- "is-close-button-hidden": !0,
1049
- size: "xl"
1050
- }, {
1051
- default: withCtx(() => [
1052
- createVNode(unref(VcDialogTitle), null, {
1053
- default: withCtx(() => [...P[0] ||= [createElementVNode("h1", { class: "sr-only" }, " Image ", -1)]]),
1054
- _: 1
1055
- }),
1056
- createVNode(unref(VcDialogDescription), null, {
1057
- default: withCtx(() => [createElementVNode("p", _hoisted_1$6, toDisplayString(N.imageAlt), 1)]),
1058
- _: 1
1059
- }),
1060
- createElementVNode("div", _hoisted_2$4, [createVNode(unref(VcDialogCloseButton), null, {
1061
- default: withCtx(() => [createVNode(unref(VcIconButton), {
1062
- "class-config": { root: "bg-primary/50 backdrop-blur-md text-primary border-none shadow-none" },
1063
- icon: "close",
1064
- label: "close",
1065
- variant: "primary"
1066
- })]),
1067
- _: 1
1068
- })]),
1069
- createElementVNode("img", {
1070
- src: N.imageUrl,
1071
- alt: N.imageAlt,
1072
- exit: { opacity: 1 },
1073
- class: "size-full object-contain"
1074
- }, null, 8, _hoisted_3$4)
1075
- ]),
1076
- _: 1
1077
- }));
1078
- }
1079
- }), _hoisted_1$5 = { class: "relative isolate overflow-hidden" }, _hoisted_2$3 = ["disabled"], _hoisted_3$3 = { class: "sr-only" }, _hoisted_4$2 = ["src", "alt"], Image_default = /* @__PURE__ */ defineComponent({
1080
- __name: "Image",
1081
- props: {
1082
- isZoomEnabled: {
1083
- type: Boolean,
1084
- default: !1
1085
- },
1086
- alt: {},
1087
- blurhash: { default: null },
1088
- fit: {},
1089
- src: {}
1090
- },
1091
- setup(i) {
1092
- let N = i, P = useId(), I = useDialog(ImageDialog_default), R = ref(!0);
1093
- function B() {
1094
- R.value = !1;
1095
- }
1096
- function V() {
1097
- I.open({
1098
- imageId: P,
1099
- fit: N.fit,
1100
- imageAlt: N.alt,
1101
- imageUrl: N.src
1102
- });
1103
- }
1104
- return (i, P) => (openBlock(), createElementBlock("div", _hoisted_1$5, [createVNode(unref(AnimatePresence), { initial: !1 }, {
1105
- default: withCtx(() => [R.value ? (openBlock(), createBlock(unref(Motion), {
1106
- key: 0,
1107
- exit: { opacity: 0 },
1108
- transition: { duration: .2 },
1109
- class: "absolute inset-0 z-1"
1110
- }, {
1111
- default: withCtx(() => [N.blurhash === null ? createCommentVNode("", !0) : (openBlock(), createBlock(ImageBlurhash_default, {
1112
- key: 0,
1113
- blurhash: N.blurhash
1114
- }, null, 8, ["blurhash"]))]),
1115
- _: 1
1116
- })) : createCommentVNode("", !0), createElementVNode("button", mergeProps(unref(I).triggerProps.value, {
1117
- class: [{ "pointer-events-none": !N.isZoomEnabled }, "block size-full cursor-pointer outline-none"],
1118
- disabled: !N.isZoomEnabled,
1119
- variant: "unstyled",
1120
- type: "button",
1121
- onClick: V
1122
- }), [createElementVNode("span", _hoisted_3$3, " Zoom image " + toDisplayString(N.alt), 1), createElementVNode("img", {
1123
- src: N.src,
1124
- alt: N.alt,
1125
- class: normalizeClass([{
1126
- "object-cover": N.fit === "cover",
1127
- "object-contain": N.fit === "contain"
1128
- }, "size-full"]),
1129
- onLoad: B
1130
- }, null, 42, _hoisted_4$2)], 16, _hoisted_2$3)]),
1131
- _: 1
1132
- })]));
1133
- }
1134
- }), _hoisted_1$4 = { class: "group bg-secondary px-lg py-md max-w-full overflow-hidden rounded-xl" }, _hoisted_2$2 = {
1135
- key: 1,
1136
- "aria-hidden": !0,
1137
- class: "flex size-8 items-center justify-center"
1138
- }, _hoisted_3$2 = { class: "relative" }, _hoisted_4$1 = { class: "text-primary-on-brand absolute bottom-0.5 left-1/2 z-89 -translate-x-1/2 text-[0.625rem] font-medium" }, _hoisted_5$1 = { class: "flex items-center justify-between overflow-hidden" }, _hoisted_6 = { class: "flex flex-col overflow-hidden" }, _hoisted_7 = { class: "text-tertiary text-xs" }, _hoisted_8 = { class: "bg-quaternary h-0.75 w-28 shrink-0 rounded-full" }, FormFileUploadItem_default = /* @__PURE__ */ defineComponent({
1139
- __name: "FormFileUploadItem",
1140
- props: {
1141
- isMultiple: { type: Boolean },
1142
- item: {}
1143
- },
1144
- setup(i) {
1145
- let N = i;
1146
- return (i, P) => (openBlock(), createBlock(unref(VcFileUploadItem), { item: N.item }, {
1147
- default: withCtx(() => [createElementVNode("li", _hoisted_1$4, [createVNode(AppGroup_default, { justify: "between" }, {
1148
- default: withCtx(() => [createVNode(AppGroup_default, {
1149
- gap: "lg",
1150
- class: "overflow-hidden"
1151
- }, {
1152
- default: withCtx(() => [N.item.url !== null && N.item.mimeType.startsWith("image/") ? (openBlock(), createBlock(Image_default, {
1153
- key: 0,
1154
- "is-zoom-enabled": !0,
1155
- alt: N.item.name,
1156
- src: N.item.url,
1157
- blurhash: N.item.status === unref(FileUploadStatus).SUCCESS ? N.item.blurHash : null,
1158
- class: "size-8 shrink-0 rounded-md",
1159
- fit: "cover"
1160
- }, null, 8, [
1161
- "alt",
1162
- "src",
1163
- "blurhash"
1164
- ])) : (openBlock(), createElementBlock("div", _hoisted_2$2, [createElementVNode("div", _hoisted_3$2, [createVNode(unref(VcIcon), {
1165
- icon: "file",
1166
- class: "text-brand-500 size-8"
1167
- }), createElementVNode("div", _hoisted_4$1, toDisplayString(unref(FileUtil).mimeTypeToExtension(N.item.mimeType)), 1)])])), createElementVNode("div", _hoisted_5$1, [createElementVNode("div", _hoisted_6, [createVNode(TruncateText_default, {
1168
- label: N.item.name,
1169
- class: "text-primary truncate text-sm"
1170
- }, null, 8, ["label"]), createVNode(AppGroup_default, null, {
1171
- default: withCtx(() => [createElementVNode("span", _hoisted_7, toDisplayString(N.item.mimeType), 1), createVNode(unref(AnimatePresence), { initial: !1 }, {
1172
- default: withCtx(() => [N.item.status === unref(FileUploadStatus).UPLOADING || N.item.status === unref(FileUploadStatus).PENDING ? (openBlock(), createBlock(unref(Motion), {
1173
- key: 0,
1174
- exit: { opacity: 0 },
1175
- "as-child": !0
1176
- }, {
1177
- default: withCtx(() => [createElementVNode("div", _hoisted_8, [createVNode(unref(Motion), {
1178
- animate: { width: N.item.status === unref(FileUploadStatus).UPLOADING ? `${N.item.progress}%` : "0%" },
1179
- initial: { width: "0%" },
1180
- class: "bg-brand-solid h-full rounded-full"
1181
- }, null, 8, ["animate"])])]),
1182
- _: 1
1183
- })) : createCommentVNode("", !0)]),
1184
- _: 1
1185
- })]),
1186
- _: 1
1187
- })])])]),
1188
- _: 1
1189
- }), createVNode(FormFileUploadItemRight_default, {
1190
- "is-multiple": N.isMultiple,
1191
- item: N.item
1192
- }, null, 8, ["is-multiple", "item"])]),
1193
- _: 1
1194
- })])]),
1195
- _: 1
1196
- }, 8, ["item"]));
1197
- }
1198
- });
1199
- const fileReferenceFormSchema = z.object({
1200
- uuid: z.string(),
1201
- name: z.string(),
1202
- blurHash: z.string().nullable(),
1203
- mimeType: z.string(),
1204
- order: z.number(),
1205
- url: z.string().nullable()
1206
- });
1207
- function useDealDetailQuery(i) {
1208
- return He({
1209
- queryFn: () => DealService.getByUuid(i.value),
1210
- queryKey: { dealDetail: { dealUuid: i } }
1211
- });
1212
- }
1213
- function useMailCreateMutation() {
1214
- return ze({
1215
- queryFn: async ({ body: i, params: N }) => {
1216
- await MailService.create(i, N.externalAttachments);
1217
- },
1218
- queryKeysToInvalidate: {
1219
- dealDetail: { dealUuid: (i) => i.dealUuid },
1220
- mailIndex: {}
1221
- }
1222
- });
1223
- }
1224
- var _hoisted_1$3 = { class: "w-full overflow-hidden" }, _hoisted_2$1 = { class: "gap-md flex flex-col justify-start" }, _hoisted_3$1 = { class: "relative" }, _hoisted_4 = { class: "overflow-hidden" }, _hoisted_5 = { class: "gap-sm py-md flex overflow-x-auto" }, DealSendMailFormAttachmentField_default = /* @__PURE__ */ defineComponent({
1225
- __name: "DealSendMailFormAttachmentField",
1226
- props: /* @__PURE__ */ mergeModels({
1227
- id: { default: null },
1228
- isRequired: {
1229
- type: Boolean,
1230
- default: !1
1231
- },
1232
- isTouched: {
1233
- type: Boolean,
1234
- default: !1
1235
- },
1236
- accept: {},
1237
- errorMessage: { default: null },
1238
- externalAttachments: { default: () => [] },
1239
- hint: { default: null },
1240
- label: { default: null }
1241
- }, {
1242
- modelValue: { required: !0 },
1243
- modelModifiers: {}
1244
- }),
1245
- emits: ["update:modelValue"],
1246
- setup(i) {
1247
- let N = i, P = useModel(i, "modelValue"), I = useToast(), R = useI18n(), B = useId(), V = computed(() => Array.isArray(P.value));
1248
- function H(i) {
1249
- I.error({
1250
- title: V.value ? R.t("component.file_upload.error.multiple_files_rejected") : R.t("component.file_upload.error.single_file_rejected"),
1251
- description: i.map((i) => i.name).join(", ")
1252
- });
1253
- }
1254
- return (i, I) => (openBlock(), createElementBlock("div", _hoisted_1$3, [createVNode(unref(VcFileUploadRoot), {
1255
- modelValue: P.value,
1256
- "onUpdate:modelValue": I[0] ||= (i) => P.value = i,
1257
- accept: N.accept,
1258
- "get-file-info": unref(FileUploadService).getFileInfo,
1259
- "confirm-upload": unref(FileUploadService).confirmUpload,
1260
- onFilesRejected: H
1261
- }, {
1262
- default: withCtx(({ items: i }) => [createVNode(unref(MotionConfig), { transition: {
1263
- duration: .3,
1264
- type: "spring",
1265
- bounce: 0
1266
- } }, {
1267
- default: withCtx(() => [createElementVNode("div", _hoisted_2$1, [createVNode(unref(VcFileUploadTrigger), null, {
1268
- default: withCtx(() => [createVNode(unref(VcButton), {
1269
- class: "w-fit",
1270
- "icon-left": "attachment",
1271
- variant: "secondary"
1272
- }, {
1273
- default: withCtx(() => [createTextVNode(toDisplayString(unref(R).t("wise_crm.deal.send_mail.attachment_field.add_attachment")), 1)]),
1274
- _: 1
1275
- })]),
1276
- _: 1
1277
- }), i.length > 0 || N.externalAttachments.length > 0 ? (openBlock(), createBlock(unref(VcFileUploadDropzone), { key: 0 }, {
1278
- default: withCtx(({ isHoveringOverPage: P, isHoveringOverDropzone: I }) => [createVNode(unref(VcFormField), {
1279
- for: unref(B),
1280
- hint: N.hint,
1281
- "error-message": N.errorMessage,
1282
- "is-required": N.isRequired,
1283
- "is-touched": N.isTouched,
1284
- label: unref(R).t("wise_crm.deal.send_mail.attachment_field.mail_attachments_label")
1285
- }, {
1286
- label: withCtx(() => [createVNode(unref(VcFormFieldLabel), { class: "sr-only" })]),
1287
- default: withCtx(() => [createElementVNode("div", _hoisted_3$1, [createVNode(FormFileUploadDropzoneOverlay_default, {
1288
- "is-hovering-over-page": P,
1289
- "is-hovering-over-dropzone": I
1290
- }, null, 8, ["is-hovering-over-page", "is-hovering-over-dropzone"]), createVNode(AnimateHeight_default, null, {
1291
- default: withCtx(() => [createVNode(unref(AnimatePresence), {
1292
- initial: !1,
1293
- mode: "popLayout"
1294
- }, {
1295
- default: withCtx(() => [createElementVNode("div", _hoisted_4, [createElementVNode("ul", _hoisted_5, [(openBlock(!0), createElementBlock(Fragment, null, renderList(N.externalAttachments, (i) => (openBlock(), createBlock(DealExternalAttachment_default, {
1296
- key: i.uuid,
1297
- attachment: i
1298
- }, null, 8, ["attachment"]))), 128)), (openBlock(!0), createElementBlock(Fragment, null, renderList(i, (i) => (openBlock(), createElementBlock("div", {
1299
- key: i.key,
1300
- class: "w-90"
1301
- }, [createVNode(FormFileUploadItem_default, {
1302
- item: i,
1303
- "is-multiple": V.value
1304
- }, null, 8, ["item", "is-multiple"])]))), 128))])])]),
1305
- _: 2
1306
- }, 1024)]),
1307
- _: 2
1308
- }, 1024)])]),
1309
- _: 2
1310
- }, 1032, [
1311
- "for",
1312
- "hint",
1313
- "error-message",
1314
- "is-required",
1315
- "is-touched",
1316
- "label"
1317
- ])]),
1318
- _: 2
1319
- }, 1024)) : createCommentVNode("", !0)])]),
1320
- _: 2
1321
- }, 1024)]),
1322
- _: 1
1323
- }, 8, [
1324
- "modelValue",
1325
- "accept",
1326
- "get-file-info",
1327
- "confirm-upload"
1328
- ])]));
1329
- }
1330
- }), _hoisted_1$2 = { class: "gap-md text-tertiary flex items-center" }, _hoisted_2 = {
1331
- key: 0,
1332
- class: "gap-xs flex items-center"
1333
- }, _hoisted_3 = { class: "text-xs" }, DealSendMailFormFooter_default = /* @__PURE__ */ defineComponent({
1334
- __name: "DealSendMailFormFooter",
1335
- props: {
1336
- isGeneratingPdf: {
1337
- type: Boolean,
1338
- default: !1
1339
- },
1340
- isSubmitting: {
1341
- type: Boolean,
1342
- default: !1
1343
- }
1344
- },
1345
- emits: ["cancel"],
1346
- setup(N, { emit: P }) {
1347
- let I = N, R = P, B = useI18n();
1348
- function V() {
1349
- R("cancel");
1350
- }
1351
- return (P, R) => (openBlock(), createBlock(AppDialogContainer_default, { class: "pt-lg gap-md border-secondary flex justify-between border-t" }, {
1352
- default: withCtx(() => [createVNode(unref(VcButton), {
1353
- variant: "secondary",
1354
- size: "lg",
1355
- onClick: V
1356
- }, {
1357
- default: withCtx(() => [createTextVNode(toDisplayString(unref(B).t("wise_crm.form.cancel")), 1)]),
1358
- _: 1
1359
- }), createElementVNode("div", _hoisted_1$2, [N.isGeneratingPdf ? (openBlock(), createElementBlock("div", _hoisted_2, [createVNode(unref(VcSpinner), { class: "size-3" }), createElementVNode("span", _hoisted_3, toDisplayString(unref(B).t("wise_crm.deal.send_mail.pdf_generating")), 1)])) : createCommentVNode("", !0), createVNode(unref(VcButton), {
1360
- "is-loading": I.isSubmitting,
1361
- "is-disabled": N.isGeneratingPdf,
1362
- size: "lg",
1363
- type: "submit"
1364
- }, {
1365
- default: withCtx(() => [createTextVNode(toDisplayString(unref(B).t("wise_crm.form.send")), 1)]),
1366
- _: 1
1367
- }, 8, ["is-loading", "is-disabled"])])]),
1368
- _: 1
1369
- }));
1370
- }
1371
- });
1372
- const mailTemplateUuidSchema = z$1.uuid().brand("MailTemplateUuid"), mailCreateFormSchema = z$1.object({
1373
- clientId: z$1.object({
1374
- uuid: z$1.uuid(),
1375
- type: z$1.enum(ClientType)
1376
- }),
1377
- dealUuid: z$1.uuid(),
1378
- mailTemplateUuid: mailTemplateUuidSchema,
1379
- attachments: fileReferenceFormSchema.array(),
1380
- bcc: z$1.array(z$1.email()).nullable(),
1381
- cc: z$1.array(z$1.email()).nullable(),
1382
- from: z$1.email().nullable(),
1383
- replyTo: z$1.email().nullable(),
1384
- subject: z$1.string().min(1),
1385
- text: z$1.string().min(1),
1386
- to: z$1.array(z$1.email()).min(1)
1387
- });
1388
- var _hoisted_1$1 = { class: "flex-1 overflow-y-auto" }, DealSendMailForm_default = /* @__PURE__ */ defineComponent({
1389
- __name: "DealSendMailForm",
1390
- props: {
1391
- dealUuid: {},
1392
- isGeneratingPdf: { type: Boolean },
1393
- client: {},
1394
- dealLanguage: {},
1395
- defaultSenderEmails: {},
1396
- externalAttachments: { default: () => [] },
1397
- template: {}
1398
- },
1399
- emits: ["close"],
1400
- setup(i, { emit: P }) {
1401
- let I = i, R = P, H = useI18n(), U = useApiErrorToast(), W = useMailCreateMutation(), G = computed(() => I.template.locales.findIndex((i) => i.language === I.dealLanguage)), K = useForm({
1402
- initialState: {
1403
- clientId: {
1404
- uuid: I.client.uuid,
1405
- type: I.client.type
1406
- },
1407
- dealUuid: I.dealUuid,
1408
- mailTemplateUuid: I.template.uuid,
1409
- attachments: [...I.template.locales[G.value]?.attachments.map(FileReferenceTransformer.toForm) ?? []],
1410
- bcc: I.template.defaultBCC,
1411
- cc: I.template.defaultCC,
1412
- from: null,
1413
- replyTo: null,
1414
- subject: I.template.locales[G.value]?.subject ?? null,
1415
- text: I.template.locales[G.value]?.message ?? null,
1416
- to: I.defaultSenderEmails ?? []
1417
- },
1418
- schema: mailCreateFormSchema,
1419
- onSubmit: async (i) => {
1420
- try {
1421
- await W.execute({
1422
- body: i,
1423
- params: {
1424
- dealUuid: I.dealUuid,
1425
- externalAttachments: I.externalAttachments
1426
- }
1427
- }), $();
1428
- } catch (i) {
1429
- U.show(i);
1430
- }
1431
- }
1432
- });
1433
- K.register("bcc"), K.register("cc"), K.register("replyTo"), K.register("from"), K.register("dealUuid", I.dealUuid), K.register("clientId", I.client);
1434
- let Y = K.register("subject"), X = K.register("to"), Z = K.register("attachments", []), Q = K.register("text");
1435
- function $() {
1436
- R("close");
1437
- }
1438
- return (i, P) => (openBlock(), createBlock(AppForm_default, {
1439
- form: unref(K),
1440
- class: "flex h-full flex-col"
1441
- }, {
1442
- default: withCtx(() => [createElementVNode("div", _hoisted_1$1, [
1443
- createVNode(DealCommunicationMailListSectionContainer_default, { class: "pr-6xl" }, {
1444
- default: withCtx(() => [createVNode(unref(VcTextField), mergeProps(unref(toFormField)(unref(Y)), {
1445
- "class-config": {
1446
- input: "text-xl",
1447
- root: "border-none shadow-none text-md"
1448
- },
1449
- placeholder: unref(H).t("wise_crm.deal.send_mail_form.subject_placeholder")
1450
- }), null, 16, ["placeholder"])]),
1451
- _: 1
1452
- }),
1453
- createVNode(DealCommunicationMailListSectionContainer_default, null, {
1454
- default: withCtx(() => [createVNode(AppGroup_default, null, {
1455
- default: withCtx(() => [createVNode(AppTagsInputField_default, mergeProps(unref(toFormField)(unref(X)), {
1456
- label: unref(H).t("wise_crm.deal.send_mail_form.to_label"),
1457
- placeholder: unref(H).t("wise_crm.deal.send_mail_form.email_placeholder")
1458
- }), {
1459
- label: withCtx(() => [createVNode(unref(VcFormFieldLabel), { class: "sr-only" })]),
1460
- _: 1
1461
- }, 16, ["label", "placeholder"])]),
1462
- _: 1
1463
- })]),
1464
- _: 1
1465
- }),
1466
- createVNode(DealCommunicationMailListSectionContainer_default, null, {
1467
- default: withCtx(() => [createVNode(DealSendMailFormAttachmentField_default, mergeProps({ "external-attachments": I.externalAttachments }, unref(toFormField)(unref(Z)), { accept: ["application/pdf", "image/*"] }), null, 16, ["external-attachments"])]),
1468
- _: 1
1469
- }),
1470
- createVNode(DealCommunicationMailListSectionContainer_default, { class: "flex-1 border-b-0" }, {
1471
- default: withCtx(() => [createVNode(AppRichTextField_default, mergeProps(unref(toFormField)(unref(Q)), { label: unref(H).t("wise_crm.deal.send_mail_form.message_label") }), {
1472
- label: withCtx(() => [createVNode(unref(VcFormFieldLabel), { class: "sr-only" })]),
1473
- _: 1
1474
- }, 16, ["label"])]),
1475
- _: 1
1476
- })
1477
- ]), createVNode(DealSendMailFormFooter_default, {
1478
- "is-generating-pdf": I.isGeneratingPdf,
1479
- "is-submitting": unref(K).isSubmitting.value,
1480
- onCancel: $
1481
- }, null, 8, ["is-generating-pdf", "is-submitting"])]),
1482
- _: 1
1483
- }, 8, ["form"]));
1484
- }
1485
- }), _hoisted_1 = {
1486
- key: 0,
1487
- class: "p-xl"
1488
- }, DealSendMailDialog_default = /* @__PURE__ */ defineComponent({
1489
- __name: "DealSendMailDialog",
1490
- props: {
1491
- dealUuid: {},
1492
- client: {},
1493
- defaultSenderEmails: {},
1494
- externalAttachments: { default: () => [] },
1495
- generatePdfFile: {},
1496
- templateKey: {}
1497
- },
1498
- emits: ["close"],
1499
- setup(i, { emit: N }) {
1500
- let P = i, I = N, R = useApiErrorToast(), B = ref(P.generatePdfFile !== void 0), H = ref(null), U = computed(() => H.value === null ? P.externalAttachments : [...P.externalAttachments, H.value]), W = useDealDetailQuery(computed(() => P.dealUuid)), G = computed(() => W.data.value?.dealLanguage ?? SdkContentLocale.NL_BE), K = useMailTemplateDetailByKeyQuery(computed(() => P.templateKey));
1501
- function Y() {
1502
- I("close");
1503
- }
1504
- async function X() {
1505
- if (P.generatePdfFile !== void 0) try {
1506
- H.value = await P.generatePdfFile;
1507
- } catch (i) {
1508
- R.show(i);
1509
- } finally {
1510
- B.value = !1;
1511
- }
1512
- }
1513
- return onMounted(async () => {
1514
- await X();
1515
- }), (i, N) => (openBlock(), createBlock(unref(VcDialog), {
1516
- "class-config": { closeButton: { root: "bg-primary" } },
1517
- class: "h-200 max-h-[90vh] w-280 max-w-[90vw]",
1518
- onClose: Y
1519
- }, {
1520
- default: withCtx(() => [createVNode(unref(VcDialogContent), { class: "h-full w-full border" }, {
1521
- default: withCtx(() => [unref(K).isLoading.value ? (openBlock(), createElementBlock("div", _hoisted_1, [createVNode(AppGroup_default, {
1522
- direction: "col",
1523
- class: "h-full"
1524
- }, {
1525
- default: withCtx(() => [createVNode(AppSkeletonLoader_default, { class: "h-40 w-full" }), createVNode(AppSkeletonLoader_default, { class: "mt-xl w-full flex-1" })]),
1526
- _: 1
1527
- })])) : unref(K).data.value !== null && unref(W).data.value !== null ? (openBlock(), createBlock(DealSendMailForm_default, {
1528
- key: 1,
1529
- "default-sender-emails": unref(W).data.value.contactPersons.map((i) => i.email).filter((i) => i !== null),
1530
- "deal-language": G.value,
1531
- template: unref(K).data.value,
1532
- client: P.client,
1533
- "deal-uuid": P.dealUuid,
1534
- "external-attachments": U.value,
1535
- "is-generating-pdf": B.value,
1536
- onClose: Y
1537
- }, null, 8, [
1538
- "default-sender-emails",
1539
- "deal-language",
1540
- "template",
1541
- "client",
1542
- "deal-uuid",
1543
- "external-attachments",
1544
- "is-generating-pdf"
1545
- ])) : createCommentVNode("", !0)]),
1546
- _: 1
1547
- })]),
1548
- _: 1
1549
- }));
1550
- }
1551
- });
1552
- export { AnimateHeight_default as _, FormFileUploadDropzoneOverlay_default as a, useMailTemplateDetailQuery as c, ContentLocaleUtil as d, DealService as f, BoardService as g, useUserIndexQuery as h, FormFileUploadItem_default as i, MailTemplateService as l, ButtonTooltip_default as m, useDealDetailQuery as n, FileUploadService as o, TruncateText_default as p, fileReferenceFormSchema as r, AppRichTextField_default as s, DealSendMailDialog_default as t, DealSourceUtil as u, CenterContent_default as v, AppTagsInputField_default as y };