@cling-se/widget 0.17.3 → 0.18.0

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 (232) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/AddClientCallout-Bod9Eqx4.js +101 -0
  3. package/dist/AnswerModal-a2cyKFbt.js +3371 -0
  4. package/dist/AttachmentItem-DBUqckCS.js +171 -0
  5. package/dist/BaseUpload-DrWzuvbS.js +6503 -0
  6. package/dist/BlockMedia-DuE_K9hR.js +103 -0
  7. package/dist/CCallout-CM1VsH30.js +104 -0
  8. package/dist/{CCurrencyDropdown-CXXQu8th.js → CCurrencyDropdown-C_lAaq4P.js} +91 -53
  9. package/dist/CDropdownItem-DMUAJ90n.js +749 -0
  10. package/dist/CFormField.vue_vue_type_script_setup_true_lang-BqAyWe3T.js +292 -0
  11. package/dist/{CPhoneFormat-BtBGl8b4.js → CPhoneFormat-Dnn_cKk7.js} +13 -21
  12. package/dist/CPhoneInput-DuGkDiv-.js +207 -0
  13. package/dist/CPriceInput-B7DYzKcF.js +142 -0
  14. package/dist/CSelect-BZZDr27O.js +98 -0
  15. package/dist/CSkeleton.vue_vue_type_script_setup_true_lang-D2jDhnYI.js +51 -0
  16. package/dist/ClientAutocomplete-DuaJ5zDf.js +532 -0
  17. package/dist/ClientModal-CaMSjLkD.js +1188 -0
  18. package/dist/ColorPicker-BISZPQ6j.js +1408 -0
  19. package/dist/CompanyModal-ClTcmU4Y.js +250 -0
  20. package/dist/ContentWrapper-Bj7jbWU0.js +265 -0
  21. package/dist/CoverBlockSettings-AXyiLxrF.js +861 -0
  22. package/dist/DocAnswer-Bu09V33D.js +33 -0
  23. package/dist/DocDetails-B6-2LKsO.js +452 -0
  24. package/dist/DocForm-CFN8LWSd.js +6772 -0
  25. package/dist/DocFormSend-D1CUhy4n.js +171 -0
  26. package/dist/DocLinks-CuliFqtN.js +36 -0
  27. package/dist/DocModalBase-BxKsnwN-.js +29 -0
  28. package/dist/DocPrint-B_HJ_RET.js +399 -0
  29. package/dist/DocReceipt-D-A1TaTI.js +341 -0
  30. package/dist/DocSendReminder-BKTJonzh.js +181 -0
  31. package/dist/{DocTextEditor-yD9Dt_um.js → DocTextEditor-CEPcJT2o.js} +7907 -5579
  32. package/dist/DocTimeline-CF9S4YDZ.js +537 -0
  33. package/dist/DocumentClient-7mbq2QA4.js +90 -0
  34. package/dist/DocumentLayout-DkFlHgW6.js +1434 -0
  35. package/dist/DocumentLogotype-BTYMdpNi.js +162 -0
  36. package/dist/DocumentVoided-CWr5WMUv.js +33 -0
  37. package/dist/EmbedInput-SevVEpwc.js +156 -0
  38. package/dist/EmbedSettings-YMbUmp1O.js +103 -0
  39. package/dist/ErrorCallout-CQo2iF9c.js +34 -0
  40. package/dist/FilePreviewModal-C0xBeoAz.js +202 -0
  41. package/dist/Flag-BObij6SN.js +41 -0
  42. package/dist/HeaderSettings-C77pR78n.js +720 -0
  43. package/dist/ImageSelectModal-DKdU-0uq.js +119 -0
  44. package/dist/ImageUploadWrapper-BGkS5Cll.js +1585 -0
  45. package/dist/Index-B3y-jq9s.js +1098 -0
  46. package/dist/Index-B41pUREi.js +47 -0
  47. package/dist/Index-BEyeS1OG.js +52 -0
  48. package/dist/Index-BG5j8ZFP.js +93 -0
  49. package/dist/Index-BOT65yQR.js +68 -0
  50. package/dist/Index-BQNl-cXP.js +28 -0
  51. package/dist/Index-BY6xsS7C.js +38 -0
  52. package/dist/Index-Bh0Xv5ry.js +163 -0
  53. package/dist/Index-Bn4FSQcx.js +228 -0
  54. package/dist/Index-BrRIAede.js +87 -0
  55. package/dist/Index-C-6um0kX.js +76 -0
  56. package/dist/{Index-C_aIQ908.js → Index-C-gHa5xk.js} +319 -214
  57. package/dist/Index-C0wcjKCH.js +629 -0
  58. package/dist/Index-C6BbUFYw.js +160 -0
  59. package/dist/Index-C8xwJ0m1.js +200 -0
  60. package/dist/Index-CKgFEJF4.js +140 -0
  61. package/dist/{Index-Dfq7egc1.js → Index-CQwmu4f1.js} +47 -60
  62. package/dist/Index-CXchTpBa.js +74 -0
  63. package/dist/{Index-Ch9r5yhG.js → Index-CYoRt8PA.js} +9 -17
  64. package/dist/Index-CZZNQ4q5.js +39 -0
  65. package/dist/Index-CkaAs5ms.js +136 -0
  66. package/dist/Index-CtpXaBz8.js +363 -0
  67. package/dist/Index-CxDsSGtZ.js +126 -0
  68. package/dist/Index-DFkTBm02.js +102 -0
  69. package/dist/Index-DP3ll8F-.js +70 -0
  70. package/dist/{Index-RWMPRDAE.js → Index-DPDzMKQa.js} +10 -18
  71. package/dist/Index-DvxSig3z.js +25 -0
  72. package/dist/Index-Dzrn3Y6p.js +16 -0
  73. package/dist/{Index-CRiATiQn.js → Index-LQb0omFE.js} +10 -18
  74. package/dist/Index-Mt4mSaNT.js +4 -0
  75. package/dist/Index-_xN_cczo.js +3477 -0
  76. package/dist/Index-gAz45qgR.js +21 -0
  77. package/dist/Index-xXLFalgR.js +49 -0
  78. package/dist/Index-zyZRPz3H.js +28 -0
  79. package/dist/Index.vue_vue_type_script_lang-Ddo1wo-D.js +671 -0
  80. package/dist/InputToggleRow-CokEYwm2.js +99 -0
  81. package/dist/ManualPopover-Dukly7GP.js +65 -0
  82. package/dist/MediaWrapper-B8msCrQm.js +18 -0
  83. package/dist/{NotBindingText-CC7TxUqg.js → NotBindingText-DcQd8Eej.js} +13 -17
  84. package/dist/PackageGroup-clUIUoik.js +1060 -0
  85. package/dist/PdfTerms-DpzMVRfN.js +34 -0
  86. package/dist/PdfViewer-CSf4Rtbj.js +392 -0
  87. package/dist/PlainHtml.vue_vue_type_script_setup_true_lang-D6KSjjMA.js +17 -0
  88. package/dist/PriceHeader-Dyweu8aH.js +488 -0
  89. package/dist/{SearchApi-G2Hvp0Dd.js → SearchApi-Y1fDQn0u.js} +37 -49
  90. package/dist/SendForm-B9l24WwR.js +6689 -0
  91. package/dist/Setup-DyzbPFM4.js +47 -0
  92. package/dist/{SmartList-BynTuXtB.js → SmartList-CWGKoAJh.js} +16 -24
  93. package/dist/Sortable.vue_vue_type_script_setup_true_lang-C2Gwp6Q-.js +1349 -0
  94. package/dist/{TermsSettings-cA5YAO77.js → TermsSettings-BeQH307A.js} +169 -56
  95. package/dist/ThemeColorRow-DFIsPy55.js +105 -0
  96. package/dist/ToggleBinding-DlH4y1IM.js +44 -0
  97. package/dist/UploadModal-BZ0mPBBB.js +134 -0
  98. package/dist/VideoPlayerInput-DBxcTUb7.js +134 -0
  99. package/dist/VideoPlayerSettings-Dg1OxjOa.js +78 -0
  100. package/dist/VideoSelectModal-BhbanMix.js +217 -0
  101. package/dist/{anime.es-BrPTThYb.js → anime.es-4wvNItHq.js} +205 -201
  102. package/dist/{color-TdtKxwVa.js → color-HetJPhlA.js} +1 -2
  103. package/dist/{dom-Ds4ypDrd.js → dom-CkTGWrfu.js} +3 -6
  104. package/dist/{focusDrawerMixin-CximZA1J.js → focusDrawerMixin-BVbTYOGr.js} +1 -1
  105. package/dist/{formDrawerState-CkNGdxn5.js → formDrawerState-CogZ-GVm.js} +2 -2
  106. package/dist/helpers-B4GUxtdD.js +46 -0
  107. package/dist/index-BZDey7B-.js +268 -0
  108. package/dist/index-Bd8_ZHHq.js +188 -0
  109. package/dist/index-BvyoYp1e.js +508 -0
  110. package/dist/index-CJZoubA3.js +3525 -0
  111. package/dist/index-D7yQWP4d.js +125 -0
  112. package/dist/index-D8hGHka6.js +513 -0
  113. package/dist/index-Dxy4tf7x.js +149 -0
  114. package/dist/index.es.js +2 -5
  115. package/dist/index.umd.js +303 -1486
  116. package/dist/main-Bn5XkQPb.js +57570 -0
  117. package/dist/mapFormMixin-C7FJLnbO.js +1528 -0
  118. package/dist/omit-DrWpFvRJ.js +56 -0
  119. package/dist/{publicSenderState-CGEm9EYe.js → publicSenderState-tdtCFPMx.js} +4 -4
  120. package/dist/splitpanes-BApidgjj.js +342 -0
  121. package/dist/template-CHdf2K2I.js +1572 -0
  122. package/dist/tippy.esm-Co6FYzEM.js +1994 -0
  123. package/dist/useTermsModal-VDnO1Lro.js +87 -0
  124. package/dist/{utils-Dr4AcaE9.js → utils-DZkn0Q9c.js} +8 -11
  125. package/dist/validation-CqBkar3f.js +40 -0
  126. package/dist/widget.css +1 -0
  127. package/package.json +20 -25
  128. package/dist/AddClientCallout-Br6IhwGH.js +0 -48
  129. package/dist/AnswerModal-CsWltR6j.js +0 -3879
  130. package/dist/AttachmentItem-BG7FuSCD.js +0 -85
  131. package/dist/BaseDatePicker-PSNBtUIh.js +0 -3187
  132. package/dist/BaseUpload-BfEurAAV.js +0 -1977
  133. package/dist/BlockMedia-Bo3OfNSU.js +0 -76
  134. package/dist/CCallout-CAjM8-1X.js +0 -58
  135. package/dist/CDropdownItem-CN7gSfgY.js +0 -640
  136. package/dist/CFormField-Clvcf2Jh.js +0 -240
  137. package/dist/CPhoneInput-CEHXh5jM.js +0 -138
  138. package/dist/CPriceInput-D2c07SXp.js +0 -116
  139. package/dist/CSelect-Cz2IPzxS.js +0 -91
  140. package/dist/CSkeleton-AsnvnD-m.js +0 -55
  141. package/dist/ClientAutocomplete-CZ55-DKe.js +0 -438
  142. package/dist/ClientModal-CgUhWZ5L.js +0 -666
  143. package/dist/ColorPicker-IFGHqH-u.js +0 -2879
  144. package/dist/CompanyModal-TLSBFo3U.js +0 -147
  145. package/dist/ContentWrapper-HClxKPuT.js +0 -190
  146. package/dist/CoverBlockSettings-D99hAa6e.js +0 -659
  147. package/dist/DocAnswer-CTV_Bpt7.js +0 -36
  148. package/dist/DocDetails-CQe5htXj.js +0 -263
  149. package/dist/DocForm-6Efv5_oz.js +0 -5017
  150. package/dist/DocFormSend-DbXcklxU.js +0 -146
  151. package/dist/DocLinks-BO545zbL.js +0 -38
  152. package/dist/DocModalBase-DXHNJ-6i.js +0 -28
  153. package/dist/DocPrint-Bf2U4FQN.js +0 -240
  154. package/dist/DocReceipt-CWXvC7bY.js +0 -217
  155. package/dist/DocSendReminder-CRzBM2NJ.js +0 -140
  156. package/dist/DocTimeline-DGVOk8-2.js +0 -485
  157. package/dist/DocumentClient-Das9BaJ7.js +0 -136
  158. package/dist/DocumentLayout-4q8rmTVT.js +0 -4880
  159. package/dist/DocumentLogotype-DLncJJAB.js +0 -92
  160. package/dist/DocumentVoided-CcI9lX27.js +0 -25
  161. package/dist/EmbedInput-BPdy0lGS.js +0 -117
  162. package/dist/EmbedSettings-L2iwYLQK.js +0 -74
  163. package/dist/ErrorCallout-Ds_tBT02.js +0 -27
  164. package/dist/FilePreviewModal-hxUu330p.js +0 -81
  165. package/dist/Flag-1-HcT5Dz.js +0 -46
  166. package/dist/HeaderSettings-C27fMugK.js +0 -440
  167. package/dist/ImageSelectModal-BKDIyxF4.js +0 -86
  168. package/dist/ImageUploadWrapper-BiYzUQur.js +0 -1604
  169. package/dist/Index-5BOWxcPG.js +0 -26
  170. package/dist/Index-B1Odktov.js +0 -754
  171. package/dist/Index-B3d5BjEn.js +0 -25
  172. package/dist/Index-B3sSU_4X.js +0 -54
  173. package/dist/Index-B5Dqsh3K.js +0 -150
  174. package/dist/Index-B6aO1c_w.js +0 -62
  175. package/dist/Index-BGfICxJQ.js +0 -643
  176. package/dist/Index-BHopC0hv.js +0 -24
  177. package/dist/Index-BJXcSmp_.js +0 -55
  178. package/dist/Index-BQe6QjQZ.js +0 -25
  179. package/dist/Index-BmXx_x6t.js +0 -77
  180. package/dist/Index-C692qMTG.js +0 -294
  181. package/dist/Index-CEvbw-3i.js +0 -41
  182. package/dist/Index-CYSULnpn.js +0 -32
  183. package/dist/Index-CdtYzwAM.js +0 -107
  184. package/dist/Index-CetF2FW0.js +0 -230
  185. package/dist/Index-Cv6XLM20.js +0 -73
  186. package/dist/Index-Cwy8ff76.js +0 -154
  187. package/dist/Index-D34z4UEY.js +0 -84
  188. package/dist/Index-DNCei-lp.js +0 -56
  189. package/dist/Index-DUbxgIYB.js +0 -2445
  190. package/dist/Index-DVwn_LLf.js +0 -28
  191. package/dist/Index-Dla-mesV.js +0 -146
  192. package/dist/Index-KtUkOPI2.js +0 -58
  193. package/dist/Index-LjnOTVJk.js +0 -66
  194. package/dist/Index-ky1SRtfY.js +0 -94
  195. package/dist/Index-mceZW2NX.js +0 -41
  196. package/dist/Index-tD3hZjh8.js +0 -144
  197. package/dist/Index-vM5kDtC2.js +0 -33
  198. package/dist/InputToggleRow-BmDuSbE2.js +0 -57
  199. package/dist/ManualPopover-CQfjPvFe.js +0 -60
  200. package/dist/MediaWrapper-DDzcjR6V.js +0 -23
  201. package/dist/PackageGroup-mAGXfZDv.js +0 -704
  202. package/dist/PdfTerms-BH_Nwf2h.js +0 -31
  203. package/dist/PdfViewer-mBLxI8bA.js +0 -383
  204. package/dist/PlainHtml-B7gUNNZd.js +0 -27
  205. package/dist/PriceHeader-DClYMPcq.js +0 -338
  206. package/dist/SendForm-Cxv_m8Rq.js +0 -1023
  207. package/dist/Setup-B90VDZTG.js +0 -50
  208. package/dist/ThemeColorRow-D-Z7w4Wk.js +0 -69
  209. package/dist/ToggleBinding-DOeTcWzi.js +0 -42
  210. package/dist/UploadModal-DOPLVEpV.js +0 -95
  211. package/dist/VideoPlayerInput-1zG06elO.js +0 -97
  212. package/dist/VideoPlayerSettings-O-4rAYYh.js +0 -61
  213. package/dist/VideoSelectModal-DzqFrqCg.js +0 -104
  214. package/dist/answerDocumentMixin-HBiNWYCH.js +0 -51
  215. package/dist/debounce-Ch1d3526.js +0 -84
  216. package/dist/formValidationMixin-D_MzsHsR.js +0 -49
  217. package/dist/index-BNdbPq4J.js +0 -492
  218. package/dist/index-BXzugeJ6.js +0 -81
  219. package/dist/index-C5wcxrC6.js +0 -167
  220. package/dist/index-CgDOs7t4.js +0 -2700
  221. package/dist/index-Cj-_2coz.js +0 -351
  222. package/dist/index-DpqV5y0K.js +0 -102
  223. package/dist/main-BL_yzf2r.js +0 -57357
  224. package/dist/mapFormMixin-Cu_vkTP-.js +0 -3028
  225. package/dist/omit-Dfe_H1Ft.js +0 -31
  226. package/dist/simplebar.min-CRlLD1Oz.js +0 -71
  227. package/dist/splitpanes-BHUVsCZF.js +0 -382
  228. package/dist/style.css +0 -4
  229. package/dist/throttle-BX_w77tW.js +0 -18
  230. package/dist/tippy.esm-n4arfVzA.js +0 -1805
  231. package/dist/vuedraggable.umd-DW4PJoZ3.js +0 -3161
  232. package/dist/vuex.esm-DKGl8mcw.js +0 -467
