@cling-se/widget 0.14.4 → 0.14.6

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 (129) hide show
  1. package/dist/AddClientCallout-C7abPZ87.js +46 -0
  2. package/dist/AnswerModal-CsA2pl2P.js +3874 -0
  3. package/dist/AttachmentItem-Da1-7xwf.js +78 -0
  4. package/dist/BaseDatePicker-k9zlSi5J.js +3183 -0
  5. package/dist/BaseUpload-BUrXX3fT.js +1977 -0
  6. package/dist/BlockMedia-CYI07qAn.js +76 -0
  7. package/dist/CCallout-Qwae66vo.js +59 -0
  8. package/dist/CCurrencyDropdown-Y_u0hgBx.js +246 -0
  9. package/dist/CDropdownItem-CXJ4xD8W.js +538 -0
  10. package/dist/CField.vue_vue_type_style_index_0_lang-l0sNRNKZ.js +1 -0
  11. package/dist/CFormField--m3PvQuT.js +241 -0
  12. package/dist/CPhoneFormat-Qg6MkDVP.js +62 -0
  13. package/dist/CPriceInput-Dlx44UrR.js +112 -0
  14. package/dist/CTabs.vue_vue_type_style_index_0_scoped_b7262014_lang-l0sNRNKZ.js +1 -0
  15. package/dist/ClientAutocomplete-BKKc_br6.js +78 -0
  16. package/dist/ClientModal-CVZFb1Br.js +625 -0
  17. package/dist/ColorPicker-Bo3s3Esp.js +2879 -0
  18. package/dist/CompanyModal-DadjAioS.js +141 -0
  19. package/dist/ContentWrapper-BC3ZBQW9.js +183 -0
  20. package/dist/CoverBlockSettings-B484eE4g.js +275 -0
  21. package/dist/DocAnswer-CcYryOWI.js +36 -0
  22. package/dist/DocDetails-BigsoEWL.js +246 -0
  23. package/dist/DocForm-DlN0eNWt.js +7273 -0
  24. package/dist/DocFormSend-TqKo210I.js +143 -0
  25. package/dist/DocLinks-DSo54vDn.js +38 -0
  26. package/dist/DocModalBase-XlM1SThW.js +28 -0
  27. package/dist/DocPrint-tD0Vd9Sw.js +240 -0
  28. package/dist/DocReceipt-CDHPrhXM.js +210 -0
  29. package/dist/DocSendReminder-C62RhltH.js +137 -0
  30. package/dist/DocTextEditor-VjhV9IRp.js +17181 -0
  31. package/dist/DocTimeline-LcW4z3nC.js +481 -0
  32. package/dist/DocumentClient-CqbTRdpB.js +136 -0
  33. package/dist/DocumentLayout-Dbf8_01r.js +4909 -0
  34. package/dist/DocumentLogotype-DXYnBedV.js +87 -0
  35. package/dist/DocumentVoided-vH1Ti5lZ.js +25 -0
  36. package/dist/EmbedInput-D9qP8OnY.js +113 -0
  37. package/dist/EmbedSettings-DISuNqJT.js +72 -0
  38. package/dist/ErrorCallout-CCtCVwSh.js +28 -0
  39. package/dist/FilePreviewModal-BjhNyb6L.js +81 -0
  40. package/dist/Flag-Dhukv9_J.js +114 -0
  41. package/dist/HeaderSettings-CK4SkB1x.js +392 -0
  42. package/dist/ImageSelectModal-DnvPZzXx.js +84 -0
  43. package/dist/ImageUploadWrapper-B7cNMu5a.js +1604 -0
  44. package/dist/Index-B3HoK_cZ.js +84 -0
  45. package/dist/Index-B3aucNji.js +25 -0
  46. package/dist/Index-B9H5MMHb.js +62 -0
  47. package/dist/Index-BAYdvT-t.js +754 -0
  48. package/dist/Index-BLeQprjq.js +46 -0
  49. package/dist/Index-BOyvQlng.js +154 -0
  50. package/dist/Index-BVsw2tak.js +70 -0
  51. package/dist/Index-BY1UKGEO.js +98 -0
  52. package/dist/Index-Bh0kMSsA.js +107 -0
  53. package/dist/Index-BlQSM7tC.js +144 -0
  54. package/dist/Index-BpcJBGGd.js +642 -0
  55. package/dist/Index-Bs8wprXw.js +58 -0
  56. package/dist/Index-BvZZAvFd.js +21 -0
  57. package/dist/Index-CFo-3Y5Q.js +26 -0
  58. package/dist/Index-CNvp5K3L.js +559 -0
  59. package/dist/Index-CPJVx14x.js +171 -0
  60. package/dist/Index-CQ325eVT.js +140 -0
  61. package/dist/Index-CWrDtcfT.js +49 -0
  62. package/dist/Index-CyJnSvDR.js +223 -0
  63. package/dist/Index-D6bc7lg4.js +52 -0
  64. package/dist/Index-DCR8ev4U.js +33 -0
  65. package/dist/Index-DGQSB9cH.js +24 -0
  66. package/dist/Index-DXAvlq74.js +292 -0
  67. package/dist/Index-D_rfst8y.js +45 -0
  68. package/dist/Index-Dm8xMFGg.js +61 -0
  69. package/dist/Index-DtSSgtxB.js +55 -0
  70. package/dist/Index-DuTw9vhb.js +77 -0
  71. package/dist/Index-Dw26jtGV.js +31 -0
  72. package/dist/Index-OxN73_fO.js +32 -0
  73. package/dist/Index-S-FHG7_k.js +2402 -0
  74. package/dist/Index-ZFkitzfq.js +69 -0
  75. package/dist/Index-dyWK9jgr.js +25 -0
  76. package/dist/Index-gb11ngPS.js +57 -0
  77. package/dist/Index-lKk_XKJ3.js +150 -0
  78. package/dist/InputToggleRow-DSSvhPKA.js +57 -0
  79. package/dist/ManualPopover-lpJYSkw5.js +58 -0
  80. package/dist/MediaWrapper-BQ22FA2B.js +23 -0
  81. package/dist/NotBindingText-JxwzZLPP.js +32 -0
  82. package/dist/PackageGroup-BLSMSUDz.js +699 -0
  83. package/dist/PdfTerms-DtutjM5Y.js +36 -0
  84. package/dist/PdfViewer-BsxcZI_x.js +374 -0
  85. package/dist/PlainHtml-BMPZs2fT.js +20 -0
  86. package/dist/PriceHeader-BRYY01H2.js +339 -0
  87. package/dist/SearchApi-6001iFxU.js +161 -0
  88. package/dist/Setup-cw6jMI9M.js +50 -0
  89. package/dist/SmartList-q6H-uLbm.js +83 -0
  90. package/dist/TermsSettings-DWvaPneu.js +102 -0
  91. package/dist/ThemeColorRow-BXWnvfz-.js +67 -0
  92. package/dist/ToggleBinding-DydtwpNG.js +38 -0
  93. package/dist/UploadModal-D_EDKHGD.js +95 -0
  94. package/dist/VideoPlayerInput-B9yzUeBW.js +93 -0
  95. package/dist/VideoPlayerSettings-Bvp9l0yj.js +61 -0
  96. package/dist/VideoSelectModal-DY3N4JiS.js +100 -0
  97. package/dist/anime.es-BrPTThYb.js +858 -0
  98. package/dist/answerDocumentMixin-BYZPU_R-.js +51 -0
  99. package/dist/color-TdtKxwVa.js +19 -0
  100. package/dist/debounce-BPnlzNwd.js +84 -0
  101. package/dist/dom-CJxkno7i.js +91 -0
  102. package/dist/favicon.ico +0 -0
  103. package/dist/focusDrawerMixin-DC9Oa1i7.js +22 -0
  104. package/dist/formComponentsInstall-CEW6TK6z.js +2499 -0
  105. package/dist/formDrawerState-CAzvSMiQ.js +20 -0
  106. package/dist/formValidationMixin-D7zXxCpC.js +49 -0
  107. package/dist/i18nMessages-Chz_lxGG.js +17 -0
  108. package/dist/index-B9WDC3Xe.js +166 -0
  109. package/dist/index-BCMaUC5r.js +3916 -0
  110. package/dist/index-BDMI4NVY.js +492 -0
  111. package/dist/index-BbscgdRg.js +81 -0
  112. package/dist/index-CLUljEDI.js +347 -0
  113. package/dist/index-SxyZvewN.js +102 -0
  114. package/dist/index.es.js +35 -0
  115. package/dist/index.umd.js +3148 -0
  116. package/dist/main-CQBEuZk9.js +56739 -0
  117. package/dist/mapFormMixin-DlFcgwhm.js +72 -0
  118. package/dist/omit-BWy0Zhd3.js +31 -0
  119. package/dist/publicSenderState-CvOcFv2U.js +21 -0
  120. package/dist/splitpanes-BHUVsCZF.js +382 -0
  121. package/dist/style.css +4 -0
  122. package/dist/throttle-BrC8eGjQ.js +18 -0
  123. package/dist/tinycolor-PhFP695w.js +633 -0
  124. package/dist/tippy.esm-7dmKOUvu.js +1799 -0
  125. package/dist/utils-NBLgNGHR.js +108 -0
  126. package/dist/vuedraggable.umd-ByfH7ZxC.js +3161 -0
  127. package/dist/vuex.esm-DKGl8mcw.js +467 -0
  128. package/package.json +1 -1
  129. package/vite.config.ts +0 -1
