@feedmepos/mf-connect 0.1.38-beta.74 → 0.1.38-beta.75

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 (140) hide show
  1. package/dist/Analytic-9B27Q-I3.js +761 -0
  2. package/dist/App-isiE4pjM.js +4642 -0
  3. package/dist/AuditLogs-BmHr7pNI.js +1991 -0
  4. package/dist/Bin-BR06pDbx.js +166 -0
  5. package/dist/Broadcast-D_t80J2I.js +267 -0
  6. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-C5IuPCTB.js +121 -0
  7. package/dist/Card-Zs-1lcSr.js +910 -0
  8. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +97 -0
  9. package/dist/Collections-BjeTJSHo.js +541 -0
  10. package/dist/Credit-DdmdsxOF.js +261 -0
  11. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
  12. package/dist/DateInput.vue_vue_type_script_setup_true_lang-BN4Q5Y3l.js +54 -0
  13. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +58 -0
  14. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DkOfrONH.js +3120 -0
  15. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-kzk3iEKA.js +351 -0
  16. package/dist/Experience-WxtE9ZIT.js +260 -0
  17. package/dist/FileSaver.min-Vgxo4jNi.js +74 -0
  18. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
  19. package/dist/Game-Cc0mZ3y4.js +331 -0
  20. package/dist/GenerateMaterial-Dsvnpz4o.js +589 -0
  21. package/dist/Grab-CcaXToD-.js +301 -0
  22. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-D0yJMgs9.js +145 -0
  23. package/dist/Index-C0TcFJJY.js +259 -0
  24. package/dist/JsonViewer-v8_C7l5N.js +87 -0
  25. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-CXFtSS9_.js +48 -0
  26. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-Ca7hKpcD.js +18737 -0
  27. package/dist/MainLayout-DPpjvWwq.js +41 -0
  28. package/dist/Marketing-DfXuNM7X.js +145 -0
  29. package/dist/MarketingMaterialEdit-C63qyQSd.js +746 -0
  30. package/dist/Member-LTYVn-80.js +280 -0
  31. package/dist/MemberList-Gqr6ha5p.js +1601 -0
  32. package/dist/MemberOverview-wL_ailso.js +58 -0
  33. package/dist/MemberTransactions-CVZ-SPhm.js +45 -0
  34. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-BGooFTgg.js +60799 -0
  35. package/dist/Mission-CLQdNsOe.js +335 -0
  36. package/dist/Overview-BluyLBRI.js +1078 -0
  37. package/dist/Point-DQLQxJG1.js +263 -0
  38. package/dist/Promotion-BG0xL1ed.js +397 -0
  39. package/dist/Queue-BR7TrLI8.js +259 -0
  40. package/dist/Record-2WFpDhAb.js +341 -0
  41. package/dist/Review-Bu9SGftr.js +617 -0
  42. package/dist/ReviewFacebookCallback-CV99Udei.js +243 -0
  43. package/dist/ReviewGoogleCallback-DiqgQzOt.js +213 -0
  44. package/dist/Reward-CPhM3ChT.js +442 -0
  45. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-Q9pVq11w.js +149 -0
  46. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BRUQtqjv.js +1912 -0
  47. package/dist/Segment-D6V8FKUY.js +881 -0
  48. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BrE1gGHP.js +181 -0
  49. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-DQhO9k7V.js +188 -0
  50. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-CyHx6m95.js +147 -0
  51. package/dist/Setting-Bh5bB75w.js +2000 -0
  52. package/dist/SettingAdvertisements-CFUjq6s1.js +264 -0
  53. package/dist/Store-DiVaUn7w.js +1996 -0
  54. package/dist/StoreRewards-Bb9iW3Yz.js +535 -0
  55. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-DVFsPzLK.js +1129 -0
  56. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-D9uZR0si.js +7005 -0
  57. package/dist/Tier-BYxLjqAB.js +970 -0
  58. package/dist/Title-D3cdNE2O.js +568 -0
  59. package/dist/Transaction-D7ItbBra.js +39 -0
  60. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-UXSlpEM0.js +130 -0
  61. package/dist/Voucher-DNQz_ujN.js +422 -0
  62. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-CztGuaCV.js +421 -0
  63. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-RI0mY3Nx.js +56 -0
  64. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  65. package/dist/app-wDQR6dpb.js +39 -0
  66. package/dist/app-zPef9Uzl.js +59396 -0
  67. package/dist/app.js +7 -0
  68. package/dist/business-DKEB57Mf.js +82 -0
  69. package/dist/campaign-BD_s6pW4.js +100 -0
  70. package/dist/campaign-CpzFl8Vr.js +4 -0
  71. package/dist/campaign-D9IfNIPI.js +253 -0
  72. package/dist/campaign.enum-gPz5hWSW.js +26 -0
  73. package/dist/campaign.fn-Csxad3W7.js +776 -0
  74. package/dist/collectible.enum-CA-QbTP-.js +19 -0
  75. package/dist/collection.fn-tFxG0UiA.js +26 -0
  76. package/dist/dto-CdvywxS_.js +222 -0
  77. package/dist/duplicateCampaign-Cj68m0Ti.js +51 -0
  78. package/dist/effect-KecOJIEK.js +89 -0
  79. package/dist/email-addresses-Ske7sY-s.js +705 -0
  80. package/dist/export-17vDh5vq.js +97 -0
  81. package/dist/feedme.ico +0 -0
  82. package/dist/helper-B-ZDFjy7.js +86 -0
  83. package/dist/index-BRZC-Cy5.js +85 -0
  84. package/dist/index-BV_G-XzK.js +30289 -0
  85. package/dist/index-BwLCkOIF.js +36 -0
  86. package/dist/index-C1Z4oibL.js +48 -0
  87. package/dist/index-CNLqZu6_.js +2639 -0
  88. package/dist/index-CdByBgmF.js +32 -0
  89. package/dist/index-CkqQGjg1.js +8912 -0
  90. package/dist/index-CuvNtC_M.js +61 -0
  91. package/dist/index-D05Pcg0E.js +124 -0
  92. package/dist/index-D58_aTiN.js +28897 -0
  93. package/dist/index-DCzjjZgV.js +67 -0
  94. package/dist/index-DY3_9zbY.js +3431 -0
  95. package/dist/index-Dc2JsMD2.js +54 -0
  96. package/dist/index-Dh78uGTl.js +146 -0
  97. package/dist/index-DnrSd_o_.js +3 -0
  98. package/dist/index-vh86FiIQ.js +10 -0
  99. package/dist/index-woXH3LmA.js +31 -0
  100. package/dist/index.esm2017-DxQe1gCt.js +3069 -0
  101. package/dist/loading-B1ymwDT_.js +71 -0
  102. package/dist/lodash-BiGSPE0G.js +3678 -0
  103. package/dist/membership-GnNCDGBk.js +235 -0
  104. package/dist/moment-D7p2TMB-.js +2583 -0
  105. package/dist/money-CG6LGklW.js +15 -0
  106. package/dist/number-p19we-YD.js +12 -0
  107. package/dist/object-qECH92oz.js +26 -0
  108. package/dist/objectId-dwaoBfJX.js +7 -0
  109. package/dist/objectid-XhaZoPQl.js +145 -0
  110. package/dist/plugins-cxSxZO0d.js +1817 -0
  111. package/dist/remy-D_Deb3ue.js +13 -0
  112. package/dist/reward-siULTu5h.js +36 -0
  113. package/dist/rule-GD9oMCPH.js +1969 -0
  114. package/dist/rule-builder-DWFem4d5.js +102 -0
  115. package/dist/style.css +13 -0
  116. package/dist/template-o23nw6e2.js +188 -0
  117. package/dist/tier-BJDhpH6X.js +4 -0
  118. package/dist/tiers/tier=1.png +0 -0
  119. package/dist/tiers/tier=2.png +0 -0
  120. package/dist/tiers/tier=3.png +0 -0
  121. package/dist/tiers/tier=4.png +0 -0
  122. package/dist/timezone-BVwygiRH.js +1154 -0
  123. package/dist/titles/type=diamond.png +0 -0
  124. package/dist/titles/type=drinks.png +0 -0
  125. package/dist/titles/type=food.png +0 -0
  126. package/dist/titles/type=heart.png +0 -0
  127. package/dist/titles/type=medal.png +0 -0
  128. package/dist/titles/type=spend.png +0 -0
  129. package/dist/titles/type=thank-you.png +0 -0
  130. package/dist/titles/type=thumbs-up.png +0 -0
  131. package/dist/titles/type=years.png +0 -0
  132. package/dist/trigger-CrEBP1aZ.js +213 -0
  133. package/dist/tslib.es6-BCqqvLQ_.js +44 -0
  134. package/dist/type_drinks-D6jnpvwV.js +4 -0
  135. package/dist/usePagination-BbTCnhtY.js +266 -0
  136. package/dist/user-DcMEufQ6.js +55 -0
  137. package/dist/vue-i18n-BxV_u4BZ.js +2365 -0
  138. package/dist/xlsx-BnJDxONa.js +15491 -0
  139. package/dist/zod-CUN5LrI6.js +91 -0
  140. package/package.json +1 -1