@@ -1,440 +0,0 @@
1
- import { m as x, t as _ } from "./mapFormMixin-Cu_vkTP-.js";
2
- import { T as C } from "./ThemeColorRow-D-Z7w4Wk.js";
3
- import w from "./VideoPlayerInput-1zG06elO.js";
4
- import k from "./ImageUploadWrapper-BiYzUQur.js";
5
- import { B as b, a as S } from "./index-C5wcxrC6.js";
6
- import { c as y, n as u, q as d, P as V, k as A, ai as L } from "./main-BL_yzf2r.js";
7
- import { C as z } from "./CFormField-Clvcf2Jh.js";
8
- import { b as $ } from "./CDropdownItem-CN7gSfgY.js";
9
- const v = y.unsplash.id, I = y.pexels.id, B = {
10
- name: "MediaSelectModal",
11
- i18nOptions: {
12
- namespaces: "mediaSelectModal",
13
- messages: {
14
- en: {
15
- title: "Choose background",
16
- creditVideos: "Videos from {{thing}}",
17
- tabLink: "Use link",
18
- minWidth: "Recommended minimum image width is 1200 pixels or greater."
19
- },
20
- sv: {
21
- title: "Välj bakgrundsbild",
22
- creditVideos: "Videor från {{thing}}",
23
- tabLink: "Egen länk",
24
- minWidth: "Rekommenderad minimum bredd på bilden är 1200 pixlar eller större."
25
- }
26
- }
27
- },
28
- components: {
29
- BackgroundModal: b,
30
- BackgroundList: S,
31
- VideoPlayerInput: w,
32
- ImageUploadWrapper: k
33
- },
34
- props: {
35
- currentType: {
36
- type: String,
37
- default: ""
38
- }
39
- },
40
- data() {
41
- return {
42
- tabs: [
43
- {
44
- value: "unsplash",
45
- label: "Unsplash",
46
- icon: '<svg style="margin-right: calc(0.5 * var(--rem));" width="20" height="20" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M10 9V0h12v9H10zm12 5h10v18H0V14h10v9h12v-9z"/></svg>'
47
- },
48
- {
49
- value: "customImage",
50
- label: this.$t("_common:upload"),
51
- icon: '<svg style="margin-right: calc(0.5 * var(--rem));" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="8.5" cy="8.5" r="1.5"/><path d="M20.4 14.5L16 10 4 20"/></svg>'
52
- },
53
- {
54
- value: "pexels",
55
- label: "Pexels",
56
- icon: '<svg style="margin-right: calc(0.5 * var(--rem));" xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 32 32"><path d="M2 0h28a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2z" fill="#05A081"></path><path d="M13 21h3.863v-3.752h1.167a3.124 3.124 0 1 0 0-6.248H13v10zm5.863 2H11V9h7.03a5.124 5.124 0 0 1 .833 10.18V23z" fill="#fff"></path></svg>'
57
- },
58
- {
59
- value: "customVideo",
60
- label: this.$t("tabLink"),
61
- icon: '<svg style="margin-right: calc(0.5 * var(--rem));" width="28" height="28" xmlns="http://www.w3.org/2000/svg" version="1.1" x="0" y="0" xml:space="preserve" viewBox="0 0 71.412 50"><g transform="scale(.58824)"><path d="M118.9 13.3c-1.4-5.2-5.5-9.3-10.7-10.7C98.7 0 60.7 0 60.7 0s-38 0-47.5 2.5C8.1 3.9 3.9 8.1 2.5 13.3 0 22.8 0 42.5 0 42.5s0 19.8 2.5 29.2C3.9 76.9 8 81 13.2 82.4 22.8 85 60.7 85 60.7 85s38 0 47.5-2.5c5.2-1.4 9.3-5.5 10.7-10.7 2.5-9.5 2.5-29.2 2.5-29.2s.1-19.8-2.5-29.3z" fill="red" fill-opacity="1"/><path fill="#fff" d="M80.2 42.5L48.6 24.3v36.4z"/></g></svg>'
62
- }
63
- ],
64
- activeTab: "unsplash",
65
- selectedImage: null,
66
- preferredColor: null,
67
- customImage: null,
68
- selectedVideo: null,
69
- customVideo: null
70
- };
71
- },
72
- computed: {
73
- isImage() {
74
- return ["unsplash", "customImage"].includes(this.activeTab);
75
- }
76
- },
77
- created() {
78
- this.currentType === "video" && (this.activeTab = "pexels");
79
- },
80
- methods: {
81
- async fetchImage({ query: o, page: t }) {
82
- const { data: e } = await d.get(
83
- "https://api.unsplash.com/search/photos",
84
- {
85
- params: {
86
- page: t,
87
- per_page: 12,
88
- client_id: v,
89
- query: o
90
- }
91
- }
92
- );
93
- return {
94
- items: (e.results || []).map((i) => ({
95
- ...i,
96
- image: i.urls.regular,
97
- minImage: i.urls.thumb
98
- })),
99
- total: e.total
100
- };
101
- },
102
- async fetchVideo({ query: o, page: t }) {
103
- const { data: e } = await d.get("https://api.pexels.com/videos/search", {
104
- headers: {
105
- Authorization: I
106
- },
107
- params: {
108
- page: t,
109
- per_page: 12,
110
- query: o
111
- }
112
- }), i = (s, a) => s.height < a.height || s.width < a.width ? -1 : 1, r = (s) => (s.find(({ height: a }) => a > 1e3 && a < 1200) || {}).link;
113
- return {
114
- items: (e.videos || []).map(
115
- ({ id: s, image: a, video_files: m = [], user: h }) => {
116
- const { sd: p, hd: g } = (m || []).sort(i).reduce(
117
- (c, l) => (c[l.quality] && l.link && c[l.quality].push(l.link), c),
118
- { sd: [], hd: [] }
119
- ), [f] = p;
120
- let n = r(m);
121
- return n || ([n] = g.length ? g : p.slice(-1)), {
122
- id: `${s}`,
123
- image: a,
124
- minImage: a,
125
- video: n,
126
- minVideo: f,
127
- userName: h.name,
128
- userLink: h.link
129
- };
130
- }
131
- ),
132
- total: e.total_results
133
- };
134
- },
135
- selectImage({ image: o, links: t, color: e }) {
136
- this.selectedImage = V(o, { w: 1800 }), e && (this.preferredColor = e);
137
- const i = new Image();
138
- i.src = this.selectedImage, d.get(t.download_location, {
139
- params: {
140
- client_id: v
141
- }
142
- });
143
- },
144
- setCustomBackground({ response: o }) {
145
- this.customImage = o.url;
146
- },
147
- selectVideo({ id: o, image: t, video: e }) {
148
- this.selectedVideo = {
149
- id: o,
150
- url: e,
151
- thumbnail: t,
152
- provider: "pexels"
153
- };
154
- },
155
- onSave() {
156
- let o;
157
- this.isImage ? o = {
158
- type: "image",
159
- value: this.activeTab === "unsplash" ? this.selectedImage : this.customImage
160
- } : o = {
161
- type: "video",
162
- value: this.activeTab === "pexels" ? this.selectedVideo : this.customVideo
163
- }, this.preferredColor && (o.preferredColor = this.preferredColor), this.$emit("input", o), this.$parent && this.$parent.$emit("input", o), this.$emit("close");
164
- }
165
- }
166
- };
167
- var M = function() {
168
- var t = this, e = t._self._c;
169
- return e("BackgroundModal", t._g({ scopedSlots: t._u([{ key: "header", fn: function() {
170
- return [e("div", { staticClass: "flex w-full items-center justify-center", staticStyle: { padding: "calc(0.25 * var(--rem)) calc(1 * var(--rem))", "border-bottom": "1px solid hsl(0, 0%, 88%)" } }, t._l(t.tabs, function(i, r) {
171
- return e("CButton", { key: r, staticStyle: { "font-size": "15px", "font-weight": "700", opacity: "0.5", "box-shadow": "none" }, style: t.activeTab === i.value && { opacity: 1 }, on: { click: function(s) {
172
- t.activeTab = i.value;
173
- } } }, [e("span", { staticClass: "inline-flex items-center justify-center" }, [e("div", { domProps: { innerHTML: t._s(i.icon) } }), e("span", { staticClass: "max-md:!hidden" }, [t._v(t._s(i.label))])])]);
174
- }), 1)];
175
- }, proxy: !0 }]) }, t.$listeners), [["unsplash", "pexels"].includes(t.activeTab) ? e("BackgroundList", { key: t.activeTab, attrs: { fetch: t.isImage ? t.fetchImage : t.fetchVideo, "credit-text": t.$t("creditVideos", { thing: t.activeTab.capitalize() }), "default-query": "nature" }, on: { select: function(i) {
176
- t.isImage ? t.selectImage(i) : t.selectVideo(i);
177
- } }, scopedSlots: t._u([{ key: "footer", fn: function() {
178
- return [e("CButton", { staticStyle: { "margin-left": "0.5em" }, attrs: { disabled: t.isImage ? !t.selectedImage : !t.selectedVideo, type: "secondary" }, on: { click: t.onSave } }, [t._v(" " + t._s(t.$t("_common:save")) + " ")])];
179
- }, proxy: !0 }], null, !1, 782343106) }) : t.activeTab === "customVideo" ? e("div", { staticClass: "flex w-full flex-col items-center justify-center" }, [e("div", { staticStyle: { "max-width": "500px", width: "100%", margin: "0 auto", "padding-top": "calc(3 * var(--rem))" } }, [e("div", { staticStyle: { position: "relative", width: "100%", "padding-top": "56.25%", "background-color": "hsl(var(--gray-color-100) / 1)", "border-radius": "0.5em", "margin-bottom": "calc(1.5 * var(--rem))" } }, [t.customVideo ? e("iframe", { staticClass: "custom-video-preview", attrs: { src: t.customVideo.url } }) : t._e()]), e("VideoPlayerInput", { attrs: { filled: !0, "video-options": { background: !0 } }, model: { value: t.customVideo, callback: function(i) {
180
- t.customVideo = i;
181
- }, expression: "customVideo" } }, [e("CButton", { attrs: { disabled: !t.customVideo, type: "secondary" }, on: { click: t.onSave } }, [t._v(" " + t._s(t.$t("_common:save")) + " ")])], 1)], 1)]) : e("div", { staticClass: "flex flex-col items-center justify-center" }, [e("div", { staticStyle: { "max-width": "500px", width: "100%", margin: "0 auto", "padding-top": "calc(3 * var(--rem))" } }, [e("ImageUploadWrapper", { ref: "uploadWrapper", attrs: { "on-image-upload": t.setCustomBackground }, scopedSlots: t._u([{ key: "default", fn: function({ progress: i }) {
182
- return [e("div", { staticClass: "relative mb-6 w-full" }, [t.customImage ? e("img", { staticClass: "h-full w-full object-cover object-scale-down object-top", staticStyle: { "max-height": "500px" }, attrs: { src: t.customImage, alt: t.customImage } }) : e("div", { staticClass: "flex aspect-video flex-col items-center justify-center rounded-md bg-gray-100" }, [e("CButton", { style: t.customImage && { opacity: 0.5 }, attrs: { loading: !!i && i < 100, "icon-left": "upload", type: "none" } }, [t._v(" " + t._s(t.$t("_common:upload")) + " ")]), e("div", { staticClass: "text-center text-gray-600", staticStyle: { "padding-top": "calc(1 * var(--rem))", "font-size": "14px", "max-width": "40ch" } }, [t._v(" " + t._s(t.$t("minWidth")) + " ")])], 1)])];
183
- } }]) }), e("div", { staticClass: "flex items-center justify-center" }, [e("CButton", { attrs: { disabled: !t.customImage, type: "secondary" }, on: { click: t.onSave } }, [t._v(" " + t._s(t.$t("_common:save")) + " ")])], 1)], 1)])], 1);
184
- }, T = [], F = /* @__PURE__ */ u(
185
- B,
186
- M,
187
- T,
188
- !1,
189
- null,
190
- "e2e19b2c"
191
- );
192
- const P = F.exports, R = {
193
- name: "CRadioButton",
194
- components: {
195
- CButton: A
196
- },
197
- mixins: [L],
198
- props: {
199
- type: {
200
- type: String,
201
- default: "primary"
202
- },
203
- expanded: Boolean
204
- },
205
- data() {
206
- return {
207
- isFocused: !1
208
- };
209
- }
210
- };
211
- var j = function() {
212
- var t = this, e = t._self._c;
213
- return e("div", { staticClass: "control", class: { "is-expanded": t.expanded } }, [e("CButton", { ref: "label", staticClass: "c-radio radio button", class: [{ "is-disabled": t.disabled, "is-focused": t.isFocused }], attrs: { tag: "label", type: t.newValue === t.nativeValue ? t.type : null, size: t.size, disabled: t.disabled }, on: { click: t.focus, keydown: function(i) {
214
- return !i.type.indexOf("key") && t._k(i.keyCode, "enter", 13, i.key, "Enter") ? null : (i.preventDefault(), t.$refs.$el.label.click());
215
- } } }, [t._t("default"), e("input", { directives: [{ name: "model", rawName: "v-model", value: t.computedValue, expression: "computedValue" }], ref: "input", attrs: { disabled: t.disabled, required: t.required, name: t.name, type: "radio" }, domProps: { value: t.nativeValue, checked: t._q(t.computedValue, t.nativeValue) }, on: { click: function(i) {
216
- i.stopPropagation();
217
- }, focus: function(i) {
218
- t.isFocused = !0;
219
- }, blur: function(i) {
220
- t.isFocused = !1;
221
- }, change: function(i) {
222
- t.computedValue = t.nativeValue;
223
- } } })], 2)], 1);
224
- }, H = [], q = /* @__PURE__ */ u(
225
- R,
226
- j,
227
- H,
228
- !1,
229
- null,
230
- null
231
- );
232
- const D = q.exports, O = {
233
- name: "HeaderSettings",
234
- components: {
235
- ThemeColorRow: C,
236
- CRadioButton: D,
237
- CSwitch: $,
238
- CField: z
239
- },
240
- mixins: [
241
- x(
242
- [
243
- "layout",
244
- "items",
245
- "media",
246
- "showPriceSummary",
247
- "backgroundColor",
248
- "textAlign",
249
- "textColor"
250
- ],
251
- { useEmit: !1 }
252
- )
253
- ],
254
- data() {
255
- return {
256
- type: "image",
257
- layoutOptions2: [
258
- {
259
- value: "left",
260
- icon: '<rect x="3" y="6" width="18" height="14" rx="1"></rect><rect x="3" y="6" width="8" height="14" rx="1" fill="currentColor"></rect>'
261
- },
262
- {
263
- value: "right",
264
- icon: '<rect x="3" y="6" width="18" height="14" rx="1"></rect><rect x="13" y="6" width="8" height="14" rx="1" fill="currentColor"></rect>'
265
- },
266
- {
267
- value: "top",
268
- icon: '<rect x="3" y="6" width="18" height="14" rx="1"></rect><rect x="3" y="6" width="18" height="7" rx="1" fill="currentColor"></rect>'
269
- },
270
- {
271
- value: "bottom",
272
- icon: '<rect x="3" y="6" width="18" height="14" rx="1"></rect><rect x="3" y="14" width="18" height="5" rx="1" fill="currentColor"></rect>'
273
- },
274
- {
275
- value: "center",
276
- icon: '<rect x="3" y="6" width="18" height="14" rx="1"></rect><rect x="8" y="12" width="8" height="2" rx="0" fill="currentColor"></rect>'
277
- },
278
- {
279
- value: "price",
280
- icon: '<rect x="4" y="6" width="16" height="7"></rect><rect x="4" y="16" width="16" height="3" style="fill: currentColor;"></rect>'
281
- }
282
- ],
283
- alignOptions: [
284
- {
285
- value: "left",
286
- icon: '<path d="M 6 9 A 2.0002 2.0002 0 1 0 6 13 L 34 13 A 2.0002 2.0002 0 1 0 34 9 L 6 9 z M 6 22 A 2.0002 2.0002 0 1 0 6 26 L 42 26 A 2.0002 2.0002 0 1 0 42 22 L 6 22 z M 7 35 A 2.0002 2.0002 0 1 0 7 39 L 27 39 A 2.0002 2.0002 0 1 0 27 35 L 7 35 z" />'
287
- },
288
- {
289
- value: "center",
290
- icon: '<path d="M 10 9 A 2.0002 2.0002 0 1 0 10 13 L 38 13 A 2.0002 2.0002 0 1 0 38 9 L 10 9 z M 6 22 A 2.0002 2.0002 0 1 0 6 26 L 42 26 A 2.0002 2.0002 0 1 0 42 22 L 6 22 z M 14 35 A 2.0002 2.0002 0 1 0 14 39 L 34 39 A 2.0002 2.0002 0 1 0 34 35 L 14 35 z" />'
291
- },
292
- {
293
- value: "right",
294
- icon: '<path d="M 14 9 A 2.0002 2.0002 0 1 0 14 13 L 42 13 A 2.0002 2.0002 0 1 0 42 9 L 14 9 z M 6 22 A 2.0002 2.0002 0 1 0 6 26 L 42 26 A 2.0002 2.0002 0 1 0 42 22 L 6 22 z M 22 35 A 2.0002 2.0002 0 1 0 22 39 L 42 39 A 2.0002 2.0002 0 1 0 42 35 L 22 35 z" />'
295
- }
296
- ]
297
- };
298
- },
299
- computed: {
300
- layoutOptions() {
301
- var t;
302
- const { type: o } = ((t = this.items) == null ? void 0 : t[0]) || {};
303
- return [
304
- {
305
- // left
306
- isActive: this.layout === "vertical" && o === "media",
307
- icon: '<rect x="3" y="6" width="18" height="14" rx="1"></rect><rect x="3" y="6" width="8" height="14" rx="1" fill="currentColor"></rect>',
308
- onClick: () => this.setLayout({ layout: "vertical", type: "media" })
309
- },
310
- {
311
- // right
312
- isActive: this.layout === "vertical" && o === "content",
313
- icon: '<rect x="3" y="6" width="18" height="14" rx="1"></rect><rect x="13" y="6" width="8" height="14" rx="1" fill="currentColor"></rect>',
314
- onClick: () => this.setLayout({ layout: "vertical", type: "content" })
315
- },
316
- {
317
- // top
318
- isActive: this.layout === "horizontal" && o === "media",
319
- icon: '<rect x="3" y="6" width="18" height="14" rx="1"></rect><rect x="3" y="6" width="18" height="7" rx="1" fill="currentColor"></rect>',
320
- onClick: () => this.setLayout({ layout: "horizontal", type: "media" })
321
- },
322
- {
323
- // bottom
324
- isActive: this.layout === "horizontal" && o === "content",
325
- icon: '<rect x="3" y="6" width="18" height="14" rx="1"></rect><rect x="3" y="14" width="18" height="5" rx="1" fill="currentColor"></rect>',
326
- onClick: () => this.setLayout({ layout: "horizontal", type: "content" })
327
- },
328
- {
329
- // center
330
- isActive: this.layout === "center",
331
- icon: '<rect x="3" y="6" width="18" height="14" rx="1"></rect><rect x="8" y="12" width="8" height="2" rx="0" fill="currentColor"></rect>',
332
- onClick: () => this.setLayout({ layout: "center", type: "media" })
333
- },
334
- {
335
- // price
336
- isActive: this.layout === "price",
337
- icon: '<rect x="4" y="6" width="16" height="7"></rect><rect x="4" y="16" width="16" height="3" style="fill: currentColor;"></rect>',
338
- onClick: () => this.setLayout({ layout: "price" })
339
- }
340
- ];
341
- },
342
- overlayColor: {
343
- get() {
344
- var o;
345
- return ((o = this.media) == null ? void 0 : o.overlayColor) || "";
346
- },
347
- set(o) {
348
- this.media = { ...this.media, overlay: !0, overlayColor: o };
349
- }
350
- },
351
- background() {
352
- let o = "";
353
- const { type: t, resourceUrl: e, video: i = {} } = this.media || {};
354
- return t === "image" && e ? o = e : t === "video" && i.thumbnail && (o = i.thumbnail), o;
355
- },
356
- theme() {
357
- var o;
358
- return ((o = this._document) == null ? void 0 : o.theme) || {};
359
- },
360
- showPriceToggle: {
361
- get() {
362
- return !!(typeof this.showPriceSummary == "boolean" ? this.showPriceSummary : this.theme.showPriceSummary);
363
- },
364
- set(o) {
365
- this.showPriceSummary = o;
366
- }
367
- }
368
- },
369
- watch: {
370
- layout(o) {
371
- this._document.isDirty(this._value.textAlign) || (this.textAlign = o === "center" ? o : "left");
372
- },
373
- backgroundColor(o) {
374
- this._document.isDirty(this._value.textColor) || (this.textColor = _.readability(o, "#fff") < 1.8 ? "#111111" : "#FFFFFF");
375
- }
376
- },
377
- methods: {
378
- // Used for setting the correct array item order for specific layouts
379
- // will place the given item type first in items
380
- setLayout({ layout: o, type: t = "" }) {
381
- const e = (i) => (r) => r.type === i ? -1 : 1;
382
- t && (this.items = [...this.items].sort(e(t))), this.layout = o;
383
- },
384
- openBgModal() {
385
- const { type: o = "image" } = this.media || {};
386
- this.$modal.show(
387
- P,
388
- {
389
- currentType: o
390
- },
391
- {},
392
- {
393
- input: ({ type: t, value: e, preferredColor: i }) => {
394
- const r = t === "image" ? "resourceUrl" : "video";
395
- this.media = {
396
- ...this.media,
397
- type: t,
398
- [r]: e
399
- }, i && !this._document.isDirty(this._value.backgroundColor) && (this.backgroundColor = i);
400
- }
401
- }
402
- );
403
- }
404
- }
405
- };
406
- var U = function() {
407
- var t = this, e = t._self._c;
408
- return e("div", { staticClass: "d-root" }, [e("div", { staticClass: "d-option" }, [e("div", { staticClass: "d-option-title", staticStyle: { "padding-bottom": "calc(0.5 * var(--rem))" } }, [t._v(" Layouts ")]), e("div", { staticClass: "grid grid-cols-3 gap-2 p-1" }, t._l(t.layoutOptions, function({ isActive: i, onClick: r, icon: s }, a) {
409
- return e("CButton", { key: a, staticStyle: { padding: "6px 10px", "border-radius": "3px", height: "initial" }, attrs: { type: i ? "secondary" : "none", pattern: i ? "primary" : "secondary", size: "normal" }, on: { click: r } }, [e("svg", { attrs: { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "1.75", "stroke-linecap": "round", "stroke-linejoin": "round" }, domProps: { innerHTML: t._s(s) } })]);
410
- }), 1)]), e("div", { staticClass: "d-option" }, [e("div", { staticClass: "d-option-title", staticStyle: { "padding-bottom": "calc(0.5 * var(--rem))" } }, [t._v(" " + t._s(t.$t("_common:background").capitalize()) + " ")]), e("div", { staticClass: "d-option-button-image", style: {
411
- backgroundImage: `url(${t.background || t.theme.background})`
412
- }, on: { click: t.openBgModal } })]), e("div", { staticClass: "d-option", staticStyle: { "padding-bottom": "0.5em" } }, [e("ThemeColorRow", { staticClass: "d-option-title", attrs: { value: t.overlayColor || t.theme.backgroundFilter || "", placement: "auto" }, on: { change: function(i) {
413
- t.overlayColor = i;
414
- } } }, [t._v(" " + t._s(t.$t("components:account.documentForm.settings.backgroundFilter")) + " ")])], 1), t.layout === "price" ? e("div", { staticClass: "d-option" }, [e("div", { staticClass: "d-option-title" }, [e("div", { staticStyle: { flex: "1 1 auto" } }, [t._v(" " + t._s(t.$t("components:account.documentForm.settings.priceSummaryBackground")) + " ")]), e("CSwitch", { staticStyle: { "margin-right": "0" }, attrs: { size: "small", type: "secondary" }, model: { value: t.showPriceToggle, callback: function(i) {
415
- t.showPriceToggle = i;
416
- }, expression: "showPriceToggle" } })], 1), t.showPriceToggle ? e("div", { staticClass: "d-option-row", staticStyle: { "padding-top": "1em" } }, [e("ThemeColorRow", { staticClass: "d-option-title", attrs: { value: t.backgroundColor || t.theme.priceSummaryBackground || "", "picker-options": { disableAlpha: !0 }, placement: "auto" }, on: { change: function(i) {
417
- t.backgroundColor = i;
418
- } } }, [t._v(" " + t._s(t.$t("_common:backgroundColor").capitalize()) + " ")])], 1) : t._e()]) : [t.layout !== "center" ? e("div", { staticClass: "d-option" }, [e("ThemeColorRow", { staticClass: "d-option-title", attrs: { value: t.backgroundColor || t.theme.priceSummaryBackground || "", "picker-options": { disableAlpha: !0 }, placement: "auto" }, on: { change: function(i) {
419
- t.backgroundColor = i, t._document.setDirty(t._value.backgroundColor);
420
- } } }, [t._v(" " + t._s(t.$t("_common:backgroundColor").capitalize()) + " ")])], 1) : t._e(), e("div", { staticClass: "d-option" }, [e("ThemeColorRow", { staticClass: "d-option-title", staticStyle: { "margin-top": "calc(0.5 * var(--rem))" }, attrs: { value: t.textColor || "", "picker-options": { disableAlpha: !0 }, placement: "auto" }, on: { change: function(i) {
421
- t.textColor = i, t._document.setDirty(t._value.textColor);
422
- } } }, [t._v(" " + t._s(t.$t("_common:textColor").capitalize()) + " ")])], 1), e("div", { staticClass: "d-option flex w-full" }, [e("div", { staticClass: "d-option-title", staticStyle: { "margin-top": "calc(0.5 * var(--rem))" } }, [t._v(" " + t._s(t.$t("_common:textAlign").capitalize()) + " ")]), e("CField", { staticStyle: { "margin-left": "auto" } }, t._l(t.alignOptions, function({ value: i, icon: r }, s) {
423
- return e("CRadioButton", { key: s, class: !t.textAlign && "text-gray-400", attrs: { "native-value": i, type: t.textAlign ? "secondary" : "none", size: "small" }, on: { input: function(a) {
424
- return t._document.setDirty(t._value.textAlign);
425
- } }, model: { value: t.textAlign, callback: function(a) {
426
- t.textAlign = a;
427
- }, expression: "textAlign" } }, [e("svg", { staticStyle: { margin: "0" }, attrs: { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 48 48", fill: "currentColor", stroke: "currentColor", "stroke-linecap": "round", "stroke-linejoin": "round" }, domProps: { innerHTML: t._s(r) } })]);
428
- }), 1)], 1)]], 2);
429
- }, W = [], E = /* @__PURE__ */ u(
430
- O,
431
- U,
432
- W,
433
- !1,
434
- null,
435
- "7fbe66cc"
436
- );
437
- const tt = E.exports;
438
- export {
439
- tt as default
440
- };
@@ -1,86 +0,0 @@
1
- import r from "./ImageUploadWrapper-BiYzUQur.js";
2
- import { B as l, a as i } from "./index-C5wcxrC6.js";
3
- import { c, n as d, q as n, P as m } from "./main-BL_yzf2r.js";
4
- const o = c.unsplash.id, p = {
5
- name: "ImageSelectModal",
6
- i18nOptions: {
7
- namespaces: "imageSelectModal",
8
- messages: {
9
- en: {
10
- creditImages: "Images from {{thing}}"
11
- },
12
- sv: {
13
- creditImages: "Bilder från {{thing}}"
14
- }
15
- }
16
- },
17
- components: {
18
- BackgroundModal: l,
19
- BackgroundList: i,
20
- ImageUploadWrapper: r
21
- },
22
- data() {
23
- return {
24
- selectedUrl: null
25
- };
26
- },
27
- methods: {
28
- async fetch({ query: a, page: e }) {
29
- const { data: t } = await n.get(
30
- "https://api.unsplash.com/search/photos",
31
- {
32
- params: {
33
- page: e,
34
- per_page: 12,
35
- client_id: o,
36
- query: a
37
- }
38
- }
39
- );
40
- return {
41
- items: (t.results || []).map((s) => ({
42
- ...s,
43
- image: s.urls.regular,
44
- minImage: s.urls.thumb
45
- })),
46
- total: t.total
47
- };
48
- },
49
- selectImage(a) {
50
- this.selectedUrl = m(a.image, { w: 1800 });
51
- const e = new Image();
52
- e.src = this.selectedUrl, n.get(a.links.download_location, {
53
- params: {
54
- client_id: o
55
- }
56
- });
57
- },
58
- setCustomBackground({ response: a }) {
59
- this.selectedUrl = a.url, this.onSave();
60
- },
61
- onSave() {
62
- this.$emit("change"), this.$emit("input", this.selectedUrl), this.$parent && (this.$parent.$emit("change"), this.$parent.$emit("input", this.selectedUrl)), this.$emit("close");
63
- }
64
- }
65
- };
66
- var u = function() {
67
- var e = this, t = e._self._c;
68
- return t("BackgroundModal", e._g({}, e.$listeners), [t("BackgroundList", { attrs: { fetch: e.fetch, "credit-text": e.$t("creditImages", { thing: "Unsplash" }), "default-query": "architecture" }, on: { select: e.selectImage }, scopedSlots: e._u([{ key: "footer", fn: function() {
69
- return [t("ImageUploadWrapper", { ref: "uploadWrapper", attrs: { "on-image-upload": e.setCustomBackground }, on: { upload: function(s) {
70
- e.isUploadingImage = !0;
71
- } }, scopedSlots: e._u([{ key: "default", fn: function({ progress: s }) {
72
- return [t("CButton", { attrs: { loading: !!s, "icon-left": "upload", type: "none" } }, [e._v(" " + e._s(e.$t("_common:upload")) + " ")])];
73
- } }]) }), t("CButton", { staticStyle: { "margin-left": "0.5em" }, attrs: { type: "secondary" }, on: { click: e.onSave } }, [e._v(" " + e._s(e.$t("_common:save")) + " ")])];
74
- }, proxy: !0 }]) })], 1);
75
- }, g = [], h = /* @__PURE__ */ d(
76
- p,
77
- u,
78
- g,
79
- !1,
80
- null,
81
- "4fdd100a"
82
- );
83
- const v = h.exports;
84
- export {
85
- v as default
86
- };