@cling-se/widget 0.9.2 → 0.9.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 (132) hide show
  1. package/dist/AddClientCallout-d472aa84.js +57 -0
  2. package/dist/{AnswerModal-8f918a49.js → AnswerModal-06487437.js} +7 -5
  3. package/dist/{AttachmentItem-79618446.js → AttachmentItem-d98488ee.js} +5 -7
  4. package/dist/BaseDatePicker-8c098701.js +3156 -0
  5. package/dist/{BaseInput-9f376e4e.js → BaseInput-2723d613.js} +4 -4
  6. package/dist/{BaseUpload-9a3d655d.js → BaseUpload-996d74b3.js} +27 -26
  7. package/dist/BlockMedia-00907fb6.js +72 -0
  8. package/dist/CCallout-ffa95028.js +52 -0
  9. package/dist/CDropdownItem-74672842.js +610 -0
  10. package/dist/CField-06dd50f1.js +183 -0
  11. package/dist/CField.vue_vue_type_style_index_0_lang-4ed993c7.js +1 -0
  12. package/dist/CSlider.vue_vue_type_style_index_0_lang-f49d85e0.js +83 -0
  13. package/dist/ClientAutocomplete-f65643dd.js +80 -0
  14. package/dist/ClientModal-d276aabd.js +547 -0
  15. package/dist/ColorPicker-4f6b70af.js +2881 -0
  16. package/dist/{CompanyModal-5dfa4486.js → CompanyModal-30c54ce3.js} +12 -11
  17. package/dist/{ContentWrapper-3ac57cb2.js → ContentWrapper-d5653fef.js} +21 -14
  18. package/dist/{CoverBlockSettings-323ef519.js → CoverBlockSettings-2335f3a8.js} +7 -7
  19. package/dist/DocForm-9ca24de4.js +6772 -0
  20. package/dist/DocFormSend-d0c6fa1d.js +135 -0
  21. package/dist/{DocModalBase-4058a890.js → DocModalBase-f4915a62.js} +1 -1
  22. package/dist/{DocReceipt-390f75e3.js → DocReceipt-d192000e.js} +1 -1
  23. package/dist/{DocSendReminder-afc52d3d.js → DocSendReminder-06d5b34c.js} +1 -1
  24. package/dist/{DocTextEditor-0be1aea9.js → DocTextEditor-c6d1df3c.js} +16 -12
  25. package/dist/{DocTimeline-c421dead.js → DocTimeline-b4c20f93.js} +11 -11
  26. package/dist/DocumentClient-c2319f00.js +145 -0
  27. package/dist/{DocumentLogotype-5230c7bd.js → DocumentLogotype-1efd1ce9.js} +3 -3
  28. package/dist/{EmbedInput-8092d310.js → EmbedInput-654c0477.js} +10 -11
  29. package/dist/{EmbedSettings-bbea9894.js → EmbedSettings-b81ec734.js} +10 -11
  30. package/dist/ErrorCallout-60d0b3ab.js +30 -0
  31. package/dist/{FilePreviewModal-67088d0f.js → FilePreviewModal-895bd1bd.js} +6 -7
  32. package/dist/FormInputRow-9819eb71.js +2045 -0
  33. package/dist/{HeaderSettings-e02a5832.js → HeaderSettings-c6dac755.js} +23 -19
  34. package/dist/{ImageSelectModal-a9912356.js → ImageSelectModal-7cece54e.js} +20 -18
  35. package/dist/{ImageUploadWrapper-1310e96e.js → ImageUploadWrapper-53afd31d.js} +3 -3
  36. package/dist/{Index-f3eae2af.js → Index-01c63c88.js} +2 -2
  37. package/dist/{Index-90566113.js → Index-1a7e98d7.js} +8 -8
  38. package/dist/{Index-0ac00646.js → Index-1d361d01.js} +6 -7
  39. package/dist/{Index-9cd881f2.js → Index-2535f58f.js} +2 -2
  40. package/dist/{Index-f4bb1f71.js → Index-34c84bab.js} +8 -9
  41. package/dist/{Index-f03edd3d.js → Index-5cc51230.js} +7 -8
  42. package/dist/{Index-648a786a.js → Index-5e35f4a2.js} +3 -3
  43. package/dist/{Index-6df9883f.js → Index-60fc8a6e.js} +5 -6
  44. package/dist/{Index-de45c9c3.js → Index-61f7dc92.js} +2 -2
  45. package/dist/{Index-26f9a008.js → Index-63805642.js} +73 -118
  46. package/dist/{Index-ca8aedde.js → Index-66c8cbfa.js} +11 -12
  47. package/dist/{Index-a9ed7c39.js → Index-6ef78b7a.js} +4 -6
  48. package/dist/{Index-8a22c5cd.js → Index-701f0d05.js} +1 -1
  49. package/dist/{Index-6ee090c3.js → Index-7443e91c.js} +16 -17
  50. package/dist/{Index-1ae93acd.js → Index-82574a41.js} +6 -7
  51. package/dist/{Index-35f3bca9.js → Index-82b5de12.js} +6 -7
  52. package/dist/{Index-d02a530a.js → Index-8bca2d87.js} +8 -9
  53. package/dist/{Index-57ce8eee.js → Index-9233cc83.js} +22 -15
  54. package/dist/{Index-faeeff50.js → Index-98e8bb86.js} +21 -16
  55. package/dist/{Index-17e60907.js → Index-9aaf8b90.js} +33 -31
  56. package/dist/{Index-0d81bade.js → Index-b020a80c.js} +6 -7
  57. package/dist/{Index-28c78ddc.js → Index-b14d0f03.js} +6 -7
  58. package/dist/{Index-d3e59202.js → Index-b15cfd62.js} +10 -10
  59. package/dist/{Index-0a22673f.js → Index-c4de05aa.js} +7 -7
  60. package/dist/{Index-87497c7c.js → Index-c67218ce.js} +7 -7
  61. package/dist/{Index-2b684213.js → Index-c7e68382.js} +6 -7
  62. package/dist/{Index-e1bd4ea9.js → Index-caf5cf44.js} +54 -44
  63. package/dist/{Index-2d5fe047.js → Index-cd76b120.js} +6 -7
  64. package/dist/Index-d45a1eff.js +28 -0
  65. package/dist/{Index-876daf3e.js → Index-d8879ca9.js} +2 -2
  66. package/dist/{Index-1f966c82.js → Index-e45a0c32.js} +27 -20
  67. package/dist/{Index-d11146a6.js → Index-e749f6f1.js} +6 -6
  68. package/dist/{Index-15591118.js → Index-e80f5f9c.js} +11 -11
  69. package/dist/{Index-e30b3de9.js → Index-f935c492.js} +6 -7
  70. package/dist/{InputToggleRow-c58dde03.js → InputToggleRow-9d8a7da4.js} +1 -1
  71. package/dist/IsPremiumPreStep-3a087524.js +1919 -0
  72. package/dist/{MediaWrapper-afc29574.js → MediaWrapper-d4a4b66f.js} +4 -4
  73. package/dist/{NotBindingText-e3a49f8a.js → NotBindingText-b199006c.js} +2 -2
  74. package/dist/{PackageGroup-150a9942.js → PackageGroup-37ac99b1.js} +24 -17
  75. package/dist/{PdfTerms-fcc835f4.js → PdfTerms-8b52bb6e.js} +6 -7
  76. package/dist/{PdfViewer-b1118475.js → PdfViewer-38bd8439.js} +2 -2
  77. package/dist/{PlainHtml-47791667.js → PlainHtml-9174cbf6.js} +1 -1
  78. package/dist/PriceHeader-e357afe9.js +336 -0
  79. package/dist/SearchApi-2e286be6.js +148 -0
  80. package/dist/{TermsSettings-c97df867.js → TermsSettings-c74eec79.js} +6 -6
  81. package/dist/{ThemeColorRow-014a0526.js → ThemeColorRow-3558367b.js} +7 -6
  82. package/dist/{ToggleBinding-342beacc.js → ToggleBinding-6c9c1ac3.js} +8 -9
  83. package/dist/{UploadModal-aed5f8c9.js → UploadModal-6d0abd77.js} +21 -22
  84. package/dist/{VideoPlayerInput-7ebb49d7.js → VideoPlayerInput-77cd86aa.js} +5 -6
  85. package/dist/{VideoPlayerSettings-0a027a8e.js → VideoPlayerSettings-b7eb781c.js} +13 -14
  86. package/dist/{VideoSelectModal-5c1a8ddc.js → VideoSelectModal-d2299552.js} +10 -10
  87. package/dist/anime.es-e284c852.js +858 -0
  88. package/dist/answerDocumentMixin-66023e62.js +54 -0
  89. package/dist/color-71c20583.js +15 -0
  90. package/dist/{cssMode-b59b5164.js → cssMode-8552fc56.js} +15 -14
  91. package/dist/focusDrawerMixin-67462262.js +68 -0
  92. package/dist/formComponentsInstall-ad9c2a83.js +2491 -0
  93. package/dist/formValidationMixin-4920ab53.js +4984 -0
  94. package/dist/{freemarker2-5b426d60.js → freemarker2-7e10a65d.js} +19 -18
  95. package/dist/{handlebars-9a256dec.js → handlebars-8045bfa8.js} +18 -17
  96. package/dist/{html-4322f199.js → html-8afcb633.js} +14 -13
  97. package/dist/{htmlMode-d8a0ed16.js → htmlMode-1a2d1b48.js} +19 -18
  98. package/dist/index-3d6d7a03.js +490 -0
  99. package/dist/index-805c56e4.js +4 -0
  100. package/dist/{index-c2f8c4f3.js → index-bf93d7c2.js} +13 -12
  101. package/dist/index-c48c5eb4.js +14 -0
  102. package/dist/{index-7359c27c.js → index-f805bfce.js} +21 -15
  103. package/dist/index.es.js +3 -3
  104. package/dist/index.umd.js +713 -600
  105. package/dist/{javascript-7f9828c0.js → javascript-dad5561e.js} +11 -10
  106. package/dist/{jsonMode-e07cde60.js → jsonMode-ce09245f.js} +19 -18
  107. package/dist/{liquid-b47f65fb.js → liquid-05247459.js} +11 -10
  108. package/dist/{main-154fab72.js → main-04025a56.js} +19557 -20415
  109. package/dist/mapFormMixin-8d073f99.js +66 -0
  110. package/dist/{publicSenderState-51ca0439.js → publicSenderState-97108de1.js} +1 -1
  111. package/dist/{python-f3873309.js → python-3f3513c5.js} +11 -10
  112. package/dist/{razor-4071ec1b.js → razor-1f3e9c4e.js} +14 -13
  113. package/dist/regions-29ee6964.js +1250 -0
  114. package/dist/simplebar.min-3af55aab.js +2429 -0
  115. package/dist/style.css +4 -0
  116. package/dist/template-42a1d852.js +526 -0
  117. package/dist/throttle-a2c1f34d.js +18 -0
  118. package/dist/tinycolor-88fa380f.js +634 -0
  119. package/dist/{tsMode-71160e05.js → tsMode-4c026047.js} +15 -14
  120. package/dist/{typescript-80a61e6a.js → typescript-baf56f67.js} +11 -10
  121. package/dist/{utils-72915af5.js → utils-6670dea6.js} +5 -5
  122. package/dist/vuedraggable.umd-d7138234.js +3179 -0
  123. package/dist/{xml-021490f1.js → xml-ffc6146a.js} +11 -10
  124. package/package.json +3 -2
  125. package/stats.html +1 -1
  126. package/dist/DocForm-5ff2cbbb.js +0 -22074
  127. package/dist/DocFormSend-06ffa19c.js +0 -113
  128. package/dist/Index-2b5c1367.js +0 -29
  129. package/dist/PriceHeader-1dfa95fd.js +0 -329
  130. package/dist/formComponentsInstall-e33d6795.js +0 -11121
  131. package/dist/index-51b2742c.js +0 -11
  132. package/dist/throttle-f479e1f1.js +0 -18