@@ -0,0 +1,301 @@
1
+ import { defineComponent as q, ref as L, computed as z, h as J, onMounted as Q, resolveComponent as u, openBlock as f, createElementBlock as k, Fragment as F, createVNode as l, unref as i, withCtx as x, createElementVNode as m, renderList as W, createBlock as O, resolveDynamicComponent as X, toDisplayString as Y } from "vue";
2
+ import { _ as Z } from "./campaign-CpzFl8Vr.js";
3
+ import { useDialog as ee, components as te } from "@feedmepos/ui-library";
4
+ import { p as P } from "./plugins-cxSxZO0d.js";
5
+ import { u as oe } from "./loading-B1ymwDT_.js";
6
+ import { u as ne } from "./business-DKEB57Mf.js";
7
+ import { u as ae } from "./campaign-BD_s6pW4.js";
8
+ import { u as re } from "./vue-i18n-BxV_u4BZ.js";
9
+ import { h as d } from "./moment-D7p2TMB-.js";
10
+ import { a as se, b as V } from "./campaign-D9IfNIPI.js";
11
+ import { s as ie, _ as ce } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-DkOfrONH.js";
12
+ import { u as le } from "./template-o23nw6e2.js";
13
+ import { _ as $ } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
14
+ import { c as C } from "./index-D05Pcg0E.js";
15
+ const me = { class: "px-24 flex flex-col gap-y-16" }, ue = { class: "flex items-center justify-between w-full" }, de = { class: "flex gap-8 overflow-x-auto" }, pe = { class: "space-y-8" }, fe = { class: "flex w-full gap-4 items-center" }, ge = { class: "flex flex-col gap-16 text-center" }, ye = { class: "fm-typo-en-title-sm-800" }, be = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pe = /* @__PURE__ */ q({
16
+ __name: "Grab",
17
+ setup(_e) {
18
+ const { t: o } = re(), I = {
19
+ label: o("connect.grab.createCampaign"),
20
+ value: "create",
21
+ isPrimary: !0,
22
+ prependIcon: "add"
23
+ }, A = le("GRAB", ee()), S = ne(), g = ae(), { global: R, minor: T } = oe, K = [
24
+ {
25
+ label: "Bill promotion",
26
+ value: "BILL"
27
+ },
28
+ {
29
+ label: "Item promotion",
30
+ value: "ITEM"
31
+ }
32
+ ], c = L({
33
+ searchKey: "",
34
+ location: [],
35
+ effectType: []
36
+ });
37
+ function E(e) {
38
+ const t = c.value.location;
39
+ return !t || t.length === 0 || !e.targetLocation ? !0 : Array.isArray(t) ? t.some((a) => {
40
+ var s;
41
+ return (s = e == null ? void 0 : e.targetLocation) == null ? void 0 : s.includes(a);
42
+ }) : e.targetLocation.includes(t);
43
+ }
44
+ function j(e) {
45
+ var s, r;
46
+ const t = c.value.effectType;
47
+ if (!t || t.length === 0) return !0;
48
+ const a = (r = (s = e.effect) == null ? void 0 : s.options) == null ? void 0 : r.target;
49
+ return t.includes(a);
50
+ }
51
+ const p = z(
52
+ () => g.campaigns.grab.filter(
53
+ (e) => E(e) && j(e)
54
+ )
55
+ ), G = [
56
+ {
57
+ header: o("connect.grab.promotionTitle"),
58
+ accessorFn: (e) => e.name
59
+ },
60
+ {
61
+ header: o("connect.grab.period"),
62
+ accessorFn: (e) => {
63
+ const t = d(e.timeframeOptions.start).format("DD/MM/YYYY"), a = d(e.timeframeOptions.end).format("DD/MM/YYYY");
64
+ return `${t} - ${a}`;
65
+ }
66
+ },
67
+ {
68
+ header: o("connect.grab.status"),
69
+ accessorFn: (e) => se(e),
70
+ cell(e) {
71
+ return V(e.row.original);
72
+ }
73
+ },
74
+ {
75
+ header: o("connect.grab.summary"),
76
+ cell(e) {
77
+ const t = ie(e.row.original.discount);
78
+ return t ? `${t.type} - ${t.adjustment}` : "-";
79
+ }
80
+ },
81
+ {
82
+ header: o("connect.grab.actions"),
83
+ cell(e) {
84
+ return J(te.FmButton, {
85
+ variant: "tertiary",
86
+ icon: "delete",
87
+ iconColor: "neutral-gray-400",
88
+ onClick: (t) => {
89
+ t.stopPropagation(), D(e.row.original);
90
+ }
91
+ });
92
+ }
93
+ }
94
+ ], B = L();
95
+ async function D(e) {
96
+ await P.remove(o("connect.grab.confirmRemove", { name: e.name })) && await T(
97
+ async () => {
98
+ await C.delete(e._id), await g.read("PROMOTION");
99
+ },
100
+ {
101
+ message: o("connect.grab.removing", { name: e.name }),
102
+ successMessage: o("connect.grab.removedSuccessfully", {
103
+ name: e.name
104
+ })
105
+ }
106
+ );
107
+ }
108
+ async function b(e) {
109
+ e ? await t() : A.open(async (a) => {
110
+ await t(a);
111
+ });
112
+ async function t(a) {
113
+ var s;
114
+ (s = B.value) == null || s.showSheet(
115
+ !0,
116
+ "GRAB",
117
+ e ? await C.readById(e._id) : void 0,
118
+ a
119
+ );
120
+ }
121
+ }
122
+ async function N(e) {
123
+ var a;
124
+ const t = await U(e.campaign);
125
+ if (t.length > 0) {
126
+ const s = t.map(
127
+ (r) => `"${r.name}" (${d(r.timeframeOptions.start).format("DD/MM/YYYY")} - ${d(r.timeframeOptions.end).format("DD/MM/YYYY")})`
128
+ ).join(`
129
+ `);
130
+ return await ((a = P.dialog) == null ? void 0 : a.open({
131
+ title: o("connect.grab.conflictDetected"),
132
+ message: o("connect.grab.conflictMessage", {
133
+ conflicts: s
134
+ }),
135
+ closeButton: !0,
136
+ overlay: !0,
137
+ primaryActions: {
138
+ close: !0,
139
+ text: "OK"
140
+ }
141
+ })), !1;
142
+ }
143
+ await T(
144
+ async () => (e.campaign._id ? await C.update(e.campaign._id, e) : await C.create(e), await g.read("PROMOTION"), !0),
145
+ {
146
+ message: o(
147
+ e.campaign._id ? "connect.grab.updating" : "connect.grab.creating"
148
+ ),
149
+ successMessage: o(
150
+ e.campaign._id ? "connect.grab.updatedSuccessfully" : "connect.grab.createdSuccessfully"
151
+ )
152
+ }
153
+ );
154
+ }
155
+ async function U(e) {
156
+ const t = g.campaigns.grab, a = [], s = !!e._id;
157
+ for (const r of t) {
158
+ if (s && r._id === e._id) continue;
159
+ const _ = d(e.timeframeOptions.start), y = d(e.timeframeOptions.end), h = d(r.timeframeOptions.start), v = d(r.timeframeOptions.end);
160
+ if (_.isBefore(v) && y.isAfter(h) || h.isBefore(y) && v.isAfter(_)) {
161
+ const n = e.discount, w = r.discount;
162
+ n.scope.type === w.scope.type && a.push(r);
163
+ }
164
+ }
165
+ return a;
166
+ }
167
+ async function H(e) {
168
+ switch (e) {
169
+ case "create":
170
+ b();
171
+ break;
172
+ }
173
+ }
174
+ return Q(async () => {
175
+ await R(async () => {
176
+ await S.readLocations(), await g.read("PROMOTION");
177
+ });
178
+ }), (e, t) => {
179
+ const a = u("FmPill"), s = u("FmPageHead"), r = u("FmSearch"), _ = u("FmTable"), y = u("FmButton"), h = u("FmListItem"), v = u("FmList"), M = u("FmCard");
180
+ return f(), k(F, null, [
181
+ l(s, {
182
+ title: i(o)("connect.grab.title"),
183
+ actions: i(p).length > 0 ? [I] : [],
184
+ "onClick:action": H
185
+ }, {
186
+ prepend: x(() => [
187
+ l(a, { variant: "beta" }),
188
+ l(a, { variant: "premium" })
189
+ ]),
190
+ _: 1
191
+ }, 8, ["title", "actions"]),
192
+ m("div", me, [
193
+ l(r, {
194
+ modelValue: c.value.searchKey,
195
+ "onUpdate:modelValue": t[0] || (t[0] = (n) => c.value.searchKey = n),
196
+ class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
197
+ placeholder: i(o)("connect.grab.search"),
198
+ collapsible: ""
199
+ }, null, 8, ["modelValue", "placeholder"]),
200
+ i(p) && i(p).length > 0 ? (f(), k(F, { key: 0 }, [
201
+ m("div", ue, [
202
+ m("div", de, [
203
+ l($, {
204
+ label: `${i(o)("connect.common.location")}: `,
205
+ "right-icon": "keyboard_arrow_down",
206
+ modelValue: c.value.location,
207
+ "onUpdate:modelValue": t[1] || (t[1] = (n) => c.value.location = n),
208
+ icon: "storefront",
209
+ "show-item-label": !0,
210
+ items: i(S).locationOptions
211
+ }, null, 8, ["label", "modelValue", "items"]),
212
+ l($, {
213
+ label: "Type:",
214
+ "right-icon": "keyboard_arrow_down",
215
+ modelValue: c.value.effectType,
216
+ "onUpdate:modelValue": t[2] || (t[2] = (n) => c.value.effectType = n),
217
+ icon: "filter_list",
218
+ "show-item-label": !0,
219
+ items: K
220
+ }, null, 8, ["modelValue"])
221
+ ]),
222
+ l(r, {
223
+ modelValue: c.value.searchKey,
224
+ "onUpdate:modelValue": t[3] || (t[3] = (n) => c.value.searchKey = n),
225
+ class: "xs:hidden",
226
+ placeholder: "search",
227
+ collapsible: ""
228
+ }, null, 8, ["modelValue"])
229
+ ]),
230
+ l(_, {
231
+ class: "xs:hidden",
232
+ "row-data": i(p),
233
+ "column-defs": G,
234
+ "search-value": c.value.searchKey,
235
+ "column-filter": [],
236
+ onRowClick: t[4] || (t[4] = (n) => b(n.original)),
237
+ "hide-footer": i(p).length < 10
238
+ }, null, 8, ["row-data", "search-value", "hide-footer"]),
239
+ l(v, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
240
+ default: x(() => [
241
+ (f(!0), k(F, null, W(i(p).filter(
242
+ (n) => n.name.toLowerCase().includes(c.value.searchKey.toLowerCase())
243
+ ), (n) => (f(), O(h, {
244
+ key: n._id.toString(),
245
+ onClick: (w) => b(n),
246
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
247
+ }, {
248
+ default: x(() => [
249
+ m("div", pe, [
250
+ m("div", fe, [
251
+ (f(), O(X(i(V)(n))))
252
+ ])
253
+ ]),
254
+ l(y, {
255
+ icon: "delete",
256
+ "icon-color": "neutral-gray-400",
257
+ variant: "tertiary",
258
+ onClick: (w) => (w.stopPropagation(), D(n))
259
+ }, null, 8, ["onClick"])
260
+ ]),
261
+ _: 2
262
+ }, 1032, ["onClick"]))), 128))
263
+ ]),
264
+ _: 1
265
+ })
266
+ ], 64)) : (f(), O(M, {
267
+ key: 1,
268
+ variant: "outlined",
269
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
270
+ }, {
271
+ default: x(() => [
272
+ t[6] || (t[6] = m("img", {
273
+ src: Z,
274
+ class: "aspect-square w-[150px]"
275
+ }, null, -1)),
276
+ m("div", ge, [
277
+ m("div", ye, Y(i(o)("connect.grab.createPromotionCampaign")), 1),
278
+ m("div", be, Y(i(o)("connect.grab.description")), 1)
279
+ ]),
280
+ l(y, {
281
+ variant: "primary",
282
+ label: i(o)("connect.grab.createPromotionCampaign"),
283
+ icon: "add",
284
+ onClick: t[5] || (t[5] = (n) => b())
285
+ }, null, 8, ["label"])
286
+ ]),
287
+ _: 1
288
+ }))
289
+ ]),
290
+ l(ce, {
291
+ ref_key: "sheetRef",
292
+ ref: B,
293
+ "onSubmit:modelValue": N
294
+ }, null, 512)
295
+ ], 64);
296
+ };
297
+ }
298
+ });
299
+ export {
300
+ Pe as default
301
+ };
@@ -0,0 +1,145 @@
1
+ import { openBlock as l, createElementBlock as o, createElementVNode as r, defineComponent as $, ref as b, onMounted as I, resolveComponent as f, renderSlot as x, toDisplayString as s, createCommentVNode as h, normalizeStyle as V, unref as i, Fragment as w, createVNode as F, withCtx as g, createTextVNode as p, normalizeClass as z, createBlock as k } from "vue";
2
+ import { u as R } from "./vue-i18n-BxV_u4BZ.js";
3
+ import { _ as H } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ const N = {}, D = { class: "animate-pulse flex space-x-4 bg-gray-300 dark:bg-gray-700 items-center justify-center rounded w-full h-full" };
5
+ function L(e, d) {
6
+ return l(), o("div", D, [...d[0] || (d[0] = [
7
+ r("svg", {
8
+ class: "dark:text-gray-600 h-10 text-gray-200 w-10",
9
+ "aria-hidden": "true",
10
+ xmlns: "http://www.w3.org/2000/svg",
11
+ fill: "currentColor",
12
+ viewBox: "0 0 20 18"
13
+ }, [
14
+ r("path", { d: "M18 0H2a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2Zm-5.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Zm4.376 10.481A1 1 0 0 1 16 15H4a1 1 0 0 1-.895-1.447l3.5-7A1 1 0 0 1 7.468 6a.965.965 0 0 1 .9.5l2.775 4.757 1.546-1.887a1 1 0 0 1 1.618.1l2.541 4a1 1 0 0 1 .028 1.011Z" })
15
+ ], -1)
16
+ ])]);
17
+ }
18
+ const T = /* @__PURE__ */ H(N, [["render", L]]), U = { class: "max-w-full max-h-[400px] space-y-4" }, Z = { key: 0 }, _ = { class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400" }, A = {
19
+ key: 1,
20
+ class: "h-full w-full relative bg-fm-color-neutral-white p-12 border-2 border-dashed border-fm-color-neutral-gray-300 rounded-md flex flex-col items-center justify-center gap-8 hover:border-fm-color-neutral-gray-400"
21
+ }, E = ["src"], M = ["src"], q = { class: "absolute right-0 top-0" }, J = /* @__PURE__ */ $({
22
+ __name: "ImageInput",
23
+ props: {
24
+ required: {
25
+ type: Boolean,
26
+ default: () => !1
27
+ },
28
+ disabled: {
29
+ type: Boolean,
30
+ default: () => !1
31
+ },
32
+ thumbnail: {
33
+ type: String,
34
+ default: () => {
35
+ }
36
+ },
37
+ file: {
38
+ type: File,
39
+ default: () => {
40
+ }
41
+ },
42
+ label: {
43
+ type: String,
44
+ default: () => {
45
+ }
46
+ },
47
+ aspectRatio: {
48
+ type: String,
49
+ default: "2/3"
50
+ },
51
+ imageFit: {
52
+ type: String,
53
+ default: "contain"
54
+ },
55
+ accept: {
56
+ type: String,
57
+ default: ".png, .jpg, .jpeg, .webm"
58
+ },
59
+ recommendedSize: {
60
+ type: String,
61
+ default: void 0
62
+ },
63
+ deleteButton: {
64
+ type: Boolean,
65
+ default: !0
66
+ }
67
+ },
68
+ emits: ["update:file"],
69
+ setup(e, { emit: d }) {
70
+ const { t: y } = R(), c = e, a = b({
71
+ loading: !1,
72
+ imgsrc: c.thumbnail
73
+ }), m = b(!1), v = d;
74
+ async function u(t) {
75
+ return t == null ? (a.value.imgsrc = void 0, v("update:file", null)) : (m.value = !!t.type.startsWith("video/"), a.value.loading = !0, a.value.imgsrc = URL.createObjectURL(t), a.value.loading = !1, v("update:file", t));
76
+ }
77
+ return I(() => {
78
+ var t;
79
+ c.file && u(c.file), (t = c.thumbnail) != null && t.includes("mp4") && (m.value = !0);
80
+ }), (t, n) => {
81
+ const S = f("FmDropField"), B = f("FmHelperText"), j = f("FmButton");
82
+ return l(), o("div", U, [
83
+ x(t.$slots, "label", {}, () => [
84
+ e.label ? (l(), o("div", Z, s(e.label), 1)) : h("", !0)
85
+ ]),
86
+ r("div", {
87
+ style: V({ "aspect-ratio": e.aspectRatio }),
88
+ class: "flex flex-col max-h-full max-w-full"
89
+ }, [
90
+ i(a).loading ? (l(), k(T, { key: 1 })) : (l(), o(w, { key: 0 }, [
91
+ i(a).imgsrc ? (l(), o("div", A, [
92
+ i(m) ? (l(), o("video", {
93
+ key: 1,
94
+ src: i(a).imgsrc || e.thumbnail,
95
+ class: "w-full h-full",
96
+ controls: ""
97
+ }, null, 8, M)) : (l(), o("img", {
98
+ key: 0,
99
+ class: z([`object-${e.imageFit}`, "w-full h-full"]),
100
+ src: i(a).imgsrc || e.thumbnail
101
+ }, null, 10, E)),
102
+ r("div", q, [
103
+ x(t.$slots, "delete-button"),
104
+ e.deleteButton ? (l(), k(j, {
105
+ key: 0,
106
+ class: "!text-neutral-50 !bg-neutral-700",
107
+ icon: "delete",
108
+ variant: "tertiary",
109
+ disabled: e.disabled,
110
+ onClick: n[1] || (n[1] = (C) => u(null))
111
+ }, null, 8, ["disabled"])) : h("", !0)
112
+ ])
113
+ ])) : (l(), o(w, { key: 0 }, [
114
+ F(S, {
115
+ class: "flex-1 hihiha",
116
+ accept: e.accept,
117
+ disabled: e.disabled,
118
+ onFileUpload: u,
119
+ onFileRejected: n[0] || (n[0] = (C) => u(null))
120
+ }, {
121
+ label: g(() => [...n[2] || (n[2] = [
122
+ p(s(void 0), -1)
123
+ ])]),
124
+ "helper-text": g(() => [...n[3] || (n[3] = [
125
+ p(s(void 0), -1)
126
+ ])]),
127
+ "accept-text": g(() => [
128
+ r("div", _, [
129
+ r("div", null, " (" + s(e.recommendedSize ?? i(y)("connect.common.imageInput.recommendedSize")) + ") ", 1),
130
+ p(" " + s(i(y)("connect.common.imageInput.accepts", { accept: e.accept })), 1)
131
+ ])
132
+ ]),
133
+ _: 1
134
+ }, 8, ["accept", "disabled"]),
135
+ F(B, { text: "" })
136
+ ], 64))
137
+ ], 64))
138
+ ], 4)
139
+ ]);
140
+ };
141
+ }
142
+ });
143
+ export {
144
+ J as _
145
+ };