@cling-se/widget 0.13.1 → 0.13.2

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 (136) hide show
  1. package/README.md +27 -22
  2. package/dist/{AddClientCallout-fd6dc000.js → AddClientCallout-7LpWNu29.js} +11 -16
  3. package/dist/{AnswerModal-7c83d608.js → AnswerModal-DnTU4eo8.js} +1931 -1948
  4. package/dist/{AttachmentItem-468fd65c.js → AttachmentItem-DcwbrFUh.js} +15 -18
  5. package/dist/{BaseDatePicker-1975be7c.js → BaseDatePicker-BpyeJH3N.js} +139 -142
  6. package/dist/{BaseInput-2ca68242.js → BaseInput-DJreiE5M.js} +77 -56
  7. package/dist/{BaseUpload-a37ee3a3.js → BaseUpload-iosxX2-N.js} +208 -212
  8. package/dist/{BlockMedia-9fa610ce.js → BlockMedia-DnbdVEZz.js} +6 -8
  9. package/dist/{CCallout-4c253200.js → CCallout-CgviPbdr.js} +26 -16
  10. package/dist/{CDropdownItem-7e71da85.js → CDropdownItem-CTJ55d4m.js} +51 -50
  11. package/dist/{CField-823448be.js → CField-FGP7ehRq.js} +75 -58
  12. package/dist/{CPhoneFormat-54baa501.js → CPhoneFormat-8u5dmTPd.js} +5 -7
  13. package/dist/{CSlider.vue_vue_type_style_index_0_lang-ceb19661.js → CTabs.vue_vue_type_style_index_0_scoped_e02a6440_lang-Dc_pbPEA.js} +6 -8
  14. package/dist/{ClientAutocomplete-186cc118.js → ClientAutocomplete-hcl0bJxO.js} +11 -13
  15. package/dist/{ClientModal-c5ee3885.js → ClientModal-B8PkUqY2.js} +25 -32
  16. package/dist/{ColorPicker-65a47379.js → ColorPicker-6AIHrfJ5.js} +5 -7
  17. package/dist/{CompanyModal-564e2b35.js → CompanyModal-H4hHfy7Y.js} +28 -30
  18. package/dist/{ContentWrapper-ac56e749.js → ContentWrapper-CHZtfhFI.js} +25 -43
  19. package/dist/{CoverBlockSettings-8949a330.js → CoverBlockSettings-etwL5N5l.js} +20 -31
  20. package/dist/{DocAnswer-2c0cb58f.js → DocAnswer-Udn1ItYd.js} +5 -12
  21. package/dist/{DocDetails-6522bb1b.js → DocDetails-BQz-is7P.js} +47 -59
  22. package/dist/{DocForm-983d41f5.js → DocForm-Cvuxr89v.js} +4869 -4944
  23. package/dist/{DocFormSend-787ce614.js → DocFormSend-Bo6YPSMr.js} +15 -33
  24. package/dist/DocLinks-DlWyanFQ.js +38 -0
  25. package/dist/{DocModalBase-60c69c7f.js → DocModalBase-BnuOPozg.js} +8 -10
  26. package/dist/{DocPrint-78c501ca.js → DocPrint-Uw8zz2tr.js} +6 -10
  27. package/dist/{DocReceipt-ac44b93f.js → DocReceipt-DsRzRjD8.js} +11 -15
  28. package/dist/{DocSendReminder-6cf2424c.js → DocSendReminder-BEEEh-L9.js} +2 -6
  29. package/dist/{DocTextEditor-81f63135.js → DocTextEditor-C-qeLSQa.js} +2509 -2529
  30. package/dist/{DocTimeline-35106a94.js → DocTimeline-Bz29bHJu.js} +26 -37
  31. package/dist/{DocumentClient-eda56a3c.js → DocumentClient-1O7wxh-X.js} +15 -22
  32. package/dist/{DocumentLayout-4005baa4.js → DocumentLayout-BrN5peVY.js} +4510 -4527
  33. package/dist/{DocumentLogotype-0d7d5080.js → DocumentLogotype-Bbas4MsY.js} +20 -22
  34. package/dist/DocumentVoided-Dy-pp_ng.js +25 -0
  35. package/dist/{EmbedInput-8c301d27.js → EmbedInput-bXXwMP4u.js} +9 -12
  36. package/dist/{EmbedSettings-05ab2762.js → EmbedSettings-BA2THNrd.js} +6 -9
  37. package/dist/ErrorCallout-Dvy9895L.js +28 -0
  38. package/dist/{FilePreviewModal-743fe489.js → FilePreviewModal-r84Ah3lE.js} +8 -14
  39. package/dist/{Flag-a6b545e0.js → Flag-CDN9A_59.js} +18 -20
  40. package/dist/{HeaderSettings-b739ddbb.js → HeaderSettings-DoDFhLcR.js} +34 -49
  41. package/dist/{ImageSelectModal-b626ef57.js → ImageSelectModal-D6ifkvIw.js} +12 -20
  42. package/dist/{ImageUploadWrapper-be047810.js → ImageUploadWrapper-K0-MmL-L.js} +356 -384
  43. package/dist/{Index-071b97c8.js → Index-3p6X7Ln-.js} +24 -26
  44. package/dist/{Index-c049a6e2.js → Index-B26J4tXQ.js} +7 -9
  45. package/dist/{Index-8f237754.js → Index-B6gB5CD3.js} +6 -8
  46. package/dist/{Index-b56a2d94.js → Index-B6u3OUGH.js} +20 -23
  47. package/dist/{Index-ecbffb52.js → Index-BN64idjX.js} +18 -31
  48. package/dist/{Index-a52df5e2.js → Index-BNGaREiU.js} +14 -21
  49. package/dist/{Index-4298f3e2.js → Index-BNeg0lcx.js} +13 -15
  50. package/dist/{Index-56e4127a.js → Index-BQVjSt_5.js} +29 -29
  51. package/dist/Index-BVNgUe07.js +21 -0
  52. package/dist/{Index-3f02e8ca.js → Index-Be-J2RvQ.js} +8 -11
  53. package/dist/{Index-848bb05c.js → Index-Btlub0dK.js} +11 -13
  54. package/dist/{Index-4f119d80.js → Index-BtzGGZEN.js} +459 -510
  55. package/dist/{Index-8ea1a895.js → Index-ByCpvqCC.js} +16 -21
  56. package/dist/{Index-5bf8b9b7.js → Index-CSg7HLqX.js} +8 -10
  57. package/dist/{Index-54f457ee.js → Index-CUZJomAi.js} +10 -12
  58. package/dist/{Index-63aea2b8.js → Index-Cj_3udAp.js} +12 -21
  59. package/dist/{Index-6b66b9ff.js → Index-CnOdi4ux.js} +4 -6
  60. package/dist/{Index-8e82da74.js → Index-DT9AWIQ2.js} +12 -15
  61. package/dist/Index-DWHl_jys.js +24 -0
  62. package/dist/{Index-fe0e805b.js → Index-Di3ibm8r.js} +51 -58
  63. package/dist/Index-Dk-kPbWy.js +52 -0
  64. package/dist/Index-Dl87oWQa.js +49 -0
  65. package/dist/{Index-a3920b7b.js → Index-DnDY3FUU.js} +9 -11
  66. package/dist/{Index-8ebe3371.js → Index-DoKh3I_O.js} +19 -26
  67. package/dist/{Index-c349151b.js → Index-DvA5sZ1U.js} +7 -9
  68. package/dist/{Index-01224b38.js → Index-DwlzPadK.js} +233 -273
  69. package/dist/{Index-b2de3af8.js → Index-ID37TIgR.js} +2 -4
  70. package/dist/Index-TPRXPN4a.js +26 -0
  71. package/dist/{Index-8cfeac73.js → Index-YdyeCcFX.js} +80 -90
  72. package/dist/{Index-97c18be1.js → Index-b0dDsObZ.js} +5 -9
  73. package/dist/{Index-caebb616.js → Index-bIYFzizT.js} +4 -6
  74. package/dist/{Index-4b09d0fa.js → Index-d5iMi4y5.js} +116 -118
  75. package/dist/{Index-ea1e223d.js → Index-oYQ9EfP9.js} +16 -18
  76. package/dist/{Index-f1bf6520.js → Index-phsroK51.js} +6 -8
  77. package/dist/{InputToggleRow-f86fdf91.js → InputToggleRow-ClHkgn7s.js} +3 -5
  78. package/dist/{ManualPopover-d7c2a780.js → ManualPopover-DrhgZvGC.js} +1 -3
  79. package/dist/{MediaWrapper-2381bc95.js → MediaWrapper-BxNEJOT7.js} +3 -6
  80. package/dist/{NotBindingText-a9eae0b2.js → NotBindingText-BhKMdYBN.js} +5 -7
  81. package/dist/{PackageGroup-95d99d03.js → PackageGroup--pDNkIMj.js} +35 -59
  82. package/dist/{PdfTerms-4a6d6067.js → PdfTerms-BL34ex7f.js} +11 -18
  83. package/dist/{PdfViewer-8d7f2143.js → PdfViewer-CPSINxc8.js} +25 -29
  84. package/dist/{PlainHtml-9d3f71d6.js → PlainHtml-Dc76U4EV.js} +5 -7
  85. package/dist/{PriceHeader-f2cb6529.js → PriceHeader-CEGF-DO3.js} +113 -130
  86. package/dist/SearchApi-D4yY2KZj.js +161 -0
  87. package/dist/{Setup-74c47337.js → Setup-BJIY_mWN.js} +9 -11
  88. package/dist/{TermsSettings-0c5a6cad.js → TermsSettings-DM4pvL-n.js} +6 -12
  89. package/dist/{ThemeColorRow-bbf4f527.js → ThemeColorRow-D7TCU3ap.js} +8 -10
  90. package/dist/{ToggleBinding-50af6f0f.js → ToggleBinding-CSgFUF6o.js} +7 -9
  91. package/dist/{UploadModal-d2757015.js → UploadModal-Cz7o7DeT.js} +16 -19
  92. package/dist/{VideoPlayerInput-cb6c91e8.js → VideoPlayerInput-Db0RRtb5.js} +6 -8
  93. package/dist/{VideoPlayerSettings-bff30628.js → VideoPlayerSettings-BgbNuWbP.js} +7 -11
  94. package/dist/{VideoSelectModal-9ec9ecfc.js → VideoSelectModal-BIKeCzUZ.js} +20 -28
  95. package/dist/{answerDocumentMixin-9368852c.js → answerDocumentMixin-Bqg9Of1S.js} +5 -5
  96. package/dist/{debounce-f8aeabc5.js → debounce-DceKdgy2.js} +3 -3
  97. package/dist/{dom-962579a6.js → dom-CPYqHOIw.js} +2 -2
  98. package/dist/{focusDrawerMixin-e2312605.js → focusDrawerMixin-Cx41U1xU.js} +1 -1
  99. package/dist/{formComponentsInstall-6894b988.js → formComponentsInstall-CWgaR4yB.js} +1198 -1171
  100. package/dist/{formDrawerState-b99be3a7.js → formDrawerState-DLCSwrgc.js} +1 -1
  101. package/dist/{formValidationMixin-a9a35060.js → formValidationMixin-CsLym0iM.js} +2 -2
  102. package/dist/{index-b2348f09.js → index-0kj8-T7-.js} +39 -44
  103. package/dist/{index-9d1ade78.js → index-4MqvoLi4.js} +3 -5
  104. package/dist/{index-96e9db00.js → index-By9c7IPL.js} +41 -59
  105. package/dist/{index-d35e9363.js → index-C16hoSRM.js} +5 -3
  106. package/dist/{index-c9186403.js → index-C6C4uskP.js} +14 -16
  107. package/dist/{IsPremiumPreStep-27645ee9.js → index-Cp7dG8Zm.js} +531 -566
  108. package/dist/index.es.js +3 -3
  109. package/dist/index.umd.js +1019 -1028
  110. package/dist/{main-b9ea9725.js → main-DBw231uy.js} +21733 -21943
  111. package/dist/{mapFormMixin-de4a37c3.js → mapFormMixin-BrtcYsT9.js} +1 -2
  112. package/dist/{vuedraggable.umd-1b113186.js → omit-DQqb9hkZ.js} +143 -133
  113. package/dist/{publicSenderState-a2c0cc9d.js → publicSenderState-BysO0Mzz.js} +1 -1
  114. package/dist/{splitpanes-ba7897bf.js → splitpanes-BHUVsCZF.js} +38 -42
  115. package/dist/style.css +2 -2
  116. package/dist/{throttle-53a6c735.js → throttle-DKrISvLg.js} +2 -2
  117. package/dist/{tinycolor-071e269c.js → tinycolor-Be3bF6zy.js} +6 -6
  118. package/dist/{tippy.esm-1b89bf69.js → tippy.esm-yjYH8SnL.js} +226 -232
  119. package/dist/{utils-44a35f52.js → utils-DP30AdJH.js} +1 -1
  120. package/package.json +2 -2
  121. package/dist/DocLinks-d6b1b080.js +0 -41
  122. package/dist/DocumentVoided-fe1bd505.js +0 -27
  123. package/dist/ErrorCallout-87033b39.js +0 -30
  124. package/dist/Index-6bfbbbd2.js +0 -61
  125. package/dist/Index-6c21af02.js +0 -28
  126. package/dist/Index-cbd0f3f6.js +0 -23
  127. package/dist/Index-f006e9fe.js +0 -26
  128. package/dist/Index-fc0516f6.js +0 -54
  129. package/dist/SearchApi-2a59cdc7.js +0 -167
  130. package/dist/index-3671e1b7.js +0 -14
  131. package/dist/index-805c56e4.js +0 -4
  132. /package/dist/{CField.vue_vue_type_style_index_0_lang-4ed993c7.js → CField.vue_vue_type_style_index_0_lang-l0sNRNKZ.js} +0 -0
  133. /package/dist/{anime.es-e284c852.js → anime.es-BrPTThYb.js} +0 -0
  134. /package/dist/{color-c1606adc.js → color-TdtKxwVa.js} +0 -0
  135. /package/dist/{i18nMessages-6b279c15.js → i18nMessages-Chz_lxGG.js} +0 -0
  136. /package/dist/{vuex.esm-4a0fff7c.js → vuex.esm-DKGl8mcw.js} +0 -0