@@ -1,7 +1,7 @@
1
- import { B as n } from "./DocForm-5ff2cbbb.js";
2
- import { m as a } from "./formComponentsInstall-e33d6795.js";
3
- import { n as m } from "./main-154fab72.js";
4
- import "./vuex.esm-4a0fff7c.js";
1
+ import { B as n } from "./BlockMedia-00907fb6.js";
2
+ import { m as a } from "./mapFormMixin-8d073f99.js";
3
+ import { n as m } from "./main-04025a56.js";
4
+ import "./color-71c20583.js";
5
5
  const o = {
6
6
  name: "MediaWrapper",
7
7
  components: { BlockMedia: n },
@@ -1,5 +1,5 @@
1
- import { P as t } from "./PlainHtml-47791667.js";
2
- import { n as e } from "./main-154fab72.js";
1
+ import { P as t } from "./PlainHtml-9174cbf6.js";
2
+ import { n as e } from "./main-04025a56.js";
3
3
  const r = {
4
4
  name: "NotBindingText",
5
5
  i18nOptions: {
@@ -1,8 +1,15 @@
1
- import { t as m } from "./DocForm-5ff2cbbb.js";
2
- import { L as v, M as y, p as g, n as p, N as f, j as k, r as u, O as w } from "./main-154fab72.js";
3
- import { m as _, E as P } from "./formComponentsInstall-e33d6795.js";
4
- import { T as x } from "./DocTextEditor-0be1aea9.js";
5
- import "./vuex.esm-4a0fff7c.js";
1
+ import { t as m } from "./tinycolor-88fa380f.js";
2
+ import { a4 as v, a5 as y, o as g, n as p, a6 as f, r as k, b as u, a7 as w } from "./main-04025a56.js";
3
+ import { E as P } from "./ErrorCallout-60d0b3ab.js";
4
+ import { m as _ } from "./mapFormMixin-8d073f99.js";
5
+ import { T as x } from "./DocTextEditor-c6d1df3c.js";
6
+ import "./FormInputRow-9819eb71.js";
7
+ import "./ColorPicker-4f6b70af.js";
8
+ import "./formValidationMixin-4920ab53.js";
9
+ import "./CDropdownItem-74672842.js";
10
+ import "./CSlider.vue_vue_type_style_index_0_lang-f49d85e0.js";
11
+ import "./CField.vue_vue_type_style_index_0_lang-4ed993c7.js";
12
+ import "./color-71c20583.js";
6
13
  const $ = {
7
14
  name: "ArticleItem",
8
15
  mixins: [_([])],
@@ -322,7 +329,7 @@ var B = function() {
322
329
  }, attrs: { type: "text" }, on: { click: function(r) {
323
330
  e.canToggle && e.$emit("toggle", e.workPackage.packageId);
324
331
  } } }, [e.workPackage.isSelected ? [t("svg", { staticStyle: { "margin-right": "0.5rem" }, attrs: { viewBox: "0 0 24 24", width: "18", height: "18", stroke: "currentColor", "stroke-width": "3.5", fill: "none", "stroke-linecap": "round", "stroke-linejoin": "round" } }, [t("polyline", { attrs: { points: "20 6 9 17 4 12" } })]), e._v(" " + e._s(e._document.$t("chapters.packageItem.selected")) + " ")] : [e._v(" " + e._s(e._document.$t(`chapters.packageItem.${e.type === "radio" ? "select" : "add"}`)) + " ")]], 2) : e._e()]], 2) : e._e()], 1);