@@ -0,0 +1,347 @@
1
+ import { w as m } from "./CDropdownItem-CXJ4xD8W.js";
2
+ import { n as o, E as f, S as v, g as i, h as l } from "./main-CQBEuZk9.js";
3
+ import { m as h, a as d, b as _ } from "./vuex.esm-DKGl8mcw.js";
4
+ import { B as p } from "./DocTextEditor-VjhV9IRp.js";
5
+ import { v as r } from "./index-BDMI4NVY.js";
6
+ import { S as g } from "./SmartList-q6H-uLbm.js";
7
+ const x = {
8
+ mixins: [m],
9
+ props: {
10
+ placement: {
11
+ type: String,
12
+ default: "top-start"
13
+ }
14
+ },
15
+ data() {
16
+ return {
17
+ isOpen: !1
18
+ };
19
+ },
20
+ methods: {
21
+ onOpen() {
22
+ this.$emit("open"), this.isOpen = !0;
23
+ },
24
+ onClose() {
25
+ this.$emit("close"), this.isOpen = !1;
26
+ }
27
+ }
28
+ };
29
+ var C = function() {
30
+ var e = this, t = e._self._c;
31
+ return e.mq === "sm" ? t("div", [t("div", { on: { click: e.onOpen } }, [e._t("default")], 2), e.isOpen ? t("portal", { attrs: { to: "modal" } }, [t("div", { staticClass: "modal-overlay", on: { click: function(a) {
32
+ return a.target !== a.currentTarget ? null : e.onClose.apply(null, arguments);
33
+ } } }, [t("div", { staticClass: "modal-container" }, [e._t("popover", null, { close: e.onClose })], 2)])]) : e._e()], 1) : t("v-popover", e._b({ attrs: { open: e.isOpen, placement: e.placement, "popover-class": "reset" }, on: { close: function(a) {
34
+ return e.onClose();
35
+ }, "update:open": function(a) {
36
+ a ? e.onOpen() : e.onClose();
37
+ } } }, "v-popover", e.$props, !1), [e._t("default"), t("div", { staticClass: "popover-container", attrs: { slot: "popover" }, slot: "popover" }, [e.isOpen ? t("portal", { attrs: { to: "modal" } }, [t("div", { staticClass: "overlay" })]) : e._e(), e._t("popover", null, { close: e.onClose })], 2)], 2);
38
+ }, T = [], $ = /* @__PURE__ */ o(
39
+ x,
40
+ C,
41
+ T,
42
+ !1,
43
+ null,
44
+ "92a9b7fb"
45
+ );
46
+ const S = $.exports, { mapFields: y } = f({
47
+ getterType: "forms/getField",
48
+ mutationType: "forms/updateField"
49
+ }), b = {
50
+ i18nOptions: {
51
+ namespaces: "TextTemplatesForm",
52
+ messages: {
53
+ en: {
54
+ textLabel: "Snippet",
55
+ name: {
56
+ label: "Template Name",
57
+ placeholder: "Name"
58
+ },
59
+ placeholderType: {
60
+ default: "Write here..."
61
+ },
62
+ validations: {
63
+ name: {
64
+ required: "Name is required",
65
+ maxLength: "Maximum length is 256 characters"
66
+ },
67
+ textContent: {
68
+ required: "Add some content"
69
+ }
70
+ }
71
+ },
72
+ sv: {
73
+ textLabel: "Mallens innehåll",
74
+ name: {
75
+ label: "Namn på mallen",
76
+ placeholder: "Mallens namn"
77
+ },
78
+ placeholderType: {
79
+ default: "Skriv här..."
80
+ },
81
+ validations: {
82
+ name: {
83
+ required: "Ge mallen ett namn",
84
+ maxLength: "Får max vara 256 tecken långt"
85
+ },
86
+ textContent: {
87
+ required: "Skriv vad mallen ska innehålla"
88
+ }
89
+ }
90
+ }
91
+ }
92
+ },
93
+ name: "TextTemplatesForm",
94
+ components: {
95
+ BaseTextEditor: p,
96
+ Spinner: v
97
+ },
98
+ props: {
99
+ id: {
100
+ type: [String, Number],
101
+ default: null
102
+ },
103
+ predefinedTextContent: {
104
+ type: String,
105
+ default: null
106
+ },
107
+ onAfterSubmit: {
108
+ type: Function,
109
+ default: null
110
+ },
111
+ showFixedCloseButton: {
112
+ type: Boolean,
113
+ default: !1
114
+ }
115
+ },
116
+ validations: {
117
+ name: {
118
+ required: r.required,
119
+ maxLength: r.maxLength(255)
120
+ },
121
+ textContent: {
122
+ required: r.required
123
+ }
124
+ },
125
+ computed: {
126
+ ...h({
127
+ isPosting: "templateMessages/isPosting",
128
+ isFetching: "templateMessages/isFetching",
129
+ checkFormChanged: "forms/hasChanged"
130
+ }),
131
+ ...y({
132
+ templateMessage: "templateMessage",
133
+ name: "templateMessage.name",
134
+ textContent: "templateMessage.message"
135
+ }),
136
+ messages() {
137
+ return {
138
+ name: {
139
+ required: this.$t("validations.name.required"),
140
+ maxLength: this.$t("validations.name.maxLength")
141
+ },
142
+ textContent: {
143
+ required: this.$t("validations.textContent.required")
144
+ }
145
+ };
146
+ },
147
+ hasChanged() {
148
+ return this.checkFormChanged("templateMessage");
149
+ }
150
+ },
151
+ watch: {
152
+ id() {
153
+ this.load();
154
+ }
155
+ },
156
+ mounted() {
157
+ this.load(), this.predefinedTextContent && (this.textContent = this.predefinedTextContent);
158
+ },
159
+ methods: {
160
+ ...d({
161
+ loadTemplate: i.LOAD_TEMPLATE_MESSAGE,
162
+ deleteTemplate: i.DELETE_TEMPLATE_MESSAGE,
163
+ formNewTemplate: i.FORM_NEW_TEMPLATE_MESSAGE,
164
+ formEditTemplate: i.FORM_EDIT_TEMPLATE_MESSAGE,
165
+ formSubmitTemplate: i.FORM_SUBMIT_TEMPLATE_MESSAGE
166
+ }),
167
+ canLeave() {
168
+ return !this.hasChanged;
169
+ },
170
+ async load() {
171
+ try {
172
+ this.id ? (await this.loadTemplate({
173
+ id: this.id
174
+ }), await this.formEditTemplate({
175
+ id: this.id
176
+ })) : await this.formNewTemplate();
177
+ } catch (s) {
178
+ l(s);
179
+ }
180
+ },
181
+ validateBeforeSubmit() {
182
+ return this.$v.$touch(), this.$v.$invalid ? !1 : this.submit();
183
+ },
184
+ async submit() {
185
+ if (this.hasChanged)
186
+ try {
187
+ await this.formSubmitTemplate(), typeof this.onAfterSubmit == "function" && this.onAfterSubmit();
188
+ } catch (s) {
189
+ l(s);
190
+ }
191
+ },
192
+ async remove() {
193
+ try {
194
+ await this.deleteTemplate({ id: this.id }), typeof this.onAfterSubmit == "function" && this.onAfterSubmit();
195
+ } catch (s) {
196
+ l(s);
197
+ }
198
+ }
199
+ }
200
+ };
201
+ var M = function() {
202
+ var e = this, t = e._self._c;
203
+ return t("div", { staticStyle: { position: "relative" } }, [e.showFixedCloseButton ? t("CButton", { staticClass: "fixed-close-button", attrs: { circle: "", icon: "x" }, on: { click: function(a) {
204
+ return e.$emit("close");
205
+ } } }) : e._e(), e.isFetching ? t("div", { staticClass: "flex w-full items-center justify-center", staticStyle: { padding: "calc(3 * var(--rem)) 0" } }, [t("Spinner")], 1) : e.templateMessage !== void 0 ? t("form", [t("CField", { attrs: { validator: e.$v.name, messages: e.messages.name, label: e.$t("name.label") } }, [t("CInput", { attrs: { placeholder: e.$t("name.placeholder") }, on: { blur: function(a) {
206
+ return e.$v.name.$touch();
207
+ } }, model: { value: e.name, callback: function(a) {
208
+ e.name = a;
209
+ }, expression: "name" } })], 1), t("CField", { attrs: { validator: e.$v.textContent, messages: e.messages.textContent, label: e.$t("textLabel") } }, [t("BaseTextEditor", { attrs: { placeholder: e.$t("placeholderType.default"), "class-list": "large" }, on: { blur: function(a) {
210
+ return e.$v.textContent.$touch();
211
+ } }, model: { value: e.textContent, callback: function(a) {
212
+ e.textContent = a;
213
+ }, expression: "textContent" } })], 1), t("CButton", { staticStyle: { "margin-top": "calc(1 * var(--rem))" }, attrs: { loading: e.isPosting, disabled: !e.hasChanged, type: "secondary", icon: "save", wide: "" }, on: { click: function(a) {
214
+ return e.validateBeforeSubmit();
215
+ } } }, [e._v(" " + e._s(e.$t("_common:save")) + " ")]), e.id ? t("CButton", { staticStyle: { "margin-top": "calc(1 * var(--rem))" }, attrs: { loading: e.isPosting, type: "secondary", pattern: "tertiary", wide: "" }, on: { click: function(a) {
216
+ return e.remove();
217
+ } } }, [e._v(" " + e._s(e.$t("_common:remove")) + " ")]) : e._e()], 1) : e._e()], 1);
218
+ }, E = [], w = /* @__PURE__ */ o(
219
+ b,
220
+ M,
221
+ E,
222
+ !1,
223
+ null,
224
+ "a9ef19eb"
225
+ );
226
+ const F = w.exports, k = {
227
+ name: "TextTemplatesModal",
228
+ components: {
229
+ SmartList: g,
230
+ BaseTextEditor: p
231
+ },
232
+ mixins: [m],
233
+ data() {
234
+ return {
235
+ selectedIndex: 0,
236
+ query: ""
237
+ };
238
+ },
239
+ computed: {
240
+ ..._("templateMessages", {
241
+ templateMessages: (s) => s.data
242
+ }),
243
+ templates() {
244
+ return Object.values(this.templateMessages);
245
+ }
246
+ },
247
+ methods: {
248
+ onSelect(s) {
249
+ this.$emit("select", s), this.close();
250
+ },
251
+ close() {
252
+ this.$emit("close");
253
+ },
254
+ openCreateModal() {
255
+ this.close(), this.$modal.show(
256
+ F,
257
+ {
258
+ predefinedTextContent: "",
259
+ showFixedCloseButton: !0,
260
+ onAfterSubmit: () => this.$modal.hide("saveTemplateModal")
261
+ },
262
+ {
263
+ name: "saveTemplateModal",
264
+ delay: 100,
265
+ adaptive: !0,
266
+ height: "auto",
267
+ width: "90%",
268
+ maxWidth: 500,
269
+ scrollable: !0,
270
+ classes: "overflow-visible default"
271
+ }
272
+ );
273
+ }
274
+ }
275
+ };
276
+ var q = function() {
277
+ var e = this, t = e._self._c;
278
+ return t("SmartList", { attrs: { items: e.templates, "sort-key": "position", query: e.query }, scopedSlots: e._u([{ key: "default", fn: function({ items: a }) {
279
+ return [t("div", { ref: "modal-container", staticClass: "font-inter t-modal" }, [t("div", { staticClass: "t-nav" }, [t("CInput", { ref: "searchInput", staticClass: "search-input focus:text-gray-500", attrs: { placeholder: e.$t("search"), icon: "search" }, on: { input: function(n) {
280
+ e.selectedIndex = 0;
281
+ } }, model: { value: e.query, callback: function(n) {
282
+ e.query = n;
283
+ }, expression: "query" } })], 1), t("div", { staticClass: "t-main" }, [t("div", { staticClass: "t-list" }, e._l(a, function(n, c) {
284
+ return t("div", { key: n.id, staticClass: "t-list-item truncate-text", class: { selected: c === e.selectedIndex }, on: { "&mouseover": function(u) {
285
+ e.selectedIndex = c;
286
+ }, click: function(u) {
287
+ return e.onSelect(a[e.selectedIndex].message || "");
288
+ } } }, [e._v(" " + e._s(n.name) + " ")]);
289
+ }), 0), e.mq !== "sm" ? t("div", { staticClass: "t-text quill-format" }, [a[e.selectedIndex] ? t("BaseTextEditor", { attrs: { value: a[e.selectedIndex].message || "", editable: !1, extensions: "all", "class-list": "document-form", unstyled: "" } }) : t("div", [e._v(" " + e._s(e.$t("noResults")) + " ")])], 1) : e._e()]), t("div", { staticClass: "t-footer flex w-full items-center justify-between" }, [t("div", { staticStyle: { display: "inline-flex", "align-items": "center" } }), t("div", [t("CButton", { staticClass: "t-footer-button", attrs: { to: { name: "settingsTemplates" }, target: "_blank", size: "small" } }, [e._v(" " + e._s(e.$t("handle")) + " "), t("CIcon", { staticStyle: { "margin-left": "0.5em" }, attrs: { type: "new-window", size: "16" } })], 1), t("CButton", { staticClass: "t-footer-button", attrs: { size: "small" }, on: { click: e.openCreateModal } }, [e._v(" " + e._s(e.$t("create", { thing: e.$t("template") })) + " ")])], 1)])])];
290
+ } }]) });
291
+ }, A = [], L = /* @__PURE__ */ o(
292
+ k,
293
+ q,
294
+ A,
295
+ !1,
296
+ null,
297
+ "6b139605"
298
+ );
299
+ const B = L.exports, O = {
300
+ name: "TextTemplates",
301
+ components: {
302
+ ContextModal: S,
303
+ TextTemplatesModal: B
304
+ },
305
+ inject: {
306
+ viewSettings: {
307
+ default: () => ({ isPublicForm: !1 })
308
+ }
309
+ },
310
+ props: {
311
+ placement: {
312
+ type: String,
313
+ default: "left"
314
+ }
315
+ },
316
+ created() {
317
+ this.viewSettings.isPublicForm || this.loadTemplateMessages();
318
+ },
319
+ methods: {
320
+ ...d({
321
+ loadTemplateMessages: i.LOAD_TEMPLATE_MESSAGES
322
+ })
323
+ }
324
+ };
325
+ var I = function() {
326
+ var e = this, t = e._self._c;
327
+ return e.viewSettings.isPublicForm ? e._e() : t("div", { staticClass: "t-list" }, [t("ContextModal", { attrs: { "break-point": 1e3, placement: e.placement }, on: { open: function(a) {
328
+ return e.$emit("open");
329
+ }, close: function(a) {
330
+ return e.$emit("close");
331
+ } }, scopedSlots: e._u([{ key: "popover", fn: function({ close: a }) {
332
+ return [t("TextTemplatesModal", { on: { close: a, select: function(n) {
333
+ return e.$emit("select", n);
334
+ } } })];
335
+ } }], null, !1, 1240188552) }, [t("div", { staticClass: "t-option main" }, [e._t("default")], 2)])], 1);
336
+ }, P = [], G = /* @__PURE__ */ o(
337
+ O,
338
+ I,
339
+ P,
340
+ !1,
341
+ null,
342
+ null
343
+ );
344
+ const H = G.exports;
345
+ export {
346
+ H as default
347
+ };
@@ -0,0 +1,102 @@
1
+ import { g as s, N as l, O as r, n as d, V as n } from "./main-CQBEuZk9.js";
2
+ import { m as p, a as c } from "./vuex.esm-DKGl8mcw.js";
3
+ const m = {
4
+ name: "ClientLinks",
5
+ props: {
6
+ id: {
7
+ type: String,
8
+ required: !0
9
+ }
10
+ },
11
+ i18nOptions: {
12
+ namespaces: "ClientLinks",
13
+ messages: {
14
+ en: {
15
+ title: "Document links",
16
+ text: "Share the document links below with your recipients. Each recipient has their own unique link.",
17
+ copied: "Link copied to clipboard",
18
+ tooltip: "Copy link",
19
+ placeholder: "No links available.",
20
+ hint: "Note that visting a link will trigger a viewed event in the events timeline."
21
+ },
22
+ sv: {
23
+ title: "Dokumentlänkar",
24
+ text: "Dela dokumentlänkarna nedan med dina mottagare. Varje mottagare har sin egen unika länk.",
25
+ copied: "Länk kopierat till urklipp",
26
+ tooltip: "Kopiera länk",
27
+ placeholder: "Inga länkar finns tillgängliga.",
28
+ hint: "Notera att ett sidbesök på en länk kommer att skapa en visad-händelse i tidslinjen."
29
+ }
30
+ }
31
+ },
32
+ computed: {
33
+ ...p({
34
+ docById: "documents2/byId"
35
+ }),
36
+ document() {
37
+ return this.docById(this.id);
38
+ },
39
+ clients() {
40
+ if (!this.document)
41
+ return [];
42
+ const { clients: o } = this.document;
43
+ return o.map((t) => ({
44
+ ...t,
45
+ primaryTitle: t.name,
46
+ secondaryTitle: t.type === "company" ? t.companyName : ""
47
+ }));
48
+ }
49
+ },
50
+ created() {
51
+ this.loadDocument({ id: this.id });
52
+ },
53
+ methods: {
54
+ ...c({
55
+ loadDocument: s.LOAD_DOCUMENT2
56
+ }),
57
+ async copyToClipboard(o) {
58
+ var i, a;
59
+ (i = o.target.previousElementSibling) == null || i.select();
60
+ const t = (a = o.target.previousElementSibling) == null ? void 0 : a.value;
61
+ if (!t)
62
+ return;
63
+ await l(t) && r("info", this.$t("copied"));
64
+ }
65
+ }
66
+ };
67
+ var u = function() {
68
+ var t = this, e = t._self._c;
69
+ return e("div", { staticClass: "font-inter", staticStyle: { "background-color": "white", "border-radius": "10px", overflow: "hidden" } }, [e("div", { staticStyle: { padding: "40px 30px", position: "relative" } }, [e("CButton", { staticStyle: { position: "absolute", right: "1em", top: "1em", color: "hsl(0, 0%, 55%)" }, attrs: { icon: "x", circle: "", size: "normal" }, on: { click: function(i) {
70
+ return t.$emit("close");
71
+ } } }), e("div", { staticStyle: { padding: "0 0 2.5em" } }, [e("div", { staticClass: "x-title", domProps: { textContent: t._s(t.$t("title")) } }), e("div", { staticClass: "x-text", domProps: { textContent: t._s(t.$t("text")) } })]), t.clients.length ? t._l(t.clients, function(i, a) {
72
+ return e("div", { key: a, staticClass: "client-card" }, [e("div", { staticStyle: { padding: "4px 6px 8px 6px" } }, [e("div", { staticClass: "client-title truncate-text" }, [t._v(" " + t._s(i.primaryTitle) + " "), i.secondaryTitle ? e("span", { staticStyle: { opacity: "0.5", "padding-left": "0.125ch" } }, [t._v("· " + t._s(i.secondaryTitle))]) : t._e()]), i.documentRole ? e("div", { domProps: { textContent: t._s(t.$t(`_common:documentRole.${i.documentRole}.label`)) } }) : t._e(), e("div", [i.email ? e("a", { attrs: { href: `mailto:${i.email}?&body=${i.docLink}` } }, [t._v(t._s(i.email))]) : t._e(), i.email && i.cellphone ? e("span", { staticStyle: { padding: "0 0.5ch" } }, [t._v("·")]) : t._e(), i.cellphone ? e("a", { attrs: { href: `sms:${i.cellphone}?&body=${i.docLink}` } }, [e("CPhoneFormat", { attrs: { phone: i.cellphone, region: i.cellphoneRegion } })], 1) : t._e()])]), e("div", { staticStyle: { display: "flex", position: "relative" } }, [e("input", { ref: "key", refInFor: !0, staticClass: "link-field truncate-text", attrs: { placeholder: t.$t("placeholder"), type: "text", readonly: "readonly" }, domProps: { value: i.docLink } }), e("div", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: t.$t("tooltip"), expression: "$t('tooltip')" }], staticClass: "clipboard-button", on: { click: t.copyToClipboard } }, [e("CIcon", { staticStyle: { "pointer-events": "none" }, attrs: { type: "copy", size: "17" } })], 1)])]);
73
+ }) : e("div", { staticStyle: { padding: "2em", "font-size": "14px", "text-align": "center", color: "hsl(0, 0%, 55%)", border: "1px solid hsl(0, 0%, 88%)", "border-radius": "6px" }, domProps: { textContent: t._s(t.$t("placeholder")) } }), e("div", { staticClass: "x-hint" }, [e("CIcon", { staticClass: "text-primary-500", staticStyle: { flex: "0 0 auto", "margin-right": "8px", "margin-top": "3px" }, attrs: { type: "info", size: "16" } }), e("div", { domProps: { textContent: t._s(t.$t("hint")) } })], 1)], 2)]);
74
+ }, h = [], y = /* @__PURE__ */ d(
75
+ m,
76
+ u,
77
+ h,
78
+ !1,
79
+ null,
80
+ "39699716"
81
+ );
82
+ const v = y.exports, g = v, _ = ({ id: o }) => {
83
+ if (!n.prototype.$modal)
84
+ throw Error("Open client modal requires plugin vue-js-modal");
85
+ n.prototype.$modal.show(
86
+ g,
87
+ {
88
+ id: o
89
+ },
90
+ {
91
+ adaptive: !0,
92
+ maxWidth: 400,
93
+ width: "90%",
94
+ height: "auto",
95
+ scrollable: !0
96
+ }
97
+ );
98
+ };
99
+ export {
100
+ g as C,
101
+ _ as o
102
+ };