@cling-se/widget 0.14.2 → 0.14.4

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 (134) hide show
  1. package/.eslintrc.cjs +4 -4
  2. package/README.md +40 -40
  3. package/package.json +1 -1
  4. package/tsconfig.json +26 -26
  5. package/tsconfig.node.json +10 -10
  6. package/tsconfig.paths.json +17 -17
  7. package/vite.config.ts +61 -61
  8. package/dist/AddClientCallout-BP2ip0A4.js +0 -46
  9. package/dist/AnswerModal-C8i3ldB_.js +0 -3869
  10. package/dist/AttachmentItem-BrvrAMae.js +0 -78
  11. package/dist/BaseDatePicker-BSkAllLg.js +0 -3183
  12. package/dist/BaseUpload-J2v3G0-q.js +0 -1977
  13. package/dist/BlockMedia-CAgKbN_k.js +0 -76
  14. package/dist/CCallout-D5Nk5DgN.js +0 -59
  15. package/dist/CCurrencyDropdown-CGYQfYSD.js +0 -246
  16. package/dist/CDropdownItem-DGES8E6l.js +0 -538
  17. package/dist/CField.vue_vue_type_style_index_0_lang-l0sNRNKZ.js +0 -1
  18. package/dist/CFormField-CE4rV3cr.js +0 -241
  19. package/dist/CPhoneFormat-DXPrTit9.js +0 -62
  20. package/dist/CPriceInput-CYsf1n6T.js +0 -112
  21. package/dist/CTabs.vue_vue_type_style_index_0_scoped_e02a6440_lang-l0sNRNKZ.js +0 -1
  22. package/dist/ClientAutocomplete-DPgOfPg1.js +0 -78
  23. package/dist/ClientModal-Dznh8Vvn.js +0 -625
  24. package/dist/ColorPicker-CWQEE8VR.js +0 -2879
  25. package/dist/CompanyModal-CeZ3GgLu.js +0 -141
  26. package/dist/ContentWrapper-DW7VHTdA.js +0 -183
  27. package/dist/CoverBlockSettings-DNSdXFgF.js +0 -275
  28. package/dist/DocAnswer-CPttkKAJ.js +0 -36
  29. package/dist/DocDetails-BCwWW_kM.js +0 -246
  30. package/dist/DocForm-BPjC08Ic.js +0 -7273
  31. package/dist/DocFormSend-BaC8IJCu.js +0 -143
  32. package/dist/DocLinks-DN-S8MY_.js +0 -38
  33. package/dist/DocModalBase-bFJp0T2Y.js +0 -28
  34. package/dist/DocPrint-Ci7Jyh-C.js +0 -240
  35. package/dist/DocReceipt-BYlXr6eS.js +0 -210
  36. package/dist/DocSendReminder-DFx4934a.js +0 -137
  37. package/dist/DocTextEditor-idQMnlIF.js +0 -17177
  38. package/dist/DocTimeline-ZmGSVRUB.js +0 -481
  39. package/dist/DocumentClient-DTRlyvLO.js +0 -136
  40. package/dist/DocumentLayout-BJAyNjNa.js +0 -4909
  41. package/dist/DocumentLogotype-pDJRc6Hj.js +0 -87
  42. package/dist/DocumentVoided-DfKewfe4.js +0 -25
  43. package/dist/EmbedInput-7hLNsnEV.js +0 -113
  44. package/dist/EmbedSettings-CpL24RhA.js +0 -72
  45. package/dist/ErrorCallout-CdJCe67q.js +0 -28
  46. package/dist/FilePreviewModal-B7qT3I7F.js +0 -81
  47. package/dist/Flag-DwW19zju.js +0 -114
  48. package/dist/HeaderSettings-C8SuuAwv.js +0 -392
  49. package/dist/ImageSelectModal-CAOh3YHc.js +0 -84
  50. package/dist/ImageUploadWrapper-21yldsj9.js +0 -1604
  51. package/dist/Index-B0BgYtWI.js +0 -150
  52. package/dist/Index-BC1AhlQ9.js +0 -98
  53. package/dist/Index-BZi6r2UN.js +0 -144
  54. package/dist/Index-BsD09y_2.js +0 -84
  55. package/dist/Index-Bu9SdKLP.js +0 -31
  56. package/dist/Index-BvsqZh2A.js +0 -26
  57. package/dist/Index-Bz4qd9uO.js +0 -55
  58. package/dist/Index-C--GiPc1.js +0 -171
  59. package/dist/Index-CC7qF0br.js +0 -77
  60. package/dist/Index-CGxOvTF4.js +0 -2402
  61. package/dist/Index-CI7_ktvb.js +0 -70
  62. package/dist/Index-COJZmxkX.js +0 -32
  63. package/dist/Index-CObEQ6G-.js +0 -140
  64. package/dist/Index-CP2bsXd-.js +0 -52
  65. package/dist/Index-CSvZBLnp.js +0 -49
  66. package/dist/Index-Ci-hGBbC.js +0 -33
  67. package/dist/Index-Ckzq1cEJ.js +0 -69
  68. package/dist/Index-CoIh5y2F.js +0 -62
  69. package/dist/Index-Couda8BX.js +0 -21
  70. package/dist/Index-CvXt3dm6.js +0 -292
  71. package/dist/Index-D95MNzAZ.js +0 -58
  72. package/dist/Index-DB5EG4EI.js +0 -223
  73. package/dist/Index-DDvRihXA.js +0 -24
  74. package/dist/Index-DIAntwBs.js +0 -61
  75. package/dist/Index-DUdJNcDT.js +0 -25
  76. package/dist/Index-DfANvO5d.js +0 -154
  77. package/dist/Index-Ds1Jv5Mr.js +0 -559
  78. package/dist/Index-FIWsRGmh.js +0 -57
  79. package/dist/Index-M3b7S4YX.js +0 -25
  80. package/dist/Index-NoN1_539.js +0 -642
  81. package/dist/Index-UGFm4yxI.js +0 -107
  82. package/dist/Index-aCBe0dXx.js +0 -754
  83. package/dist/Index-kJFtpJEP.js +0 -46
  84. package/dist/Index-rQKoLISX.js +0 -45
  85. package/dist/InputToggleRow-Ct8rvqAF.js +0 -57
  86. package/dist/ManualPopover-B0vp9ydC.js +0 -54
  87. package/dist/MediaWrapper-hmofOPLv.js +0 -23
  88. package/dist/NotBindingText-COpJPwHe.js +0 -32
  89. package/dist/PackageGroup-BdtslJL-.js +0 -699
  90. package/dist/PdfTerms-EDStBDhn.js +0 -36
  91. package/dist/PdfViewer-D1_Roqu2.js +0 -374
  92. package/dist/PlainHtml-C3JPvt4o.js +0 -20
  93. package/dist/PriceHeader-BdfozyN8.js +0 -339
  94. package/dist/SearchApi-CQtYh98a.js +0 -161
  95. package/dist/Setup-DHHMT6xu.js +0 -50
  96. package/dist/SmartList-BXeRj5NC.js +0 -83
  97. package/dist/TermsSettings-D1tDAu-r.js +0 -102
  98. package/dist/ThemeColorRow-HUN-QPY_.js +0 -63
  99. package/dist/ToggleBinding-CRoVM6Nw.js +0 -38
  100. package/dist/UploadModal-BD3pIiPT.js +0 -95
  101. package/dist/VideoPlayerInput-QFJfPoCf.js +0 -93
  102. package/dist/VideoPlayerSettings-CGq--niu.js +0 -61
  103. package/dist/VideoSelectModal-B61rBqdH.js +0 -100
  104. package/dist/anime.es-BrPTThYb.js +0 -858
  105. package/dist/answerDocumentMixin-DiONfM1s.js +0 -51
  106. package/dist/color-TdtKxwVa.js +0 -19
  107. package/dist/debounce-BIchuVwa.js +0 -84
  108. package/dist/dom-CJxkno7i.js +0 -91
  109. package/dist/favicon.ico +0 -0
  110. package/dist/focusDrawerMixin-CzvgKsOZ.js +0 -22
  111. package/dist/formComponentsInstall-EQLbqYqI.js +0 -2494
  112. package/dist/formDrawerState-CiKGHdNH.js +0 -20
  113. package/dist/formValidationMixin-5BVcxu38.js +0 -49
  114. package/dist/i18nMessages-Chz_lxGG.js +0 -17
  115. package/dist/index-BYTRIZIz.js +0 -81
  116. package/dist/index-Be__C37A.js +0 -102
  117. package/dist/index-CUydiL8B.js +0 -3919
  118. package/dist/index-DH6SCEKQ.js +0 -166
  119. package/dist/index-gtVGRKIX.js +0 -347
  120. package/dist/index-tNIrTnCx.js +0 -492
  121. package/dist/index.es.js +0 -35
  122. package/dist/index.umd.js +0 -3148
  123. package/dist/main-Bp2qcma0.js +0 -56697
  124. package/dist/mapFormMixin-Ce3_WIKw.js +0 -72
  125. package/dist/omit-21u5fFMx.js +0 -31
  126. package/dist/publicSenderState-BcN9kJJr.js +0 -21
  127. package/dist/splitpanes-BHUVsCZF.js +0 -382
  128. package/dist/style.css +0 -4
  129. package/dist/throttle-CfPxqhW_.js +0 -18
  130. package/dist/tinycolor-DNK6zGoq.js +0 -633
  131. package/dist/tippy.esm-B5TcTBWX.js +0 -1799
  132. package/dist/utils-GzwJPAEe.js +0 -108
  133. package/dist/vuedraggable.umd-2pmrPYml.js +0 -3161
  134. package/dist/vuex.esm-DKGl8mcw.js +0 -467
