@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,625 @@
1
+ import { C as v } from "./ClientAutocomplete-BKKc_br6.js";
2
+ import { E as p, a9 as y, I as C, n as u, b as l, d as b, c as _, g as c, aa as $, y as w } from "./main-CQBEuZk9.js";
3
+ import { w as f } from "./CDropdownItem-CXJ4xD8W.js";
4
+ import { v as r } from "./index-BDMI4NVY.js";
5
+ import { m as g, b as x, a as k } from "./vuex.esm-DKGl8mcw.js";
6
+ import { o as N } from "./omit-BWy0Zhd3.js";
7
+ function h(a) {
8
+ if (typeof a > "u")
9
+ throw Error("Missing param inputParam");
10
+ let e = a;
11
+ Number.isInteger(e) && (e = e.toString());
12
+ let t = 0;
13
+ const i = e.length, n = i % 2;
14
+ let s, o;
15
+ for (s = 0; s < i; s += 1)
16
+ o = parseInt(e.charAt(s), 10), s % 2 === n && (o *= 2), o > 9 && (o -= 9), t += o;
17
+ return t % 10 === 0;
18
+ }
19
+ function m(a) {
20
+ let e = a.replace(/ /g, "");
21
+ return e = e.replace(/-/g, ""), !h(e) || (e = [e.slice(0, 6), "-", e.slice(6)].join(""), !e.match(/^(\d{6})-(\d{4})$/)) ? !1 : e;
22
+ }
23
+ function d(a) {
24
+ if (typeof a > "u" || a === null || a === "")
25
+ return !1;
26
+ let e = a.trim().replace(/[^0-9]+/g, "");
27
+ if (e.length !== 10 && e.length !== 12)
28
+ return !1;
29
+ if (e.length === 10) {
30
+ const n = e.substring(0, 2), s = (/* @__PURE__ */ new Date()).getFullYear(), o = parseInt(
31
+ s.toString().substring(2, 2),
32
+ 10
33
+ );
34
+ parseInt(n, 10) === 19 || parseInt(n, 10) === 20 || (parseInt(n, 10) >= 0 && parseInt(n, 10) <= o ? e = `20${e}` : e = `19${e}`);
35
+ }
36
+ return (/* @__PURE__ */ new Date()).getFullYear() - parseInt(e.substring(0, 4), 10) < 16 ? !1 : h(e.substring(2)) ? e : !1;
37
+ }
38
+ const I = {
39
+ sv: {
40
+ title: "Mottagare",
41
+ updateButton: "Spara mottagare",
42
+ individual: "Privatperson",
43
+ reference: "Referens",
44
+ workAddressSubLabel: "Där arbetet utförs",
45
+ showMore: "Visa fler fält",
46
+ seperateWorkAddress: {
47
+ false: "Arbetsadress som ovan",
48
+ true: "Annan"
49
+ },
50
+ placeholders: {
51
+ name: "Mottagarens namn",
52
+ companyName: "Företagets namn",
53
+ socialNo: "10 eller 12 siffror",
54
+ orgNo: "Företagets org-nr",
55
+ reference: "Er referens",
56
+ cellphone: "Mobilnummer",
57
+ address: "Gatuadress"
58
+ },
59
+ validations: {
60
+ name: {
61
+ required: "Vem är din kund?"
62
+ },
63
+ orgNo: {
64
+ personalNumber: "Personnumret är inte giltigt"
65
+ },
66
+ realOrgNo: {
67
+ realOrgNo: "Organisationsnumret är inte giltigt"
68
+ },
69
+ reference: {
70
+ required: "Vem är din referens?"
71
+ },
72
+ email: {
73
+ required: "E-post saknas",
74
+ email: "E-posten är ogiltig"
75
+ }
76
+ },
77
+ signMethod: {
78
+ button: {
79
+ title: "Standard - knapptryck",
80
+ content: "Bevisnivå: IP-adress, tidpunkt och enhet."
81
+ },
82
+ bankId: {
83
+ title: "BankId",
84
+ content: "Samma säkerhetsgrad som bankerna har."
85
+ },
86
+ signature: {
87
+ title: "Standard",
88
+ content: "Bevisnivå: IP-adress, tidpunkt och enhet."
89
+ },
90
+ inPerson: {
91
+ title: "Fysisk underskrift",
92
+ content: "Signatur på utskrivet dokument"
93
+ }
94
+ }
95
+ },
96
+ en: {
97
+ title: "Recipient",
98
+ updateButton: "Save recipient",
99
+ individual: "Individual",
100
+ reference: "Contact",
101
+ workAddressSubLabel: "Where work is going to be performed",
102
+ showMore: "Show additional fields",
103
+ seperateWorkAddress: {
104
+ false: "Work address same as above",
105
+ true: "Other"
106
+ },
107
+ placeholders: {
108
+ name: "Recipient name",
109
+ companyName: "Company name",
110
+ socialNo: "10 or 12 numbers",
111
+ orgNo: "Company registration number",
112
+ reference: "Name",
113
+ cellphone: "Cellphone",
114
+ address: "Street"
115
+ },
116
+ validations: {
117
+ name: {
118
+ required: "Who's your contact person?"
119
+ },
120
+ orgNo: {
121
+ personalNumber: "Invalid social security number"
122
+ },
123
+ realOrgNo: {
124
+ realOrgNo: "Invalid organisation number"
125
+ },
126
+ reference: {
127
+ required: "Missing contact name"
128
+ },
129
+ email: {
130
+ required: "Email missing",
131
+ email: "Invalid email"
132
+ }
133
+ },
134
+ signMethod: {
135
+ button: {
136
+ title: "Standard - button",
137
+ content: "Level of proof: IP address, timestamp and device."
138
+ },
139
+ bankId: {
140
+ title: "BankID",
141
+ content: "Same level of proof as the banks use."
142
+ },
143
+ signature: {
144
+ title: "Signature",
145
+ content: "Level of proof: IP address, timestamp and device."
146
+ },
147
+ inPerson: {
148
+ title: "In person",
149
+ content: "Signature on print document"
150
+ }
151
+ }
152
+ }
153
+ }, { mapFields: S } = p({
154
+ getterType: "forms/getField",
155
+ mutationType: "forms/updateField"
156
+ }), F = {
157
+ name: "FormClient",
158
+ i18nOptions: {
159
+ namespaces: "formClient",
160
+ messages: I
161
+ },
162
+ components: {
163
+ ClientAutocomplete: v,
164
+ Animation: y
165
+ },
166
+ mixins: [f],
167
+ props: {
168
+ requireReference: {
169
+ type: Boolean,
170
+ default: !0
171
+ },
172
+ searchEnabled: {
173
+ type: Boolean,
174
+ default: !1
175
+ },
176
+ validateOrgNo: {
177
+ type: Boolean,
178
+ default: !1
179
+ },
180
+ simpleForm: {
181
+ type: Boolean,
182
+ default: !1
183
+ },
184
+ inputFocusOnMount: {
185
+ type: String,
186
+ default: ""
187
+ },
188
+ // Optional field with prop sync, if within the context of documents
189
+ documentRole: {
190
+ type: String,
191
+ default: ""
192
+ },
193
+ // Optional field with prop sync, if within the context of documents
194
+ answerMethod: {
195
+ type: Object,
196
+ default: null
197
+ },
198
+ signOptions: {
199
+ type: Array,
200
+ default: () => []
201
+ },
202
+ isPublicForm: {
203
+ type: Boolean,
204
+ default: !1
205
+ }
206
+ },
207
+ validations() {
208
+ return [
209
+ this.name,
210
+ this.orgNo,
211
+ this.reference,
212
+ this.email,
213
+ this.cellphone
214
+ ].some((e) => !!e) ? {
215
+ orgNo: {
216
+ personalNumber(e) {
217
+ return !this.validateOrgNo || !e ? !0 : this.isIndivid ? d(e) : m(e) || d(e);
218
+ }
219
+ },
220
+ reference: {
221
+ required: r.requiredIf((e) => e.requireReference && !e.isIndivid)
222
+ },
223
+ email: {
224
+ email: r.email
225
+ }
226
+ } : {
227
+ name: {
228
+ required: r.required
229
+ },
230
+ orgNo: {
231
+ required: r.requiredIf((e) => e.type === "company")
232
+ },
233
+ cellphone: {
234
+ required: r.requiredIf((e) => !e.isIndivid)
235
+ },
236
+ reference: {
237
+ required: r.requiredIf((e) => !e.isIndivid)
238
+ },
239
+ email: {
240
+ required: r.requiredIf((e) => !e.isIndivid)
241
+ }
242
+ };
243
+ },
244
+ computed: {
245
+ ...S({
246
+ id: "endCustomer.id",
247
+ type: "endCustomer.customerType",
248
+ name: "endCustomer.name",
249
+ realOrgNo: "endCustomer.org_no",
250
+ reference: "endCustomer.reference",
251
+ email: "endCustomer.email",
252
+ street: "endCustomer.street",
253
+ zip: "endCustomer.zip",
254
+ city: "endCustomer.city",
255
+ cellphone: "endCustomer.cellphone",
256
+ cellphoneRegion: "endCustomer.cellphoneRegion",
257
+ separateWorkAddress: "endCustomer.separateWorkAddress",
258
+ workStreet: "endCustomer.workStreet",
259
+ workZip: "endCustomer.workZip",
260
+ workCity: "endCustomer.workCity",
261
+ reverseVat: "endCustomer.reverseVat",
262
+ doUpdateEndCustomer: "endCustomer.doUpdateEndCustomer"
263
+ }),
264
+ ...g({
265
+ isPosting: "endCustomers/isPosting",
266
+ companyRegion: "application/companyRegion",
267
+ feature: "application/feature"
268
+ }),
269
+ messages() {
270
+ return {
271
+ name: {
272
+ required: this.$t("validations.name.required")
273
+ },
274
+ orgNo: {
275
+ personalNumber: this.$t("validations.orgNo.personalNumber")
276
+ },
277
+ realOrgNo: {
278
+ personalNumber: this.$t("validations.realOrgNo.realOrgNo")
279
+ },
280
+ reference: {
281
+ required: this.$t("validations.reference.required")
282
+ },
283
+ email: {
284
+ required: this.$t("validations.email.required"),
285
+ email: this.$t("validations.email.email")
286
+ }
287
+ };
288
+ },
289
+ orgNo: {
290
+ get() {
291
+ return this.realOrgNo;
292
+ },
293
+ set(a) {
294
+ const e = this.isIndivid ? d(a) : m(a) || d(a);
295
+ return this.validateOrgNo && e ? (this.realOrgNo = e, !0) : (this.realOrgNo = a, !0);
296
+ }
297
+ },
298
+ isIndivid() {
299
+ return this.type === "individual";
300
+ }
301
+ },
302
+ watch: {
303
+ type(a) {
304
+ C.setItem("defaultClientType", a);
305
+ }
306
+ },
307
+ mounted() {
308
+ this.$refs[this.inputFocusOnMount] ? this.$refs[this.inputFocusOnMount].$el.querySelector("input").focus() : this.$refs.name.$el.querySelector("input").focus();
309
+ },
310
+ methods: {
311
+ validateForm() {
312
+ return this.$v.$touch(), this.$v.$invalid ? !1 : (this.$emit("submit", !0), !0);
313
+ }
314
+ }
315
+ };
316
+ var M = function() {
317
+ var e = this, t = e._self._c;
318
+ return t("div", { staticClass: "form-client" }, [e.simpleForm ? t("form", { on: { submit: function(i) {
319
+ return i.preventDefault(), e.validateForm.apply(null, arguments);
320
+ } } }, [t("div", { staticClass: "space-between flex flex-wrap items-center pb-6" }, [t("div", { staticClass: "flex-grow", staticStyle: { "font-weight": "600", "font-size": "20px" } }, [e._v(" " + e._s(e.$t("_common:recipient").capitalize()) + " ")]), t("div", { staticClass: "type-toggle" }, [t("div", { staticClass: "type-toggle-button", class: { active: e.type === "individual" }, on: { click: function(i) {
321
+ e.type = "individual";
322
+ } } }, [e._v(" " + e._s(e.$t("individual")) + " ")]), t("div", { staticClass: "type-toggle-button", class: { active: e.type === "company" }, on: { click: function(i) {
323
+ e.type = "company";
324
+ } } }, [e._v(" " + e._s(e.$t("_common:company").capitalize()) + " ")])])]), t("CField", { staticStyle: { "margin-bottom": "calc(1.5 * var(--rem))" }, attrs: { label: e.isIndivid ? e.$t("_common:name").capitalize() : e.$t("_common:company").capitalize(), validator: e.$v.name, messages: e.messages.name, "label-position": "inside" } }, [t("ClientAutocomplete", { ref: "name", attrs: { placeholder: e.isIndivid ? e.$t("placeholders.name") : e.$t("placeholders.companyName"), "search-enabled": e.searchEnabled, "show-loading": !0 }, on: { setClient: function(i) {
325
+ return e.$emit("setClient", i);
326
+ } }, model: { value: e.name, callback: function(i) {
327
+ e.name = i;
328
+ }, expression: "name" } })], 1), t("Animation", [e.isIndivid ? e._e() : t("CField", { staticClass: "pb-4", attrs: { validator: e.$v.reference, messages: e.messages.reference, label: e.$t("reference").capitalize(), "label-position": "inside" } }, [t("CInput", { ref: "reference", attrs: { placeholder: e.$t("placeholders.reference") }, model: { value: e.reference, callback: function(i) {
329
+ e.reference = i;
330
+ }, expression: "reference" } })], 1)], 1), t("CField", { staticStyle: { "margin-bottom": "calc(1.5 * var(--rem))" }, attrs: { validator: e.$v.email, messages: e.messages.email, label: e.$t("_common:email").capitalize(), "label-position": "inside" } }, [t("CInput", { ref: "email", attrs: { placeholder: e.$t("_common:email").capitalize() }, model: { value: e.email, callback: function(i) {
331
+ e.email = typeof i == "string" ? i.trim() : i;
332
+ }, expression: "email" } })], 1), t("CPhoneInput", { ref: "cellphone", staticStyle: { "margin-bottom": "calc(1.5 * var(--rem))" }, attrs: { label: e.$t("_common:cellphone").capitalize(), placeholder: e.$t("placeholders.cellphone"), region: e.cellphoneRegion, "default-region": e.companyRegion, "label-position": "inside" }, on: { "update:region": function(i) {
333
+ e.cellphoneRegion = i;
334
+ } }, model: { value: e.cellphone, callback: function(i) {
335
+ e.cellphone = i;
336
+ }, expression: "cellphone" } }), e.documentRole ? t("CDropdown", { staticStyle: { "margin-bottom": "calc(1 * var(--rem))" }, attrs: { expanded: "" } }, [t("CButton", { staticClass: "is-left", staticStyle: { width: "100%" }, attrs: { slot: "trigger", "dropdown-icon": !0, "icon-props": {
337
+ stroke: "hsl(0, 0%, 50%)"
338
+ }, "icon-left": e.documentRole === "signee" ? "pen-tool" : "eye", type: "none", pattern: "secondary" }, slot: "trigger" }, [t("div", { staticStyle: { "line-height": "1.25", padding: "4px 0" } }, [t("div", [e._v(" " + e._s(e.$t(`_common:documentRole.${e.documentRole}.description`)) + " ")]), t("div", { staticStyle: { "font-size": "12px", opacity: "0.7" } }, [e._v(" " + e._s(e.$t(`_common:documentRole.${e.documentRole}.label`)) + " ")])])]), e._l(["signee", "recipient", "approver"], function(i) {
339
+ return t("CDropdownItem", { key: i, attrs: { "icon-left": i === "signee" ? "pen-tool" : "eye", "icon-props": {
340
+ stroke: "hsl(0, 0%, 50%)"
341
+ } }, on: { click: function(n) {
342
+ return e.$emit("update:document-role", i);
343
+ } } }, [t("div", { staticStyle: { "line-height": "1.25", padding: "4px 0" } }, [t("div", [e._v(e._s(e.$t(`_common:documentRole.${i}.description`)))]), t("div", { staticStyle: { "font-size": "12px", opacity: "0.7" } }, [e._v(" " + e._s(e.$t(`_common:documentRole.${i}.label`)) + " ")])])]);
344
+ })], 2) : e._e(), t("CButton", { attrs: { type: "secondary", pattern: "tertiary", size: "small", "icon-left": "arrow-right" }, on: { click: function(i) {
345
+ return e.$emit("show-more");
346
+ } } }, [e._v(" " + e._s(e.$t("showMore").capitalize()) + " ")]), t("CButton", { staticClass: "mt-4", staticStyle: { padding: "16px", "border-radius": "8px", height: "100%", "font-size": "14px", "font-weight": "600", "box-shadow": "0 2px 4px -1px rgba(0, 0, 0, 0.1)" }, attrs: { loading: e.isPosting, "native-type": "submit", type: "secondary", wide: "", size: "medium" } }, [e._v(" " + e._s(e.$t("updateButton")) + " ")])], 1) : t("div", { class: { "column-only": e.windowWidth <= 600 } }, [t("div", { staticClass: "flex items-center justify-center", staticStyle: { "margin-bottom": "calc(2.5 * var(--rem))" } }, [t("div", { staticClass: "type-toggle" }, [t("div", { staticClass: "type-toggle-button", class: { active: e.type === "individual" }, on: { click: function(i) {
347
+ e.type = "individual";
348
+ } } }, [e._v(" " + e._s(e.$t("individual")) + " ")]), t("div", { staticClass: "type-toggle-button", class: { active: e.type === "company" }, on: { click: function(i) {
349
+ e.type = "company";
350
+ } } }, [e._v(" " + e._s(e.$t("_common:company").capitalize()) + " ")])])]), t("CField", { staticClass: "flex", attrs: { grouped: "" } }, [t("CField", { attrs: { label: e.isIndivid ? e.$t("_common:name").capitalize() : e.$t("_common:company").capitalize(), validator: e.$v.name, messages: e.messages.name, "label-position": "inside", expanded: "" } }, [t("ClientAutocomplete", { ref: "name", attrs: { placeholder: e.isIndivid ? e.$t("placeholders.name") : e.$t("placeholders.companyName"), "show-loading": !0, "search-enabled": e.searchEnabled }, on: { setClient: function(i) {
351
+ return e.$emit("setClient", i);
352
+ } }, model: { value: e.name, callback: function(i) {
353
+ e.name = i;
354
+ }, expression: "name" } })], 1), t("CField", { attrs: { label: e.isIndivid ? e.$t("_common:socialNo").capitalize() : e.$t("_common:orgNoShort").capitalize(), validator: e.$v.orgNo, messages: e.isIndivid ? e.messages.orgNo : e.messages.realOrgNo, "label-position": "inside", expanded: "" } }, [t("CInput", { ref: "orgNo", attrs: { placeholder: e.isIndivid ? e.$t("placeholders.socialNo") : e.$t("placeholders.orgNo") }, model: { value: e.orgNo, callback: function(i) {
355
+ e.orgNo = i;
356
+ }, expression: "orgNo" } })], 1)], 1), t("Animation", [e.type && !e.isIndivid ? t("CField", { staticClass: "pb-4", attrs: { validator: e.$v.reference, messages: e.messages.reference, label: e.$t("_common:reference").capitalize(), "label-position": "inside" } }, [t("CInput", { ref: "reference", attrs: { placeholder: e.$t("placeholders.reference") }, model: { value: e.reference, callback: function(i) {
357
+ e.reference = i;
358
+ }, expression: "reference" } })], 1) : e._e(), e.type && !e.isIndivid && e.feature("reverseVat") && e.feature("regionSE") ? t("CField", { staticStyle: { "padding-left": "0.5em", "margin-bottom": "calc(2 * var(--rem))" } }, [t("CCheckbox", { attrs: { size: "normal" }, model: { value: e.reverseVat, callback: function(i) {
359
+ e.reverseVat = i;
360
+ }, expression: "reverseVat" } }, [e._v(" " + e._s(e.$t("_common:vat.reverseVat")) + " ")])], 1) : e._e()], 1), t("CField", { staticClass: "flex", attrs: { grouped: "" } }, [t("CField", { staticClass: "flex-1", attrs: { validator: e.$v.email, messages: e.messages.email, label: e.$t("_common:email").capitalize(), "label-position": "inside", expanded: "" } }, [t("CInput", { ref: "email", attrs: { placeholder: e.$t("_common:email").capitalize() }, model: { value: e.email, callback: function(i) {
361
+ e.email = typeof i == "string" ? i.trim() : i;
362
+ }, expression: "email" } })], 1), t("CPhoneInput", { staticClass: "flex-1", staticStyle: { "margin-bottom": "calc(1.5 * var(--rem))" }, attrs: { label: e.$t("_common:cellphone").capitalize(), placeholder: e.$t("placeholders.cellphone"), region: e.cellphoneRegion, "default-region": e.companyRegion, "label-position": "inside" }, on: { "update:region": function(i) {
363
+ e.cellphoneRegion = i;
364
+ } }, model: { value: e.cellphone, callback: function(i) {
365
+ e.cellphone = i;
366
+ }, expression: "cellphone" } })], 1), t("CField", { attrs: { label: e.$t("_common:address").capitalize(), "label-position": "inside" } }, [t("CInput", { ref: "street", attrs: { placeholder: e.$t("placeholders.address") }, model: { value: e.street, callback: function(i) {
367
+ e.street = i;
368
+ }, expression: "street" } })], 1), t("CField", { staticClass: "force-two flex", attrs: { grouped: "" } }, [t("CField", { attrs: { expanded: "" } }, [t("CInput", { ref: "zip", attrs: { placeholder: e.$t("_common:zip").capitalize() }, model: { value: e.zip, callback: function(i) {
369
+ e.zip = i;
370
+ }, expression: "zip" } })], 1), t("CField", { attrs: { expanded: "" } }, [t("CInput", { ref: "city", attrs: { placeholder: e.$t("_common:city").capitalize() }, model: { value: e.city, callback: function(i) {
371
+ e.city = i;
372
+ }, expression: "city" } })], 1)], 1), t("CField", { staticClass: "flex" }, [t("CRadio", { staticStyle: { "margin-bottom": "0.5em" }, attrs: { "native-value": !1, type: "secondary", size: "small" }, model: { value: e.separateWorkAddress, callback: function(i) {
373
+ e.separateWorkAddress = i;
374
+ }, expression: "separateWorkAddress" } }, [e._v(" " + e._s(e.$t("seperateWorkAddress.false")) + " ")]), t("CRadio", { staticStyle: { "margin-bottom": "0.5em" }, attrs: { "native-value": !0, type: "secondary", size: "small" }, model: { value: e.separateWorkAddress, callback: function(i) {
375
+ e.separateWorkAddress = i;
376
+ }, expression: "separateWorkAddress" } }, [e._v(" " + e._s(e.$t("seperateWorkAddress.true")) + " ")])], 1), t("Animation", [e.type && e.separateWorkAddress ? t("div", [t("CField", { attrs: { label: e.$t("_common:addressWork").capitalize() + ` ( ${e.$t("workAddressSubLabel")} )` } }, [t("CInput", { ref: "workStreet", attrs: { placeholder: e.$t("placeholders.address") }, model: { value: e.workStreet, callback: function(i) {
377
+ e.workStreet = i;
378
+ }, expression: "workStreet" } })], 1), t("CField", { staticClass: "force-two flex", attrs: { grouped: "" } }, [t("CField", { attrs: { expanded: "" } }, [t("CInput", { ref: "workZip", attrs: { placeholder: e.$t("_common:zip").capitalize(), expanded: "" }, model: { value: e.workZip, callback: function(i) {
379
+ e.workZip = i;
380
+ }, expression: "workZip" } })], 1), t("CField", { attrs: { expanded: "" } }, [t("CInput", { ref: "workCity", attrs: { placeholder: e.$t("_common:city").capitalize(), expanded: "" }, model: { value: e.workCity, callback: function(i) {
381
+ e.workCity = i;
382
+ }, expression: "workCity" } })], 1)], 1)], 1) : e._e()]), e.documentRole || e.answerMethod ? t("CField", { staticClass: "flex pt-4", attrs: { grouped: "" } }, [e.documentRole ? t("div", { staticClass: "dropdown-field-wrapper flex min-w-0 flex-col" }, [t("div", { staticClass: "my-1 text-sm text-gray-600" }, [e._v(" " + e._s(e.$t("_common:documentRole.title")) + " ")]), t("CDropdown", { staticStyle: { "margin-bottom": "calc(1 * var(--rem))" }, attrs: { expanded: "" } }, [t("CButton", { staticClass: "is-left", attrs: { slot: "trigger", "dropdown-icon": !0, "icon-props": {
383
+ stroke: "hsl(0, 0%, 50%)"
384
+ }, "icon-left": e.documentRole === "signee" ? "pen-tool" : "eye", type: "none", pattern: "secondary", expanded: "" }, slot: "trigger" }, [t("div", { staticClass: "py-1 leading-5" }, [t("div", [e._v(" " + e._s(e.$t(`_common:documentRole.${e.documentRole}.description`)) + " ")]), t("div", { staticClass: "text-xs opacity-70" }, [e._v(" " + e._s(e.$t(`_common:documentRole.${e.documentRole}.label`)) + " ")])])]), e._l(["signee", "recipient", "approver"], function(i) {
385
+ return t("CDropdownItem", { key: i, attrs: { "icon-left": i === "signee" ? "pen-tool" : "eye", "icon-props": {
386
+ stroke: "hsl(0, 0%, 50%)"
387
+ } }, on: { click: function(n) {
388
+ return e.$emit("update:document-role", i);
389
+ } } }, [t("div", { staticStyle: { "line-height": "1.25", padding: "4px 0" } }, [t("div", [e._v(e._s(e.$t(`_common:documentRole.${i}.description`)))]), t("div", { staticStyle: { "font-size": "12px", opacity: "0.7" } }, [e._v(" " + e._s(e.$t(`_common:documentRole.${i}.label`)) + " ")])])]);
390
+ })], 2)], 1) : e._e(), e.answerMethod ? t("div", { staticClass: "dropdown-field-wrapper flex min-w-0 flex-col" }, [t("div", { staticClass: "my-1 text-sm text-gray-600" }, [e._v(" " + e._s(e.$t("_common:signMethod.title")) + " ")]), t("CDropdown", { staticStyle: { "margin-bottom": "calc(1 * var(--rem))" }, attrs: { expanded: "" } }, [t("CButton", { staticClass: "is-left", attrs: { slot: "trigger", "dropdown-icon": !0, type: "none", pattern: "secondary", expanded: "" }, slot: "trigger" }, [t("div", { staticClass: "max-w-[calc(16_*_var(--rem))] py-1 leading-5" }, [t("div", [e._v(e._s(e.$t(`signMethod.${e.answerMethod.accept}.title`)))]), t("div", { staticClass: "truncate text-xs opacity-70" }, [e._v(" " + e._s(e.$t(`signMethod.${e.answerMethod.accept}.content`)) + " ")])])]), e._l(e.signOptions, function(i) {
391
+ return t("CDropdownItem", { key: i, on: { click: function(n) {
392
+ return e.$emit("update:answer-method", {
393
+ ...e.answerMethod,
394
+ accept: i
395
+ });
396
+ } } }, [t("div", { staticStyle: { "line-height": "1.25", padding: "4px 0" } }, [t("div", [e._v(e._s(e.$t(`signMethod.${i}.title`)))]), t("div", { staticClass: "max-w-[calc(12_*_var(--rem))] truncate", staticStyle: { "font-size": "12px", opacity: "0.7", "text-wrap": "wrap" } }, [e._v(" " + e._s(e.$t(`signMethod.${i}.content`)) + " ")])])]);
397
+ })], 2)], 1) : e._e()]) : e._e(), t("div", { staticStyle: { "margin-top": "calc(3 * var(--rem))" } }, [t("CButton", { staticStyle: { padding: "16px", "border-radius": "8px", height: "100%", "font-size": "14px", "font-weight": "600", "box-shadow": "0 2px 4px -1px rgba(0, 0, 0, 0.1)" }, attrs: { loading: e.isPosting, type: "secondary", wide: "" }, on: { click: e.validateForm } }, [e._v(e._s(e.$t("updateButton")))])], 1)], 1)]);
398
+ }, z = [], O = /* @__PURE__ */ u(
399
+ F,
400
+ M,
401
+ z,
402
+ !1,
403
+ null,
404
+ "2405400e"
405
+ );
406
+ const R = O.exports, { mapFields: q } = p({
407
+ getterType: "forms/getField",
408
+ mutationType: "forms/updateField"
409
+ }), A = {
410
+ name: "ClientModal",
411
+ i18nOptions: {
412
+ namespaces: "clientModal",
413
+ messages: {
414
+ en: {
415
+ unsavedDialog: {
416
+ title: "Unsaved changes",
417
+ message: "Are you sure you want to cancel?",
418
+ cancel: "No",
419
+ submit: "Yes"
420
+ },
421
+ removeDialog: {
422
+ title: "Remove recipient",
423
+ message: "Would you like to remove recipient from the document?"
424
+ }
425
+ },
426
+ sv: {
427
+ unsavedDialog: {
428
+ title: "Osparade ändringar",
429
+ message: "Är du säker på att du vill avbryta?",
430
+ cancel: "Stanna kvar",
431
+ submit: "Ja, stäng"
432
+ },
433
+ removeDialog: {
434
+ title: "Ta bort mottagare",
435
+ message: "Vill du ta bort mottagaren från dokumentet?"
436
+ }
437
+ }
438
+ }
439
+ },
440
+ components: {
441
+ FormClient: R
442
+ },
443
+ mixins: [f],
444
+ props: {
445
+ documentClientIndex: {
446
+ type: Number,
447
+ default: 0
448
+ },
449
+ signOrder: {
450
+ type: Number,
451
+ default: 0
452
+ },
453
+ inputFocusOnMount: {
454
+ type: String,
455
+ default: ""
456
+ },
457
+ forceExpand: {
458
+ type: Boolean,
459
+ default: !1
460
+ },
461
+ signOptions: {
462
+ type: Array,
463
+ default: () => ["signature", "inPerson"]
464
+ },
465
+ setFormValue: {
466
+ type: Function,
467
+ required: !0
468
+ },
469
+ removeFormValue: {
470
+ type: Function,
471
+ required: !0
472
+ },
473
+ // Optional prop if this modal is mounted from public form
474
+ isPublicForm: {
475
+ type: Boolean,
476
+ default: !1
477
+ }
478
+ },
479
+ data() {
480
+ var e;
481
+ let a = l(this.formData, "data.defaultAnswerMethod.accept") || "signature";
482
+ return (e = this.signOptions) != null && e.length && !this.signOptions.includes(a) && ([a] = this.signOptions), {
483
+ storedNewClient: {
484
+ documentRole: "signee",
485
+ answerMethod: {
486
+ accept: a,
487
+ deny: "button"
488
+ }
489
+ },
490
+ isLoading: !1,
491
+ hasChanged: !1,
492
+ showMore: !1
493
+ };
494
+ },
495
+ computed: {
496
+ ...q({
497
+ endCustomer: "endCustomer"
498
+ }),
499
+ ...x("forms", {
500
+ formData: (a) => a.document2
501
+ }),
502
+ ...g({
503
+ can: "application/can",
504
+ feature: "application/feature",
505
+ defaultClientType: "endCustomers/defaultClientType"
506
+ }),
507
+ validateOrgNo() {
508
+ return !!(this.feature("bankId") || this.isPublicForm && b[_.brand].defaultRegion === "SE");
509
+ },
510
+ existsOnDocument() {
511
+ return !!l(this.formData, `clients[${this.documentClientIndex}]`);
512
+ }
513
+ },
514
+ created() {
515
+ this.forceExpand && (this.showMore = !0);
516
+ const a = l(
517
+ this.formData,
518
+ `clients[${this.documentClientIndex}]`,
519
+ {}
520
+ );
521
+ this.loadForm(a), ["endCustomer", "storedNewClient"].forEach(
522
+ (e) => this.$watch(e, {
523
+ deep: !0,
524
+ handler() {
525
+ this.hasChanged = !0;
526
+ }
527
+ })
528
+ );
529
+ },
530
+ methods: {
531
+ ...k({
532
+ saveClient: c.FORM_SUBMIT_ENDCUSTOMER,
533
+ showMessage: c.SHOW_MESSAGE
534
+ }),
535
+ omit: N,
536
+ loadForm(a = {}) {
537
+ this.storedNewClient = Object.assign(this.storedNewClient, a), this.endCustomer = $({
538
+ type: this.defaultClientType(),
539
+ ...a
540
+ });
541
+ },
542
+ async onSave() {
543
+ this.isLoading = !0;
544
+ let a = l(this.endCustomer, "id");
545
+ if (!this.isPublicForm) {
546
+ let e = !1;
547
+ this.endCustomer && (this.endCustomer.id ? this.can("endCustomers", "modify", this.endCustomer.id) && (e = !0) : this.can("endCustomers", "create") && (e = !0)), e && (a = await this.saveClient());
548
+ }
549
+ this.setFormValue({
550
+ key: `clients[${this.documentClientIndex}]`,
551
+ value: w(
552
+ { ...this.endCustomer, ...a && { id: a } },
553
+ { ...this.storedNewClient, signOrder: this.signOrder }
554
+ )
555
+ }), this.$emit("close"), this.isLoading = !1;
556
+ },
557
+ removeClient() {
558
+ this.showMessage({
559
+ displayType: "dialog",
560
+ type: "danger",
561
+ title: this.$t("removeDialog.title"),
562
+ message: this.$t("removeDialog.message"),
563
+ actions: {
564
+ cancel: {
565
+ text: this.$t("_common:cancel"),
566
+ callback: "cancel"
567
+ },
568
+ submit: {
569
+ text: this.$t("_common:remove"),
570
+ callback: () => {
571
+ this.removeFormValue(`clients[${this.documentClientIndex}]`), this.$emit("close");
572
+ }
573
+ }
574
+ }
575
+ });
576
+ },
577
+ close() {
578
+ return !this.hasChanged || !this.showMore ? this.$emit("close") : this.showMessage({
579
+ displayType: "dialog",
580
+ type: "danger",
581
+ title: this.$t("unsavedDialog.title"),
582
+ message: this.$t("unsavedDialog.message"),
583
+ actions: {
584
+ cancel: {
585
+ text: this.$t("unsavedDialog.cancel"),
586
+ callback: "cancel"
587
+ },
588
+ submit: {
589
+ text: this.$t("unsavedDialog.submit"),
590
+ callback: () => this.$emit("close")
591
+ }
592
+ }
593
+ });
594
+ }
595
+ }
596
+ };
597
+ var D = function() {
598
+ var e = this, t = e._self._c;
599
+ return t("div", { staticClass: "font-primary fixed inset-0 z-[1000] grid place-items-center overflow-auto bg-black bg-opacity-10 max-sm:block max-sm:min-h-full max-sm:w-full max-sm:overflow-auto sm:py-4", on: { "&click": function(i) {
600
+ return i.target !== i.currentTarget ? null : e.close.apply(null, arguments);
601
+ } } }, [t("div", { staticClass: "max-sm:h-initial relative mx-auto flex flex-col items-center rounded-xl bg-white p-10 text-lg max-sm:min-h-full max-sm:w-full max-sm:rounded-none max-sm:pt-16" }, [t("CButton", { staticClass: "z-2 absolute right-4 top-4", class: e.showMore ? "" : "sm:!hidden", attrs: { pattern: "tertiary", type: "none", circle: "", icon: "x" }, on: { click: e.close } }), t("FormClient", { staticClass: "max-w-full p-0", class: [e.showMore ? "w-[520px]" : "w-[360px]"], attrs: { "search-enabled": !0, "require-reference": !1, "simple-form": !e.showMore, "input-focus-on-mount": e.inputFocusOnMount, "document-role": e.storedNewClient.documentRole, "answer-method": e.storedNewClient.answerMethod, "sign-options": e.signOptions, "validate-org-no": e.validateOrgNo, "is-public-form": e.isPublicForm }, on: { "update:documentRole": function(i) {
602
+ return e.$set(e.storedNewClient, "documentRole", i);
603
+ }, "update:document-role": function(i) {
604
+ return e.$set(e.storedNewClient, "documentRole", i);
605
+ }, "update:answerMethod": function(i) {
606
+ return e.$set(e.storedNewClient, "answerMethod", i);
607
+ }, "update:answer-method": function(i) {
608
+ return e.$set(e.storedNewClient, "answerMethod", i);
609
+ }, setClient: function(i) {
610
+ e.loadForm(e.omit(i, ["answerMethod"]));
611
+ }, submit: e.onSave, "show-more": function(i) {
612
+ e.showMore = !0;
613
+ } } }), e.existsOnDocument && e.mq === "sm" ? t("CButton", { staticClass: "mt-4 text-sm", attrs: { type: "danger", pattern: "secondary", wide: "" }, on: { click: e.removeClient } }, [e._v(" " + e._s(e.$t("_common:remove")) + " ")]) : e._e()], 1)]);
614
+ }, B = [], E = /* @__PURE__ */ u(
615
+ A,
616
+ D,
617
+ B,
618
+ !1,
619
+ null,
620
+ null
621
+ );
622
+ const U = E.exports;
623
+ export {
624
+ U as default
625
+ };