@@ -1,163 +1,55 @@
1
- import { b as H, m as g } from "./vuex.esm-4a0fff7c.js";
2
- import { s as q, F as j } from "./Flag-a6b545e0.js";
3
- import { m } from "./mapFormMixin-de4a37c3.js";
4
- import { B as I } from "./BaseDatePicker-1975be7c.js";
5
- import { E as K } from "./ErrorCallout-87033b39.js";
6
- import { I as W, a as X, r as l } from "./IsPremiumPreStep-27645ee9.js";
7
- import { n as o, aw as O, ax as v, h as U, b as c, ay as Q, r as Y, az as G, aA as J, s as T, aB as P, aC as R, d as M, F as y } from "./main-b9ea9725.js";
8
- import Z from "./AddClientCallout-fd6dc000.js";
9
- import ee from "./ClientModal-c5ee3885.js";
10
- import { c as te, r as ie, g as se, C as h, a as f, b as p } from "./CDropdownItem-7e71da85.js";
11
- import { S as ne } from "./CSlider.vue_vue_type_style_index_0_lang-ceb19661.js";
12
- import { C as _ } from "./CCallout-4c253200.js";
13
- import { C as z } from "./CField-823448be.js";
1
+ import { m } from "./mapFormMixin-BrtcYsT9.js";
2
+ import { I as H, a as q, r as l } from "./index-Cp7dG8Zm.js";
3
+ import { n as o, ay as j, az as v, h as K, b as c, aA as W, q as X, aB as I, aC as U, r as O, aD as T, f as P, aE as M, F as y } from "./main-DBw231uy.js";
4
+ import { B as R } from "./BaseDatePicker-BpyeJH3N.js";
5
+ import { E as Q } from "./ErrorCallout-Dvy9895L.js";
6
+ import { s as Y, F as G } from "./Flag-CDN9A_59.js";
7
+ import { b as J, m as g } from "./vuex.esm-DKGl8mcw.js";
8
+ import Z from "./AddClientCallout-7LpWNu29.js";
9
+ import ee from "./ClientModal-B8PkUqY2.js";
10
+ import { c as te, r as ie, g as se, C as h, a as f, b as p } from "./CDropdownItem-CTJ55d4m.js";
11
+ import { S as ne } from "./CTabs.vue_vue_type_style_index_0_scoped_e02a6440_lang-Dc_pbPEA.js";
12
+ import { C as _ } from "./CCallout-CgviPbdr.js";
13
+ import { C as E } from "./CField-FGP7ehRq.js";
14
14
  const ae = {
15
- name: "DocumentSendReminderItem",
16
- props: {
17
- label: {
18
- type: String,
19
- required: !0
20
- },
21
- value: {
22
- type: [Number, String],
23
- default: 0
15
+ name: "CFormField",
16
+ components: {
17
+ CField: E
18
+ },
19
+ extends: j,
20
+ computed: {
21
+ type() {
22
+ return this.hasErrors ? "is-danger" : this.isValid ? "is-success" : null;
24
23
  },
25
- done: {
26
- type: Boolean,
27
- default: !1
24
+ customClass() {
25
+ return this.hasErrors ? "text-red-500" : this.isValid ? "text-green-500" : null;
28
26
  }
29
27
  }
30
28
  };
31
29
  var re = function() {
32
30
  var e = this, i = e._self._c;
33
- return i("div", { staticClass: "mb-4 flex min-h-[2.5em] select-none items-center rounded-md bg-gray-100 px-4 py-2 text-sm font-medium" }, [i("div", { staticClass: "mr-6 flex-auto select-none text-gray-700" }, [e._v(" " + e._s(e.label) + " ")]), i("div", { staticClass: "flex flex-nowrap items-center justify-center text-sm" }, [e.done ? i("span", { staticClass: "text-green-500" }, [i("BaseIcon", { attrs: { type: "check", size: "18" } }), e._v(" " + e._s(e.$t("sent")) + " ")], 1) : [i("CButton", { staticClass: "!h-6 !w-6 bg-white", attrs: { icon: "minus", size: "small", circle: "", raised: "" }, on: { click: function(s) {
34
- e.$emit("input", Math.max(e.value - 1, 0));
35
- } } }), i("div", { staticClass: "min-w-[8ch] py-4 text-center text-sm font-medium text-gray-800" }, [e.value ? [e._v(" " + e._s(e.$tc("day", { count: Number(e.value) })) + " ")] : i("span", { staticClass: "text-xs text-gray-500" }, [e._v(" " + e._s(e.$t("disabled").capitalize()) + " ")])], 2), i("CButton", { staticClass: "!h-6 !w-6 bg-white", attrs: { icon: "plus", size: "small", circle: "", raised: "" }, on: { click: function(s) {
36
- return e.$emit("input", e.value + 1);
37
- } } })]], 2)]);
31
+ return i("CField", e._b({ attrs: { label: e.label, "custom-class": e.customClass, type: e.type, message: e.firstErrorMessage } }, "CField", { ...e.$attrs, ...e.$props }, !1), [e._t("default")], 2);
38
32
  }, oe = [], le = /* @__PURE__ */ o(
39
33
  ae,
40
34
  re,
41
35
  oe,
42
36
  !1,
43
37
  null,
44
- null,
45
- null,
46
- null
47
- );
48
- const de = le.exports, ce = {
49
- name: "DocumentSendReminders",
50
- i18nOptions: {
51
- namespaces: "documentSendReminders",
52
- messages: {
53
- en: {
54
- description: "Edit when smart reminders should be sent to client",
55
- notViewed: "Not viewed after",
56
- notAnswered: "No reply after",
57
- expires: "When expiration date is within"
58
- },
59
- sv: {
60
- description: "Ställ in när smarta påminnelser ska skickas ut till mottagaren",
61
- notViewed: "Inte öppnat efter",
62
- notAnswered: "Inte svarat efter",
63
- expires: "När giltighetstiden är inom"
64
- }
65
- }
66
- },
67
- components: {
68
- DocumentSendReminderItem: de
69
- },
70
- mixins: [m()],
71
- props: {
72
- setFormValue: {
73
- type: Function,
74
- required: !0
75
- },
76
- removeFormValue: {
77
- type: Function,
78
- required: !0
79
- }
80
- },
81
- computed: {
82
- reminders() {
83
- const t = {
84
- first: null,
85
- notViewed: null,
86
- notAnswered: null,
87
- expires: null
88
- };
89
- return this._document.reminders.forEach((e, i) => {
90
- e.type === "first" ? t.first = { ...e, index: i } : e.type === "viewed" ? t.notViewed = { ...e, index: i } : e.type === "expires" ? t.expires = { ...e, index: i } : t.notAnswered = { ...e, index: i };
91
- }), t;
92
- }
93
- },
94
- methods: {
95
- getDefaultReminders() {
96
- if (!this._document.template)
97
- return [];
98
- const t = this._document.template.getDefaultData({
99
- path: "properties.data.properties.reminders"
100
- });
101
- return t && Array.isArray(t) ? t : [];
102
- },
103
- setReminder(t, e) {
104
- let i = "sendDays";
105
- if (typeof e == "string" && (i = "sendAt"), !e) {
106
- this.removeFormValue(`data.reminders[${t.index}]`);
107
- return;
108
- }
109
- if (typeof t == "string") {
110
- let s = this.getDefaultReminders().find(
111
- (n) => n.type === t
112
- );
113
- if (s || (s = O.default.find((n) => n.type === t)), !s)
114
- throw new Error("Could not find default reminder");
115
- s[i] = e, this.setFormValue({ key: "data.reminders", value: s });
116
- return;
117
- }
118
- this.setFormValue({
119
- key: `data.reminders[${t.index}].${i}`,
120
- value: e
121
- });
122
- }
123
- }
124
- };
125
- var ue = function() {
126
- var e = this, i = e._self._c;
127
- return i("div", { staticStyle: { "background-color": "white", "border-radius": "calc(0.5 * var(--rem))", padding: "calc(2 * var(--rem))", "font-size": "16px" } }, [i("div", { staticStyle: { "font-size": "1.25em", "font-weight": "700", "margin-bottom": "0.25em", "text-align": "center" } }, [e._v(" " + e._s(e.$t("_common:reminder_plural").capitalize()) + " ")]), i("div", { staticClass: "text-center text-gray-600", staticStyle: { "max-width": "calc(20 * var(--rem))", margin: "0 auto calc(2 * var(--rem)) auto" } }, [e._v(" " + e._s(e.$t("description")) + " ")]), e._l([
128
- { type: "notViewed", fallbackKey: "viewed" },
129
- { type: "notAnswered", fallbackKey: "reminder" },
130
- { type: "expires", fallbackKey: "expires" }
131
- ], function(s, n) {
132
- return i("DocumentSendReminderItem", { key: n, attrs: { label: e.$t(s.type), value: e.reminders[s.type] ? e.reminders[s.type].sendDays : 0, done: e.reminders[s.type] && e.reminders[s.type].status === "successful" }, on: { input: function(a) {
133
- return e.setReminder(e.reminders[s.type] || s.fallbackKey, a);
134
- } } });
135
- }), i("div", { staticClass: "flex w-full items-center justify-center", staticStyle: { "margin-top": "calc(2.5 * var(--rem))" } }, [i("CButton", { attrs: { type: "secondary", expanded: "" }, on: { click: function(s) {
136
- return e.$emit("close");
137
- } } }, [e._v(" " + e._s(e.$t("_common:save")) + " ")])], 1)], 2);
138
- }, me = [], pe = /* @__PURE__ */ o(
139
- ce,
140
- ue,
141
- me,
142
- !1,
143
- null,
144
- null,
145
- null,
146
38
  null
147
39
  );
148
- const he = pe.exports;
149
- function N(t, e) {
40
+ const de = le.exports;
41
+ function z(t, e) {
150
42
  const i = new Date(t.getTime());
151
43
  return i.setDate(
152
44
  t.getDate() + (7 + e - t.getDay() - 1) % 7 + 1
153
45
  ), i.setHours(8, 0, 0, 0), i;
154
46
  }
155
- function E(t) {
47
+ function N(t) {
156
48
  const e = new Date(t.getTime());
157
49
  return e.setDate(e.getDate() + 1), e.setHours(10, 0, 0, 0), e;
158
50
  }
159
- let b = E(/* @__PURE__ */ new Date()), C = N(/* @__PURE__ */ new Date(), 1);
160
- const fe = {
51
+ let b = N(/* @__PURE__ */ new Date()), C = z(/* @__PURE__ */ new Date(), 1);
52
+ const ce = {
161
53
  name: "DocumentSendLater",
162
54
  i18nOptions: {
163
55
  namespaces: "documentSendLater",
@@ -183,7 +75,7 @@ const fe = {
183
75
  }
184
76
  },
185
77
  components: {
186
- BaseDatePicker: I
78
+ BaseDatePicker: R
187
79
  },
188
80
  props: {
189
81
  _document: {
@@ -218,7 +110,7 @@ const fe = {
218
110
  }
219
111
  },
220
112
  computed: {
221
- ...H("forms", {
113
+ ...J("forms", {
222
114
  formData: (t) => t.document2.data
223
115
  }),
224
116
  ...g({
@@ -241,7 +133,7 @@ const fe = {
241
133
  }
242
134
  },
243
135
  created() {
244
- b = E(/* @__PURE__ */ new Date()), C = N(/* @__PURE__ */ new Date(), 1);
136
+ b = N(/* @__PURE__ */ new Date()), C = z(/* @__PURE__ */ new Date(), 1);
245
137
  },
246
138
  methods: {
247
139
  setTime(t) {
@@ -269,14 +161,14 @@ const fe = {
269
161
  ), s = i >= 0 ? `data.reminders[${i}]` : "data.reminders";
270
162
  this.setFormValue({ key: s, value: e }), await this.onSaveDocument({ doSend: !0 }), this.backupSentFlag = !1;
271
163
  } catch (e) {
272
- U(e);
164
+ K(e);
273
165
  } finally {
274
166
  this.backupSentFlag = !1;
275
167
  }
276
168
  }
277
169
  }
278
170
  };
279
- var ge = function() {
171
+ var ue = function() {
280
172
  var e = this, i = e._self._c;
281
173
  return i("div", { staticClass: "overflow-hidden rounded-xl bg-white" }, [i("div", { staticClass: "px-6 pb-3 pt-8" }, [i("div", { staticClass: "text-md text-center font-semibold" }, [e._v(" " + e._s(e.$t("title")) + " ")]), i("div", { staticClass: "pt-8" }, e._l([
282
174
  [e.tomorrowMorning, "tomorrowMorning"],
@@ -285,21 +177,102 @@ var ge = function() {
285
177
  return i("div", { key: n, staticClass: "mb-4 flex cursor-pointer select-none items-center justify-between rounded-md border border-gray-200 bg-gray-50 p-4 text-sm hover:border-gray-300 hover:bg-gray-100 active:border-gray-400 active:bg-gray-200", on: { click: () => e.onSendAt(s[0]) } }, [i("div", { staticClass: "font-medium" }, [e._v(e._s(e.$t(s[1])))]), i("div", { staticClass: "text-gray-500" }, [e._v(" " + e._s(e.$formatDate(s[0], "p, d MMM")) + " ")])]);
286
178
  }), 0)]), i("div", { staticClass: "border-t border-gray-200 bg-gray-100 px-8 py-6", class: e.showCustom ? "" : "cursor-pointer hover:bg-gray-200", on: { click: function(s) {
287
179
  e.showCustom = !0;
288
- } } }, [i("div", { staticClass: "flex items-center text-sm" }, [i("BaseIcon", { staticClass: "text-primary-500 mr-2", attrs: { type: "calendar", size: "18" } }), i("div", { staticClass: "font-medium", domProps: { textContent: e._s(e.$t("custom.title")) } })], 1), i("Animation", [i("div", { directives: [{ name: "show", rawName: "v-show", value: e.showCustom, expression: "showCustom" }], staticClass: "mt-4" }, [i("div", { staticClass: "grid grid-cols-2 gap-4" }, [i("BaseDatePicker", { attrs: { value: e.sendAt }, on: { input: e.setDate } }), i("CInput", { attrs: { value: e.$formatDate(e.sendAt, "HH:mm"), clearable: !1, type: "time" }, on: { input: e.setTime } })], 1), e.$v.$invalid ? i("div", { staticClass: "error-wrapper" }, [i("BaseIcon", { staticClass: "text-primary-500 mr-2", attrs: { type: "calendar" } }), e._v(" " + e._s(e.$t("custom.invalid")) + " ")], 1) : e._e(), i("CButton", { staticStyle: { "margin-top": "calc(1.5 * var(--rem))" }, attrs: { loading: e.isPostingDocument, type: "secondary", wide: "" }, on: { click: function(s) {
180
+ } } }, [i("div", { staticClass: "flex items-center text-sm" }, [i("CIcon", { staticClass: "text-primary-500 mr-2", attrs: { type: "calendar", size: "18" } }), i("div", { staticClass: "font-medium", domProps: { textContent: e._s(e.$t("custom.title")) } })], 1), i("Animation", [i("div", { directives: [{ name: "show", rawName: "v-show", value: e.showCustom, expression: "showCustom" }], staticClass: "mt-4" }, [i("div", { staticClass: "grid grid-cols-2 gap-4" }, [i("BaseDatePicker", { attrs: { value: e.sendAt }, on: { input: e.setDate } }), i("CInput", { attrs: { value: e.$formatDate(e.sendAt, "HH:mm"), clearable: !1, type: "time" }, on: { input: e.setTime } })], 1), e.$v.$invalid ? i("div", { staticClass: "error-wrapper" }, [i("CIcon", { staticClass: "text-primary-500 mr-2", attrs: { type: "calendar" } }), e._v(" " + e._s(e.$t("custom.invalid")) + " ")], 1) : e._e(), i("CButton", { staticStyle: { "margin-top": "calc(1.5 * var(--rem))" }, attrs: { loading: e.isPostingDocument, type: "secondary", wide: "" }, on: { click: function(s) {
289
181
  return e.onSendAt(e.sendAt);
290
182
  } } }, [e._v(" " + e._s(e.$t("_common:send")) + " " + e._s(e.$formatDate(e.sendAt, "d MMM - p")) + " ")])], 1)])], 1)]);
291
- }, ve = [], ye = /* @__PURE__ */ o(
292
- fe,
293
- ge,
294
- ve,
183
+ }, me = [], pe = /* @__PURE__ */ o(
184
+ ce,
185
+ ue,
186
+ me,
295
187
  !1,
296
188
  null,
297
- "f68debf4",
298
- null,
299
- null
189
+ "799363f2"
300
190
  );
301
- const _e = ye.exports;
302
- const be = {
191
+ const he = pe.exports, fe = {
192
+ sv: {
193
+ title: "Skicka dokument",
194
+ nameLabel: "Dokumentnamn",
195
+ namePlaceholder: "Namn",
196
+ sendAs: "Skicka som",
197
+ validityPeriod: "Giltighetstid",
198
+ manualDelivery: "Manuell leverans",
199
+ manualDeliveryTooltip: "Skicka ut dokument till din mottagare själv. Du kan dela en länk eller en PDF.",
200
+ scheduledTooltip: "Schemalägg utskick",
201
+ clientsAreMissingContactInfo: "En eller flera mottagare saknar e-post eller mobiltelefon-nr. Dokumentet kommer inte att kunna skickas till dem.",
202
+ missingDeliveryMethod: "Välj en eller fler leveransmetoder",
203
+ sendButton: "Skicka dokument",
204
+ signMethod: {
205
+ title: "Signeringsmetod",
206
+ tooltip: "Hur ska din mottagare signera?",
207
+ button: {
208
+ title: "Standard - knapptryck",
209
+ content: "Bevisnivå: IP-adress, tidpunkt och enhet."
210
+ },
211
+ bankId: {
212
+ title: "BankId",
213
+ content: "Samma säkerhetsgrad som bankerna har."
214
+ },
215
+ signature: {
216
+ title: "Standard",
217
+ content: "Bevisnivå: IP-adress, tidpunkt och enhet."
218
+ },
219
+ inPerson: {
220
+ title: "Fysisk underskrift",
221
+ content: "Signatur på utskrivet dokument"
222
+ }
223
+ }
224
+ },
225
+ en: {
226
+ title: "Send document",
227
+ nameLabel: "Document name",
228
+ namePlaceholder: "Name",
229
+ sendAs: "Send as",
230
+ validityPeriod: "Expiration",
231
+ manualDelivery: "Manual delivery",
232
+ manualDeliveryTooltip: "Share the document with your recipient yourself. You can share a link or a PDF.",
233
+ scheduledTooltip: "Schedule delivery",
234
+ clientsAreMissingContactInfo: "Note that one or more recipients are missing an email or cellphone number. The document will not be sent to them.",
235
+ missingDeliveryMethod: "Please select one or more delivery methods",
236
+ sendButton: "Send document",
237
+ signMethod: {
238
+ title: "Signing method",
239
+ tooltip: "How do you want your client to sign?",
240
+ button: {
241
+ title: "Standard - button",
242
+ content: "Level of proof: IP address, timestamp and device."
243
+ },
244
+ bankId: {
245
+ title: "BankID",
246
+ content: "Same level of proof as the banks use."
247
+ },
248
+ signature: {
249
+ title: "Signature",
250
+ content: "Level of proof: IP address, timestamp and device."
251
+ },
252
+ inPerson: {
253
+ title: "In person",
254
+ content: "Signature on print document"
255
+ }
256
+ }
257
+ }
258
+ }, ge = {
259
+ sv: {
260
+ addFirstButton: "Lägg till mottagare",
261
+ addButton: "Lägg till mottagare",
262
+ signOrder: {
263
+ label: "Signeringsordning",
264
+ tooltip: "Signeringsordning låter dig bestämma i vilken ordning dina mottagare tar emot och signerar dokumentet."
265
+ }
266
+ },
267
+ en: {
268
+ addFirstButton: "Add recipient",
269
+ addButton: "Add recipient",
270
+ signOrder: {
271
+ label: "Signing order",
272
+ tooltip: "Signing order lets you decide the order in which your recipients receive and sign your documents."
273
+ }
274
+ }
275
+ }, ve = {
303
276
  name: "ClientSendListItem",
304
277
  props: {
305
278
  client: {
@@ -318,6 +291,10 @@ const be = {
318
291
  type: Boolean,
319
292
  default: !1
320
293
  },
294
+ allowEditClients: {
295
+ type: Boolean,
296
+ default: !0
297
+ },
321
298
  rightButton: {
322
299
  // TODO temporary in order to disable sender sign for widget context
323
300
  type: Boolean,
@@ -329,49 +306,52 @@ const be = {
329
306
  isHover: !1,
330
307
  isDropdownOpen: !1
331
308
  };
309
+ },
310
+ methods: {
311
+ onClick() {
312
+ var t;
313
+ if (this.rightButton && this.isSender)
314
+ return (t = this.$refs.dropdown) == null ? void 0 : t.toggle();
315
+ this.allowEditClients && this.$emit("open");
316
+ }
332
317
  }
333
318
  };
334
- var Ce = function() {
319
+ var ye = function() {
335
320
  var s;
336
321
  var e = this, i = e._self._c;
337
322
  return i("div", { staticClass: "rc-card flex items-center", class: {
338
323
  "is-hover": e.isHover,
339
324
  "has-controls": e.isOrder
340
- }, staticStyle: { "padding-left": "8px" }, on: { click: function(n) {
341
- e.rightButton && e.isSender ? e.$refs.dropdown.toggle() : e.$emit("open");
342
- }, "&mouseover": function(n) {
325
+ }, staticStyle: { "padding-left": "8px" }, on: { click: e.onClick, "&mouseover": function(n) {
343
326
  e.isHover = !0;
344
327
  }, "&mouseleave": function(n) {
345
328
  e.isHover = !1;
346
- } } }, [e.compact ? i("div", { staticStyle: { "font-size": "14px" } }, [i("div", [e._v(e._s(e.client.name || e.client.companyName))]), e.client.name && e.client.companyName ? i("div", { staticStyle: { "font-size": "12px", "font-weight": "500" } }, [e._v(" " + e._s(e.client.companyName) + " ")]) : e._e(), e.client.documentRole ? i("div", { staticClass: "text-gray-700", staticStyle: { "font-size": "13px", "margin-top": "4px" } }, [e._v(" " + e._s(e.$t(`_common:documentRole.${e.client.documentRole}.description`)) + " ")]) : e._e(), e.isOrder ? i("div", { staticClass: "compact-order" }, [i("BaseIcon", { staticClass: "compact-order-button", attrs: { size: "16", type: "chevron-up" }, on: { click: function(n) {
329
+ } } }, [e.compact ? i("div", { staticStyle: { "font-size": "14px" } }, [i("div", [e._v(e._s(e.client.name || e.client.companyName))]), e.client.name && e.client.companyName ? i("div", { staticStyle: { "font-size": "12px", "font-weight": "500" } }, [e._v(" " + e._s(e.client.companyName) + " ")]) : e._e(), e.client.documentRole ? i("div", { staticClass: "text-gray-700", staticStyle: { "font-size": "13px", "margin-top": "4px" } }, [e._v(" " + e._s(e.$t(`_common:documentRole.${e.client.documentRole}.description`)) + " ")]) : e._e(), e.isOrder ? i("div", { staticClass: "compact-order" }, [i("CIcon", { staticClass: "compact-order-button", attrs: { size: "16", type: "chevron-up" }, on: { click: function(n) {
347
330
  return n.preventDefault(), n.stopPropagation(), e.$emit("move", -1);
348
- } } }), i("div", { staticClass: "rc-order", staticStyle: { width: "20px", height: "20px" } }, [e._v(" " + e._s(e.client.signOrder) + " ")]), i("BaseIcon", { staticClass: "compact-order-button", attrs: { size: "16", type: "chevron-down" }, on: { click: function(n) {
331
+ } } }), i("div", { staticClass: "rc-order", staticStyle: { width: "20px", height: "20px" } }, [e._v(" " + e._s(e.client.signOrder) + " ")]), i("CIcon", { staticClass: "compact-order-button", attrs: { size: "16", type: "chevron-down" }, on: { click: function(n) {
349
332
  return n.preventDefault(), n.stopPropagation(), e.$emit("move", 1);
350
333
  } } })], 1) : e._e()]) : [i("div", { staticStyle: { width: "34px", flex: "0 0 34px", display: "inline-flex", "justify-content": "center" } }, [e.isOrder ? i("div", { staticStyle: { position: "relative", display: "inline-block" } }, [i("CButton", { staticClass: "rc-order__button up", attrs: { type: "none", pattern: "primary", circle: "", raised: "", size: "small", icon: "minus" }, on: { click: function(n) {
351
334
  return n.preventDefault(), n.stopPropagation(), e.$emit("move", -1);
352
335
  } } }), i("CButton", { staticClass: "rc-order__button down", attrs: { type: "none", pattern: "primary", circle: "", raised: "", size: "small", icon: "plus" }, on: { click: function(n) {
353
336
  return n.preventDefault(), n.stopPropagation(), e.$emit("move", 1);
354
- } } }), i("div", { staticClass: "rc-order" }, [e._v(" " + e._s(e.client.signOrder) + " ")])], 1) : i("BaseIcon", { staticClass: "text-primary-500", staticStyle: { "margin-right": "8px", flex: "0 0 18px" }, attrs: { type: e.isSender ? "send" : ["signee", "approver"].includes(e.client.documentRole) ? "pen-tool" : "eye", size: "18" } })], 1), i("div", { staticClass: "rc-data truncate-text" }, [e.client.name || e.client.companyName ? i("div", { staticStyle: { "font-weight": "500" } }, [e._v(" " + e._s(e.client.name || e.client.companyName) + " ")]) : e.isSender ? i("div", { staticClass: "text-gray-500" }, [e._v(" " + e._s(e.$t("_common:empty", { thing: e.$t("_common:reference") })) + " ")]) : i("div", { staticClass: "text-gray-500" }, [e._v(" " + e._s(e.$t("_common:missing", { thing: e.$t("_common:name") })) + " ")]), i("div", { staticClass: "text-gray-700", staticStyle: { "font-size": "12px" } }, [e.isSender ? [e.isSender ? i("span", [e._v(" " + e._s(e.$t("_common:documentRole.sender.description")) + " ")]) : e._e(), e.client.documentRole === "signee" ? i("span", [e._v(" " + e._s(e.$t(`_common:documentRole.${e.client.documentRole}.description`)) + " ")]) : e._e()] : [((s = e.client.answerMethod) == null ? void 0 : s.accept) === "inPerson" ? i("span", { staticClass: "text-red-500" }, [e._v(" " + e._s(e.$t("_common:signMethod.title")) + ": "), i("span", [e._v(" " + e._s(e.$t("_common:signMethod.inPerson")) + " ")])]) : e._e(), e.client.documentRole ? i("span", [e._v(" " + e._s(e.$t(`_common:documentRole.${e.client.documentRole}.description`)) + " ")]) : e._e(), e.client.email ? i("span", [e._v(e._s(e.client.email))]) : e._e(), e.client.cellphone ? i("span", [e._v(e._s(e.client.cellphone))]) : e._e()]], 2)])], e.rightButton ? i("transition", { attrs: { name: "fade-100" } }, [e.isHover || e.isDropdownOpen ? [e.isSender ? i("CDropdown", { ref: "dropdown", staticStyle: { position: "absolute", right: "calc(0.5 * var(--rem))" }, attrs: { position: "is-bottom-left", "menu-styling": {
337
+ } } }), i("div", { staticClass: "rc-order" }, [e._v(" " + e._s(e.client.signOrder) + " ")])], 1) : i("CIcon", { staticClass: "text-primary-500", staticStyle: { "margin-right": "8px", flex: "0 0 18px" }, attrs: { type: e.isSender ? "send" : ["signee", "approver"].includes(e.client.documentRole) ? "pen-tool" : "eye", size: "18" } })], 1), i("div", { staticClass: "rc-data truncate-text" }, [e.client.name || e.client.companyName ? i("div", { staticStyle: { "font-weight": "500" } }, [e._v(" " + e._s(e.client.name || e.client.companyName) + " ")]) : e.isSender ? i("div", { staticClass: "text-gray-500" }, [e._v(" " + e._s(e.$t("_common:empty", { thing: e.$t("_common:reference") })) + " ")]) : i("div", { staticClass: "text-gray-500" }, [e._v(" " + e._s(e.$t("_common:missing", { thing: e.$t("_common:name") })) + " ")]), i("div", { staticClass: "text-gray-700", staticStyle: { "font-size": "12px" } }, [e.isSender ? [e.isSender ? i("span", [e._v(" " + e._s(e.$t("_common:documentRole.sender.description")) + " ")]) : e._e(), e.client.documentRole === "signee" ? i("span", [e._v(" " + e._s(e.$t(`_common:documentRole.${e.client.documentRole}.description`)) + " ")]) : e._e()] : [((s = e.client.answerMethod) == null ? void 0 : s.accept) === "inPerson" ? i("span", { staticClass: "text-red-500" }, [e._v(" " + e._s(e.$t("_common:signMethod.title")) + ": "), i("span", [e._v(" " + e._s(e.$t("_common:signMethod.inPerson")) + " ")])]) : e._e(), e.client.documentRole ? i("span", [e._v(" " + e._s(e.$t(`_common:documentRole.${e.client.documentRole}.description`)) + " ")]) : e._e(), e.client.email ? i("span", [e._v(e._s(e.client.email))]) : e._e(), e.client.cellphone ? i("span", [e._v(e._s(e.client.cellphone))]) : e._e()]], 2)])], e.rightButton ? i("transition", { attrs: { name: "fade-100" } }, [e.isHover || e.isDropdownOpen ? [e.isSender ? i("CDropdown", { ref: "dropdown", staticStyle: { position: "absolute", right: "calc(0.5 * var(--rem))" }, attrs: { position: "is-bottom-left", "menu-styling": {
355
338
  minWidth: "220px"
356
339
  }, "append-to-body": "" }, on: { "active-change": function(n) {
357
340
  e.isDropdownOpen = n;
358
341
  } }, nativeOn: { click: function(n) {
359
342
  n.stopPropagation();
360
- } } }, [i("CButton", { attrs: { slot: "trigger", circle: "", size: "small", type: "none", pattern: "secondary", raised: "", icon: "more-horizontal" }, slot: "trigger" }), e._t("dropdownOptions")], 2) : i("CButton", { staticStyle: { position: "absolute", right: "calc(0.5 * var(--rem))" }, attrs: { circle: "", size: "small", icon: "x", type: "none", pattern: "secondary", raised: "" }, on: { click: function(n) {
343
+ } } }, [i("CButton", { attrs: { slot: "trigger", circle: "", size: "small", type: "none", pattern: "secondary", raised: "", icon: "more-horizontal" }, slot: "trigger" }), e._t("dropdownOptions")], 2) : e.allowEditClients ? i("CButton", { staticStyle: { position: "absolute", right: "calc(0.5 * var(--rem))" }, attrs: { circle: "", size: "small", icon: "x", type: "none", pattern: "secondary", raised: "" }, on: { click: function(n) {
361
344
  return n.stopPropagation(), e.$emit("remove");
362
- } } })] : e._e()], 2) : e._e()], 2);
363
- }, xe = [], we = /* @__PURE__ */ o(
364
- be,
365
- Ce,
366
- xe,
345
+ } } }) : e._e()] : e._e()], 2) : e._e()], 2);
346
+ }, _e = [], be = /* @__PURE__ */ o(
347
+ ve,
348
+ ye,
349
+ _e,
367
350
  !1,
368
351
  null,
369
- "bf545f05",
370
- null,
371
- null
352
+ "47fa5bc0"
372
353
  );
373
- const L = we.exports;
374
- const Se = {
354
+ const L = be.exports, Ce = {
375
355
  name: "SenderBlockItem",
376
356
  i18nOptions: {
377
357
  namespaces: "senderBlockItem",
@@ -399,6 +379,11 @@ const Se = {
399
379
  setFnName: "setFormValue"
400
380
  })
401
381
  ],
382
+ inject: {
383
+ allowSenderSign: {
384
+ default: !0
385
+ }
386
+ },
402
387
  props: {
403
388
  setFormValue: {
404
389
  type: Function,
@@ -409,11 +394,6 @@ const Se = {
409
394
  default: !1
410
395
  }
411
396
  },
412
- inject: {
413
- allowSenderSign: {
414
- default: !0
415
- }
416
- },
417
397
  data() {
418
398
  return {
419
399
  senderClientData: null
@@ -435,7 +415,7 @@ const Se = {
435
415
  "data.defaultAnswerMethod"
436
416
  );
437
417
  this.senderClientData = {
438
- ...Q(),
418
+ ...W(),
439
419
  documentRole: "recipient",
440
420
  ...i && { answerMethod: i },
441
421
  ...this.senderClient,
@@ -462,7 +442,7 @@ const Se = {
462
442
  }
463
443
  }
464
444
  };
465
- var $e = function() {
445
+ var we = function() {
466
446
  var e = this, i = e._self._c;
467
447
  return e.senderClientData ? i("RecipientBlockItem", { staticClass: "first-of-group last-of-group", staticStyle: { display: "inline-flex", width: "auto", "padding-right": "2em", "min-width": "220px" }, attrs: { client: e.senderClientData, "right-button": e.allowSenderSign, "is-sender": !0 } }, [i("template", { slot: "dropdownOptions" }, [i("CDropdownItem", { attrs: { value: !!e.senderClient, "close-on-click": !1, toggle: "" }, on: { input: e.toggleSenderSign } }, [e._v(" " + e._s(e.$t("toggle.label")) + " ")]), e.senderClient ? [i("CDropdownItem", { attrs: { separator: "" } }), i("div", { staticClass: "text-gray-400", staticStyle: { "font-size": "13px", padding: "calc(0.5 * var(--rem)) 0 calc(0.25 * var(--rem))", "font-weight": "500" } }, [e._v(" " + e._s(e.$t("_common:signMethod.title")) + " ")]), e._l([
468
448
  "login",
@@ -473,111 +453,24 @@ var $e = function() {
473
453
  return e.setSenderMethod(s);
474
454
  } } }, [e._v(" " + e._s(e.$t(`_common:signMethod.${s}`)) + " ")]);
475
455
  })] : i("div", { staticClass: "bg-gray-100 text-gray-700", staticStyle: { padding: "calc(0.5 * var(--rem))", margin: "calc(0.5 * var(--rem))", "font-size": "13px", "border-radius": "4px", "line-height": "1.25", "font-weight": "500" } }, [e._v(" " + e._s(e.$t("toggle.description")) + " ")])], 2)], 2) : e._e();
476
- }, ke = [], De = /* @__PURE__ */ o(
477
- Se,
478
- $e,
479
- ke,
456
+ }, xe = [], Se = /* @__PURE__ */ o(
457
+ Ce,
458
+ we,
459
+ xe,
480
460
  !1,
481
461
  null,
482
- "9f98b35e",
483
- null,
484
- null
462
+ "dad49914"
485
463
  );
486
- const Ve = De.exports, Fe = {
487
- sv: {
488
- title: "Skicka dokument",
489
- nameLabel: "Dokumentnamn",
490
- namePlaceholder: "Namn",
491
- sendAs: "Skicka som",
492
- validityPeriod: "Giltighetstid",
493
- manualDelivery: "Manuell leverans",
494
- manualDeliveryTooltip: "Skicka ut dokument till din mottagare själv. Du kan dela en länk eller en PDF.",
495
- scheduledTooltip: "Schemalägg utskick",
496
- clientsAreMissingContactInfo: "En eller flera mottagare saknar e-post eller mobiltelefon-nr. Dokumentet kommer inte att kunna skickas till dem.",
497
- missingDeliveryMethod: "Välj en eller fler leveransmetoder",
498
- sendButton: "Skicka dokument",
499
- signMethod: {
500
- title: "Signeringsmetod",
501
- tooltip: "Hur ska din mottagare signera?",
502
- button: {
503
- title: "Standard - knapptryck",
504
- content: "Bevisnivå: IP-adress, tidpunkt och enhet."
505
- },
506
- bankId: {
507
- title: "BankId",
508
- content: "Samma säkerhetsgrad som bankerna har."
509
- },
510
- signature: {
511
- title: "Standard",
512
- content: "Bevisnivå: IP-adress, tidpunkt och enhet."
513
- },
514
- inPerson: {
515
- title: "Fysisk underskrift",
516
- content: "Signatur på utskrivet dokument"
517
- }
518
- }
519
- },
520
- en: {
521
- title: "Send document",
522
- nameLabel: "Document name",
523
- namePlaceholder: "Name",
524
- sendAs: "Send as",
525
- validityPeriod: "Expiration",
526
- manualDelivery: "Manual delivery",
527
- manualDeliveryTooltip: "Share the document with your recipient yourself. You can share a link or a PDF.",
528
- scheduledTooltip: "Schedule delivery",
529
- clientsAreMissingContactInfo: "Note that one or more recipients are missing an email or cellphone number. The document will not be sent to them.",
530
- missingDeliveryMethod: "Please select one or more delivery methods",
531
- sendButton: "Send document",
532
- signMethod: {
533
- title: "Signing method",
534
- tooltip: "How do you want your client to sign?",
535
- button: {
536
- title: "Standard - button",
537
- content: "Level of proof: IP address, timestamp and device."
538
- },
539
- bankId: {
540
- title: "BankID",
541
- content: "Same level of proof as the banks use."
542
- },
543
- signature: {
544
- title: "Signature",
545
- content: "Level of proof: IP address, timestamp and device."
546
- },
547
- inPerson: {
548
- title: "In person",
549
- content: "Signature on print document"
550
- }
551
- }
552
- }
553
- }, Ae = {
554
- sv: {
555
- addFirstButton: "Lägg till mottagare",
556
- addButton: "Lägg till mottagare",
557
- signOrder: {
558
- label: "Signeringsordning",
559
- tooltip: "Signeringsordning låter dig bestämma i vilken ordning dina mottagare tar emot och signerar dokumentet."
560
- }
561
- },
562
- en: {
563
- addFirstButton: "Add recipient",
564
- addButton: "Add recipient",
565
- signOrder: {
566
- label: "Signing order",
567
- tooltip: "Signing order lets you decide the order in which your recipients receive and sign your documents."
568
- }
569
- }
570
- };
571
- const Be = {
464
+ const $e = Se.exports, ke = {
572
465
  name: "RecipientBlock",
573
466
  i18nOptions: {
574
467
  namespaces: "recipientBlock",
575
- messages: Ae
468
+ messages: ge
576
469
  },
577
470
  components: {
578
471
  AddClientCallout: Z,
579
472
  RecipientBlockItem: L,
580
- SenderBlockItem: Ve
473
+ SenderBlockItem: $e
581
474
  },
582
475
  mixins: [
583
476
  m(["clients"], {
@@ -602,6 +495,10 @@ const Be = {
602
495
  type: Boolean,
603
496
  default: !1
604
497
  },
498
+ allowEditClients: {
499
+ type: Boolean,
500
+ default: !0
501
+ },
605
502
  isPublicForm: {
606
503
  type: Boolean,
607
504
  default: !1
@@ -623,7 +520,7 @@ const Be = {
623
520
  },
624
521
  methods: {
625
522
  onMoveRecipient({ index: t, direction: e }) {
626
- this.clients = Y(this.clients).set(
523
+ this.clients = X(this.clients).set(
627
524
  {
628
525
  ...this.clients[t],
629
526
  signOrder: Math.max(this.clients[t].signOrder + e, 0)
@@ -642,7 +539,7 @@ const Be = {
642
539
  signOrder: i ? s.signOrder : n + 1
643
540
  }));
644
541
  } else
645
- e = c(this._document, "template.reminders", []), e.length || (e = O.default);
542
+ e = c(this._document, "template.reminders", []), e.length || (e = I.default);
646
543
  this.setFormValue({ key: "data.reminders", value: e }), this.setFormValue({ key: "useSignOrder", value: t });
647
544
  },
648
545
  removeClient(t) {
@@ -653,7 +550,7 @@ const Be = {
653
550
  this.$modal.show(ee, {
654
551
  documentClientIndex: t,
655
552
  ...this.useSignOrder && {
656
- signOrder: G(e) === "number" ? e : this.maxSignOrder + 1
553
+ signOrder: U(e) === "number" ? e : this.maxSignOrder + 1
657
554
  },
658
555
  setFormValue: this.setFormValue,
659
556
  removeFormValue: this.removeFormValue,
@@ -665,13 +562,13 @@ const Be = {
665
562
  }
666
563
  }
667
564
  };
668
- var Ie = function() {
565
+ var De = function() {
669
566
  var e = this, i = e._self._c;
670
- return i("div", [e.compact ? e._e() : [i("div", { staticClass: "pb-0.5 text-xs font-medium text-gray-900" }, [e._v(" " + e._s(e.$t("_common:from").capitalize()) + ": ")]), i("SenderBlockItem", { attrs: { _document: e._document, _value: { senderClient: "senderClient" }, "set-form-value": e.setFormValue, "default-add-sender-client": e.defaultAddSenderClient } })], i("div", { staticClass: "block-title flex pb-0.5 pt-2 text-xs text-gray-500", class: { "block-title__line": !e.compact } }, [e.compact ? e._e() : i("div", { staticClass: "font-medium text-gray-900" }, [e._v(" " + e._s(e.$t("_common:to").capitalize()) + ": ")]), e.clients && e.clients.length ? i("div", { staticClass: "ml-auto inline-flex items-center justify-end" }, [i("BaseIcon", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: e.$t("signOrder.tooltip"), expression: "$t('signOrder.tooltip')" }], staticClass: "mr-1", attrs: { type: "info", size: "14" } }), i("div", { staticClass: "mr-2 font-medium" }, [e._v(" " + e._s(e.$t("signOrder.label")) + " ")]), i("CSwitch", { staticClass: "!mr-0", attrs: { value: e.useSignOrder, size: "tiny", type: "success" }, on: { input: e.toggleSignOrder } })], 1) : e._e()]), e.clients && e.clients.length ? [e.useSignOrder ? i("transition-group", { staticClass: "list-move", attrs: { name: "list-move" } }, [e._l(e.sortedClients, function(s, n) {
567
+ return i("div", [e.compact ? e._e() : [i("div", { staticClass: "pb-0.5 text-xs font-medium text-gray-900" }, [e._v(" " + e._s(e.$t("_common:from").capitalize()) + ": ")]), i("SenderBlockItem", { attrs: { _document: e._document, _value: { senderClient: "senderClient" }, "set-form-value": e.setFormValue, "default-add-sender-client": e.defaultAddSenderClient } })], i("div", { staticClass: "block-title flex pb-0.5 pt-2 text-xs text-gray-500", class: { "block-title__line": !e.compact } }, [e.compact ? e._e() : i("div", { staticClass: "font-medium text-gray-900" }, [e._v(" " + e._s(e.$t("_common:to").capitalize()) + ": ")]), e.clients && e.clients.length ? i("div", { staticClass: "ml-auto inline-flex items-center justify-end" }, [i("CIcon", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: e.$t("signOrder.tooltip"), expression: "$t('signOrder.tooltip')" }], staticClass: "mr-1", attrs: { type: "info", size: "14" } }), i("div", { staticClass: "mr-2 font-medium" }, [e._v(" " + e._s(e.$t("signOrder.label")) + " ")]), i("CSwitch", { staticClass: "!mr-0", attrs: { value: e.useSignOrder, size: "tiny", type: "success" }, on: { input: e.toggleSignOrder } })], 1) : e._e()]), e.clients && e.clients.length ? [e.useSignOrder ? i("transition-group", { staticClass: "list-move", attrs: { name: "list-move" } }, [e._l(e.sortedClients, function(s, n) {
671
568
  return [n > 0 && s.signOrder !== e.sortedClients[n - 1].signOrder ? i("div", { key: n, staticClass: "h-2 pl-6" }, [i("div", { staticClass: "bg-primary-500 h-full w-0.5 rounded-sm" })]) : e._e(), i("div", { key: s._uniqueId, staticClass: "mb-0.5 mt-px" }, [i("RecipientBlockItem", { class: {
672
569
  "first-of-group": n === 0 || n > 0 && s.signOrder !== e.sortedClients[n - 1].signOrder,
673
570
  "last-of-group": n === e.sortedClients.length - 1 || e.sortedClients[n + 1] && s.signOrder !== e.sortedClients[n + 1].signOrder
674
- }, attrs: { client: s, "is-order": e.useSignOrder, compact: e.compact }, on: { move: function(a) {
571
+ }, attrs: { client: s, "is-order": e.useSignOrder, compact: e.compact, "allow-edit-clients": e.allowEditClients }, on: { move: function(a) {
675
572
  return e.onMoveRecipient({ index: s.index, direction: a });
676
573
  }, open: function(a) {
677
574
  return e.openClientModal(s.index);
@@ -682,42 +579,169 @@ var Ie = function() {
682
579
  return i("RecipientBlockItem", { key: s._uniqueId, staticClass: "mb-0.5 mt-px", class: {
683
580
  "first-of-group": n === 0,
684
581
  "last-of-group": n === e.clients.length - 1
685
- }, attrs: { "is-order": e.useSignOrder, compact: e.compact, client: s }, on: { open: function(a) {
582
+ }, attrs: { "is-order": e.useSignOrder, compact: e.compact, "allow-edit-clients": e.allowEditClients, client: s }, on: { open: function(a) {
686
583
  return e.openClientModal(n);
687
584
  }, remove: function(a) {
688
585
  return e.removeClient(n);
689
586
  } } });
690
- }), e.compact ? e._e() : i("CButton", { staticClass: "is-thinner !text-sm", attrs: { type: "secondary", pattern: "tertiary", "icon-left": "plus", size: "normal" }, on: { click: function(s) {
587
+ }), !e.compact && e.allowEditClients ? i("CButton", { staticClass: "is-thinner !text-sm", attrs: { type: "secondary", pattern: "tertiary", "icon-left": "plus", size: "normal" }, on: { click: function(s) {
691
588
  return e.openClientModal(e.clients.length);
692
- } } }, [e._v(" " + e._s(e.$t("addButton")) + " ")])] : e.$view === "widget" || this.viewSettings.isPublicForm ? i("CButton", { staticClass: "!px-4 font-medium", attrs: { type: "secondary", raised: "", size: "small", taller: "", "icon-left": "person" }, on: { click: function(s) {
589
+ } } }, [e._v(" " + e._s(e.$t("addButton")) + " ")]) : e._e()] : (e.$view === "widget" || e.viewSettings.isPublicForm) && e.allowEditClients ? i("CButton", { staticClass: "!px-4 font-medium", attrs: { type: "secondary", raised: "", size: "small", taller: "", "icon-left": "person" }, on: { click: function(s) {
693
590
  return e.openClientModal(e.clients.length);
694
- } } }, [e._v(" " + e._s(e.$t("addFirstButton")) + " ")]) : e.compact ? e._e() : i("AddClientCallout", { attrs: { compact: !0 }, on: { add: function(s) {
591
+ } } }, [e._v(" " + e._s(e.$t("addFirstButton")) + " ")]) : !e.compact && e.allowEditClients ? i("AddClientCallout", { attrs: { compact: !0 }, on: { add: function(s) {
695
592
  return e.openClientModal(e.clients.length);
696
- }, setClient: e.setClient } })], 2);
593
+ }, setClient: e.setClient } }) : e._e()], 2);
594
+ }, Ve = [], Fe = /* @__PURE__ */ o(
595
+ ke,
596
+ De,
597
+ Ve,
598
+ !1,
599
+ null,
600
+ "d0782eac"
601
+ );
602
+ const Ae = Fe.exports, Be = {
603
+ name: "DocumentSendReminderItem",
604
+ props: {
605
+ label: {
606
+ type: String,
607
+ required: !0
608
+ },
609
+ value: {
610
+ type: [Number, String],
611
+ default: 0
612
+ },
613
+ done: {
614
+ type: Boolean,
615
+ default: !1
616
+ }
617
+ }
618
+ };
619
+ var Ie = function() {
620
+ var e = this, i = e._self._c;
621
+ return i("div", { staticClass: "mb-4 flex min-h-[2.5em] select-none items-center rounded-md bg-gray-100 px-4 py-2 text-sm font-medium" }, [i("div", { staticClass: "mr-6 flex-auto select-none text-gray-700" }, [e._v(" " + e._s(e.label) + " ")]), i("div", { staticClass: "flex flex-nowrap items-center justify-center text-sm" }, [e.done ? i("span", { staticClass: "text-green-500" }, [i("CIcon", { attrs: { type: "check", size: "18" } }), e._v(" " + e._s(e.$t("sent")) + " ")], 1) : [i("CButton", { staticClass: "!h-6 !w-6 bg-white", attrs: { icon: "minus", size: "small", circle: "", raised: "" }, on: { click: function(s) {
622
+ e.$emit("input", Math.max(e.value - 1, 0));
623
+ } } }), i("div", { staticClass: "min-w-[8ch] py-4 text-center text-sm font-medium text-gray-800" }, [e.value ? [e._v(" " + e._s(e.$tc("day", { count: Number(e.value) })) + " ")] : i("span", { staticClass: "text-xs text-gray-500" }, [e._v(" " + e._s(e.$t("disabled").capitalize()) + " ")])], 2), i("CButton", { staticClass: "!h-6 !w-6 bg-white", attrs: { icon: "plus", size: "small", circle: "", raised: "" }, on: { click: function(s) {
624
+ return e.$emit("input", e.value + 1);
625
+ } } })]], 2)]);
697
626
  }, Oe = [], Te = /* @__PURE__ */ o(
698
627
  Be,
699
628
  Ie,
700
629
  Oe,
701
630
  !1,
702
631
  null,
703
- "c3186725",
632
+ null
633
+ );
634
+ const Pe = Te.exports, Me = {
635
+ name: "DocumentSendReminders",
636
+ i18nOptions: {
637
+ namespaces: "documentSendReminders",
638
+ messages: {
639
+ en: {
640
+ description: "Edit when smart reminders should be sent to client",
641
+ notViewed: "Not viewed after",
642
+ notAnswered: "No reply after",
643
+ expires: "When expiration date is within"
644
+ },
645
+ sv: {
646
+ description: "Ställ in när smarta påminnelser ska skickas ut till mottagaren",
647
+ notViewed: "Inte öppnat efter",
648
+ notAnswered: "Inte svarat efter",
649
+ expires: "När giltighetstiden är inom"
650
+ }
651
+ }
652
+ },
653
+ components: {
654
+ DocumentSendReminderItem: Pe
655
+ },
656
+ mixins: [m()],
657
+ props: {
658
+ setFormValue: {
659
+ type: Function,
660
+ required: !0
661
+ },
662
+ removeFormValue: {
663
+ type: Function,
664
+ required: !0
665
+ }
666
+ },
667
+ computed: {
668
+ reminders() {
669
+ const t = {
670
+ first: null,
671
+ notViewed: null,
672
+ notAnswered: null,
673
+ expires: null
674
+ };
675
+ return this._document.reminders.forEach((e, i) => {
676
+ e.type === "first" ? t.first = { ...e, index: i } : e.type === "viewed" ? t.notViewed = { ...e, index: i } : e.type === "expires" ? t.expires = { ...e, index: i } : t.notAnswered = { ...e, index: i };
677
+ }), t;
678
+ }
679
+ },
680
+ methods: {
681
+ getDefaultReminders() {
682
+ if (!this._document.template)
683
+ return [];
684
+ const t = this._document.template.getDefaultData({
685
+ path: "properties.data.properties.reminders"
686
+ });
687
+ return t && Array.isArray(t) ? t : [];
688
+ },
689
+ setReminder(t, e) {
690
+ let i = "sendDays";
691
+ if (typeof e == "string" && (i = "sendAt"), !e) {
692
+ this.removeFormValue(`data.reminders[${t.index}]`);
693
+ return;
694
+ }
695
+ if (typeof t == "string") {
696
+ let s = this.getDefaultReminders().find(
697
+ (n) => n.type === t
698
+ );
699
+ if (s || (s = I.default.find((n) => n.type === t)), !s)
700
+ throw new Error("Could not find default reminder");
701
+ s[i] = e, this.setFormValue({ key: "data.reminders", value: s });
702
+ return;
703
+ }
704
+ this.setFormValue({
705
+ key: `data.reminders[${t.index}].${i}`,
706
+ value: e
707
+ });
708
+ }
709
+ }
710
+ };
711
+ var Re = function() {
712
+ var e = this, i = e._self._c;
713
+ return i("div", { staticStyle: { "background-color": "white", "border-radius": "calc(0.5 * var(--rem))", padding: "calc(2 * var(--rem))", "font-size": "16px" } }, [i("div", { staticStyle: { "font-size": "1.25em", "font-weight": "700", "margin-bottom": "0.25em", "text-align": "center" } }, [e._v(" " + e._s(e.$t("_common:reminder_plural").capitalize()) + " ")]), i("div", { staticClass: "text-center text-gray-600", staticStyle: { "max-width": "calc(20 * var(--rem))", margin: "0 auto calc(2 * var(--rem)) auto" } }, [e._v(" " + e._s(e.$t("description")) + " ")]), e._l([
714
+ { type: "notViewed", fallbackKey: "viewed" },
715
+ { type: "notAnswered", fallbackKey: "reminder" },
716
+ { type: "expires", fallbackKey: "expires" }
717
+ ], function(s, n) {
718
+ return i("DocumentSendReminderItem", { key: n, attrs: { label: e.$t(s.type), value: e.reminders[s.type] ? e.reminders[s.type].sendDays : 0, done: e.reminders[s.type] && e.reminders[s.type].status === "successful" }, on: { input: function(a) {
719
+ return e.setReminder(e.reminders[s.type] || s.fallbackKey, a);
720
+ } } });
721
+ }), i("div", { staticClass: "flex w-full items-center justify-center", staticStyle: { "margin-top": "calc(2.5 * var(--rem))" } }, [i("CButton", { attrs: { type: "secondary", expanded: "" }, on: { click: function(s) {
722
+ return e.$emit("close");
723
+ } } }, [e._v(" " + e._s(e.$t("_common:save")) + " ")])], 1)], 2);
724
+ }, Ee = [], ze = /* @__PURE__ */ o(
725
+ Me,
726
+ Re,
727
+ Ee,
728
+ !1,
704
729
  null,
705
730
  null
706
731
  );
707
- const Pe = Te.exports;
708
- const Re = {
732
+ const Ne = ze.exports, Le = {
709
733
  name: "SendForm",
710
734
  i18nOptions: {
711
735
  namespaces: "sendForm",
712
- messages: Fe
736
+ messages: fe
713
737
  },
714
738
  components: {
715
- Simplebar: q,
716
- BaseDatePicker: I,
717
- RecipientBlock: Pe,
718
- ErrorCallout: K,
719
- IsPremiumPreStep: W,
720
- IsPremium: X
739
+ Simplebar: Y,
740
+ BaseDatePicker: R,
741
+ RecipientBlock: Ae,
742
+ ErrorCallout: Q,
743
+ IsPremiumPreStep: H,
744
+ IsPremium: q
721
745
  },
722
746
  mixins: [
723
747
  m(
@@ -745,6 +769,10 @@ const Re = {
745
769
  type: Boolean,
746
770
  default: !0
747
771
  },
772
+ allowEditClients: {
773
+ type: Boolean,
774
+ default: !0
775
+ },
748
776
  setFormValue: {
749
777
  type: Function,
750
778
  required: !0
@@ -857,8 +885,6 @@ const Re = {
857
885
  async doSaveDocument({ doSend: t }) {
858
886
  try {
859
887
  this.localIsPosting = !0, await this.onSaveDocument({ doSend: t });
860
- } catch (e) {
861
- throw e;
862
888
  } finally {
863
889
  this.localIsPosting = !1;
864
890
  }
@@ -894,7 +920,7 @@ const Re = {
894
920
  },
895
921
  openReminders() {
896
922
  this.useSignOrder || this.$modal.show(
897
- he,
923
+ Ne,
898
924
  {
899
925
  _document: this._document,
900
926
  setFormValue: this.setFormValue,
@@ -910,7 +936,7 @@ const Re = {
910
936
  },
911
937
  openSendLater() {
912
938
  this.$v.$touch(), !this.$v.$invalid && this.$modal.show(
913
- _e,
939
+ he,
914
940
  {
915
941
  _document: this._document,
916
942
  setFormValue: this.setFormValue,
@@ -936,7 +962,7 @@ const Re = {
936
962
  }
937
963
  }
938
964
  };
939
- var Me = function() {
965
+ var He = function() {
940
966
  var e = this, i = e._self._c;
941
967
  return i("IsPremium", { scopedSlots: e._u([{ key: "default", fn: function({ canUseBankId: s, canUseSms: n }) {
942
968
  var a;
@@ -944,7 +970,7 @@ var Me = function() {
944
970
  e.name = r;
945
971
  }, expression: "name" } })], 1) : e._e(), i("div", { staticClass: "mb-6" }, [i("RecipientBlock", { attrs: { _value: {
946
972
  clients: "clients"
947
- }, _document: e._document, "set-form-value": e.setFormValue, "remove-form-value": e.removeFormValue, "default-add-sender-client": e.documentSenderSign, "is-public-form": e.isPublicForm } })], 1), e._t("default"), e.defaultAnswerMethod && e.signMethods.length > 1 ? i("div", { staticClass: "mb-8" }, [i("div", { staticClass: "block-title pb-0.5 text-xs font-medium text-gray-900" }, [e._v(" " + e._s(e.$t("signMethod.title")) + " "), i("BaseIcon", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: e.$t("signMethod.tooltip"), expression: "$t('signMethod.tooltip')" }], staticClass: "ml-px text-gray-500", attrs: { type: "info", size: "14" } })], 1), i("div", { staticClass: "cb-card-group" }, e._l(e.signMethods, function(r) {
973
+ }, _document: e._document, "set-form-value": e.setFormValue, "remove-form-value": e.removeFormValue, "default-add-sender-client": e.documentSenderSign, "allow-edit-clients": e.allowEditClients, "is-public-form": e.isPublicForm } })], 1), e._t("default"), e.defaultAnswerMethod && e.signMethods.length > 1 ? i("div", { staticClass: "mb-8" }, [i("div", { staticClass: "block-title pb-0.5 text-xs font-medium text-gray-900" }, [e._v(" " + e._s(e.$t("signMethod.title")) + " "), i("CIcon", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: e.$t("signMethod.tooltip"), expression: "$t('signMethod.tooltip')" }], staticClass: "ml-px text-gray-500", attrs: { type: "info", size: "14" } })], 1), i("div", { staticClass: "cb-card-group" }, e._l(e.signMethods, function(r) {
948
974
  return i("div", { key: r.value, staticClass: "cb-card flex border-2 border-transparent hover:border-gray-300/30 hover:bg-gray-200", class: {
949
975
  checked: e.defaultAnswerMethod.accept === r.value
950
976
  }, on: { click: function(d) {
@@ -974,7 +1000,7 @@ var Me = function() {
974
1000
  })
975
1001
  ` }], staticClass: "mr-2 w-12", attrs: { loading: e.isPosting, type: "none", icon: "save", pattern: "secondary" }, on: { click: function(d) {
976
1002
  return e.doSaveDocument({ doSend: !1 });
977
- } } }) : e._e(), e.showSchedule && !e.useSignOrder && !e.isManualDelivery ? i("CButton", { staticClass: "@md:w-auto mr-2 w-12", staticStyle: { padding: "14px 16px", "border-radius": "8px", height: "initial", "font-size": "14px", "font-weight": "600" }, attrs: { disabled: e.isPosting || !e.clients.length, type: "none", pattern: "secondary" }, on: { click: e.openSendLater } }, [i("span", { staticClass: "@md:!block !hidden", domProps: { textContent: e._s(e.$t("scheduledTooltip")) } }), i("BaseIcon", { staticClass: "@md:!hidden", attrs: { type: "calendar", size: "16" } })], 1) : e._e(), i("div", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: e.$v.$invalid ? {
1003
+ } } }) : e._e(), e.showSchedule && !e.useSignOrder && !e.isManualDelivery ? i("CButton", { staticClass: "@md:w-auto mr-2 w-12", staticStyle: { padding: "14px 16px", "border-radius": "8px", height: "initial", "font-size": "14px", "font-weight": "600" }, attrs: { disabled: e.isPosting || !e.clients.length, type: "none", pattern: "secondary" }, on: { click: e.openSendLater } }, [i("span", { staticClass: "@md:!block !hidden", domProps: { textContent: e._s(e.$t("scheduledTooltip")) } }), i("CIcon", { staticClass: "@md:!hidden", attrs: { type: "calendar", size: "16" } })], 1) : e._e(), i("div", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: e.$v.$invalid ? {
978
1004
  content: e.clients.length ? e.$t("missingDeliveryMethod") : e.$t(
979
1005
  "components:account.documentForm.clients.errorMessage"
980
1006
  )
@@ -994,151 +1020,57 @@ var Me = function() {
994
1020
  } }], null, !0) })];
995
1021
  }), e._t("footer")], 2)], 1)];
996
1022
  } }], null, !0) });
997
- }, ze = [], Ne = /* @__PURE__ */ o(
998
- Re,
999
- Me,
1000
- ze,
1001
- !1,
1002
- null,
1003
- "45742846",
1004
- null,
1005
- null
1006
- );
1007
- const ri = Ne.exports, Ee = {
1008
- name: "CFormField",
1009
- components: {
1010
- CField: z
1011
- },
1012
- extends: J,
1013
- computed: {
1014
- type() {
1015
- return this.hasErrors ? "is-danger" : this.isValid ? "is-success" : null;
1016
- },
1017
- customClass() {
1018
- return this.hasErrors ? "text-red-500" : this.isValid ? "text-green-500" : null;
1019
- }
1020
- }
1021
- };
1022
- var Le = function() {
1023
- var e = this, i = e._self._c;
1024
- return i("CField", e._b({ attrs: { label: e.label, "custom-class": e.customClass, type: e.type, message: e.firstErrorMessage } }, "CField", { ...e.$attrs, ...e.$props }, !1), [e._t("default")], 2);
1025
- }, He = [], qe = /* @__PURE__ */ o(
1026
- Ee,
1023
+ }, qe = [], je = /* @__PURE__ */ o(
1027
1024
  Le,
1028
1025
  He,
1026
+ qe,
1029
1027
  !1,
1030
1028
  null,
1031
- null,
1032
- null,
1033
- null
1029
+ "a160ead7"
1034
1030
  );
1035
- const je = qe.exports, Ke = {
1036
- name: "CSkeleton",
1037
- functional: !0,
1031
+ const ri = je.exports, Ke = {
1032
+ name: "CAutocomplete",
1033
+ components: {
1034
+ CInput: O
1035
+ },
1036
+ mixins: [T],
1037
+ inheritAttrs: !1,
1038
1038
  props: {
1039
- active: {
1040
- type: Boolean,
1041
- default: !0
1039
+ value: {
1040
+ type: [Number, String],
1041
+ default: null
1042
1042
  },
1043
- animated: {
1044
- type: Boolean,
1045
- default: !1
1043
+ data: {
1044
+ type: Array,
1045
+ default: () => []
1046
1046
  },
1047
- width: [Number, String],
1048
- height: [Number, String],
1049
- circle: Boolean,
1050
- rounded: {
1051
- type: Boolean,
1052
- default: !0
1047
+ field: {
1048
+ type: String,
1049
+ default: "value"
1053
1050
  },
1054
- count: {
1055
- type: Number,
1056
- default: 1
1051
+ keepFirst: Boolean,
1052
+ clearOnSelect: Boolean,
1053
+ openOnFocus: Boolean,
1054
+ customFormatter: {
1055
+ type: Function,
1056
+ default: () => {
1057
+ }
1057
1058
  },
1058
- hidden: {
1059
- type: [Boolean, String],
1060
- default: !1
1061
- },
1062
- color: {
1063
- type: String,
1064
- default: null
1065
- }
1066
- },
1067
- render(t, e) {
1068
- if (!e.props.active)
1069
- return;
1070
- const i = [], s = e.props.width, n = e.props.height;
1071
- for (let a = 0; a < e.props.count; a++)
1072
- i.push(
1073
- t("div", {
1074
- staticClass: "c-skeleton-item",
1075
- class: { "is-rounded": e.props.rounded },
1076
- key: a,
1077
- style: {
1078
- height: n === void 0 ? null : isNaN(n) ? n : n + "px",
1079
- width: s === void 0 ? null : isNaN(s) ? s : s + "px",
1080
- borderRadius: e.props.circle ? "50%" : null,
1081
- background: e.props.color ? e.props.color : null
1082
- }
1083
- })
1084
- );
1085
- return t(
1086
- "div",
1087
- {
1088
- staticStyle: e.data.staticStyle,
1089
- staticClass: "c-skeleton",
1090
- class: [
1091
- e.data.staticClass,
1092
- {
1093
- "is-animated": e.props.animated,
1094
- "is-invisible": e.props.hidden
1095
- }
1096
- ]
1097
- },
1098
- i
1099
- );
1100
- }
1101
- }, We = null, Xe = null;
1102
- var Ue = /* @__PURE__ */ o(
1103
- Ke,
1104
- We,
1105
- Xe,
1106
- !1,
1107
- null,
1108
- null,
1109
- null,
1110
- null
1111
- );
1112
- const x = Ue.exports, Qe = {
1113
- name: "CAutocomplete",
1114
- components: {
1115
- CInput: T
1116
- },
1117
- mixins: [P],
1118
- inheritAttrs: !1,
1119
- props: {
1120
- value: [Number, String],
1121
- data: {
1122
- type: Array,
1123
- default: () => []
1124
- },
1125
- field: {
1126
- type: String,
1127
- default: "value"
1128
- },
1129
- keepFirst: Boolean,
1130
- clearOnSelect: Boolean,
1131
- openOnFocus: Boolean,
1132
- customFormatter: Function,
1133
1059
  checkInfiniteScroll: Boolean,
1134
1060
  keepOpen: Boolean,
1135
1061
  clearable: Boolean,
1136
- maxHeight: [String, Number],
1062
+ maxHeight: {
1063
+ type: [String, Number],
1064
+ default: null
1065
+ },
1137
1066
  dropdownPosition: {
1138
1067
  type: String,
1139
1068
  default: "auto"
1140
1069
  },
1141
- iconRight: String,
1070
+ iconRight: {
1071
+ type: String,
1072
+ default: null
1073
+ },
1142
1074
  iconRightClickable: Boolean,
1143
1075
  appendToBody: Boolean
1144
1076
  },
@@ -1388,9 +1320,9 @@ const x = Ue.exports, Qe = {
1388
1320
  onBlur(t) {
1389
1321
  this.hasFocus = !1, this.$emit("blur", t);
1390
1322
  },
1391
- onInput(t) {
1392
- const e = this.getValue(this.selected);
1393
- e && e === this.newValue || (this.$emit("typing", this.newValue), this.checkValidity());
1323
+ onInput() {
1324
+ const t = this.getValue(this.selected);
1325
+ t && t === this.newValue || (this.$emit("typing", this.newValue), this.checkValidity());
1394
1326
  },
1395
1327
  rightIconClick(t) {
1396
1328
  this.clearable ? this.newValue = "" : this.$emit("icon-right-click", t);
@@ -1420,7 +1352,7 @@ const x = Ue.exports, Qe = {
1420
1352
  }
1421
1353
  }
1422
1354
  };
1423
- var Ye = function() {
1355
+ var We = function() {
1424
1356
  var e = this, i = e._self._c;
1425
1357
  return i("div", { staticClass: "autocomplete control", class: { "is-expanded": e.expanded } }, [i("CInput", e._b({ ref: "input", attrs: { size: e.size, loading: e.loading, rounded: e.rounded, icon: e.icon, "icon-right": e.newIconRight, "icon-right-clickable": e.newIconRightClickable, "icon-pack": e.iconPack, maxlength: e.maxlength, autocomplete: e.newAutocomplete, "use-html5-validation": !1, type: "text" }, on: { input: e.onInput, focus: e.focused, blur: e.onBlur, "icon-right-click": e.rightIconClick, "icon-click": (s) => e.$emit("icon-click", s) }, nativeOn: { keyup: function(s) {
1426
1358
  if (!s.type.indexOf("key") && e._k(s.keyCode, "esc", 27, s.key, ["Esc", "Escape"]))
@@ -1441,21 +1373,170 @@ var Ye = function() {
1441
1373
  return e.setSelected(s, void 0, a);
1442
1374
  } } }, [e.hasDefaultSlot ? e._t("default", null, { option: s, index: n }) : i("span", [e._v(" " + e._s(e.getValue(s, !0)) + " ")])], 2);
1443
1375
  }), e.data.length === 0 && e.hasEmptySlot ? i("div", { staticClass: "dropdown-item is-disabled" }, [e._t("empty")], 2) : e._e(), e.hasFooterSlot ? i("div", { staticClass: "dropdown-item" }, [e._t("footer")], 2) : e._e()], 2)])])], 1);
1444
- }, Ge = [], Je = /* @__PURE__ */ o(
1445
- Qe,
1446
- Ye,
1447
- Ge,
1376
+ }, Xe = [], Ue = /* @__PURE__ */ o(
1377
+ Ke,
1378
+ We,
1379
+ Xe,
1448
1380
  !1,
1449
1381
  null,
1382
+ null
1383
+ );
1384
+ const Qe = Ue.exports, Ye = {
1385
+ name: "CMessage",
1386
+ props: {
1387
+ type: {
1388
+ type: String,
1389
+ default: "secondary"
1390
+ },
1391
+ badge: {
1392
+ type: String,
1393
+ default: ""
1394
+ },
1395
+ text: {
1396
+ type: String,
1397
+ default: ""
1398
+ }
1399
+ }
1400
+ };
1401
+ var Ge = function(e, i) {
1402
+ return e("div", { class: [i.data.class, i.data.staticClass], staticStyle: { padding: "0.75em 1em", display: "flex", "align-items": "flex-start", "border-radius": "0.6em", "background-color": "hsl(var(--gray-color-100) / 1)" }, style: { ...i.data.staticStyle } }, [e("div", { class: [`has-background-${i.props.type}`], staticStyle: { display: "inline-block", padding: "0.5em", "border-radius": "0.45em", "font-weight": "700", color: "white", "line-height": "1", "font-size": "12px", "margin-right": "1.25em" } }, [i._v(" " + i._s(i.props.badge || i.parent.$t("components:cling.message.tip")) + " ")]), e("div", { staticStyle: { color: "hsl(0, 0%, 25%)" } }, [i.props.text ? [i._v(" " + i._s(i.props.text) + " ")] : i._e(), i._t("default")], 2)]);
1403
+ }, Je = [], Ze = /* @__PURE__ */ o(
1404
+ Ye,
1405
+ Ge,
1406
+ Je,
1407
+ !0,
1450
1408
  null,
1409
+ "9be3b227"
1410
+ );
1411
+ const w = Ze.exports, et = {
1412
+ name: "CPhoneInput",
1413
+ components: {
1414
+ Flag: G,
1415
+ CInput: O,
1416
+ CDropdown: h,
1417
+ CDropdownItem: f,
1418
+ CButton: P,
1419
+ CField: E,
1420
+ SmartList: ne
1421
+ },
1422
+ props: {
1423
+ value: {
1424
+ type: [String, Number],
1425
+ default: ""
1426
+ },
1427
+ region: {
1428
+ type: String,
1429
+ default: ""
1430
+ },
1431
+ // Region to fallback to if prefix is not found in value
1432
+ defaultRegion: {
1433
+ type: String,
1434
+ required: !0
1435
+ },
1436
+ label: {
1437
+ type: String,
1438
+ default: ""
1439
+ },
1440
+ labelPosition: {
1441
+ type: String,
1442
+ default: ""
1443
+ }
1444
+ },
1445
+ data() {
1446
+ return {
1447
+ internalPrefix: null,
1448
+ // Used to remember prefix when value is changed to empty
1449
+ searchQuery: ""
1450
+ };
1451
+ },
1452
+ computed: {
1453
+ defaultPrefix() {
1454
+ return l[this.internalRegion].callingCode;
1455
+ },
1456
+ currentRegion() {
1457
+ return this.getRegionByCallingCode(this.prefix);
1458
+ },
1459
+ internalRegion: {
1460
+ get() {
1461
+ if (this.region)
1462
+ return this.region;
1463
+ if (this.value) {
1464
+ const t = (Object.keys(l) || []).find(
1465
+ (e) => l[e].callingCode && this.value && this.value.startsWith(l[e].callingCode)
1466
+ );
1467
+ if (t)
1468
+ return t;
1469
+ }
1470
+ return this.internalPrefix ? this.getRegionByCallingCode(this.internalPrefix) : this.defaultRegion;
1471
+ },
1472
+ set(t) {
1473
+ this.$emit("update:region", t), this.updateValue({ prefix: l[t].callingCode });
1474
+ }
1475
+ },
1476
+ prefix() {
1477
+ if (!this.value)
1478
+ return this.internalPrefix || this.defaultPrefix;
1479
+ const t = (Object.keys(l) || []).find(
1480
+ (e) => l[e].callingCode && this.value && this.value.startsWith(l[e].callingCode)
1481
+ );
1482
+ return t ? l[t].callingCode : this.defaultPrefix;
1483
+ },
1484
+ phone: {
1485
+ get() {
1486
+ return this.prefix && this.value && this.value.startsWith(this.prefix) ? this.value.substring(this.prefix.length) : this.value;
1487
+ },
1488
+ set(t) {
1489
+ this.updateValue({ phone: t });
1490
+ }
1491
+ },
1492
+ sortedRegions() {
1493
+ return (Object.keys(l) || []).map((t) => ({
1494
+ key: t,
1495
+ title: `${l[t].name} (${t})`,
1496
+ callingCode: l[t].callingCode
1497
+ })).sort((t, e) => t.title.localeCompare(e.title));
1498
+ }
1499
+ },
1500
+ methods: {
1501
+ getRegionByCallingCode(t) {
1502
+ return t ? (Object.keys(l) || []).find(
1503
+ (i) => t === l[i].callingCode
1504
+ ) : null;
1505
+ },
1506
+ updateValue({ prefix: t, phone: e }) {
1507
+ const i = t !== void 0 ? t : this.prefix || "", s = e !== void 0 ? e : this.phone || "", n = `${i}${s}`;
1508
+ n !== i ? (this.$emit("input", n), this.region || this.$emit("update:region", this.internalRegion), this.internalPrefix = null) : (this.internalPrefix = i, this.$emit("input", ""));
1509
+ }
1510
+ }
1511
+ };
1512
+ var tt = function() {
1513
+ var e = this, i = e._self._c;
1514
+ return i("CField", { staticClass: "has-addons", attrs: { expanded: "" } }, [i("div", { staticClass: "control" }, [i("SmartList", { attrs: { query: e.searchQuery, items: e.sortedRegions }, scopedSlots: e._u([{ key: "default", fn: function({ items: s }) {
1515
+ return [i("CDropdown", { staticClass: "control", staticStyle: { height: "100%" }, attrs: { size: e.$attrs.size, disabled: e.$attrs.disabled, "menu-styling": {
1516
+ maxWidth: "300px"
1517
+ }, scrollable: !0, position: "is-bottom-right", "max-height": "240px" }, model: { value: e.internalRegion, callback: function(n) {
1518
+ e.internalRegion = n;
1519
+ }, expression: "internalRegion" } }, [i("CButton", { staticStyle: { height: "100%" }, attrs: { slot: "trigger", size: e.$attrs.size, type: "none", pattern: "secondary" }, slot: "trigger" }, [i("Flag", { staticStyle: { "margin-right": "0.35em" }, attrs: { region: e.internalRegion } }), e._v(" " + e._s(e.prefix) + " ")], 1), i("CInput", { staticStyle: { "margin-bottom": "0.25em" }, attrs: { slot: "header", placeholder: e.$t("_common:search"), filled: "" }, slot: "header", model: { value: e.searchQuery, callback: function(n) {
1520
+ e.searchQuery = n;
1521
+ }, expression: "searchQuery" } }), e._l(s, function({ key: n, title: a, callingCode: r }) {
1522
+ return i("CDropdownItem", { key: n, staticClass: "truncate-text", attrs: { value: n } }, [i("Flag", { staticStyle: { "margin-right": "0.75em", flex: "0 0 auto" }, attrs: { region: n, title: a } }), i("span", { staticClass: "truncate-text" }, [e._v(" " + e._s(a) + " (" + e._s(r) + ") ")])], 1);
1523
+ })], 2)];
1524
+ } }]) })], 1), i("CField", { staticClass: "control", attrs: { label: e.label, "label-position": e.labelPosition, expanded: "" } }, [i("CInput", e._b({ attrs: { size: e.$attrs.size, placeholder: e.$attrs.placeholder, type: "tel" }, model: { value: e.phone, callback: function(s) {
1525
+ e.phone = s;
1526
+ }, expression: "phone" } }, "CInput", { ...e.$attrs, ...e.$props }, !1))], 1)], 1);
1527
+ }, it = [], st = /* @__PURE__ */ o(
1528
+ et,
1529
+ tt,
1530
+ it,
1531
+ !1,
1451
1532
  null,
1452
1533
  null
1453
1534
  );
1454
- const Ze = Je.exports, et = {
1535
+ const x = st.exports, nt = {
1455
1536
  name: "CRadio",
1456
- mixins: [R]
1537
+ mixins: [M]
1457
1538
  };
1458
- var tt = function() {
1539
+ var at = function() {
1459
1540
  var e = this, i = e._self._c;
1460
1541
  return i("label", { ref: "label", staticClass: "b-radio radio", class: [`is-${e.size}`, { "is-disabled": e.disabled }], attrs: { disabled: e.disabled }, on: { click: e.focus, keydown: function(s) {
1461
1542
  return !s.type.indexOf("key") && e._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : (s.preventDefault(), e.$refs.label.click());
@@ -1464,22 +1545,20 @@ var tt = function() {
1464
1545
  }, change: function(s) {
1465
1546
  e.computedValue = e.nativeValue;
1466
1547
  } } }), i("span", { staticClass: "check", class: `is-${e.type}` }), i("span", { staticClass: "control-label" }, [e._t("default")], 2)]);
1467
- }, it = [], st = /* @__PURE__ */ o(
1468
- et,
1469
- tt,
1470
- it,
1548
+ }, rt = [], ot = /* @__PURE__ */ o(
1549
+ nt,
1550
+ at,
1551
+ rt,
1471
1552
  !1,
1472
1553
  null,
1473
- null,
1474
- null,
1475
1554
  null
1476
1555
  );
1477
- const w = st.exports, nt = {
1556
+ const S = ot.exports, lt = {
1478
1557
  name: "CRadioButton",
1479
- mixins: [R],
1480
1558
  components: {
1481
- CButton: M
1559
+ CButton: P
1482
1560
  },
1561
+ mixins: [M],
1483
1562
  props: {
1484
1563
  type: {
1485
1564
  type: String,
@@ -1493,7 +1572,7 @@ const w = st.exports, nt = {
1493
1572
  };
1494
1573
  }
1495
1574
  };
1496
- var at = function() {
1575
+ var dt = function() {
1497
1576
  var e = this, i = e._self._c;
1498
1577
  return i("div", { staticClass: "control", class: { "is-expanded": e.expanded } }, [i("CButton", { ref: "label", staticClass: "c-radio radio button", class: [{ "is-disabled": e.disabled, "is-focused": e.isFocused }], attrs: { tag: "label", type: e.newValue === e.nativeValue ? e.type : null, size: e.size, disabled: e.disabled }, on: { click: e.focus, keydown: function(s) {
1499
1578
  return !s.type.indexOf("key") && e._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : (s.preventDefault(), e.$refs.$el.label.click());
@@ -1506,29 +1585,36 @@ var at = function() {
1506
1585
  }, change: function(s) {
1507
1586
  e.computedValue = e.nativeValue;
1508
1587
  } } })], 2)], 1);
1509
- }, rt = [], ot = /* @__PURE__ */ o(
1510
- nt,
1511
- at,
1512
- rt,
1588
+ }, ct = [], ut = /* @__PURE__ */ o(
1589
+ lt,
1590
+ dt,
1591
+ ct,
1513
1592
  !1,
1514
1593
  null,
1515
- null,
1516
- null,
1517
1594
  null
1518
1595
  );
1519
- const S = ot.exports, lt = {
1596
+ const $ = ut.exports, mt = {
1520
1597
  name: "CSelect",
1521
- mixins: [P],
1598
+ mixins: [T],
1522
1599
  inheritAttrs: !1,
1523
1600
  props: {
1524
1601
  value: {
1525
1602
  type: [String, Number, Boolean, Object, Array, Function],
1526
1603
  default: null
1527
1604
  },
1528
- placeholder: String,
1605
+ placeholder: {
1606
+ type: String,
1607
+ default: ""
1608
+ },
1529
1609
  multiple: Boolean,
1530
- selectClass: [String, Object, Array],
1531
- nativeSize: [String, Number]
1610
+ selectClass: {
1611
+ type: [String, Object, Array],
1612
+ default: ""
1613
+ },
1614
+ nativeSize: {
1615
+ type: [String, Number],
1616
+ default: null
1617
+ }
1532
1618
  },
1533
1619
  data() {
1534
1620
  return {
@@ -1570,7 +1656,7 @@ const S = ot.exports, lt = {
1570
1656
  }
1571
1657
  }
1572
1658
  };
1573
- var dt = function() {
1659
+ var pt = function() {
1574
1660
  var e = this, i = e._self._c;
1575
1661
  return i("div", { staticClass: "control", class: { "is-expanded": e.expanded, "has-icons-left": e.icon } }, [i("span", { staticClass: "select", class: e.spanClasses }, [i("select", e._b({ directives: [{ name: "model", rawName: "v-model", value: e.computedValue, expression: "computedValue" }], ref: "select", class: e.selectClass, attrs: { multiple: e.multiple, size: e.nativeSize }, on: { blur: function(s) {
1576
1662
  e.$emit("blur", s) && e.checkHtml5Validity();
@@ -1585,913 +1671,854 @@ var dt = function() {
1585
1671
  });
1586
1672
  e.computedValue = s.target.multiple ? n : n[0];
1587
1673
  } } }, "select", e.$attrs, !1), [e.placeholder && e.computedValue == null ? i("option", { attrs: { disabled: "", hidden: "" }, domProps: { value: null } }, [e._v(" " + e._s(e.placeholder) + " ")]) : e._e(), e._t("default")], 2)])]);
1588
- }, ct = [], ut = /* @__PURE__ */ o(
1589
- lt,
1590
- dt,
1591
- ct,
1674
+ }, ht = [], ft = /* @__PURE__ */ o(
1675
+ mt,
1676
+ pt,
1677
+ ht,
1592
1678
  !1,
1593
1679
  null,
1594
- "e050ad8b",
1595
- null,
1596
- null
1680
+ "23e48013"
1597
1681
  );
1598
- const $ = ut.exports, mt = {
1599
- name: "CSwitch",
1682
+ const k = ft.exports, gt = {
1683
+ name: "CSkeleton",
1684
+ functional: !0,
1600
1685
  props: {
1601
- value: [String, Number, Boolean, Function, Object, Array, Date],
1602
- nativeValue: [String, Number, Boolean, Function, Object, Array, Date],
1603
- disabled: Boolean,
1604
- type: String,
1605
- name: String,
1606
- required: Boolean,
1607
- size: {
1608
- size: String,
1609
- default: "default"
1610
- },
1611
- trueValue: {
1612
- type: [String, Number, Boolean, Function, Object, Array, Date],
1686
+ active: {
1687
+ type: Boolean,
1613
1688
  default: !0
1614
1689
  },
1615
- falseValue: {
1616
- type: [String, Number, Boolean, Function, Object, Array, Date],
1690
+ animated: {
1691
+ type: Boolean,
1617
1692
  default: !1
1618
1693
  },
1694
+ width: [Number, String],
1695
+ height: [Number, String],
1696
+ circle: Boolean,
1619
1697
  rounded: {
1620
1698
  type: Boolean,
1621
1699
  default: !0
1622
- }
1623
- },
1624
- data() {
1625
- return {
1626
- newValue: this.value
1627
- };
1628
- },
1629
- computed: {
1630
- computedValue: {
1631
- get() {
1632
- return this.newValue;
1633
- },
1634
- set(t) {
1635
- this.newValue = t, this.$emit("input", t);
1636
- }
1637
1700
  },
1638
- newClass() {
1639
- return [
1640
- `is-${this.size}`,
1641
- {
1642
- "is-disabled": this.disabled,
1643
- "is-rounded": this.rounded
1644
- }
1645
- ];
1646
- }
1647
- },
1648
- watch: {
1649
- /**
1650
- * When v-model change, set internal value.
1651
- */
1652
- value(t) {
1653
- this.newValue = t;
1701
+ count: {
1702
+ type: Number,
1703
+ default: 1
1704
+ },
1705
+ hidden: {
1706
+ type: [Boolean, String],
1707
+ default: !1
1708
+ },
1709
+ color: {
1710
+ type: String,
1711
+ default: null
1654
1712
  }
1655
1713
  },
1656
- methods: {
1657
- focus() {
1658
- this.$refs.input.focus();
1659
- }
1714
+ render(t, e) {
1715
+ if (!e.props.active)
1716
+ return;
1717
+ const i = [], s = e.props.width, n = e.props.height;
1718
+ for (let a = 0; a < e.props.count; a++)
1719
+ i.push(
1720
+ t("div", {
1721
+ staticClass: "c-skeleton-item",
1722
+ class: { "is-rounded": e.props.rounded },
1723
+ key: a,
1724
+ style: {
1725
+ height: n === void 0 ? null : isNaN(n) ? n : n + "px",
1726
+ width: s === void 0 ? null : isNaN(s) ? s : s + "px",
1727
+ borderRadius: e.props.circle ? "50%" : null,
1728
+ background: e.props.color ? e.props.color : null
1729
+ }
1730
+ })
1731
+ );
1732
+ return t(
1733
+ "div",
1734
+ {
1735
+ staticStyle: e.data.staticStyle,
1736
+ staticClass: "c-skeleton",
1737
+ class: [
1738
+ e.data.staticClass,
1739
+ {
1740
+ "is-animated": e.props.animated,
1741
+ "is-invisible": e.props.hidden
1742
+ }
1743
+ ]
1744
+ },
1745
+ i
1746
+ );
1660
1747
  }
1661
- };
1662
- var pt = function() {
1663
- var e = this, i = e._self._c;
1664
- return i("label", { ref: "label", staticClass: "switch", class: e.newClass, attrs: { disabled: e.disabled }, on: { click: e.focus, keydown: function(s) {
1665
- return !s.type.indexOf("key") && e._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : (s.preventDefault(), e.$refs.label.click());
1666
- } } }, [i("input", { directives: [{ name: "model", rawName: "v-model", value: e.computedValue, expression: "computedValue" }], ref: "input", attrs: { disabled: e.disabled, name: e.name, required: e.required, "true-value": e.trueValue, "false-value": e.falseValue, type: "checkbox" }, domProps: { value: e.nativeValue, checked: Array.isArray(e.computedValue) ? e._i(e.computedValue, e.nativeValue) > -1 : e._q(e.computedValue, e.trueValue) }, on: { click: function(s) {
1667
- s.stopPropagation();
1668
- }, change: function(s) {
1669
- var n = e.computedValue, a = s.target, r = a.checked ? e.trueValue : e.falseValue;
1670
- if (Array.isArray(n)) {
1671
- var d = e.nativeValue, u = e._i(n, d);
1672
- a.checked ? u < 0 && (e.computedValue = n.concat([d])) : u > -1 && (e.computedValue = n.slice(0, u).concat(n.slice(u + 1)));
1673
- } else
1674
- e.computedValue = r;
1675
- } } }), i("span", { staticClass: "check", class: [`is-${e.type}`] }), i("span", { staticClass: "control-label" }, [e._t("default")], 2)]);
1676
- }, ht = [], ft = /* @__PURE__ */ o(
1677
- mt,
1678
- pt,
1679
- ht,
1748
+ }, vt = null, yt = null;
1749
+ var _t = /* @__PURE__ */ o(
1750
+ gt,
1751
+ vt,
1752
+ yt,
1680
1753
  !1,
1681
1754
  null,
1682
- "e2ce5684",
1683
- null,
1684
1755
  null
1685
1756
  );
1686
- const k = ft.exports, gt = {
1687
- name: "CSlotComponent",
1757
+ const D = _t.exports, bt = {
1758
+ name: "CSliderThumb",
1759
+ inheritAttrs: !1,
1688
1760
  props: {
1689
- component: {
1690
- type: Object,
1691
- required: !0
1692
- },
1693
- name: {
1694
- type: String,
1695
- default: "default"
1696
- },
1697
- scoped: {
1698
- type: Boolean
1699
- },
1700
- props: {
1701
- type: Object
1702
- },
1703
- tag: {
1704
- type: String,
1705
- default: "div"
1706
- },
1707
- event: {
1708
- type: String,
1709
- default: "hook:updated"
1710
- }
1711
- },
1712
- methods: {
1713
- refresh() {
1714
- this.$forceUpdate();
1761
+ value: {
1762
+ type: Number,
1763
+ default: 0
1715
1764
  },
1716
- isVueComponent() {
1717
- return this.component && this.component._isVue;
1718
- }
1719
- },
1720
- created() {
1721
- this.isVueComponent() && this.component.$on(this.event, this.refresh);
1722
- },
1723
- beforeDestroy() {
1724
- this.isVueComponent() && this.component.$off(this.event, this.refresh);
1725
- },
1726
- // eslint-disable-next-line consistent-return
1727
- render(t) {
1728
- if (this.isVueComponent())
1729
- return t(
1730
- this.tag,
1731
- {},
1732
- this.scoped ? this.component.$scopedSlots[this.name](this.props) : this.component.$slots[this.name]
1733
- );
1734
- }
1735
- }, vt = {
1736
- name: "CTabs",
1737
- components: {
1738
- CSlotComponent: gt
1739
- },
1740
- props: {
1741
- value: [Number, String],
1742
- expanded: Boolean,
1743
- type: String,
1744
- size: String,
1745
- position: {
1765
+ type: {
1746
1766
  type: String,
1747
- validator(t) {
1748
- return ["left", "right", "center"].indexOf(t) > -1;
1749
- },
1750
- default: null
1767
+ default: ""
1751
1768
  },
1752
- animated: {
1769
+ tooltip: {
1753
1770
  type: Boolean,
1754
1771
  default: !0
1755
1772
  },
1756
- destroyOnHide: {
1757
- type: Boolean,
1758
- default: !1
1759
- },
1760
- vertical: Boolean,
1761
- multiline: Boolean
1773
+ customFormatter: {
1774
+ type: Function,
1775
+ default: null
1776
+ }
1762
1777
  },
1763
1778
  data() {
1764
1779
  return {
1765
- activeTab: 0,
1766
- defaultSlots: [],
1767
- contentHeight: 0,
1768
- isTransitioning: !1,
1769
- _isTabs: !0
1770
- // Used internally by TabItem
1780
+ isFocused: !1,
1781
+ dragging: !1,
1782
+ startX: 0,
1783
+ startPosition: 0,
1784
+ newPosition: null,
1785
+ oldValue: this.value
1771
1786
  };
1772
1787
  },
1773
1788
  computed: {
1774
- mainClasses() {
1775
- return {
1776
- "is-fullwidth": this.expanded,
1777
- "is-vertical": this.vertical,
1778
- "is-multiline": this.multiline,
1779
- [`is-${this.position}`]: this.position && this.vertical
1780
- };
1789
+ disabled() {
1790
+ return this.$parent.disabled;
1781
1791
  },
1782
- navClasses() {
1783
- return [
1784
- this.type,
1785
- {
1786
- [`is-${this.size}`]: !!this.size,
1787
- [`is-${this.position}`]: this.position && !this.vertical,
1788
- "is-fullwidth": this.expanded,
1789
- "is-toggle-rounded is-toggle": this.type === "is-toggle-rounded"
1790
- }
1791
- ];
1792
+ max() {
1793
+ return this.$parent.max;
1792
1794
  },
1793
- tabItems() {
1794
- return this.defaultSlots.filter(
1795
- (t) => t.componentInstance && t.componentInstance.$data && t.componentInstance.$data._isTabItem
1796
- ).map((t) => t.componentInstance);
1797
- }
1798
- },
1799
- watch: {
1800
- /**
1801
- * When v-model is changed set the new active tab.
1802
- */
1803
- value(t) {
1804
- const e = this.getIndexByValue(t, t);
1805
- this.changeTab(e);
1795
+ min() {
1796
+ return this.$parent.min;
1806
1797
  },
1807
- /**
1808
- * When tab-items are updated, set active one.
1809
- */
1810
- tabItems() {
1811
- if (this.activeTab < this.tabItems.length) {
1812
- let t = this.activeTab;
1813
- this.tabItems.map((e, i) => {
1814
- e.isActive && (t = i, t < this.tabItems.length && (this.tabItems[t].isActive = !1));
1815
- }), this.tabItems[this.activeTab].isActive = !0;
1816
- } else
1817
- this.activeTab > 0 && this.changeTab(this.activeTab - 1);
1798
+ step() {
1799
+ return this.$parent.step;
1800
+ },
1801
+ precision() {
1802
+ return this.$parent.precision;
1803
+ },
1804
+ currentPosition() {
1805
+ return `${(this.value - this.min) / (this.max - this.min) * 100}%`;
1806
+ },
1807
+ wrapperStyle() {
1808
+ return { left: this.currentPosition };
1809
+ },
1810
+ tooltipLabel() {
1811
+ return typeof this.customFormatter == "function" ? this.customFormatter(this.value) : this.value.toString();
1818
1812
  }
1819
1813
  },
1820
- mounted() {
1821
- this.activeTab = this.getIndexByValue(this.value || 0), this.activeTab < this.tabItems.length && (this.tabItems[this.activeTab].isActive = !0), this.refreshSlots();
1822
- },
1823
1814
  methods: {
1824
- /**
1825
- * Change the active tab and emit change event.
1826
- */
1827
- changeTab(t) {
1828
- this.activeTab === t || this.tabItems[t] === void 0 || (this.activeTab < this.tabItems.length && this.tabItems[this.activeTab].deactivate(this.activeTab, t), this.tabItems[t].activate(this.activeTab, t), this.activeTab = t, this.$emit("change", this.getValueByIndex(t)));
1815
+ onFocus() {
1816
+ this.isFocused = !0;
1829
1817
  },
1830
- /**
1831
- * Tab click listener, emit input event and change active tab.
1832
- */
1833
- tabClick(t) {
1834
- this.activeTab !== t && (this.$emit("input", this.getValueByIndex(t)), this.changeTab(t));
1818
+ onBlur() {
1819
+ this.isFocused = !1;
1835
1820
  },
1836
- refreshSlots() {
1837
- this.defaultSlots = this.$slots.default || [];
1821
+ onButtonDown(t) {
1822
+ this.disabled || (t.preventDefault(), this.onDragStart(t), typeof window < "u" && (document.addEventListener("mousemove", this.onDragging), document.addEventListener("touchmove", this.onDragging), document.addEventListener("mouseup", this.onDragEnd), document.addEventListener("touchend", this.onDragEnd), document.addEventListener("contextmenu", this.onDragEnd)));
1838
1823
  },
1839
- getIndexByValue(t) {
1840
- const e = this.tabItems.map(
1841
- (i) => i.$options.propsData ? i.$options.propsData.value : void 0
1842
- ).indexOf(t);
1843
- return e >= 0 ? e : t;
1824
+ onLeftKeyDown() {
1825
+ this.disabled || this.value === this.min || (this.newPosition = parseFloat(this.currentPosition) - this.step / (this.max - this.min) * 100, this.setPosition(this.newPosition), this.$parent.emitValue("change"));
1844
1826
  },
1845
- getValueByIndex(t) {
1846
- const { propsData: e } = this.tabItems[t].$options;
1847
- return e && e.value ? e.value : t;
1827
+ onRightKeyDown() {
1828
+ this.disabled || this.value === this.max || (this.newPosition = parseFloat(this.currentPosition) + this.step / (this.max - this.min) * 100, this.setPosition(this.newPosition), this.$parent.emitValue("change"));
1829
+ },
1830
+ onHomeKeyDown() {
1831
+ this.disabled || this.value === this.min || (this.newPosition = 0, this.setPosition(this.newPosition), this.$parent.emitValue("change"));
1832
+ },
1833
+ onEndKeyDown() {
1834
+ this.disabled || this.value === this.max || (this.newPosition = 100, this.setPosition(this.newPosition), this.$parent.emitValue("change"));
1835
+ },
1836
+ onDragStart(t) {
1837
+ this.dragging = !0, this.$emit("dragstart"), t.type === "touchstart" && (t.clientX = t.touches[0].clientX), this.startX = t.clientX, this.startPosition = parseFloat(this.currentPosition), this.newPosition = this.startPosition;
1838
+ },
1839
+ onDragging(t) {
1840
+ if (this.dragging) {
1841
+ t.type === "touchmove" && (t.clientX = t.touches[0].clientX);
1842
+ const e = (t.clientX - this.startX) / this.$parent.sliderSize() * 100;
1843
+ this.newPosition = this.startPosition + e, this.setPosition(this.newPosition);
1844
+ }
1845
+ },
1846
+ onDragEnd() {
1847
+ this.dragging = !1, this.$emit("dragend"), this.value !== this.oldValue && this.$parent.emitValue("change"), this.setPosition(this.newPosition), typeof window < "u" && (document.removeEventListener("mousemove", this.onDragging), document.removeEventListener("touchmove", this.onDragging), document.removeEventListener("mouseup", this.onDragEnd), document.removeEventListener("touchend", this.onDragEnd), document.removeEventListener("contextmenu", this.onDragEnd));
1848
+ },
1849
+ setPosition(t) {
1850
+ if (t === null || isNaN(t))
1851
+ return;
1852
+ t < 0 ? t = 0 : t > 100 && (t = 100);
1853
+ const e = 100 / ((this.max - this.min) / this.step);
1854
+ let s = Math.round(t / e) * e / 100 * (this.max - this.min) + this.min;
1855
+ s = parseFloat(s.toFixed(this.precision)), this.$emit("input", s), !this.dragging && s !== this.oldValue && (this.oldValue = s);
1848
1856
  }
1849
1857
  }
1850
1858
  };
1851
- var yt = function() {
1859
+ var Ct = function() {
1852
1860
  var e = this, i = e._self._c;
1853
- return i("div", { staticClass: "c-tabs", class: e.mainClasses }, [i("nav", { staticClass: "tabs", class: e.navClasses }, [i("ul", e._l(e.tabItems, function(s, n) {
1854
- return i("li", { directives: [{ name: "show", rawName: "v-show", value: s.visible, expression: "tabItem.visible" }], key: n, class: {
1855
- "is-active": e.activeTab === n,
1856
- "is-disabled": s.disabled
1857
- } }, [s.$slots.header ? i("CSlotComponent", { attrs: { component: s, name: "header", tag: "a" }, nativeOn: { click: function(a) {
1858
- return e.tabClick(n);
1859
- } } }) : i("a", { on: { click: function(a) {
1860
- return e.tabClick(n);
1861
- } } }, [s.icon ? i("BaseIcon", { attrs: { size: e.size, type: s.icon } }) : e._e(), i("span", [e._v(e._s(s.label))])], 1)], 1);
1862
- }), 0)]), i("section", { staticClass: "tab-content", class: { "is-transitioning": e.isTransitioning } }, [e._t("default")], 2)]);
1863
- }, _t = [], bt = /* @__PURE__ */ o(
1864
- vt,
1865
- yt,
1866
- _t,
1861
+ return i("div", { staticClass: "c-slider-thumb-wrapper", class: { "is-dragging": e.dragging }, style: e.wrapperStyle }, [i("div", e._b({ staticClass: "c-slider-thumb", attrs: { tabindex: e.disabled ? !1 : 0 }, on: { mousedown: e.onButtonDown, touchstart: e.onButtonDown, focus: e.onFocus, blur: e.onBlur, keydown: [function(s) {
1862
+ return !s.type.indexOf("key") && e._k(s.keyCode, "left", 37, s.key, ["Left", "ArrowLeft"]) || "button" in s && s.button !== 0 ? null : (s.preventDefault(), e.onLeftKeyDown.apply(null, arguments));
1863
+ }, function(s) {
1864
+ return !s.type.indexOf("key") && e._k(s.keyCode, "right", 39, s.key, ["Right", "ArrowRight"]) || "button" in s && s.button !== 2 ? null : (s.preventDefault(), e.onRightKeyDown.apply(null, arguments));
1865
+ }, function(s) {
1866
+ return !s.type.indexOf("key") && e._k(s.keyCode, "down", 40, s.key, ["Down", "ArrowDown"]) ? null : (s.preventDefault(), e.onLeftKeyDown.apply(null, arguments));
1867
+ }, function(s) {
1868
+ return !s.type.indexOf("key") && e._k(s.keyCode, "up", 38, s.key, ["Up", "ArrowUp"]) ? null : (s.preventDefault(), e.onRightKeyDown.apply(null, arguments));
1869
+ }, function(s) {
1870
+ return !s.type.indexOf("key") && e._k(s.keyCode, "home", void 0, s.key, void 0) ? null : (s.preventDefault(), e.onHomeKeyDown.apply(null, arguments));
1871
+ }, function(s) {
1872
+ return !s.type.indexOf("key") && e._k(s.keyCode, "end", void 0, s.key, void 0) ? null : (s.preventDefault(), e.onEndKeyDown.apply(null, arguments));
1873
+ }] } }, "div", e.$attrs, !1))]);
1874
+ }, wt = [], xt = /* @__PURE__ */ o(
1875
+ bt,
1876
+ Ct,
1877
+ wt,
1867
1878
  !1,
1868
1879
  null,
1869
- "e8891cc0",
1870
- null,
1871
1880
  null
1872
1881
  );
1873
- const D = bt.exports, Ct = {
1874
- name: "CTabItem",
1882
+ const St = xt.exports, $t = {
1883
+ name: "CSliderTick",
1875
1884
  props: {
1876
- label: String,
1877
- icon: String,
1878
- iconPack: String,
1879
- disabled: Boolean,
1880
- visible: {
1881
- type: Boolean,
1882
- default: !0
1883
- },
1884
- value: [String, Number]
1885
+ value: {
1886
+ type: Number,
1887
+ default: 0
1888
+ }
1885
1889
  },
1886
- data() {
1887
- return {
1888
- isActive: !1,
1889
- transitionName: null,
1890
- _isTabItem: !0
1891
- // Used internally by Tab
1892
- };
1890
+ computed: {
1891
+ position() {
1892
+ const t = (this.value - this.$parent.min) / (this.$parent.max - this.$parent.min) * 100;
1893
+ return t >= 0 && t <= 100 ? t : 0;
1894
+ },
1895
+ hidden() {
1896
+ return this.value === this.$parent.min || this.value === this.$parent.max;
1897
+ }
1893
1898
  },
1894
1899
  created() {
1895
- if (!this.$parent.$data._isTabs)
1896
- throw this.$destroy(), new Error("You should wrap bTabItem on a bTabs");
1897
- this.$parent.refreshSlots();
1898
- },
1899
- beforeDestroy() {
1900
- this.$parent.refreshSlots();
1900
+ if (!this.$parent.$data._isSlider)
1901
+ throw this.$destroy(), new Error("You should wrap bSliderTick on a bSlider");
1901
1902
  },
1902
1903
  methods: {
1903
- /**
1904
- * Activate tab, alter animation name based on the index.
1905
- */
1906
- activate(t, e) {
1907
- this.transitionName = e < t ? this.$parent.vertical ? "slide-down" : "slide-next" : this.$parent.vertical ? "slide-up" : "slide-prev", this.isActive = !0;
1908
- },
1909
- /**
1910
- * Deactivate tab, alter animation name based on the index.
1911
- */
1912
- deactivate(t, e) {
1913
- this.transitionName = e < t ? this.$parent.vertical ? "slide-down" : "slide-next" : this.$parent.vertical ? "slide-up" : "slide-prev", this.isActive = !1;
1914
- }
1915
- },
1916
- render(t) {
1917
- if (this.$parent.destroyOnHide && (!this.isActive || !this.visible))
1918
- return;
1919
- const e = t(
1920
- "div",
1921
- {
1922
- directives: [
1923
- {
1924
- name: "show",
1925
- value: this.isActive && this.visible
1926
- }
1927
- ],
1928
- class: "tab-item"
1929
- },
1930
- this.$slots.default
1931
- );
1932
- return this.$parent.animated ? t(
1933
- "transition",
1934
- {
1935
- props: {
1936
- name: this.transitionName,
1937
- mode: "out-in"
1938
- },
1939
- on: {
1940
- "before-enter": () => {
1941
- this.$parent.isTransitioning = !0;
1942
- },
1943
- "after-enter": () => {
1944
- this.$parent.isTransitioning = !1;
1945
- }
1946
- }
1947
- },
1948
- [e]
1949
- ) : e;
1950
- }
1951
- }, xt = null, wt = null;
1952
- var St = /* @__PURE__ */ o(
1953
- Ct,
1954
- xt,
1955
- wt,
1956
- !1,
1957
- null,
1958
- null,
1959
- null,
1960
- null
1961
- );
1962
- const V = St.exports, $t = {
1963
- name: "CMessage",
1964
- props: {
1965
- type: {
1966
- type: String,
1967
- default: "secondary"
1968
- },
1969
- badge: {
1970
- type: String,
1971
- default: ""
1972
- },
1973
- text: {
1974
- type: String,
1975
- default: ""
1904
+ getTickStyle(t) {
1905
+ return { left: `${t}%` };
1976
1906
  }
1977
1907
  }
1978
1908
  };
1979
- var kt = function(e, i) {
1980
- return e("div", { class: [i.data.class, i.data.staticClass], staticStyle: { padding: "0.75em 1em", display: "flex", "align-items": "flex-start", "border-radius": "0.6em", "background-color": "hsl(var(--gray-color-100) / 1)" }, style: { ...i.data.staticStyle } }, [e("div", { class: [`has-background-${i.props.type}`], staticStyle: { display: "inline-block", padding: "0.5em", "border-radius": "0.45em", "font-weight": "700", color: "white", "line-height": "1", "font-size": "12px", "margin-right": "1.25em" } }, [i._v(" " + i._s(i.props.badge || i.parent.$t("components:cling.message.tip")) + " ")]), e("div", { staticStyle: { color: "hsl(0, 0%, 25%)" } }, [i.props.text ? [i._v(" " + i._s(i.props.text) + " ")] : i._e(), i._t("default")], 2)]);
1909
+ var kt = function() {
1910
+ var e = this, i = e._self._c;
1911
+ return i("div", { staticClass: "c-slider-tick", class: { "is-tick-hidden": e.hidden }, style: e.getTickStyle(e.position) }, [e.$slots.default ? i("span", { staticClass: "c-slider-tick-label" }, [e._t("default")], 2) : e._e()]);
1981
1912
  }, Dt = [], Vt = /* @__PURE__ */ o(
1982
1913
  $t,
1983
1914
  kt,
1984
1915
  Dt,
1985
- !0,
1986
- null,
1987
- "9be3b227",
1916
+ !1,
1988
1917
  null,
1989
1918
  null
1990
1919
  );
1991
- const F = Vt.exports, Ft = {
1992
- name: "CPhoneInput",
1920
+ const Ft = Vt.exports, At = {
1921
+ name: "CSlider",
1993
1922
  components: {
1994
- Flag: j,
1995
- CInput: T,
1996
- CDropdown: h,
1997
- CDropdownItem: f,
1998
- CButton: M,
1999
- CField: z,
2000
- SmartList: ne
1923
+ CSliderThumb: St,
1924
+ CSliderTick: Ft
2001
1925
  },
2002
1926
  props: {
2003
1927
  value: {
2004
- type: [String, Number],
2005
- default: ""
1928
+ type: [Number, Array],
1929
+ default: 0
2006
1930
  },
2007
- region: {
2008
- type: String,
2009
- default: ""
1931
+ min: {
1932
+ type: Number,
1933
+ default: 0
2010
1934
  },
2011
- // Region to fallback to if prefix is not found in value
2012
- defaultRegion: {
2013
- type: String,
2014
- required: !0
1935
+ max: {
1936
+ type: Number,
1937
+ default: 100
2015
1938
  },
2016
- label: {
1939
+ step: {
1940
+ type: Number,
1941
+ default: 1
1942
+ },
1943
+ type: {
2017
1944
  type: String,
2018
- default: ""
1945
+ default: "primary"
2019
1946
  },
2020
- labelPosition: {
1947
+ size: {
2021
1948
  type: String,
2022
1949
  default: ""
1950
+ },
1951
+ ticks: {
1952
+ type: Boolean,
1953
+ default: !1
1954
+ },
1955
+ tooltip: {
1956
+ type: Boolean,
1957
+ default: !0
1958
+ },
1959
+ tooltipType: {
1960
+ type: String,
1961
+ default: ""
1962
+ },
1963
+ rounded: {
1964
+ type: Boolean,
1965
+ default: !1
1966
+ },
1967
+ disabled: {
1968
+ type: Boolean,
1969
+ default: !1
1970
+ },
1971
+ lazy: {
1972
+ type: Boolean,
1973
+ default: !1
1974
+ },
1975
+ customFormatter: {
1976
+ type: Function,
1977
+ default: null
1978
+ },
1979
+ ariaLabel: {
1980
+ type: [String, Array],
1981
+ default: ""
1982
+ },
1983
+ biggerSliderFocus: {
1984
+ type: Boolean,
1985
+ default: !1
2023
1986
  }
2024
1987
  },
2025
1988
  data() {
2026
1989
  return {
2027
- internalPrefix: null,
2028
- // Used to remember prefix when value is changed to empty
2029
- searchQuery: ""
1990
+ value1: null,
1991
+ value2: null,
1992
+ dragging: !1,
1993
+ isRange: !1,
1994
+ _isSlider: !0
1995
+ // Used by Thumb and Tick
2030
1996
  };
2031
1997
  },
2032
1998
  computed: {
2033
- defaultPrefix() {
2034
- return l[this.internalRegion].callingCode;
1999
+ newTooltipType() {
2000
+ return this.tooltipType ? this.tooltipType : this.type;
2035
2001
  },
2036
- currentRegion() {
2037
- return this.getRegionByCallingCode(this.prefix);
2002
+ tickValues() {
2003
+ if (!this.ticks || this.min > this.max || this.step === 0)
2004
+ return [];
2005
+ const t = [];
2006
+ for (let e = this.min + this.step; e < this.max; e += this.step)
2007
+ t.push(e);
2008
+ return t;
2038
2009
  },
2039
- internalRegion: {
2040
- get() {
2041
- if (this.region)
2042
- return this.region;
2043
- if (this.value) {
2044
- const t = (Object.keys(l) || []).find(
2045
- (e) => l[e].callingCode && this.value && this.value.startsWith(l[e].callingCode)
2046
- );
2047
- if (t)
2048
- return t;
2049
- }
2050
- return this.internalPrefix ? this.getRegionByCallingCode(this.internalPrefix) : this.defaultRegion;
2051
- },
2052
- set(t) {
2053
- this.$emit("update:region", t), this.updateValue({ prefix: l[t].callingCode });
2054
- }
2010
+ minValue() {
2011
+ return Math.min(this.value1, this.value2);
2055
2012
  },
2056
- prefix() {
2057
- if (!this.value)
2058
- return this.internalPrefix || this.defaultPrefix;
2059
- const t = (Object.keys(l) || []).find(
2060
- (e) => l[e].callingCode && this.value && this.value.startsWith(l[e].callingCode)
2061
- );
2062
- return t ? l[t].callingCode : this.defaultPrefix;
2013
+ maxValue() {
2014
+ return Math.max(this.value1, this.value2);
2063
2015
  },
2064
- phone: {
2065
- get() {
2066
- return this.prefix && this.value && this.value.startsWith(this.prefix) ? this.value.substring(this.prefix.length) : this.value;
2067
- },
2068
- set(t) {
2069
- this.updateValue({ phone: t });
2070
- }
2016
+ barSize() {
2017
+ return this.isRange ? `${100 * (this.maxValue - this.minValue) / (this.max - this.min)}%` : `${100 * (this.value1 - this.min) / (this.max - this.min)}%`;
2071
2018
  },
2072
- sortedRegions() {
2073
- return (Object.keys(l) || []).map((t) => ({
2074
- key: t,
2075
- title: `${l[t].name} (${t})`,
2076
- callingCode: l[t].callingCode
2077
- })).sort((t, e) => t.title.localeCompare(e.title));
2019
+ barStart() {
2020
+ return this.isRange ? `${100 * (this.minValue - this.min) / (this.max - this.min)}%` : "0%";
2021
+ },
2022
+ precision() {
2023
+ const t = [this.min, this.max, this.step].map((e) => {
2024
+ const i = `${e}`.split(".")[1];
2025
+ return i ? i.length : 0;
2026
+ });
2027
+ return Math.max(...t);
2028
+ },
2029
+ barStyle() {
2030
+ return {
2031
+ width: this.barSize,
2032
+ left: this.barStart
2033
+ };
2034
+ },
2035
+ rootClasses() {
2036
+ return {
2037
+ "is-rounded": this.rounded,
2038
+ "is-dragging": this.dragging,
2039
+ "is-disabled": this.disabled,
2040
+ "slider-focus": this.biggerSliderFocus
2041
+ };
2042
+ }
2043
+ },
2044
+ watch: {
2045
+ /**
2046
+ * When v-model is changed set the new active step.
2047
+ */
2048
+ value(t) {
2049
+ this.setValues(t);
2050
+ },
2051
+ value1() {
2052
+ this.onInternalValueUpdate();
2053
+ },
2054
+ value2() {
2055
+ this.onInternalValueUpdate();
2056
+ },
2057
+ min() {
2058
+ this.setValues(this.value);
2059
+ },
2060
+ max() {
2061
+ this.setValues(this.value);
2078
2062
  }
2079
2063
  },
2064
+ created() {
2065
+ this.isThumbReversed = !1, this.isTrackClickDisabled = !1, this.setValues(this.value);
2066
+ },
2080
2067
  methods: {
2081
- getRegionByCallingCode(t) {
2082
- return t ? (Object.keys(l) || []).find(
2083
- (i) => t === l[i].callingCode
2084
- ) : null;
2068
+ setValues(t) {
2069
+ if (!(this.min > this.max))
2070
+ if (Array.isArray(t)) {
2071
+ this.isRange = !0;
2072
+ const e = typeof t[0] != "number" || isNaN(t[0]) ? this.min : p(t[0], this.min, this.max), i = typeof t[1] != "number" || isNaN(t[1]) ? this.max : p(t[1], this.min, this.max);
2073
+ this.value1 = this.isThumbReversed ? i : e, this.value2 = this.isThumbReversed ? e : i;
2074
+ } else
2075
+ this.isRange = !1, this.value1 = isNaN(t) ? this.min : p(t, this.min, this.max), this.value2 = null;
2085
2076
  },
2086
- updateValue({ prefix: t, phone: e }) {
2087
- const i = t !== void 0 ? t : this.prefix || "", s = e !== void 0 ? e : this.phone || "", n = `${i}${s}`;
2088
- n !== i ? (this.$emit("input", n), this.region || this.$emit("update:region", this.internalRegion), this.internalPrefix = null) : (this.internalPrefix = i, this.$emit("input", ""));
2077
+ onInternalValueUpdate() {
2078
+ this.isRange && (this.isThumbReversed = this.value1 > this.value2), (!this.lazy || !this.dragging) && this.emitValue("input"), this.dragging && this.emitValue("dragging");
2079
+ },
2080
+ sliderSize() {
2081
+ return this.$refs.slider.getBoundingClientRect().width;
2082
+ },
2083
+ onSliderClick(t) {
2084
+ if (this.disabled || this.isTrackClickDisabled)
2085
+ return;
2086
+ const e = this.$refs.slider.getBoundingClientRect().left, i = (t.clientX - e) / this.sliderSize() * 100, s = this.min + i * (this.max - this.min) / 100, n = Math.abs(s - this.value1);
2087
+ if (this.isRange) {
2088
+ const a = Math.abs(s - this.value2);
2089
+ if (n <= a) {
2090
+ if (n < this.step / 2)
2091
+ return;
2092
+ this.$refs.button1.setPosition(i);
2093
+ } else {
2094
+ if (a < this.step / 2)
2095
+ return;
2096
+ this.$refs.button2.setPosition(i);
2097
+ }
2098
+ } else {
2099
+ if (n < this.step / 2)
2100
+ return;
2101
+ this.$refs.button1.setPosition(i);
2102
+ }
2103
+ this.emitValue("change");
2104
+ },
2105
+ onDragStart() {
2106
+ this.dragging = !0, this.$emit("dragstart");
2107
+ },
2108
+ onDragEnd() {
2109
+ this.isTrackClickDisabled = !0, setTimeout(() => {
2110
+ this.isTrackClickDisabled = !1;
2111
+ }, 0), this.dragging = !1, this.$emit("dragend"), this.lazy && this.emitValue("input");
2112
+ },
2113
+ emitValue(t) {
2114
+ this.$emit(
2115
+ t,
2116
+ this.isRange ? [this.minValue, this.maxValue] : this.value1
2117
+ );
2089
2118
  }
2090
2119
  }
2091
2120
  };
2092
- var At = function() {
2121
+ var Bt = function() {
2093
2122
  var e = this, i = e._self._c;
2094
- return i("CField", { staticClass: "has-addons", attrs: { expanded: "" } }, [i("div", { staticClass: "control" }, [i("SmartList", { attrs: { query: e.searchQuery, items: e.sortedRegions }, scopedSlots: e._u([{ key: "default", fn: function({ items: s }) {
2095
- return [i("CDropdown", { staticClass: "control", staticStyle: { height: "100%" }, attrs: { size: e.$attrs.size, disabled: e.$attrs.disabled, "menu-styling": {
2096
- maxWidth: "300px"
2097
- }, scrollable: !0, position: "is-bottom-right", "max-height": "240px" }, model: { value: e.internalRegion, callback: function(n) {
2098
- e.internalRegion = n;
2099
- }, expression: "internalRegion" } }, [i("CButton", { staticStyle: { height: "100%" }, attrs: { slot: "trigger", size: e.$attrs.size, type: "none", pattern: "secondary" }, slot: "trigger" }, [i("Flag", { staticStyle: { "margin-right": "0.35em" }, attrs: { region: e.internalRegion } }), e._v(" " + e._s(e.prefix) + " ")], 1), i("CInput", { staticStyle: { "margin-bottom": "0.25em" }, attrs: { slot: "header", placeholder: e.$t("_common:search"), filled: "" }, slot: "header", model: { value: e.searchQuery, callback: function(n) {
2100
- e.searchQuery = n;
2101
- }, expression: "searchQuery" } }), e._l(s, function({ key: n, title: a, callingCode: r }) {
2102
- return i("CDropdownItem", { key: n, staticClass: "truncate-text", attrs: { value: n } }, [i("Flag", { staticStyle: { "margin-right": "0.75em", flex: "0 0 auto" }, attrs: { region: n, title: a } }), i("span", { staticClass: "truncate-text" }, [e._v(" " + e._s(a) + " (" + e._s(r) + ") ")])], 1);
2103
- })], 2)];
2104
- } }]) })], 1), i("CField", { staticClass: "control", attrs: { label: e.label, "label-position": e.labelPosition, expanded: "" } }, [i("CInput", e._b({ attrs: { size: e.$attrs.size, placeholder: e.$attrs.placeholder, type: "tel" }, model: { value: e.phone, callback: function(s) {
2105
- e.phone = s;
2106
- }, expression: "phone" } }, "CInput", { ...e.$attrs, ...e.$props }, !1))], 1)], 1);
2107
- }, Bt = [], It = /* @__PURE__ */ o(
2108
- Ft,
2123
+ return i("div", { staticClass: "c-slider", class: [`is-${e.size}`, `is-${e.type}`, e.rootClasses], on: { click: e.onSliderClick } }, [i("div", { ref: "slider", staticClass: "c-slider-track" }, [i("div", { staticClass: "c-slider-fill", style: e.barStyle }), e.ticks ? e._l(e.tickValues, function(s, n) {
2124
+ return i("CSliderTick", { key: n, attrs: { value: s } });
2125
+ }) : e._e(), e._t("default"), i("CSliderThumb", { ref: "button1", attrs: { type: `is-${e.newTooltipType}`, tooltip: e.tooltip, "custom-formatter": e.customFormatter, "aria-valuenow": e.value1, "aria-valuemin": e.min, "aria-valuemax": e.max, "aria-label": Array.isArray(e.ariaLabel) ? e.ariaLabel[0] : e.ariaLabel, "aria-disabled": e.disabled, role: "slider", "aria-orientation": "horizontal" }, on: { dragstart: e.onDragStart, dragend: e.onDragEnd }, model: { value: e.value1, callback: function(s) {
2126
+ e.value1 = s;
2127
+ }, expression: "value1" } }), e.isRange ? i("CSliderThumb", { ref: "button2", attrs: { type: e.newTooltipType, tooltip: e.tooltip, "custom-formatter": e.customFormatter, "aria-valuenow": e.value2, "aria-valuemin": e.min, "aria-valuemax": e.max, "aria-label": Array.isArray(e.ariaLabel) ? e.ariaLabel[1] : "", "aria-disabled": e.disabled, role: "slider", "aria-orientation": "horizontal" }, on: { dragstart: e.onDragStart, dragend: e.onDragEnd }, model: { value: e.value2, callback: function(s) {
2128
+ e.value2 = s;
2129
+ }, expression: "value2" } }) : e._e()], 2)]);
2130
+ }, It = [], Ot = /* @__PURE__ */ o(
2109
2131
  At,
2110
2132
  Bt,
2133
+ It,
2111
2134
  !1,
2112
2135
  null,
2113
- null,
2114
- null,
2115
2136
  null
2116
2137
  );
2117
- const A = It.exports, Ot = {
2118
- name: "CSliderThumb",
2119
- inheritAttrs: !1,
2138
+ const V = Ot.exports, Tt = {
2139
+ name: "CSwitch",
2120
2140
  props: {
2121
2141
  value: {
2122
- type: Number,
2123
- default: 0
2142
+ type: [String, Number, Boolean, Function, Object, Array, Date],
2143
+ default: null
2144
+ },
2145
+ nativeValue: {
2146
+ type: [String, Number, Boolean, Function, Object, Array, Date],
2147
+ default: null
2124
2148
  },
2149
+ disabled: Boolean,
2125
2150
  type: {
2126
2151
  type: String,
2127
2152
  default: ""
2128
2153
  },
2129
- tooltip: {
2130
- type: Boolean,
2154
+ name: {
2155
+ type: String,
2156
+ default: ""
2157
+ },
2158
+ required: Boolean,
2159
+ size: {
2160
+ type: String,
2161
+ default: ""
2162
+ },
2163
+ trueValue: {
2164
+ type: [String, Number, Boolean, Function, Object, Array, Date],
2131
2165
  default: !0
2132
2166
  },
2133
- customFormatter: Function
2167
+ falseValue: {
2168
+ type: [String, Number, Boolean, Function, Object, Array, Date],
2169
+ default: !1
2170
+ },
2171
+ rounded: {
2172
+ type: Boolean,
2173
+ default: !0
2174
+ }
2134
2175
  },
2135
2176
  data() {
2136
2177
  return {
2137
- isFocused: !1,
2138
- dragging: !1,
2139
- startX: 0,
2140
- startPosition: 0,
2141
- newPosition: null,
2142
- oldValue: this.value
2178
+ newValue: this.value
2143
2179
  };
2144
2180
  },
2145
2181
  computed: {
2146
- disabled() {
2147
- return this.$parent.disabled;
2148
- },
2149
- max() {
2150
- return this.$parent.max;
2151
- },
2152
- min() {
2153
- return this.$parent.min;
2154
- },
2155
- step() {
2156
- return this.$parent.step;
2157
- },
2158
- precision() {
2159
- return this.$parent.precision;
2160
- },
2161
- currentPosition() {
2162
- return `${(this.value - this.min) / (this.max - this.min) * 100}%`;
2163
- },
2164
- wrapperStyle() {
2165
- return { left: this.currentPosition };
2182
+ computedValue: {
2183
+ get() {
2184
+ return this.newValue;
2185
+ },
2186
+ set(t) {
2187
+ this.newValue = t, this.$emit("input", t);
2188
+ }
2166
2189
  },
2167
- tooltipLabel() {
2168
- return typeof this.customFormatter < "u" ? this.customFormatter(this.value) : this.value.toString();
2190
+ newClass() {
2191
+ return [
2192
+ `is-${this.size}`,
2193
+ {
2194
+ "is-disabled": this.disabled,
2195
+ "is-rounded": this.rounded
2196
+ }
2197
+ ];
2198
+ }
2199
+ },
2200
+ watch: {
2201
+ /**
2202
+ * When v-model change, set internal value.
2203
+ */
2204
+ value(t) {
2205
+ this.newValue = t;
2169
2206
  }
2170
2207
  },
2171
2208
  methods: {
2172
- onFocus() {
2173
- this.isFocused = !0;
2174
- },
2175
- onBlur() {
2176
- this.isFocused = !1;
2177
- },
2178
- onButtonDown(t) {
2179
- this.disabled || (t.preventDefault(), this.onDragStart(t), typeof window < "u" && (document.addEventListener("mousemove", this.onDragging), document.addEventListener("touchmove", this.onDragging), document.addEventListener("mouseup", this.onDragEnd), document.addEventListener("touchend", this.onDragEnd), document.addEventListener("contextmenu", this.onDragEnd)));
2180
- },
2181
- onLeftKeyDown() {
2182
- this.disabled || this.value === this.min || (this.newPosition = parseFloat(this.currentPosition) - this.step / (this.max - this.min) * 100, this.setPosition(this.newPosition), this.$parent.emitValue("change"));
2183
- },
2184
- onRightKeyDown() {
2185
- this.disabled || this.value === this.max || (this.newPosition = parseFloat(this.currentPosition) + this.step / (this.max - this.min) * 100, this.setPosition(this.newPosition), this.$parent.emitValue("change"));
2186
- },
2187
- onHomeKeyDown() {
2188
- this.disabled || this.value === this.min || (this.newPosition = 0, this.setPosition(this.newPosition), this.$parent.emitValue("change"));
2189
- },
2190
- onEndKeyDown() {
2191
- this.disabled || this.value === this.max || (this.newPosition = 100, this.setPosition(this.newPosition), this.$parent.emitValue("change"));
2192
- },
2193
- onDragStart(t) {
2194
- this.dragging = !0, this.$emit("dragstart"), t.type === "touchstart" && (t.clientX = t.touches[0].clientX), this.startX = t.clientX, this.startPosition = parseFloat(this.currentPosition), this.newPosition = this.startPosition;
2195
- },
2196
- onDragging(t) {
2197
- if (this.dragging) {
2198
- t.type === "touchmove" && (t.clientX = t.touches[0].clientX);
2199
- const e = (t.clientX - this.startX) / this.$parent.sliderSize() * 100;
2200
- this.newPosition = this.startPosition + e, this.setPosition(this.newPosition);
2201
- }
2202
- },
2203
- onDragEnd() {
2204
- this.dragging = !1, this.$emit("dragend"), this.value !== this.oldValue && this.$parent.emitValue("change"), this.setPosition(this.newPosition), typeof window < "u" && (document.removeEventListener("mousemove", this.onDragging), document.removeEventListener("touchmove", this.onDragging), document.removeEventListener("mouseup", this.onDragEnd), document.removeEventListener("touchend", this.onDragEnd), document.removeEventListener("contextmenu", this.onDragEnd));
2205
- },
2206
- setPosition(t) {
2207
- if (t === null || isNaN(t))
2208
- return;
2209
- t < 0 ? t = 0 : t > 100 && (t = 100);
2210
- const e = 100 / ((this.max - this.min) / this.step);
2211
- let s = Math.round(t / e) * e / 100 * (this.max - this.min) + this.min;
2212
- s = parseFloat(s.toFixed(this.precision)), this.$emit("input", s), !this.dragging && s !== this.oldValue && (this.oldValue = s);
2209
+ focus() {
2210
+ this.$refs.input.focus();
2213
2211
  }
2214
2212
  }
2215
2213
  };
2216
- var Tt = function() {
2214
+ var Pt = function() {
2217
2215
  var e = this, i = e._self._c;
2218
- return i("div", { staticClass: "c-slider-thumb-wrapper", class: { "is-dragging": e.dragging }, style: e.wrapperStyle }, [i("div", e._b({ staticClass: "c-slider-thumb", attrs: { tabindex: e.disabled ? !1 : 0 }, on: { mousedown: e.onButtonDown, touchstart: e.onButtonDown, focus: e.onFocus, blur: e.onBlur, keydown: [function(s) {
2219
- return !s.type.indexOf("key") && e._k(s.keyCode, "left", 37, s.key, ["Left", "ArrowLeft"]) || "button" in s && s.button !== 0 ? null : (s.preventDefault(), e.onLeftKeyDown.apply(null, arguments));
2220
- }, function(s) {
2221
- return !s.type.indexOf("key") && e._k(s.keyCode, "right", 39, s.key, ["Right", "ArrowRight"]) || "button" in s && s.button !== 2 ? null : (s.preventDefault(), e.onRightKeyDown.apply(null, arguments));
2222
- }, function(s) {
2223
- return !s.type.indexOf("key") && e._k(s.keyCode, "down", 40, s.key, ["Down", "ArrowDown"]) ? null : (s.preventDefault(), e.onLeftKeyDown.apply(null, arguments));
2224
- }, function(s) {
2225
- return !s.type.indexOf("key") && e._k(s.keyCode, "up", 38, s.key, ["Up", "ArrowUp"]) ? null : (s.preventDefault(), e.onRightKeyDown.apply(null, arguments));
2226
- }, function(s) {
2227
- return !s.type.indexOf("key") && e._k(s.keyCode, "home", void 0, s.key, void 0) ? null : (s.preventDefault(), e.onHomeKeyDown.apply(null, arguments));
2228
- }, function(s) {
2229
- return !s.type.indexOf("key") && e._k(s.keyCode, "end", void 0, s.key, void 0) ? null : (s.preventDefault(), e.onEndKeyDown.apply(null, arguments));
2230
- }] } }, "div", e.$attrs, !1))]);
2231
- }, Pt = [], Rt = /* @__PURE__ */ o(
2232
- Ot,
2216
+ return i("label", { ref: "label", staticClass: "switch", class: e.newClass, attrs: { disabled: e.disabled }, on: { click: e.focus, keydown: function(s) {
2217
+ return !s.type.indexOf("key") && e._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : (s.preventDefault(), e.$refs.label.click());
2218
+ } } }, [i("input", { directives: [{ name: "model", rawName: "v-model", value: e.computedValue, expression: "computedValue" }], ref: "input", attrs: { disabled: e.disabled, name: e.name, required: e.required, "true-value": e.trueValue, "false-value": e.falseValue, type: "checkbox" }, domProps: { value: e.nativeValue, checked: Array.isArray(e.computedValue) ? e._i(e.computedValue, e.nativeValue) > -1 : e._q(e.computedValue, e.trueValue) }, on: { click: function(s) {
2219
+ s.stopPropagation();
2220
+ }, change: function(s) {
2221
+ var n = e.computedValue, a = s.target, r = a.checked ? e.trueValue : e.falseValue;
2222
+ if (Array.isArray(n)) {
2223
+ var d = e.nativeValue, u = e._i(n, d);
2224
+ a.checked ? u < 0 && (e.computedValue = n.concat([d])) : u > -1 && (e.computedValue = n.slice(0, u).concat(n.slice(u + 1)));
2225
+ } else
2226
+ e.computedValue = r;
2227
+ } } }), i("span", { staticClass: "check", class: [`is-${e.type}`] }), i("span", { staticClass: "control-label" }, [e._t("default")], 2)]);
2228
+ }, Mt = [], Rt = /* @__PURE__ */ o(
2233
2229
  Tt,
2234
2230
  Pt,
2231
+ Mt,
2235
2232
  !1,
2236
2233
  null,
2237
- null,
2234
+ "4cdd239d"
2235
+ );
2236
+ const F = Rt.exports, Et = {
2237
+ name: "CTabItem",
2238
+ props: {
2239
+ label: String,
2240
+ icon: String,
2241
+ iconPack: String,
2242
+ disabled: Boolean,
2243
+ visible: {
2244
+ type: Boolean,
2245
+ default: !0
2246
+ },
2247
+ value: [String, Number]
2248
+ },
2249
+ data() {
2250
+ return {
2251
+ isActive: !1,
2252
+ transitionName: null,
2253
+ _isTabItem: !0
2254
+ // Used internally by Tab
2255
+ };
2256
+ },
2257
+ created() {
2258
+ if (!this.$parent.$data._isTabs)
2259
+ throw this.$destroy(), new Error("You should wrap bTabItem on a bTabs");
2260
+ this.$parent.refreshSlots();
2261
+ },
2262
+ beforeDestroy() {
2263
+ this.$parent.refreshSlots();
2264
+ },
2265
+ methods: {
2266
+ /**
2267
+ * Activate tab, alter animation name based on the index.
2268
+ */
2269
+ activate(t, e) {
2270
+ this.transitionName = e < t ? this.$parent.vertical ? "slide-down" : "slide-next" : this.$parent.vertical ? "slide-up" : "slide-prev", this.isActive = !0;
2271
+ },
2272
+ /**
2273
+ * Deactivate tab, alter animation name based on the index.
2274
+ */
2275
+ deactivate(t, e) {
2276
+ this.transitionName = e < t ? this.$parent.vertical ? "slide-down" : "slide-next" : this.$parent.vertical ? "slide-up" : "slide-prev", this.isActive = !1;
2277
+ }
2278
+ },
2279
+ render(t) {
2280
+ if (this.$parent.destroyOnHide && (!this.isActive || !this.visible))
2281
+ return;
2282
+ const e = t(
2283
+ "div",
2284
+ {
2285
+ directives: [
2286
+ {
2287
+ name: "show",
2288
+ value: this.isActive && this.visible
2289
+ }
2290
+ ],
2291
+ class: "tab-item"
2292
+ },
2293
+ this.$slots.default
2294
+ );
2295
+ return this.$parent.animated ? t(
2296
+ "transition",
2297
+ {
2298
+ props: {
2299
+ name: this.transitionName,
2300
+ mode: "out-in"
2301
+ },
2302
+ on: {
2303
+ "before-enter": () => {
2304
+ this.$parent.isTransitioning = !0;
2305
+ },
2306
+ "after-enter": () => {
2307
+ this.$parent.isTransitioning = !1;
2308
+ }
2309
+ }
2310
+ },
2311
+ [e]
2312
+ ) : e;
2313
+ }
2314
+ }, zt = null, Nt = null;
2315
+ var Lt = /* @__PURE__ */ o(
2316
+ Et,
2317
+ zt,
2318
+ Nt,
2319
+ !1,
2238
2320
  null,
2239
2321
  null
2240
2322
  );
2241
- const Mt = Rt.exports, zt = {
2242
- name: "CSliderTick",
2323
+ const A = Lt.exports, Ht = {
2324
+ name: "CSlotComponent",
2243
2325
  props: {
2244
- value: {
2245
- type: Number,
2246
- default: 0
2326
+ component: {
2327
+ type: Object,
2328
+ required: !0
2329
+ },
2330
+ name: {
2331
+ type: String,
2332
+ default: "default"
2333
+ },
2334
+ scoped: {
2335
+ type: Boolean
2336
+ },
2337
+ props: {
2338
+ type: Object
2339
+ },
2340
+ tag: {
2341
+ type: String,
2342
+ default: "div"
2343
+ },
2344
+ event: {
2345
+ type: String,
2346
+ default: "hook:updated"
2247
2347
  }
2248
2348
  },
2249
- computed: {
2250
- position() {
2251
- const t = (this.value - this.$parent.min) / (this.$parent.max - this.$parent.min) * 100;
2252
- return t >= 0 && t <= 100 ? t : 0;
2349
+ methods: {
2350
+ refresh() {
2351
+ this.$forceUpdate();
2253
2352
  },
2254
- hidden() {
2255
- return this.value === this.$parent.min || this.value === this.$parent.max;
2353
+ isVueComponent() {
2354
+ return this.component && this.component._isVue;
2256
2355
  }
2257
2356
  },
2258
2357
  created() {
2259
- if (!this.$parent.$data._isSlider)
2260
- throw this.$destroy(), new Error("You should wrap bSliderTick on a bSlider");
2358
+ this.isVueComponent() && this.component.$on(this.event, this.refresh);
2261
2359
  },
2262
- methods: {
2263
- getTickStyle(t) {
2264
- return { left: `${t}%` };
2265
- }
2360
+ beforeDestroy() {
2361
+ this.isVueComponent() && this.component.$off(this.event, this.refresh);
2362
+ },
2363
+ render(t) {
2364
+ if (this.isVueComponent())
2365
+ return t(
2366
+ this.tag,
2367
+ {},
2368
+ this.scoped ? this.component.$scopedSlots[this.name](this.props) : this.component.$slots[this.name]
2369
+ );
2266
2370
  }
2267
- };
2268
- var Nt = function() {
2269
- var e = this, i = e._self._c;
2270
- return i("div", { staticClass: "c-slider-tick", class: { "is-tick-hidden": e.hidden }, style: e.getTickStyle(e.position) }, [e.$slots.default ? i("span", { staticClass: "c-slider-tick-label" }, [e._t("default")], 2) : e._e()]);
2271
- }, Et = [], Lt = /* @__PURE__ */ o(
2272
- zt,
2273
- Nt,
2274
- Et,
2275
- !1,
2276
- null,
2277
- null,
2278
- null,
2279
- null
2280
- );
2281
- const Ht = Lt.exports, qt = {
2282
- name: "CSlider",
2371
+ }, qt = {
2372
+ name: "CTabs",
2283
2373
  components: {
2284
- CSliderThumb: Mt,
2285
- CSliderTick: Ht
2374
+ CSlotComponent: Ht
2286
2375
  },
2287
2376
  props: {
2288
2377
  value: {
2289
- type: [Number, Array],
2290
- default: 0
2291
- },
2292
- min: {
2293
- type: Number,
2294
- default: 0
2295
- },
2296
- max: {
2297
- type: Number,
2298
- default: 100
2299
- },
2300
- step: {
2301
- type: Number,
2302
- default: 1
2378
+ type: [Number, String],
2379
+ default: null
2303
2380
  },
2381
+ expanded: Boolean,
2304
2382
  type: {
2305
2383
  type: String,
2306
- default: "primary"
2307
- },
2308
- size: String,
2309
- ticks: {
2310
- type: Boolean,
2311
- default: !1
2384
+ default: null
2312
2385
  },
2313
- tooltip: {
2314
- type: Boolean,
2315
- default: !0
2386
+ size: {
2387
+ type: String,
2388
+ default: null
2316
2389
  },
2317
- tooltipType: String,
2318
- rounded: {
2319
- type: Boolean,
2320
- default: !1
2390
+ position: {
2391
+ type: String,
2392
+ validator(t) {
2393
+ return ["left", "right", "center"].indexOf(t) > -1;
2394
+ },
2395
+ default: null
2321
2396
  },
2322
- disabled: {
2397
+ animated: {
2323
2398
  type: Boolean,
2324
- default: !1
2399
+ default: !0
2325
2400
  },
2326
- lazy: {
2401
+ destroyOnHide: {
2327
2402
  type: Boolean,
2328
2403
  default: !1
2329
2404
  },
2330
- customFormatter: Function,
2331
- ariaLabel: [String, Array],
2332
- biggerSliderFocus: {
2333
- type: Boolean,
2334
- default: !1
2335
- }
2405
+ vertical: Boolean,
2406
+ multiline: Boolean
2336
2407
  },
2337
2408
  data() {
2338
2409
  return {
2339
- value1: null,
2340
- value2: null,
2341
- dragging: !1,
2342
- isRange: !1,
2343
- _isSlider: !0
2344
- // Used by Thumb and Tick
2410
+ activeTab: 0,
2411
+ defaultSlots: [],
2412
+ contentHeight: 0,
2413
+ isTransitioning: !1,
2414
+ _isTabs: !0
2415
+ // Used internally by TabItem
2345
2416
  };
2346
2417
  },
2347
2418
  computed: {
2348
- newTooltipType() {
2349
- return this.tooltipType ? this.tooltipType : this.type;
2350
- },
2351
- tickValues() {
2352
- if (!this.ticks || this.min > this.max || this.step === 0)
2353
- return [];
2354
- const t = [];
2355
- for (let e = this.min + this.step; e < this.max; e += this.step)
2356
- t.push(e);
2357
- return t;
2358
- },
2359
- minValue() {
2360
- return Math.min(this.value1, this.value2);
2361
- },
2362
- maxValue() {
2363
- return Math.max(this.value1, this.value2);
2364
- },
2365
- barSize() {
2366
- return this.isRange ? `${100 * (this.maxValue - this.minValue) / (this.max - this.min)}%` : `${100 * (this.value1 - this.min) / (this.max - this.min)}%`;
2367
- },
2368
- barStart() {
2369
- return this.isRange ? `${100 * (this.minValue - this.min) / (this.max - this.min)}%` : "0%";
2370
- },
2371
- precision() {
2372
- const t = [this.min, this.max, this.step].map((e) => {
2373
- const i = `${e}`.split(".")[1];
2374
- return i ? i.length : 0;
2375
- });
2376
- return Math.max(...t);
2377
- },
2378
- barStyle() {
2419
+ mainClasses() {
2379
2420
  return {
2380
- width: this.barSize,
2381
- left: this.barStart
2421
+ "is-fullwidth": this.expanded,
2422
+ "is-vertical": this.vertical,
2423
+ "is-multiline": this.multiline,
2424
+ [`is-${this.position}`]: this.position && this.vertical
2382
2425
  };
2383
2426
  },
2384
- rootClasses() {
2385
- return {
2386
- "is-rounded": this.rounded,
2387
- "is-dragging": this.dragging,
2388
- "is-disabled": this.disabled,
2389
- "slider-focus": this.biggerSliderFocus
2390
- };
2427
+ navClasses() {
2428
+ return [
2429
+ this.type,
2430
+ {
2431
+ [`is-${this.size}`]: !!this.size,
2432
+ [`is-${this.position}`]: this.position && !this.vertical,
2433
+ "is-fullwidth": this.expanded,
2434
+ "is-toggle-rounded is-toggle": this.type === "is-toggle-rounded"
2435
+ }
2436
+ ];
2437
+ },
2438
+ tabItems() {
2439
+ return this.defaultSlots.filter(
2440
+ (t) => t.componentInstance && t.componentInstance.$data && t.componentInstance.$data._isTabItem
2441
+ ).map((t) => t.componentInstance);
2391
2442
  }
2392
2443
  },
2393
2444
  watch: {
2394
2445
  /**
2395
- * When v-model is changed set the new active step.
2446
+ * When v-model is changed set the new active tab.
2396
2447
  */
2397
2448
  value(t) {
2398
- this.setValues(t);
2399
- },
2400
- value1() {
2401
- this.onInternalValueUpdate();
2402
- },
2403
- value2() {
2404
- this.onInternalValueUpdate();
2405
- },
2406
- min() {
2407
- this.setValues(this.value);
2449
+ const e = this.getIndexByValue(t, t);
2450
+ this.changeTab(e);
2408
2451
  },
2409
- max() {
2410
- this.setValues(this.value);
2452
+ /**
2453
+ * When tab-items are updated, set active one.
2454
+ */
2455
+ tabItems() {
2456
+ if (this.activeTab < this.tabItems.length) {
2457
+ let t = this.activeTab;
2458
+ this.tabItems.map((e, i) => {
2459
+ e.isActive && (t = i, t < this.tabItems.length && (this.tabItems[t].isActive = !1));
2460
+ }), this.tabItems[this.activeTab].isActive = !0;
2461
+ } else
2462
+ this.activeTab > 0 && this.changeTab(this.activeTab - 1);
2411
2463
  }
2412
2464
  },
2413
- created() {
2414
- this.isThumbReversed = !1, this.isTrackClickDisabled = !1, this.setValues(this.value);
2465
+ mounted() {
2466
+ this.activeTab = this.getIndexByValue(this.value || 0), this.activeTab < this.tabItems.length && (this.tabItems[this.activeTab].isActive = !0), this.refreshSlots();
2415
2467
  },
2416
2468
  methods: {
2417
- setValues(t) {
2418
- if (!(this.min > this.max))
2419
- if (Array.isArray(t)) {
2420
- this.isRange = !0;
2421
- const e = typeof t[0] != "number" || isNaN(t[0]) ? this.min : p(t[0], this.min, this.max), i = typeof t[1] != "number" || isNaN(t[1]) ? this.max : p(t[1], this.min, this.max);
2422
- this.value1 = this.isThumbReversed ? i : e, this.value2 = this.isThumbReversed ? e : i;
2423
- } else
2424
- this.isRange = !1, this.value1 = isNaN(t) ? this.min : p(t, this.min, this.max), this.value2 = null;
2425
- },
2426
- onInternalValueUpdate() {
2427
- this.isRange && (this.isThumbReversed = this.value1 > this.value2), (!this.lazy || !this.dragging) && this.emitValue("input"), this.dragging && this.emitValue("dragging");
2428
- },
2429
- sliderSize() {
2430
- return this.$refs.slider.getBoundingClientRect().width;
2469
+ /**
2470
+ * Change the active tab and emit change event.
2471
+ */
2472
+ changeTab(t) {
2473
+ this.activeTab === t || this.tabItems[t] === void 0 || (this.activeTab < this.tabItems.length && this.tabItems[this.activeTab].deactivate(this.activeTab, t), this.tabItems[t].activate(this.activeTab, t), this.activeTab = t, this.$emit("change", this.getValueByIndex(t)));
2431
2474
  },
2432
- onSliderClick(t) {
2433
- if (this.disabled || this.isTrackClickDisabled)
2434
- return;
2435
- const e = this.$refs.slider.getBoundingClientRect().left, i = (t.clientX - e) / this.sliderSize() * 100, s = this.min + i * (this.max - this.min) / 100, n = Math.abs(s - this.value1);
2436
- if (this.isRange) {
2437
- const a = Math.abs(s - this.value2);
2438
- if (n <= a) {
2439
- if (n < this.step / 2)
2440
- return;
2441
- this.$refs.button1.setPosition(i);
2442
- } else {
2443
- if (a < this.step / 2)
2444
- return;
2445
- this.$refs.button2.setPosition(i);
2446
- }
2447
- } else {
2448
- if (n < this.step / 2)
2449
- return;
2450
- this.$refs.button1.setPosition(i);
2451
- }
2452
- this.emitValue("change");
2475
+ /**
2476
+ * Tab click listener, emit input event and change active tab.
2477
+ */
2478
+ tabClick(t) {
2479
+ this.activeTab !== t && (this.$emit("input", this.getValueByIndex(t)), this.changeTab(t));
2453
2480
  },
2454
- onDragStart() {
2455
- this.dragging = !0, this.$emit("dragstart");
2481
+ refreshSlots() {
2482
+ this.defaultSlots = this.$slots.default || [];
2456
2483
  },
2457
- onDragEnd() {
2458
- this.isTrackClickDisabled = !0, setTimeout(() => {
2459
- this.isTrackClickDisabled = !1;
2460
- }, 0), this.dragging = !1, this.$emit("dragend"), this.lazy && this.emitValue("input");
2484
+ getIndexByValue(t) {
2485
+ const e = this.tabItems.map(
2486
+ (i) => i.$options.propsData ? i.$options.propsData.value : void 0
2487
+ ).indexOf(t);
2488
+ return e >= 0 ? e : t;
2461
2489
  },
2462
- emitValue(t) {
2463
- this.$emit(
2464
- t,
2465
- this.isRange ? [this.minValue, this.maxValue] : this.value1
2466
- );
2490
+ getValueByIndex(t) {
2491
+ const { propsData: e } = this.tabItems[t].$options;
2492
+ return e && e.value ? e.value : t;
2467
2493
  }
2468
2494
  }
2469
2495
  };
2470
2496
  var jt = function() {
2471
2497
  var e = this, i = e._self._c;
2472
- return i("div", { staticClass: "c-slider", class: [`is-${e.size}`, `is-${e.type}`, e.rootClasses], on: { click: e.onSliderClick } }, [i("div", { ref: "slider", staticClass: "c-slider-track" }, [i("div", { staticClass: "c-slider-fill", style: e.barStyle }), e.ticks ? e._l(e.tickValues, function(s, n) {
2473
- return i("CSliderTick", { key: n, attrs: { value: s } });
2474
- }) : e._e(), e._t("default"), i("CSliderThumb", { ref: "button1", attrs: { type: `is-${e.newTooltipType}`, tooltip: e.tooltip, "custom-formatter": e.customFormatter, "aria-valuenow": e.value1, "aria-valuemin": e.min, "aria-valuemax": e.max, "aria-label": Array.isArray(e.ariaLabel) ? e.ariaLabel[0] : e.ariaLabel, "aria-disabled": e.disabled, role: "slider", "aria-orientation": "horizontal" }, on: { dragstart: e.onDragStart, dragend: e.onDragEnd }, model: { value: e.value1, callback: function(s) {
2475
- e.value1 = s;
2476
- }, expression: "value1" } }), e.isRange ? i("CSliderThumb", { ref: "button2", attrs: { type: e.newTooltipType, tooltip: e.tooltip, "custom-formatter": e.customFormatter, "aria-valuenow": e.value2, "aria-valuemin": e.min, "aria-valuemax": e.max, "aria-label": Array.isArray(e.ariaLabel) ? e.ariaLabel[1] : "", "aria-disabled": e.disabled, role: "slider", "aria-orientation": "horizontal" }, on: { dragstart: e.onDragStart, dragend: e.onDragEnd }, model: { value: e.value2, callback: function(s) {
2477
- e.value2 = s;
2478
- }, expression: "value2" } }) : e._e()], 2)]);
2498
+ return i("div", { staticClass: "c-tabs", class: e.mainClasses }, [i("nav", { staticClass: "tabs", class: e.navClasses }, [i("ul", e._l(e.tabItems, function(s, n) {
2499
+ return i("li", { directives: [{ name: "show", rawName: "v-show", value: s.visible, expression: "tabItem.visible" }], key: n, class: {
2500
+ "is-active": e.activeTab === n,
2501
+ "is-disabled": s.disabled
2502
+ } }, [s.$slots.header ? i("CSlotComponent", { attrs: { component: s, name: "header", tag: "a" }, nativeOn: { click: function(a) {
2503
+ return e.tabClick(n);
2504
+ } } }) : i("a", { on: { click: function(a) {
2505
+ return e.tabClick(n);
2506
+ } } }, [s.icon ? i("CIcon", { attrs: { size: e.size, type: s.icon } }) : e._e(), i("span", [e._v(e._s(s.label))])], 1)], 1);
2507
+ }), 0)]), i("section", { staticClass: "tab-content", class: { "is-transitioning": e.isTransitioning } }, [e._t("default")], 2)]);
2479
2508
  }, Kt = [], Wt = /* @__PURE__ */ o(
2480
2509
  qt,
2481
2510
  jt,
2482
2511
  Kt,
2483
2512
  !1,
2484
2513
  null,
2485
- null,
2486
- null,
2487
- null
2514
+ "e02a6440"
2488
2515
  );
2489
2516
  const B = Wt.exports;
2490
2517
  function oi(t) {
2491
- t.component(x.name, x), t.component("CAutocomplete", Ze), t.component(y.name, y), t.component(w.name, w), t.component(S.name, S), t.component(h.name, h), t.component(f.name, f), t.component($.name, $), t.component(_.name, _), t.component(k.name, k), t.component(D.name, D), t.component(V.name, V), t.component("CField", je), t.component(F.name, F), t.component(A.name, A), t.component(B.name, B);
2518
+ t.component(D.name, D), t.component("CAutocomplete", Qe), t.component(y.name, y), t.component(S.name, S), t.component($.name, $), t.component(h.name, h), t.component(f.name, f), t.component(k.name, k), t.component(_.name, _), t.component(F.name, F), t.component(B.name, B), t.component(A.name, A), t.component("CField", de), t.component(w.name, w), t.component(x.name, x), t.component(V.name, V);
2492
2519
  }
2493
2520
  export {
2494
- je as C,
2521
+ de as C,
2495
2522
  ri as S,
2496
2523
  oi as i
2497
2524
  };