@@ -1,339 +0,0 @@
1
- import { m as c } from "./mapFormMixin-Ce3_WIKw.js";
2
- import { B as l } from "./BlockMedia-CAgKbN_k.js";
3
- import { b as r, w as d, n, ab as m } from "./main-Bp2qcma0.js";
4
- import { t as u } from "./tinycolor-DNK6zGoq.js";
5
- import { s as p } from "./dom-CJxkno7i.js";
6
- import { T as y } from "./DocTextEditor-idQMnlIF.js";
7
- import { i as h } from "./i18nMessages-Chz_lxGG.js";
8
- const _ = {
9
- name: "SummaryBottom",
10
- mixins: [c([])],
11
- inject: ["parentSize"],
12
- props: {
13
- base: {
14
- type: Object,
15
- default: null
16
- },
17
- options: {
18
- type: Array,
19
- default: () => []
20
- },
21
- backgroundColor: {
22
- type: String,
23
- default: "#4c576d"
24
- },
25
- documentCurrency: {
26
- type: String,
27
- required: !0
28
- },
29
- vatType: {
30
- type: String,
31
- required: !0
32
- }
33
- },
34
- data() {
35
- return {
36
- get: r,
37
- tinycolor: u
38
- };
39
- },
40
- computed: {
41
- prices() {
42
- return r(this, "base.prices") || {};
43
- },
44
- isIndivid() {
45
- return r(this.prices, "helpers.isIndivid", !0);
46
- },
47
- showIncVat() {
48
- return this.isIndivid;
49
- },
50
- priceTotal() {
51
- return this.isIndivid ? r(this.prices, "total", null) : r(this.prices, "subTotal", null);
52
- },
53
- priceType() {
54
- return this.prices.type || ["fixed"];
55
- },
56
- currency() {
57
- return this.prices.currency || this.documentCurrency;
58
- },
59
- openAccMaxPrice() {
60
- return this.prices.maxTotal || null;
61
- },
62
- houseWorkType() {
63
- return r(this.prices, "region.houseWorkType", null);
64
- },
65
- isReverseVat() {
66
- return r(this.prices, "region.reverseVat", !1);
67
- },
68
- priceTypeString() {
69
- return this.priceType.includes("openAccMaxPrice") ? this._document.$t("price.openAccMaxPrice") : this.priceType.includes("openAcc") ? this._document.$t("price.openAcc") : this._document.$t("price.price").capitalize();
70
- },
71
- priceDeductionVatString() {
72
- let i = "";
73
- if (this.isReverseVat && !this.showIncVat) {
74
- const t = this.priceFormat(0, {
75
- currency: this.currency,
76
- showZero: !0
77
- });
78
- return i = this._document.$t("summaryBottom.reverseVat", { amount: t }), i;
79
- }
80
- return this.houseWorkType && (i = this._document.$t("deduction.afterType", {
81
- type: `${this.houseWorkType}_percentage`
82
- })), this.showIncVat && (i += ` ${this._document.$t("vat.incVat", {
83
- thing: this._document.$t(`vat.${this.vatType}`)
84
- })}`), this.showIncVat || (i += ` ${this._document.$t("vat.exVat", {
85
- thing: this._document.$t(`vat.${this.vatType}`)
86
- })}`), i.capitalize();
87
- },
88
- backgroundSecondary() {
89
- if (!this.isSmallScreen)
90
- return { backgroundColor: "transparent" };
91
- const i = this.backgroundColor.match(/(\d*\.)?\d+/g)[0], t = this.backgroundColor.match(/(\d*\.)?\d+/g)[1], e = this.backgroundColor.match(/(\d*\.)?\d+/g)[2], s = this.backgroundColor.match(/(\d*\.)?\d+/g)[3];
92
- return {
93
- backgroundColor: `hsla(${i}, ${t ** 0.9}%, ${e ** 0.9}%, ${s})`
94
- };
95
- },
96
- isSmallScreen() {
97
- return this.parentSize.width <= 576;
98
- }
99
- },
100
- methods: {
101
- priceFormat: d,
102
- scrollToPricing() {
103
- const i = document.querySelector("#price");
104
- i && p(i);
105
- }
106
- }
107
- };
108
- var v = function() {
109
- var t = this, e = t._self._c;
110
- return e("section", { staticClass: "summary-bottom-root" }, [e("div", { staticClass: "summary-bottom", style: [
111
- {
112
- backgroundColor: t.backgroundColor,
113
- color: t.tinycolor.readability(t.backgroundColor, "#FFF") > 2.2 ? "#FFF" : "#000"
114
- },
115
- t.options.length && {
116
- overflow: "hidden",
117
- padding: 0
118
- }
119
- ] }, [t.options.length ? e("div", { staticClass: "flex w-full items-center justify-end", staticStyle: { height: "108px" } }, [e("div", { staticStyle: { "text-align": "right", padding: "calc(2 * var(--rem))" } }, [e("div", { staticStyle: { "font-size": "calc(1.5 * var(--rem))", "font-weight": "900" } }, [t._v(" " + t._s(t._document.$t("price.proposal")) + " ")]), e("div", [t._v(t._s(t._document.$t("summaryBottom.chooseFrom")))])]), e("div", { staticStyle: { "background-color": "hsla(0, 0%, 0%, 0.15)", paadding: "calc(1 * var(--rem)) calc(2 * var(--rem))", height: "100%", display: "inline-flex" } }, [t.base ? e("div", { staticStyle: { display: "flex", "flex-direction": "column", "align-items": "flex-start", "justify-content": "center", padding: "calc(1 * var(--rem)) calc(1 * var(--rem))", "text-align": "left" } }, [e("div", { staticStyle: { "font-weight": "900", "font-size": "calc(1.5 * var(--rem))" } }, [t._v(" " + t._s(t.priceFormat(t.base.prices.total, { currency: t.currency, decimals: 2, hideZeroDecimals: !0 })) + " ")]), e("div", [t._v(" + " + t._s(t._document.$tc("summaryBottom.option", { count: t.options.length })) + " ")])]) : e("div", { staticStyle: { padding: "calc(2 * var(--rem))", display: "inline-flex", "align-items": "center", "justify-content": "center", "font-weight": "900", "font-size": "calc(2.5 * var(--rem))" } }, [t._v(" " + t._s(t._document.$t("summaryBottom.noOfOptions", { count: t.options.length })) + " ")])]), e("div", { staticStyle: { "background-color": "hsla(0, 0%, 0%, 0.4)", overflow: "hidden", width: "calc(1.5 * var(--rem))", display: "flex", "flex-direction": "column", "justify-content": "center", "align-items": "center", height: "100%", color: "hsla(0, 0%, 100%, 0.2)" } })]) : e("div", { staticClass: "flex w-full justify-between", class: [
120
- {
121
- column: t.isSmallScreen,
122
- sm: t.isSmallScreen
123
- }
124
- ], staticStyle: { position: "relative" } }, [e("div", { staticClass: "flex w-full flex-col", class: [{ "fixed-price-type-string": t.isSmallScreen }], staticStyle: { "background-color": "hsl(224, 57%, 39%)" }, style: [t.backgroundSecondary] }, [e("div", { staticClass: "price-type-string data-text" }, [t._v(" " + t._s(t.priceTypeString) + " ")]), t.isSmallScreen ? t._e() : e("div", { staticClass: "price-deduction-text" }, [t._v(" " + t._s(t.priceDeductionVatString) + " ")])]), t.priceType.some((s) => ["openAcc", "openAccMaxPrice"].includes(s)) ? e("div", { staticClass: "open-acc-wrapper" }, [t.openAccMaxPrice ? e("div", { staticClass: "open-acc-item" }, [e("div", [t._v(" " + t._s(t._document.$t("price.maxPrice").capitalize()) + " " + t._s(t._document.$t("vat.exVat", { thing: t._document.$t(`vat.${t.vatType}`) })) + ": ")]), e("div", [t._v(t._s(t.priceFormat(t.openAccMaxPrice, { currency: t.currency })))])]) : t._e(), e("div", { staticClass: "open-acc-link" }, [t._v(" " + t._s(t._document.$t("see").capitalize()) + " "), e("span", { staticStyle: { color: "inherit", cursor: "pointer" }, on: { click: t.scrollToPricing } }, [e("u", [t._v(t._s(t._document.$t("price.price_plural")))])]), t._v(" " + t._s(t._document.$t("summaryBottom.forDetails")) + " ")])]) : e("div", { staticClass: "flex w-full items-center", class: [{ "justify-end": !t.isSmallScreen }] }, [e("div", { staticClass: "data-text", staticStyle: { "font-size": "calc(2 * var(--rem))", "font-weight": "900", "letter-spacing": "1px", "line-height": "1", "padding-bottom": "calc(0.3 * var(--rem))" } }, [t._v(" " + t._s(t.priceType.includes("approx") ? t._document.$t("approx").capitalize() : "") + " " + t._s(t.priceFormat(t.priceTotal, { currency: t.currency, decimals: 2, hideZeroDecimals: !0 })) + " ")])]), t.isSmallScreen ? e("div", { staticClass: "label-text caps price-deduction-text", staticStyle: { "margin-top": "4px" } }, [t._v(" " + t._s(t.priceDeductionVatString) + " ")]) : t._e()])])]);
125
- }, g = [], f = /* @__PURE__ */ n(
126
- _,
127
- v,
128
- g,
129
- !1,
130
- null,
131
- "625c1189"
132
- );
133
- const S = f.exports, x = {
134
- name: "SummaryTop",
135
- i18nOptions: {
136
- namespaces: "summaryTop",
137
- messages: h
138
- },
139
- components: {
140
- TextEditor: y,
141
- DocumentLogotype: () => import("./DocumentLogotype-pDJRc6Hj.js")
142
- },
143
- mixins: [c([])],
144
- inject: ["parentSize"],
145
- props: {
146
- showLogo: {
147
- type: Boolean,
148
- default: !0
149
- },
150
- logotype: {
151
- type: String,
152
- default: null
153
- },
154
- companyLogotype: {
155
- type: String,
156
- default: null
157
- },
158
- senderName: {
159
- type: String,
160
- default: null
161
- },
162
- docName: {
163
- type: String,
164
- default: null
165
- },
166
- docType: {
167
- type: String,
168
- required: !0
169
- },
170
- docNumber: {
171
- type: [Number, String],
172
- default: null
173
- },
174
- sentAt: {
175
- type: [String, Number],
176
- default: null
177
- // required: true,
178
- },
179
- expiresAt: {
180
- type: String,
181
- default: null
182
- },
183
- estimatedTime: {
184
- type: String,
185
- default: null
186
- },
187
- validator: {
188
- type: Object,
189
- default: () => ({})
190
- },
191
- hasHover: {
192
- type: Boolean,
193
- default: !1
194
- }
195
- },
196
- computed: {
197
- logotypeListeners() {
198
- return {
199
- ...this.$listeners,
200
- input: (i) => this.$emit("update:logotype", i)
201
- };
202
- }
203
- }
204
- };
205
- var b = function() {
206
- var t = this, e = t._self._c;
207
- return e("section", { staticClass: "summary-top flex w-full justify-center" }, [e("div", { staticClass: "doc-summary-top-wrapper" }, [e("div", { staticClass: "doc-summary-top-wrapper__background" }), e("div", { staticClass: "flex w-full justify-between", staticStyle: { "margin-bottom": "calc(2.5 * var(--rem))" } }, [t.showLogo && (t.logotype || t.companyLogotype) || t.canEdit ? e("DocumentLogotype", t._g({ attrs: { value: t.logotype, "show-logo": t.showLogo, "company-logotype": t.companyLogotype, "has-hover": t.hasHover } }, t.logotypeListeners)) : e("div", { staticClass: "company-name" }, [t._v(" " + t._s(t.senderName) + " ")]), e("div", { staticClass: "top-right-text-wrapper" }, [t.sentAt ? e("div", [t._v(t._s(t.$formatDate(t.sentAt)))]) : t._e(), t.docNumber ? e("div", [t._v(" #" + t._s(t.docNumber) + " ")]) : t._e()])], 1), e("div", { staticClass: "title-text" }, [t.canEdit ? e("TextEditor", { ref: "editor", staticClass: "no-drag", staticStyle: { "will-change": "opacity" }, attrs: { value: t.docName, placeholder: t.$t("name.placeholder"), extensions: {
208
- bulletList: !1,
209
- heading: [1, 2, 3],
210
- bold: !1,
211
- link: !1,
212
- underline: !1,
213
- blockquote: !0,
214
- table: !1
215
- }, unstyled: "", static: "" }, on: { input: function(s) {
216
- return t.$emit("update:doc-name", s);
217
- } } }) : e("div", { staticClass: "quill-custom", domProps: { innerHTML: t._s(t.docName) } })], 1), e("div", { staticClass: "flex w-full justify-between" }, [t.expiresAt ? e("div", { staticClass: "data-group" }, [e("div", { staticClass: "label-text caps" }, [t._v(t._s(t._document.$t("replyBy")))]), e("div", { staticClass: "data-text" }, [t._v(t._s(t.$formatDate(t.expiresAt)))])]) : t._e(), t.docType !== "document" ? e("div", { staticClass: "data-group" }, [e("div", { staticClass: "label-text caps" }, [t._v(" " + t._s(t._document.$t("document").capitalize()) + " ")]), e("div", { staticClass: "data-text" }, [t._v(" " + t._s(t._document.$t(`series.${t.docType}`).capitalize()) + " ")])]) : t._e(), t.parentSize.width >= 576 ? [t.estimatedTime ? e("div", { staticClass: "data-group" }, [e("div", { staticClass: "label-text caps" }, [t._v(t._s(t.$t("estimatedTime")))]), e("div", { staticClass: "data-text" }, [t._v(" " + t._s(t._document.$t("approx")) + " " + t._s(t.estimatedTime) + " ")])]) : t._e()] : t._e()], 2)])]);
218
- }, C = [], $ = /* @__PURE__ */ n(
219
- x,
220
- b,
221
- C,
222
- !1,
223
- null,
224
- "29bec6e5"
225
- );
226
- const w = $.exports, T = {
227
- name: "PriceHeader",
228
- components: {
229
- SummaryTop: w,
230
- SummaryBottom: S,
231
- BlockMedia: l
232
- },
233
- mixins: [
234
- c([
235
- "media",
236
- "backgroundColor",
237
- "documentName",
238
- "showPriceSummary",
239
- "showLogo",
240
- "logotype"
241
- ])
242
- ],
243
- props: {
244
- _document: {
245
- type: Object,
246
- default: () => ({})
247
- },
248
- _value: {
249
- type: Object,
250
- default: () => ({})
251
- },
252
- hasHover: {
253
- type: Boolean,
254
- default: !1
255
- }
256
- },
257
- computed: {
258
- internalName: {
259
- get() {
260
- var i;
261
- return this.documentName || `<p data-typography="title">${((i = this._document.data) == null ? void 0 : i.name) || ""}</p>`;
262
- },
263
- set(i) {
264
- this.documentName = i, this.$emit("input", {
265
- key: "data.name",
266
- value: m(i).trim().slice(0, 255)
267
- });
268
- }
269
- },
270
- company() {
271
- return this._document.sender.company;
272
- },
273
- prices() {
274
- return this._document.prices;
275
- },
276
- estimatedTimeString() {
277
- var e, s;
278
- const { value: i, unitType: t } = ((s = (e = this._document) == null ? void 0 : e.data) == null ? void 0 : s.estimatedTime) || {};
279
- return !i || !t ? null : this.$tc(`${t}`, { count: i });
280
- },
281
- sendAtShowDate() {
282
- const { sentAt: i, scheduledFirstDelivery: t } = this._document;
283
- return i || (t ? t.sendAt : null);
284
- },
285
- summaryBottom() {
286
- var s;
287
- let i = {
288
- show: !1,
289
- backgroundColor: this.backgroundColor || this._document.theme.priceSummaryBackground,
290
- documentCurrency: this._document.currency,
291
- vatType: this._document.vatType
292
- }, { showPriceSummary: t } = this;
293
- typeof t != "boolean" && ({ showPriceSummary: t } = this._document.theme);
294
- const e = ((s = this._document.packageGroups) == null ? void 0 : s.packages) || [];
295
- return e.length > 1 ? i = {
296
- ...i,
297
- show: t,
298
- base: { prices: this.prices },
299
- options: e.filter(({ toggable: o }) => o).map(({ prices: o }) => ({ prices: o }))
300
- } : i = {
301
- ...i,
302
- show: t && this._document.readPrices && (this.prices.total || this.prices.type.some(
303
- (o) => ["openAccMaxPrice", "openAcc"].includes(o)
304
- )),
305
- base: { prices: this.prices }
306
- }, this.canEdit && t && (i.show = !0), i.documentCurrency || (i.show = !1), i;
307
- }
308
- }
309
- };
310
- var k = function() {
311
- var s, o;
312
- var t = this, e = t._self._c;
313
- return e("div", [e("div", { staticClass: "doc-jumbotron-wrapper" }, [e("BlockMedia", { staticClass: "price-media-wrapper", attrs: { media: {
314
- ...t.media,
315
- resourceUrl: ((s = t.media) == null ? void 0 : s.resourceUrl) || t._document.theme.background,
316
- overlayColor: ((o = t.media) == null ? void 0 : o.overlayColor) || t._document.theme.backgroundFilter
317
- } } }), e("SummaryTop", { attrs: { _document: t._document, "show-logo": t.showLogo, logotype: t.logotype, "company-logotype": t.company.logotype, "sender-name": t.company.name, "doc-type": t._document.docNumber.series, "doc-name": t.internalName, "doc-number": t._document.docNumber.value, "sent-at": t.sendAtShowDate, "expires-at": t._document.expiresAt, "estimated-time": t.estimatedTimeString, "has-hover": t.hasHover }, on: { "update:showLogo": function(a) {
318
- t.showLogo = a;
319
- }, "update:show-logo": function(a) {
320
- t.showLogo = a;
321
- }, "update:logotype": function(a) {
322
- t.logotype = a;
323
- }, "update:docName": function(a) {
324
- t.internalName = a;
325
- }, "update:doc-name": function(a) {
326
- t.internalName = a;
327
- } } })], 1), t.summaryBottom.show ? e("SummaryBottom", t._b({ attrs: { _document: t._document } }, "SummaryBottom", t.summaryBottom, !1)) : t._e()], 1);
328
- }, A = [], B = /* @__PURE__ */ n(
329
- T,
330
- k,
331
- A,
332
- !1,
333
- null,
334
- "e3b73dd6"
335
- );
336
- const D = B.exports;
337
- export {
338
- D as default
339
- };
@@ -1,161 +0,0 @@
1
- import { g as u, p as h, i as f, j as d, n as m } from "./main-Bp2qcma0.js";
2
- import { d as p } from "./debounce-BIchuVwa.js";
3
- import { m as y, a as g } from "./vuex.esm-DKGl8mcw.js";
4
- const A = {
5
- name: "SearchApi",
6
- props: {
7
- customSearch: {
8
- type: Object,
9
- default: () => ({})
10
- }
11
- },
12
- data() {
13
- return {
14
- defaultSearch: {
15
- project: !0,
16
- user: !0,
17
- endCustomer: !1,
18
- article: !1,
19
- extensionArticle: !1,
20
- // Articles in any authenticated CRM
21
- document: !1
22
- },
23
- hasLoadedUsers: !1,
24
- isLoading: !1,
25
- emptyQuery: null,
26
- // String to track last query that was empty, if a new query starts with this string we do not have to search again
27
- hasSearchedAll: !1
28
- // Helper to keep track when some search types have not yet searched due min query length
29
- };
30
- },
31
- computed: {
32
- ...y({
33
- allUsers: "companyUsers/all",
34
- allAuthenticatedCRMs: "settings/allAuthenticatedCRMs",
35
- can: "application/can"
36
- }),
37
- typesToFetch() {
38
- return Object.keys(this.customSearch).length ? Object.keys(this.customSearch).filter(
39
- (t) => this.customSearch[t]
40
- ) : Object.keys(this.defaultSearch).filter(
41
- (t) => this.defaultSearch[t]
42
- );
43
- }
44
- },
45
- methods: {
46
- ...g({
47
- loadUsers: u.LOAD_COMPANY_USERS
48
- }),
49
- canFetchType(t) {
50
- return t === "endCustomer" ? this.can("endCustomers", "read") : t === "user" ? this.can("users", "modify") : !0;
51
- },
52
- async fetch({ query: t, start: s = null, end: a = null }) {
53
- const e = this.typesToFetch.reduce(
54
- (n, c) => ({ ...n, [c]: [] }),
55
- {}
56
- ), r = t.toLowerCase();
57
- if (this.emptyQuery && r && r.startsWith(this.emptyQuery) || (this.emptyQuery = null, this.hasSearchedAll = !0, !r))
58
- return e;
59
- try {
60
- const n = [], c = Object.keys(this.defaultSearch);
61
- (this.typesToFetch || []).forEach((l) => {
62
- c.includes(l) && n.push(
63
- (async () => {
64
- let o = [];
65
- l === "document" ? o = await this.fetchDocuments(r, s, a) : l === "user" ? o = await this.fetchUsers(r, s, a) : l === "extensionArticle" ? o = await this.fetchExtensionArticles(r, s, a) : o = await this.fetchType(l, r, s, a), e[l] = o;
66
- })()
67
- );
68
- }), await Promise.all(n);
69
- } finally {
70
- this.isLoading = !1;
71
- }
72
- return Object.keys(e).every(
73
- (n) => e[n].length === 0
74
- ) && this.hasSearchedAll && (this.emptyQuery = r), e;
75
- },
76
- async fetchType(t, s, a, e) {
77
- if (!this.canFetchType(t))
78
- return [];
79
- const { data: r } = await h("search", {
80
- type: t,
81
- query: s,
82
- ...a !== null && e !== null && { start: a, end: e }
83
- });
84
- return r;
85
- },
86
- async fetchUsers(t, s, a) {
87
- if (!this.canFetchType("user"))
88
- return [];
89
- this.hasLoadedUsers || (await this.loadUsers(), this.hasLoadedUsers = !0);
90
- const r = Object.values(this.allUsers).filter((i) => !!(i.fullName && i.fullName.toLowerCase().includes(t) || i.email && i.email.toLowerCase().includes(t)));
91
- return s !== null && a !== null ? r.slice(s, a) : r;
92
- },
93
- async fetchDocuments(t, s, a) {
94
- const e = t.replace(/[-[\]{}()*+?.,\\/^$|#]/g, "\\$&"), r = {
95
- $or: [
96
- { "data.name": { $regex: e, $options: "i" } },
97
- { "docNumber.value": { $regex: e, $options: "i" } },
98
- {
99
- clients: {
100
- $elemMatch: {
101
- $or: ["name", "email", "socialNo", "orgNo"].map((c) => ({
102
- [c]: { $regex: e, $options: "i" }
103
- }))
104
- }
105
- }
106
- }
107
- ]
108
- }, { data: i } = await f("/document", {
109
- params: {
110
- lean: !0,
111
- filter: encodeURIComponent(JSON.stringify(r)),
112
- fields: "clients,data.name,projectId,docNumber,createdAt",
113
- ...s !== null && a !== null && { skip: s, limit: a - s }
114
- }
115
- }), { items: n = [] } = i || {};
116
- return n;
117
- },
118
- async fetchExtensionArticles(t) {
119
- const s = [];
120
- return await Promise.all(
121
- this.allAuthenticatedCRMs.map(async (a) => {
122
- try {
123
- if (a === "pipedrive" && t.length < 2) {
124
- this.hasSearchedAll = !1;
125
- return;
126
- }
127
- const { data: e } = await d.search(a, {
128
- query: t,
129
- type: "article"
130
- });
131
- e && Array.isArray(e) && s.push(...e);
132
- } catch {
133
- }
134
- })
135
- ), s;
136
- },
137
- triggerSearch: p(async function({ q: s, cb: a, start: e, end: r }) {
138
- this.isLoading = !0;
139
- const i = await this.fetch({ query: s, start: e, end: r });
140
- return this.isLoading = !1, a(i);
141
- }, 500)
142
- },
143
- render() {
144
- return this.$scopedSlots.default({
145
- fetch: ({ q: t, cb: s, start: a = null, end: e = null }) => (this.isLoading = !0, this.triggerSearch({ q: t, cb: s, start: a, end: e })),
146
- isLoading: this.isLoading
147
- });
148
- }
149
- }, S = null, w = null;
150
- var L = /* @__PURE__ */ m(
151
- A,
152
- S,
153
- w,
154
- !1,
155
- null,
156
- null
157
- );
158
- const $ = L.exports;
159
- export {
160
- $ as S
161
- };
@@ -1,50 +0,0 @@
1
- import { n as s, c as o, e as c } from "./main-Bp2qcma0.js";
2
- const i = {
3
- name: "Setup",
4
- props: {
5
- partnerName: {
6
- type: String,
7
- default: "Partner"
8
- },
9
- closeFunc: {
10
- type: Function,
11
- default: () => {
12
- }
13
- }
14
- },
15
- computed: {
16
- baseAppUrl() {
17
- return o.baseUrl;
18
- },
19
- iframeUrl() {
20
- return `${this.baseAppUrl}/partner/connect?partnerName=${this.partnerName}`;
21
- }
22
- },
23
- created() {
24
- window.addEventListener("message", this.onReceiveMessage);
25
- },
26
- beforeDestroy() {
27
- window.removeEventListener("message", this.onReceiveMessage);
28
- },
29
- methods: {
30
- onReceiveMessage({ data: e, origin: r, source: n }) {
31
- var t;
32
- r === this.baseAppUrl && ((e == null ? void 0 : e.type) === "channelPartnerConnect" && (n == null || n.postMessage({ type: "readyForPartnerConnect" }, r)), (e == null ? void 0 : e.type) === "partnerUserConnect" && (c.trigger("account:userConnect", e == null ? void 0 : e.value), (t = this.closeFunc) == null || t.call(this)));
33
- }
34
- }
35
- };
36
- var p = function() {
37
- var r = this, n = r._self._c;
38
- return n("iframe", { staticClass: "h-full w-full", attrs: { title: "Partner Connect", src: r.iframeUrl, frameborder: "0" } });
39
- }, l = [], a = /* @__PURE__ */ s(
40
- i,
41
- p,
42
- l,
43
- !1,
44
- null,
45
- null
46
- );
47
- const m = a.exports;
48
- export {
49
- m as default
50
- };
@@ -1,83 +0,0 @@
1
- import { n as s, s as r } from "./main-Bp2qcma0.js";
2
- const o = {
3
- name: "SmartList",
4
- props: {
5
- defaultSort: {
6
- type: String,
7
- default: "desc",
8
- validator(t) {
9
- return ["asc", "desc"].includes(t);
10
- }
11
- },
12
- filterMethod: {
13
- type: Function,
14
- default: null
15
- },
16
- items: {
17
- type: Array,
18
- required: !0
19
- },
20
- sortMethod: {
21
- type: Function,
22
- default: null
23
- },
24
- sortKey: {
25
- type: String,
26
- default: ""
27
- },
28
- query: {
29
- type: String,
30
- default: ""
31
- }
32
- },
33
- data() {
34
- return {
35
- sortBy: this.sortKey,
36
- sortOrder: 1
37
- };
38
- },
39
- computed: {
40
- filteredItems() {
41
- let t = this.items;
42
- return this.query && (t = this.filterMethod ? this.filterMethod(this.query, this.items) : this.searchedItems), (this.sortBy || this.defaultSort) && (t = this.sortMethod ? this.sortMethod(this.sort, this.searchedItems) : this.sortedItems), t;
43
- },
44
- searchedItems() {
45
- return this.items.filter((t) => typeof t == "object" ? Object.keys(t).some(
46
- (e) => String(t[e]).toLowerCase().includes(this.query.toLowerCase())
47
- ) : String(t).toLowerCase().includes(this.query.toLowerCase()));
48
- },
49
- sortedItems() {
50
- return this.searchedItems.slice().sort((t, e) => (typeof t == "object" && typeof e == "object" && (t = t[this.sortBy], e = e[this.sortBy]), (t === e ? 0 : r(t, e)) * this.sortOrder));
51
- }
52
- },
53
- created() {
54
- this.defaultSort && (this.sortOrder = this.defaultSort === "asc" ? this.sortOrder : this.sortOrder * -1);
55
- },
56
- methods: {
57
- sort(t) {
58
- this.sortBy = t, this.sortOrder = this.sortOrder * -1;
59
- }
60
- },
61
- render() {
62
- return this.$scopedSlots.default({
63
- items: this.filteredItems,
64
- sortBy: this.sort,
65
- sort: {
66
- by: this.sortBy,
67
- order: this.sortOrder === 1 ? "asc" : "desc"
68
- }
69
- });
70
- }
71
- }, i = null, d = null;
72
- var h = /* @__PURE__ */ s(
73
- o,
74
- i,
75
- d,
76
- !1,
77
- null,
78
- null
79
- );
80
- const u = h.exports;
81
- export {
82
- u as S
83
- };