325
- }, M = [], O = /* @__PURE__ */ p(
332
+ }, M = [], W = /* @__PURE__ */ p(
326
333
  z,
327
334
  B,
328
335
  M,
@@ -332,8 +339,8 @@ var B = function() {
332
339
  null,
333
340
  null
334
341
  );
335
- const W = O.exports;
336
- const L = {
342
+ const O = W.exports;
343
+ const q = {
337
344
  name: "PackagePricingSummary",
338
345
  props: {
339
346
  // PackageGroup.prices (format: calcPrices of one group)
@@ -470,7 +477,7 @@ const L = {
470
477
  }
471
478
  }
472
479
  };
473
- var q = function() {
480
+ var L = function() {
474
481
  var e = this, t = e._self._c;
475
482
  return e._document.readPrices ? t("div", { staticClass: "font-inter", staticStyle: { "margin-top": "2rem", "margin-bottom": "2rem", position: "relative" }, attrs: { id: "price" } }, [e.showPricingCard ? t("div", { staticClass: "pricing-container", class: { faded: e.placeholder } }, [e._l(e.blocks, function({ header: r, items: n, footer: s }, a) {
476
483
  return t("div", { key: a, staticClass: "block-container print-avoid-break-inside", class: { first: a === 0 } }, [t("div", { staticClass: "block-header" }, [r.title ? t("div", { staticStyle: { "font-weight": "800" } }, [e._v(e._s(r.title))]) : e._e(), r.subTitle ? t("div", { staticStyle: { "font-size": "16px", "margin-left": "0.5em" } }, [e._v(e._s(r.subTitle))]) : e._e()]), n.length || s ? t("div", { staticClass: "block-body" }, [e._l(n, function({ label: c, value: l }, o) {
@@ -478,8 +485,8 @@ var q = function() {
478
485
  }), s ? t("div", { staticClass: "block-body-footer", style: { "border-top": `4px solid ${e.primaryColor}` } }, [t("div", [e._v(" " + e._s(s.title) + " "), s.subTitle ? t("div", { staticStyle: { "font-weight": "500", "font-size": "calc(1em - 2px)" } }, [e._v(" " + e._s(s.subTitle) + " ")]) : e._e()]), t("div", { staticClass: "text-right" }, [t("div", [e._v(e._s(s.value))]), s.subValue ? t("div", { staticClass: "block-body-footer-hint" }, [e._v(" " + e._s(s.subValue) + " ")]) : e._e()])]) : e._e()], 2) : e._e()]);
479
486
  }), e.prices.region && e.prices.region.reverseVat ? [t("div", { staticClass: "terms-text" }, [e._v(" " + e._s(e._document.$t("chapters.pricingSummary.terms.reverseVat")) + " ")])] : e._e(), e.prices.region && e.prices.region.houseWorkType ? t("div", { staticClass: "terms-text", attrs: { id: "villkor-avdrag" } }, [e._v(" " + e._s(e._document.$t("chapters.pricingSummary.terms.houseWork", { type: `${e.prices.region.houseWorkType}_percentage` })) + " ")]) : e._e(), e.prices.type === "approx" && e.prices.region && e.prices.region.houseWorkType === "rot" ? t("div", { staticClass: "terms-text" }, [e._v(" " + e._s(e._document.$t("chapters.pricingSummary.terms.houseWorkApprox")) + " ")]) : e._e()], 2) : e._e(), e.placeholder ? t("div", { staticClass: "flex flex-col items-center justify-center w-full", staticStyle: { position: "absolute", top: "1rem", left: "50%", transform: "translate(-50%, 0%)", "background-color": "white", width: "350px", "max-width": "90%", "border-radius": "3px", padding: "2rem", "box-shadow": "0 1px rgba(0,0,0,0.1), 0 0.5rem 2rem -0.5rem rgba(0,0,0,0.3)", "text-align": "center", "font-size": "16px" } }, [t("svg", { attrs: { width: "200", height: "100", viewBox: "0 0 418 211", xmlns: "http://www.w3.org/2000/svg" } }, [t("defs", [t("filter", { attrs: { x: "-30.7%", y: "-26.2%", width: "160%", height: "155%", filterUnits: "objectBoundingBox", id: "a" } }, [t("feOffset", { attrs: { dy: "3", in: "SourceAlpha", result: "shadowOffsetOuter1" } }), t("feGaussianBlur", { attrs: { stdDeviation: "1", in: "shadowOffsetOuter1", result: "shadowBlurOuter1" } }), t("feColorMatrix", { attrs: { values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0", in: "shadowBlurOuter1", result: "shadowMatrixOuter1" } }), t("feMerge", [t("feMergeNode", { attrs: { in: "shadowMatrixOuter1" } }), t("feMergeNode", { attrs: { in: "SourceGraphic" } })], 1)], 1)]), t("g", { attrs: { fill: "none", "fill-rule": "evenodd" } }, [t("path", { attrs: { stroke: "#E4E4E4", "stroke-width": "3", d: "M1.5 1.5h415v187H1.5z" } }), t("path", { attrs: { fill: e.primaryColor, "fill-rule": "nonzero", d: "M282 139h136v51H282z" } }), t("g", { attrs: { filter: "url(#a)", transform: "translate(365.5 165)" } }, [t("path", { attrs: { d: "M8.2 30.7c-.7-.9-1.6-2.7-3.1-5-.9-1.3-3-3.6-3.7-4.8a3.3 3.3 0 013.2-5c1.3.2 2.5.8 3.4 1.8a16 16 0 011.8 2l.9 1.2c.5.6.8 1.2.5.3-.1-1.3-.4-3.3-.9-5.2l-.7-2.8c-.3-1-.4-2-.8-3.1l-.7-3.7a7 7 0 01.7-4.6 3 3 0 013.2-.6c1.1.8 2 2 2.4 3.3.6 1.6 1 3.3 1.3 5 .4 2.5 1.2 6.1 1.2 6.9 0-1-.2-2.9 0-3.8.1-.9.8-1.6 1.7-2a5 5 0 012.3-.1c.7.1 1.4.6 1.9 1.2.6 1.5.9 3 1 4.6 0-1.4.2-2.7.6-4 .4-.6 1-1 1.8-1.3a7 7 0 012.4 0c.7.3 1.3.7 1.8 1.3.5 1.3.8 2.7.9 4.1 0 .4.2-1 .7-1.8a2.5 2.5 0 114.8 1.6v5.6c-.1 1.5-.3 3-.6 4.4-.5 1.2-1 2.4-1.8 3.6a18 18 0 00-3 4.5 10 10 0 000 4.8h-3c-1-.2-2.2-2.1-2.5-2.7a1 1 0 00-1.7 0c-.6 1-1.8 2.6-2.6 2.8h-7.9s.5-2.6-.6-3.5l-2.8-2.6-2.1-2.4z", fill: "#FFF", "fill-rule": "nonzero" } }), t("path", { attrs: { d: "M8.2 30.7c-.7-.9-1.6-2.7-3.1-5-.9-1.3-3-3.6-3.7-4.8a3.3 3.3 0 013.2-5c1.3.2 2.5.8 3.4 1.8a16 16 0 011.8 2l.9 1.2c.5.6.8 1.2.5.3-.1-1.3-.4-3.3-.9-5.2l-.7-2.8c-.3-1-.4-2-.8-3.1l-.7-3.7a7 7 0 01.7-4.6 3 3 0 013.2-.6c1.1.8 2 2 2.4 3.3.6 1.6 1 3.3 1.3 5 .4 2.5 1.2 6.1 1.2 6.9 0-1-.2-2.9 0-3.8.1-.9.8-1.6 1.7-2a5 5 0 012.3-.1c.7.1 1.4.6 1.9 1.2.6 1.5.9 3 1 4.6 0-1.4.2-2.7.6-4 .4-.6 1-1 1.8-1.3a7 7 0 012.4 0c.7.3 1.3.7 1.8 1.3.5 1.3.8 2.7.9 4.1 0 .4.2-1 .7-1.8a2.5 2.5 0 114.8 1.6v5.6c-.1 1.5-.3 3-.6 4.4-.5 1.2-1 2.4-1.8 3.6a18 18 0 00-3 4.5 10 10 0 000 4.8h-3c-1-.2-2.2-2.1-2.5-2.7a1 1 0 00-1.7 0c-.6 1-1.8 2.6-2.6 2.8h-7.9s.5-2.6-.6-3.5l-2.8-2.6-2.1-2.4z", stroke: "#000", "stroke-width": "1.9", "stroke-linecap": "round", "stroke-linejoin": "round" } }), t("path", { attrs: { d: "M29.4 32v-8.6a1 1 0 00-1.9 0v8.7a1 1 0 001.9 0zM24.4 32v-8.6a1 1 0 00-1.9 0v8.7a1 1 0 002 0zM17.5 23.4v8.7a1 1 0 102 0l-.1-8.7a1 1 0 10-1.9 0z", fill: "#000", "fill-rule": "nonzero" } })]), t("text", { attrs: { "font-family": "Inter-Regular, Inter", "font-size": "24", fill: "#FFF" } }, [t("tspan", { attrs: { x: "332.4", y: "173" } }, [e._v(e._s(e._document.$t("select")))])]), t("path", { attrs: { fill: "#E4E4E4", "fill-rule": "nonzero", d: "M28 27h124v24H28zM28 64h355v11H28zM28 82h355v12H28zM28 103h178v12H28z" } })])]), t("div", { staticStyle: { "padding-top": "1em", "font-weight": "600", "font-size": "18px" } }, [e._v(e._s(e._document.$t("chapters.pricingSummary.placeholder.title")))]), t("div", [e._v(e._s(e._document.$t("chapters.pricingSummary.placeholder.description"))), t("span", { staticStyle: { "font-weight": "600" } }, [e._v(e._s(e._document.$t("chapters.pricingSummary.placeholder.descriptionBold")))]), e._v(".")])]) : e._e()]) : e._e();
480
487
  }, Z = [], E = /* @__PURE__ */ p(
481
- L,
482
488
  q,
489
+ L,
483
490
  Z,
484
491
  !1,
485
492
  null,
@@ -487,12 +494,12 @@ var q = function() {
487
494
  null,
488
495
  null
489
496
  );
490
- const j = E.exports;
491
- const G = {
497
+ const G = E.exports;
498
+ const j = {
492
499
  name: "PackageGroup",
493
500
  components: {
494
- PackageItem: W,
495
- PackagePricingSummary: j,
501
+ PackageItem: O,
502
+ PackagePricingSummary: G,
496
503
  ErrorCallout: P
497
504
  },
498
505
  mixins: [_([
@@ -569,7 +576,7 @@ var N = function() {
569
576
  } } });
570
577
  })], 2) : e._e(), e.validator.$invalid && e.validator.$dirty ? t("ErrorCallout", { staticStyle: { "padding-bottom": "1.5rem" }, attrs: { message: e._document.$t("chapters.packageGroup.errorCallout") } }) : e._e(), e.hideGroupPrice ? e._e() : t("PackagePricingSummary", { attrs: { prices: e.prices, _document: e._document, "show-prices-inc-vat": e.showPricesIncVat, "primary-color": e.primaryColor, placeholder: !e.selectedPackages.length } })], 2);
571
578
  }, R = [], H = /* @__PURE__ */ p(
572
- G,
579
+ j,
573
580
  N,
574
581
  R,
575
582
  !1,
@@ -578,7 +585,7 @@ var N = function() {
578
585
  null,
579
586
  null
580
587
  );
581
- const Y = H.exports;
588
+ const ce = H.exports;
582
589
  export {
583
- Y as default
590
+ ce as default
584
591
  };
@@ -1,8 +1,7 @@
1
- import { V as s } from "./PdfViewer-b1118475.js";
2
- import { n as t } from "./main-154fab72.js";
3
- import "./DocForm-5ff2cbbb.js";
4
- import "./vuex.esm-4a0fff7c.js";
5
- import "./formComponentsInstall-e33d6795.js";
1
+ import { V as s } from "./PdfViewer-38bd8439.js";
2
+ import { n as t } from "./main-04025a56.js";
3
+ import "./formValidationMixin-4920ab53.js";
4
+ import "./CDropdownItem-74672842.js";
6
5
  const n = {
7
6
  name: "PdfTerms",
8
7
  functional: !0,
@@ -35,7 +34,7 @@ var a = /* @__PURE__ */ t(
35
34
  null,
36
35
  null
37
36
  );
38
- const d = a.exports;
37
+ const f = a.exports;
39
38
  export {
40
- d as default
39
+ f as default
41
40
  };
@@ -1,5 +1,5 @@
1
- import { n as u, E as g } from "./main-154fab72.js";
2
- import { W as m, e as d } from "./DocForm-5ff2cbbb.js";
1
+ import { n as u, E as g } from "./main-04025a56.js";
2
+ import { W as m, e as d } from "./formValidationMixin-4920ab53.js";
3
3
  let o, l, f, c, p;
4
4
  function w(e) {
5
5
  return typeof e == "object" && e !== null && e.__PDFDocumentLoadingTask === !0;
@@ -1,4 +1,4 @@
1
- import { n as r } from "./main-154fab72.js";
1
+ import { n as r } from "./main-04025a56.js";
2
2
  const e = {
3
3
  name: "PlainHtml"
4
4
  };
@@ -0,0 +1,336 @@
1
+ import { m as n } from "./mapFormMixin-8d073f99.js";
2
+ import { B as l } from "./BlockMedia-00907fb6.js";
3
+ import { n as c, b as a, o as d, W as u } from "./main-04025a56.js";
4
+ import { T as m } from "./DocTextEditor-c6d1df3c.js";
5
+ import { i as p } from "./i18nMessages-45c6bfd6.js";
6
+ import { t as _ } from "./tinycolor-88fa380f.js";
7
+ import { s as y } from "./formValidationMixin-4920ab53.js";
8
+ import "./color-71c20583.js";
9
+ import "./FormInputRow-9819eb71.js";
10
+ import "./ColorPicker-4f6b70af.js";
11
+ import "./CDropdownItem-74672842.js";
12
+ import "./CSlider.vue_vue_type_style_index_0_lang-f49d85e0.js";
13
+ import "./CField.vue_vue_type_style_index_0_lang-4ed993c7.js";
14
+ const h = {
15
+ name: "SummaryTop",
16
+ i18nOptions: {
17
+ namespaces: "summaryTop",
18
+ messages: p
19
+ },
20
+ components: {
21
+ TextEditor: m,
22
+ DocumentLogotype: () => import("./DocumentLogotype-1efd1ce9.js")
23
+ },
24
+ inject: ["parentSize"],
25
+ mixins: [n([])],
26
+ props: {
27
+ showLogo: {
28
+ type: Boolean,
29
+ default: !0
30
+ },
31
+ logotype: {
32
+ type: String,
33
+ default: null
34
+ },
35
+ companyLogotype: {
36
+ type: String,
37
+ default: null
38
+ },
39
+ senderName: {
40
+ type: String,
41
+ default: null
42
+ },
43
+ docName: {
44
+ type: String,
45
+ default: null
46
+ },
47
+ docType: {
48
+ type: String,
49
+ required: !0
50
+ },
51
+ docNumber: {
52
+ type: [Number, String],
53
+ default: null
54
+ },
55
+ sentAt: {
56
+ type: [String, Number],
57
+ default: null
58
+ // required: true,
59
+ },
60
+ expiresAt: {
61
+ type: String,
62
+ default: null
63
+ },
64
+ estimatedTime: {
65
+ type: String,
66
+ default: null
67
+ },
68
+ validator: {
69
+ type: Object,
70
+ default: () => ({})
71
+ },
72
+ hasHover: {
73
+ type: Boolean,
74
+ default: !1
75
+ }
76
+ },
77
+ computed: {
78
+ logotypeListeners() {
79
+ return {
80
+ ...this.$listeners,
81
+ input: (i) => this.$emit("update:logotype", i)
82
+ };
83
+ }
84
+ }
85
+ };
86
+ var g = function() {
87
+ var t = this, e = t._self._c;
88
+ return e("section", { staticClass: "flex justify-center w-full summary-top" }, [e("div", { staticClass: "doc-summary-top-wrapper" }, [e("div", { staticClass: "doc-summary-top-wrapper__background" }), e("div", { staticClass: "flex justify-between w-full", staticStyle: { "margin-bottom": "2.5rem" } }, [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: {
89
+ bulletList: !1,
90
+ heading: [1, 2, 3],
91
+ bold: !1,
92
+ link: !1,
93
+ underline: !1,
94
+ blockquote: !0,
95
+ table: !1
96
+ }, unstyled: "", static: "" }, on: { input: function(s) {
97
+ return t.$emit("update:doc-name", s);
98
+ } } }) : e("div", { staticClass: "quill-custom", domProps: { innerHTML: t._s(t.docName) } })], 1), e("div", { staticClass: "flex justify-between w-full" }, [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("time.estimatedTime")))]), e("div", { staticClass: "data-text" }, [t._v(t._s(t._document.$t("approx")) + " " + t._s(t.estimatedTime))])]) : t._e()] : t._e()], 2)])]);
99
+ }, f = [], v = /* @__PURE__ */ c(
100
+ h,
101
+ g,
102
+ f,
103
+ !1,
104
+ null,
105
+ "68d8a9dc",
106
+ null,
107
+ null
108
+ );
109
+ const S = v.exports;
110
+ const x = {
111
+ name: "SummaryBottom",
112
+ mixins: [n([])],
113
+ props: {
114
+ base: {
115
+ type: Object,
116
+ default: null
117
+ },
118
+ options: {
119
+ type: Array,
120
+ default: () => []
121
+ },
122
+ backgroundColor: {
123
+ type: String,
124
+ default: "#4c576d"
125
+ },
126
+ documentCurrency: {
127
+ type: String,
128
+ required: !0
129
+ },
130
+ vatType: {
131
+ type: String,
132
+ required: !0
133
+ }
134
+ },
135
+ inject: ["parentSize"],
136
+ data() {
137
+ return {
138
+ get: a,
139
+ tinycolor: _
140
+ };
141
+ },
142
+ computed: {
143
+ prices() {
144
+ return a(this, "base.prices") || {};
145
+ },
146
+ isIndivid() {
147
+ return a(this.prices, "helpers.isIndivid", !0);
148
+ },
149
+ showIncVat() {
150
+ return this.isIndivid;
151
+ },
152
+ priceTotal() {
153
+ return this.isIndivid ? a(this.prices, "total", null) : a(this.prices, "subTotal", null);
154
+ },
155
+ priceType() {
156
+ return this.prices.type || ["fixed"];
157
+ },
158
+ currency() {
159
+ return this.prices.currency || this.documentCurrency;
160
+ },
161
+ openAccMaxPrice() {
162
+ return this.prices.maxTotal || null;
163
+ },
164
+ houseWorkType() {
165
+ return a(this.prices, "region.houseWorkType", null);
166
+ },
167
+ isReverseVat() {
168
+ return a(this.prices, "region.reverseVat", !1);
169
+ },
170
+ priceTypeString() {
171
+ 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();
172
+ },
173
+ priceDeductionVatString() {
174
+ let i = "";
175
+ if (this.isReverseVat && !this.showIncVat) {
176
+ const t = this.priceFormat(0, { currency: this.currency, showZero: !0 });
177
+ return i = this._document.$t("summaryBottom.reverseVat", { amount: t }), i;
178
+ }
179
+ return this.houseWorkType && (i = this._document.$t("deduction.afterType", { type: `${this.houseWorkType}_percentage` })), this.showIncVat && (i += ` ${this._document.$t("vat.incVat", { thing: this._document.$t(`vat.${this.vatType}`) })}`), this.showIncVat || (i += ` ${this._document.$t("vat.exVat", { thing: this._document.$t(`vat.${this.vatType}`) })}`), i.capitalize();
180
+ },
181
+ backgroundSecondary() {
182
+ if (!this.isSmallScreen)
183
+ return { backgroundColor: "transparent" };
184
+ 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];
185
+ return {
186
+ backgroundColor: `hsla(${i}, ${t ** 0.9}%, ${e ** 0.9}%, ${s})`
187
+ };
188
+ },
189
+ isSmallScreen() {
190
+ return this.parentSize.width <= 576;
191
+ }
192
+ },
193
+ methods: {
194
+ priceFormat: d,
195
+ scrollToPricing() {
196
+ const i = document.querySelector("#price");
197
+ i && y(i);
198
+ }
199
+ }
200
+ };
201
+ var b = function() {
202
+ var t = this, e = t._self._c;
203
+ return e("section", { staticClass: "summary-bottom-root" }, [e("div", { staticClass: "summary-bottom", style: [
204
+ {
205
+ backgroundColor: t.backgroundColor,
206
+ color: t.tinycolor.readability(t.backgroundColor, "#FFF") > 2.2 ? "#FFF" : "#000"
207
+ },
208
+ t.options.length && {
209
+ overflow: "hidden",
210
+ padding: 0
211
+ }
212
+ ] }, [t.options.length ? e("div", { staticClass: "flex items-center justify-end w-full", staticStyle: { height: "108px" } }, [e("div", { staticStyle: { "text-align": "right", padding: "2rem" } }, [e("div", { staticStyle: { "font-size": "1.5rem", "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: "1rem 2rem", height: "100%", display: "inline-flex" } }, [t.base ? e("div", { staticStyle: { display: "flex", "flex-direction": "column", "align-items": "flex-start", "justify-content": "center", padding: "1rem 1rem", "text-align": "left" } }, [e("div", { staticStyle: { "font-weight": "900", "font-size": "1.5rem" } }, [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: "2rem", display: "inline-flex", "align-items": "center", "justify-content": "center", "font-weight": "900", "font-size": "2.5rem" } }, [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: "1.5rem", display: "flex", "flex-direction": "column", "justify-content": "center", "align-items": "center", height: "100%", color: "hsla(0, 0%, 100%, 0.2)" } })]) : e("div", { staticClass: "flex justify-between w-full", class: [
213
+ {
214
+ column: t.isSmallScreen,
215
+ sm: t.isSmallScreen
216
+ }
217
+ ], staticStyle: { position: "relative" } }, [e("div", { staticClass: "flex flex-col w-full", 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 items-center w-full", class: [{ "justify-end": !t.isSmallScreen }] }, [e("div", { staticClass: "data-text", staticStyle: { "font-size": "2rem", "font-weight": "900", "letter-spacing": "1px", "line-height": "1", "padding-bottom": "0.3rem" } }, [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()])])]);
218
+ }, C = [], $ = /* @__PURE__ */ c(
219
+ x,
220
+ b,
221
+ C,
222
+ !1,
223
+ null,
224
+ "dd3b66e4",
225
+ null,
226
+ null
227
+ );
228
+ const w = $.exports;
229
+ const T = {
230
+ name: "PriceHeader",
231
+ components: {
232
+ SummaryTop: S,
233
+ SummaryBottom: w,
234
+ BlockMedia: l
235
+ },
236
+ mixins: [n([
237
+ "media",
238
+ "backgroundColor",
239
+ "documentName",
240
+ "showPriceSummary",
241
+ "showLogo",
242
+ "logotype"
243
+ ])],
244
+ props: {
245
+ _document: {
246
+ type: Object,
247
+ default: () => ({})
248
+ },
249
+ _value: {
250
+ type: Object,
251
+ default: () => ({})
252
+ },
253
+ hasHover: {
254
+ type: Boolean,
255
+ default: !1
256
+ }
257
+ },
258
+ computed: {
259
+ internalName: {
260
+ get() {
261
+ return this.documentName;
262
+ },
263
+ set(i) {
264
+ this.documentName = i, this.$emit("input", { key: "data.name", value: u(i).trim().slice(0, 255) });
265
+ }
266
+ },
267
+ company() {
268
+ return this._document.sender.company;
269
+ },
270
+ prices() {
271
+ return this._document.prices;
272
+ },
273
+ estimatedTimeString() {
274
+ var e, s;
275
+ const { value: i, unitType: t } = ((s = (e = this._document) == null ? void 0 : e.data) == null ? void 0 : s.estimatedTime) || {};
276
+ return !i || !t ? null : this.$tc(`${t}`, { count: i });
277
+ },
278
+ sendAtShowDate() {
279
+ const { sentAt: i, scheduledFirstDelivery: t } = this._document;
280
+ return i || (t ? t.sendAt : null);
281
+ },
282
+ summaryBottom() {
283
+ var s;
284
+ let i = {
285
+ show: !1,
286
+ backgroundColor: this.backgroundColor || this._document.theme.priceSummaryBackground,
287
+ documentCurrency: this._document.currency,
288
+ vatType: this._document.vatType
289
+ }, { showPriceSummary: t } = this;
290
+ typeof t != "boolean" && ({ showPriceSummary: t } = this._document.theme);
291
+ const e = ((s = this._document.packageGroups) == null ? void 0 : s.packages) || [];
292
+ return e.length > 1 ? i = {
293
+ ...i,
294
+ show: t,
295
+ base: { prices: this.prices },
296
+ options: e.filter(({ toggable: r }) => r).map(({ prices: r }) => ({ prices: r }))
297
+ } : i = {
298
+ ...i,
299
+ show: t && this._document.readPrices && (this.prices.total || this.prices.type.some((r) => ["openAccMaxPrice", "openAcc"].includes(r))),
300
+ base: { prices: this.prices }
301
+ }, this.canEdit && t && (i.show = !0), i.documentCurrency || (i.show = !1), i;
302
+ }
303
+ }
304
+ };
305
+ var k = function() {
306
+ var s, r;
307
+ var t = this, e = t._self._c;
308
+ return e("div", [e("div", { staticClass: "doc-jumbotron-wrapper" }, [e("BlockMedia", { staticClass: "price-media-wrapper", attrs: { media: {
309
+ ...t.media,
310
+ resourceUrl: ((s = t.media) == null ? void 0 : s.resourceUrl) || t._document.theme.background,
311
+ overlayColor: ((r = t.media) == null ? void 0 : r.overlayColor) || t._document.theme.backgroundFilter
312
+ } } }), 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(o) {
313
+ t.showLogo = o;
314
+ }, "update:show-logo": function(o) {
315
+ t.showLogo = o;
316
+ }, "update:logotype": function(o) {
317
+ t.logotype = o;
318
+ }, "update:docName": function(o) {
319
+ t.internalName = o;
320
+ }, "update:doc-name": function(o) {
321
+ t.internalName = o;
322
+ } } })], 1), t.summaryBottom.show ? e("SummaryBottom", t._b({ attrs: { _document: t._document } }, "SummaryBottom", t.summaryBottom, !1)) : t._e()], 1);
323
+ }, A = [], B = /* @__PURE__ */ c(
324
+ T,
325
+ k,
326
+ A,
327
+ !1,
328
+ null,
329
+ "d570ff60",
330
+ null,
331
+ null
332
+ );
333
+ const E = B.exports;
334
+ export {
335
+ E as default
336
+ };
@@ -0,0 +1,148 @@
1
+ import { g as u, p as h, d as f, e as d, n as m } from "./main-04025a56.js";
2
+ import { d as p } from "./CDropdownItem-74672842.js";
3
+ import { m as y, a as g } from "./vuex.esm-4a0fff7c.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
+ invoice: !1,
22
+ document: !1
23
+ },
24
+ hasLoadedUsers: !1,
25
+ isLoading: !1,
26
+ emptyQuery: null,
27
+ // String to track last query that was empty, if a new query starts with this string we do not have to search again
28
+ hasSearchedAll: !1
29
+ // Helper to keep track when some search types have not yet searched due min query length
30
+ };
31
+ },
32
+ computed: {
33
+ ...y({
34
+ allUsers: "companyUsers/all",
35
+ allAuthenticatedCRMs: "settings/allAuthenticatedCRMs",
36
+ can: "application/can"
37
+ }),
38
+ typesToFetch() {
39
+ return Object.keys(this.customSearch).length ? Object.keys(this.customSearch).filter((e) => this.customSearch[e]) : Object.keys(this.defaultSearch).filter((e) => this.defaultSearch[e]);
40
+ }
41
+ },
42
+ methods: {
43
+ ...g({
44
+ loadUsers: u.LOAD_COMPANY_USERS
45
+ }),
46
+ canFetchType(e) {
47
+ return e === "invoice" ? this.can("invoices", "read") : e === "endCustomer" ? this.can("endCustomers", "read") : e === "user" ? this.can("users", "modify") : !0;
48
+ },
49
+ async fetch({ query: e, start: a = null, end: r = null }) {
50
+ const t = this.typesToFetch.reduce((n, c) => ({ ...n, [c]: [] }), {}), s = e.toLowerCase();
51
+ if (this.emptyQuery && s && s.startsWith(this.emptyQuery) || (this.emptyQuery = null, this.hasSearchedAll = !0, !s))
52
+ return t;
53
+ try {
54
+ const n = [], c = Object.keys(this.defaultSearch);
55
+ (this.typesToFetch || []).forEach((l) => {
56
+ c.includes(l) && n.push((async () => {
57
+ let o = [];
58
+ l === "document" ? o = await this.fetchDocuments(s, a, r) : l === "user" ? o = await this.fetchUsers(s, a, r) : l === "extensionArticle" ? o = await this.fetchExtensionArticles(s, a, r) : o = await this.fetchType(l, s, a, r), t[l] = o;
59
+ })());
60
+ }), await Promise.all(n);
61
+ } catch (n) {
62
+ throw n;
63
+ } finally {
64
+ this.isLoading = !1;
65
+ }
66
+ return Object.keys(t).every((n) => t[n].length === 0) && this.hasSearchedAll && (this.emptyQuery = s), t;
67
+ },
68
+ async fetchType(e, a, r, t) {
69
+ if (!this.canFetchType(e))
70
+ return [];
71
+ const { data: s } = await h("search", {
72
+ type: e,
73
+ query: a,
74
+ ...r !== null && t !== null && { start: r, end: t }
75
+ });
76
+ return s;
77
+ },
78
+ async fetchUsers(e, a, r) {
79
+ if (!this.canFetchType("user"))
80
+ return [];
81
+ this.hasLoadedUsers || (await this.loadUsers(), this.hasLoadedUsers = !0);
82
+ const s = Object.values(this.allUsers).filter((i) => !!(i.fullName && i.fullName.toLowerCase().includes(e) || i.email && i.email.toLowerCase().includes(e)));
83
+ return a !== null && r !== null ? s.slice(a, r) : s;
84
+ },
85
+ async fetchDocuments(e, a, r) {
86
+ const t = e.replace(/[-[\]{}()*+?.,\\/^$|#]/g, "\\$&"), s = {
87
+ $or: [
88
+ { "data.name": { $regex: t, $options: "i" } },
89
+ { "docNumber.value": { $regex: t, $options: "i" } },
90
+ {
91
+ clients: {
92
+ $elemMatch: { $or: ["name", "email", "socialNo", "orgNo"].map((c) => ({ [c]: { $regex: t, $options: "i" } })) }
93
+ }
94
+ }
95
+ ]
96
+ }, { data: i } = await f("/document", {
97
+ params: {
98
+ lean: !0,
99
+ filter: encodeURIComponent(JSON.stringify(s)),
100
+ fields: "clients,data.name,projectId,docNumber,createdAt",
101
+ ...a !== null && r !== null && { skip: a, limit: r - a }
102
+ }
103
+ }), { items: n = [] } = i || {};
104
+ return n;
105
+ },
106
+ async fetchExtensionArticles(e, a, r) {
107
+ const t = [];
108
+ return await Promise.all(this.allAuthenticatedCRMs.map(async (s) => {
109
+ try {
110
+ if (s === "pipedrive" && e.length < 2) {
111
+ this.hasSearchedAll = !1;
112
+ return;
113
+ }
114
+ const { data: i } = await d.search(s, { query: e, type: "article" });
115
+ i && Array.isArray(i) && t.push(...i);
116
+ } catch {
117
+ }
118
+ })), t;
119
+ },
120
+ // eslint-disable-next-line object-curly-newline
121
+ triggerSearch: p(async function({ q: a, cb: r, start: t, end: s }) {
122
+ this.isLoading = !0;
123
+ const i = await this.fetch({ query: a, start: t, end: s });
124
+ return this.isLoading = !1, r(i);
125
+ }, 500)
126
+ },
127
+ render() {
128
+ return this.$scopedSlots.default({
129
+ // eslint-disable-next-line object-curly-newline
130
+ fetch: ({ q: e, cb: a, start: r = null, end: t = null }) => (this.isLoading = !0, this.triggerSearch({ q: e, cb: a, start: r, end: t })),
131
+ isLoading: this.isLoading
132
+ });
133
+ }
134
+ }, S = null, w = null;
135
+ var L = /* @__PURE__ */ m(
136
+ A,
137
+ S,
138
+ w,
139
+ !1,
140
+ null,
141
+ null,
142
+ null,
143
+ null
144
+ );
145
+ const $ = L.exports;
146
+ export {
147
+ $ as S
148
+ };