@kiva/kv-components 6.52.8 → 6.52.10

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.
@@ -1,35 +1,35 @@
1
- import b from "graphql-tag";
2
- import { mdiChevronRight as P } from "@mdi/js";
1
+ import T from "graphql-tag";
2
+ import { mdiChevronRight as N } from "@mdi/js";
3
3
  import { throttle as C } from "../utils/throttle.js";
4
- import { getLendCtaSelectedOption as g, getDropdownPriceArray as O } from "../utils/loanUtils.js";
5
- import I from "./KvLendAmountButton.js";
4
+ import { getLendCtaSelectedOption as L, getDropdownPriceArray as I } from "../utils/loanUtils.js";
5
+ import R from "./KvLendAmountButton.js";
6
6
  import S from "./KvSelect.js";
7
7
  import F from "./KvButton.js";
8
- import N from "./KvMaterialIcon.js";
9
- import { resolveComponent as y, openBlock as i, createElementBlock as l, createBlock as r, withCtx as a, createTextVNode as m, toDisplayString as u, createElementVNode as f, createVNode as _, withModifiers as B, normalizeClass as h, Fragment as k, renderList as A, createCommentVNode as c } from "vue";
8
+ import V from "./KvMaterialIcon.js";
9
+ import { resolveComponent as v, openBlock as o, createElementBlock as i, createBlock as a, withCtx as r, createTextVNode as f, toDisplayString as u, createElementVNode as h, createVNode as y, withModifiers as A, normalizeClass as w, Fragment as k, renderList as p, createCommentVNode as c } from "vue";
10
10
  import "./KvLendCta.css";
11
- import V from "../_virtual/_plugin-vue_export-helper.js";
12
- const p = "Other", E = 430, ce = b`
11
+ import W from "../_virtual/_plugin-vue_export-helper.js";
12
+ const _ = "Other", E = 430, g = 480, x = 380, De = T`
13
13
  fragment KvLendCta on LoanBasic {
14
14
  id
15
15
  name
16
16
  status
17
17
  minNoteSize
18
18
  }
19
- `, we = b`
19
+ `, ye = T`
20
20
  fragment KvLendCtaUser on LoanBasic {
21
21
  id
22
22
  userProperties {
23
23
  lentTo
24
24
  }
25
25
  }
26
- `, R = {
26
+ `, K = {
27
27
  name: "KvLendCta",
28
28
  components: {
29
- KvLendAmountButton: I,
29
+ KvLendAmountButton: R,
30
30
  KvUiButton: F,
31
31
  KvUiSelect: S,
32
- KvMaterialIcon: N
32
+ KvMaterialIcon: V
33
33
  },
34
34
  props: {
35
35
  loan: {
@@ -123,28 +123,47 @@ const p = "Other", E = 430, ce = b`
123
123
  kvTrackCategory: {
124
124
  type: String,
125
125
  default: "Lending"
126
+ },
127
+ /**
128
+ * Breakpoint for narrow desktop layout (default: 480px)
129
+ * When component width is below this, it will use stacked layout even on desktop
130
+ */
131
+ narrowSidebarBreakpoint: {
132
+ type: Number,
133
+ default: g
134
+ },
135
+ /**
136
+ * Breakpoint for narrow desktop dropdown layout (default: 380px)
137
+ * When component width is below this in narrow desktop mode, dropdown moves to second row
138
+ */
139
+ narrowSidebarDropdownBreakpoint: {
140
+ type: Number,
141
+ default: x
126
142
  }
127
143
  },
128
144
  data() {
129
- var t, s;
145
+ var n, s;
130
146
  return {
131
- mdiChevronRight: P,
147
+ mdiChevronRight: N,
132
148
  defaultAmountOptions: [25, 50, 75],
133
- selectedOption: g(
149
+ selectedOption: L(
134
150
  this.getCookie,
135
151
  this.setCookie,
136
152
  this.enableFiveDollarsNotes,
137
- (s = (t = this.route) == null ? void 0 : t.query) == null ? void 0 : s.utm_campaign,
153
+ (s = (n = this.route) == null ? void 0 : n.query) == null ? void 0 : s.utm_campaign,
138
154
  this.unreservedAmount,
139
155
  this.userBalance,
140
156
  this.fiveDollarsSelected
141
157
  ),
142
- selectedDropdownOption: p,
143
- OTHER_OPTION: p,
158
+ selectedDropdownOption: _,
159
+ OTHER_OPTION: _,
144
160
  // SSR-safe viewport width initialization
145
161
  viewportWidth: typeof window < "u" ? window.innerWidth : 1024,
146
- resizeHandler: void 0,
147
- MOBILE_DROPDOWN_BREAKPOINT: E
162
+ componentWidth: 1024,
163
+ resizeObserver: null,
164
+ MOBILE_DROPDOWN_BREAKPOINT: E,
165
+ NARROW_SIDEBAR_BREAKPOINT: g,
166
+ NARROW_SIDEBAR_DROPDOWN_BREAKPOINT: x
148
167
  };
149
168
  },
150
169
  computed: {
@@ -152,52 +171,52 @@ const p = "Other", E = 430, ce = b`
152
171
  return this.customLoanDetails ? "" : `/lend/${this.loanId}`;
153
172
  },
154
173
  loanId() {
155
- var t;
156
- return (t = this.loan) == null ? void 0 : t.id;
174
+ var n;
175
+ return (n = this.loan) == null ? void 0 : n.id;
157
176
  },
158
177
  status() {
159
- var t;
160
- return ((t = this.loan) == null ? void 0 : t.status) ?? "";
178
+ var n;
179
+ return ((n = this.loan) == null ? void 0 : n.status) ?? "";
161
180
  },
162
181
  minNoteSize() {
163
- var t;
164
- return ((t = this.loan) == null ? void 0 : t.minNoteSize) ?? "";
182
+ var n;
183
+ return ((n = this.loan) == null ? void 0 : n.minNoteSize) ?? "";
165
184
  },
166
185
  lentPreviously() {
167
- var t, s;
168
- return ((s = (t = this.loan) == null ? void 0 : t.userProperties) == null ? void 0 : s.lentTo) ?? !1;
186
+ var n, s;
187
+ return ((s = (n = this.loan) == null ? void 0 : n.userProperties) == null ? void 0 : s.lentTo) ?? !1;
169
188
  },
170
189
  isInBasket() {
171
- var t;
172
- return ((t = this.basketItems) == null ? void 0 : t.some((s) => s.__typename === "LoanReservation" && s.id === this.loanId)) ?? !1;
190
+ var n;
191
+ return ((n = this.basketItems) == null ? void 0 : n.some((s) => s.__typename === "LoanReservation" && s.id === this.loanId)) ?? !1;
173
192
  },
174
193
  prices() {
175
- const t = parseFloat(this.unreservedAmount < 25 ? this.minNoteSize : 25), s = O(
194
+ const n = parseFloat(this.unreservedAmount < 25 ? this.minNoteSize : 25), s = I(
176
195
  this.unreservedAmount,
177
196
  this.isCompleteLoanActive,
178
- t,
197
+ n,
179
198
  this.enableFiveDollarsNotes,
180
199
  this.isVisitor
181
200
  );
182
- return this.maxAmount ? s.filter((o) => parseFloat(o) <= parseFloat(this.maxAmount)) : s;
201
+ return this.maxAmount ? s.filter((l) => parseFloat(l) <= parseFloat(this.maxAmount)) : s;
183
202
  },
184
203
  presetButtonsPrices() {
185
- const t = this.prices.slice(0, 3);
186
- return this.prices.length === 4 && t.push(this.prices[3]), t;
204
+ const n = this.prices.slice(0, 3);
205
+ return this.prices.length === 4 && n.push(this.prices[3]), n;
187
206
  },
188
207
  presetDropdownPrices() {
189
208
  if (this.prices.length === 4)
190
209
  return [];
191
- const t = this.prices.slice(this.defaultAmountOptions.length);
192
- return t.unshift(p), t;
210
+ const n = this.prices.slice(this.defaultAmountOptions.length);
211
+ return n.unshift(_), n;
193
212
  },
194
213
  loanName() {
195
- var t;
196
- return ((t = this.loan) == null ? void 0 : t.name) ?? "";
214
+ var n;
215
+ return ((n = this.loan) == null ? void 0 : n.name) ?? "";
197
216
  },
198
217
  presetAmountCtaButtonText() {
199
- var t;
200
- return ((t = this.loan) == null ? void 0 : t.borrowerCount) > 1 ? "Support" : `Support ${this.loanName}`;
218
+ var n;
219
+ return ((n = this.loan) == null ? void 0 : n.borrowerCount) > 1 ? "Support" : `Support ${this.loanName}`;
201
220
  },
202
221
  defaultCtaButtonText() {
203
222
  return this.showPresetAmounts ? this.presetAmountCtaButtonText : this.primaryButtonText || "Lend";
@@ -243,8 +262,8 @@ const p = "Other", E = 430, ce = b`
243
262
  return this.isAmountLessThan25(this.unreservedAmount) || this.isAmountBetween25And500(this.unreservedAmount);
244
263
  },
245
264
  isLendAmountButton() {
246
- const t = this.maxAmount ? this.maxAmount : this.unreservedAmount;
247
- return (this.lendButtonVisibility || this.state === "lent-to") && this.isAmountLessThan25(t) || this.showPresetAmounts && this.presetButtonsPrices.length === 1 && !this.isAdding;
265
+ const n = this.maxAmount ? this.maxAmount : this.unreservedAmount;
266
+ return (this.lendButtonVisibility || this.state === "lent-to") && this.isAmountLessThan25(n) || this.showPresetAmounts && this.presetButtonsPrices.length === 1 && !this.isAdding;
248
267
  },
249
268
  isFunded() {
250
269
  return this.state === "funded" || this.state === "fully-reserved";
@@ -259,37 +278,48 @@ const p = "Other", E = 430, ce = b`
259
278
  return this.isLentTo && !this.isLessThan25;
260
279
  },
261
280
  selectedDropdown() {
262
- return this.selectedDropdownOption !== p;
281
+ return this.selectedDropdownOption !== _;
263
282
  },
264
283
  showFilteredDropdown() {
265
284
  return this.presetDropdownPrices.length > 1;
266
285
  },
267
286
  hideLendButton() {
268
287
  return this.showPresetAmounts && (this.isAdding || this.presetButtonsPrices.length === 1);
288
+ },
289
+ /**
290
+ * Determines if component should use narrow desktop layout
291
+ * This is true when we're in desktop viewport but component width is narrow
292
+ */
293
+ isNarrowDesktop() {
294
+ return this.viewportWidth >= 768 && this.componentWidth < this.narrowSidebarBreakpoint;
269
295
  }
270
296
  },
271
297
  watch: {
272
- unreservedAmount(t, s) {
273
- var o, L;
274
- t !== s && s === "" && (this.selectedOption = g(
298
+ unreservedAmount(n, s) {
299
+ var l, D;
300
+ n !== s && s === "" && (this.selectedOption = L(
275
301
  this.getCookie,
276
302
  this.setCookie,
277
303
  this.enableFiveDollarsNotes,
278
- (L = (o = this.route) == null ? void 0 : o.query) == null ? void 0 : L.utm_campaign,
279
- t,
304
+ (D = (l = this.route) == null ? void 0 : l.query) == null ? void 0 : D.utm_campaign,
305
+ n,
280
306
  this.userBalance,
281
307
  this.fiveDollarsSelected,
282
308
  this.showPresetAmounts
283
- )), this.showPresetAmounts && (this.selectedOption = p);
309
+ )), this.showPresetAmounts && (this.selectedOption = _);
284
310
  }
285
311
  },
286
312
  mounted() {
287
- typeof window < "u" && (this.viewportWidth = window.innerWidth, this.resizeHandler = C(() => {
288
- this.viewportWidth = window.innerWidth;
289
- }, 50), window.addEventListener("resize", this.resizeHandler));
313
+ const n = () => {
314
+ var s;
315
+ this.viewportWidth = window.innerWidth, this.componentWidth = ((s = this.$refs.root) == null ? void 0 : s.offsetWidth) || 1024;
316
+ };
317
+ typeof window < "u" && (this.viewportWidth = window.innerWidth, window.ResizeObserver && this.$nextTick(() => {
318
+ this.resizeObserver = new window.ResizeObserver(C(n, 50)), this.$refs.root && (this.resizeObserver.observe(this.$refs.root), n());
319
+ }));
290
320
  },
291
321
  beforeDestroy() {
292
- this.resizeHandler && typeof window < "u" && window.removeEventListener("resize", this.resizeHandler);
322
+ this.resizeHandler && typeof window < "u" && window.removeEventListener("resize", this.resizeHandler), this.resizeObserver && this.$refs.root && this.resizeObserver.disconnect();
293
323
  },
294
324
  methods: {
295
325
  async addToBasket() {
@@ -301,20 +331,20 @@ const p = "Other", E = 430, ce = b`
301
331
  this.amountToLend
302
332
  ), this.$emit("add-to-basket", this.amountToLend);
303
333
  },
304
- isAmountLessThan25(t) {
305
- return t < 25 && t > 0;
334
+ isAmountLessThan25(n) {
335
+ return n < 25 && n > 0;
306
336
  },
307
- isAmountBetween25And50(t) {
308
- return t <= 50 && t > 25;
337
+ isAmountBetween25And50(n) {
338
+ return n <= 50 && n > 25;
309
339
  },
310
- isAmountBetween25And500(t) {
311
- return t < 500 && t >= 25;
340
+ isAmountBetween25And500(n) {
341
+ return n < 500 && n >= 25;
312
342
  },
313
- trackLendAmountSelection(t) {
343
+ trackLendAmountSelection(n) {
314
344
  this.showPresetAmounts && (this.selectedOption = null), this.kvTrackFunction(
315
345
  this.kvTrackCategory,
316
346
  "Modify lend amount",
317
- t,
347
+ n,
318
348
  this.loanId,
319
349
  this.loanId
320
350
  );
@@ -328,17 +358,17 @@ const p = "Other", E = 430, ce = b`
328
358
  this.loanId
329
359
  );
330
360
  },
331
- clickSecondaryButton(t) {
332
- this.secondaryButtonHandler ? (t.preventDefault(), t.stopPropagation(), this.secondaryButtonHandler()) : this.handleCheckout();
361
+ clickSecondaryButton(n) {
362
+ this.secondaryButtonHandler ? (n.preventDefault(), n.stopPropagation(), this.secondaryButtonHandler()) : this.handleCheckout();
333
363
  },
334
- clickPresetButton(t) {
364
+ clickPresetButton(n) {
335
365
  this.kvTrackFunction(
336
366
  this.kvTrackCategory,
337
367
  "Modify lend amount",
338
- t,
368
+ n,
339
369
  this.loanId,
340
370
  this.loanId
341
- ), this.selectedOption = t, this.selectedDropdownOption = p;
371
+ ), this.selectedOption = n, this.selectedDropdownOption = _;
342
372
  },
343
373
  handleCheckout() {
344
374
  this.kvTrackFunction(
@@ -348,145 +378,233 @@ const p = "Other", E = 430, ce = b`
348
378
  this.loanId,
349
379
  this.loanId
350
380
  );
381
+ },
382
+ isNarrowComponent() {
383
+ return this.componentWidth < 430;
351
384
  }
352
385
  }
353
- }, M = { class: "tw-whitespace-nowrap" }, K = {
386
+ }, M = {
387
+ ref: "root",
388
+ class: "tw-whitespace-nowrap"
389
+ }, U = {
354
390
  key: 2,
355
391
  class: "tw-w-full tw-text-center tw-rounded tw-p-2",
356
392
  style: { background: "#f1f1f1" }
357
- }, W = { class: "tw-flex" }, U = ["disabled"], z = {
393
+ }, z = { class: "tw-flex" }, H = ["disabled"], j = {
358
394
  key: 0,
359
395
  class: "md:tw-hidden tw-w-full"
360
- }, H = { class: "tw-flex tw-flex-col tw-gap-1 tw-w-full" }, j = { class: "tw-flex tw-gap-1 tw-w-full" }, q = ["value"], G = { class: "tw-flex tw-gap-1" }, J = ["value"], Q = { class: "tw-flex tw-items-center tw-h-full tw-w-full" }, X = { class: "tw-min-w-0 tw-flex-1 tw-overflow-hidden tw-text-ellipsis tw-whitespace-nowrap" }, Y = ["value"], Z = {
361
- key: 2,
396
+ }, q = { class: "tw-flex tw-flex-col tw-gap-1 tw-w-full" }, G = { class: "tw-flex tw-gap-1 tw-w-full" }, J = ["value"], Q = { class: "tw-flex tw-gap-1" }, X = ["value"], Y = { class: "tw-flex tw-items-center tw-h-full tw-w-full" }, Z = { class: "tw-min-w-0 tw-flex-1 tw-overflow-hidden tw-text-ellipsis tw-whitespace-nowrap" }, $ = {
397
+ key: 1,
398
+ class: "tw-w-full"
399
+ }, ee = { class: "tw-flex tw-flex-col tw-gap-1 tw-w-full" }, te = { class: "tw-flex tw-gap-1 tw-w-full" }, ne = ["value"], se = { class: "tw-flex tw-gap-1" }, oe = ["value"], le = { class: "tw-flex tw-items-center tw-h-full tw-w-full" }, de = { class: "tw-min-w-0 tw-flex-1 tw-overflow-hidden tw-text-ellipsis tw-whitespace-nowrap" }, ie = ["value"], re = {
400
+ key: 3,
362
401
  class: "amountDropdownWrapper"
363
- }, $ = ["value"];
364
- function ee(t, s, o, L, d, e) {
365
- const w = y("kv-ui-button"), x = y("kv-material-icon"), v = y("kv-ui-select"), T = y("kv-lend-amount-button");
366
- return i(), l("div", M, [
367
- e.isInBasket ? (i(), r(w, {
402
+ }, ae = ["value"];
403
+ function ue(n, s, l, D, d, e) {
404
+ const m = v("kv-ui-button"), P = v("kv-material-icon"), B = v("kv-ui-select"), O = v("kv-lend-amount-button");
405
+ return o(), i("div", M, [
406
+ e.isInBasket ? (o(), a(m, {
368
407
  key: 0,
369
408
  variant: "secondary",
370
409
  class: "tw-inline-flex tw-flex-1 tw-w-full",
371
410
  "data-testid": "bp-lend-cta-checkout-button",
372
- to: o.externalLinks ? void 0 : "/basket",
373
- href: o.externalLinks ? "/basket" : void 0,
374
- onClick: s[0] || (s[0] = (n) => e.clickSecondaryButton(n))
411
+ to: l.externalLinks ? void 0 : "/basket",
412
+ href: l.externalLinks ? "/basket" : void 0,
413
+ onClick: s[0] || (s[0] = (t) => e.clickSecondaryButton(t))
375
414
  }, {
376
- default: a(() => [
377
- m(u(e.loanInBasketButtonText), 1)
415
+ default: r(() => [
416
+ f(u(e.loanInBasketButtonText), 1)
378
417
  ]),
379
418
  _: 1
380
- }, 8, ["to", "href"])) : e.showNonActionableLoanButton ? (i(), r(w, {
419
+ }, 8, ["to", "href"])) : e.showNonActionableLoanButton ? (o(), a(m, {
381
420
  key: 1,
382
421
  class: "tw-inline-flex tw-flex-1"
383
422
  }, {
384
- default: a(() => [
385
- m(u(e.ctaButtonText), 1)
423
+ default: r(() => [
424
+ f(u(e.ctaButtonText), 1)
386
425
  ]),
387
426
  _: 1
388
- })) : e.isFunded ? (i(), l("div", K, " This loan was just funded! 🎉 ")) : o.showViewLoan ? (i(), r(w, {
427
+ })) : e.isFunded ? (o(), i("div", U, " This loan was just funded! 🎉 ")) : l.showViewLoan ? (o(), a(m, {
389
428
  key: 3,
390
429
  state: `${e.allSharesReserved ? "disabled" : ""}`,
391
- to: o.externalLinks ? void 0 : e.readMorePath,
392
- href: o.externalLinks ? e.readMorePath : void 0,
430
+ to: l.externalLinks ? void 0 : e.readMorePath,
431
+ href: l.externalLinks ? e.readMorePath : void 0,
393
432
  class: "tw-mb-0",
394
- onClick: s[1] || (s[1] = (n) => t.$emit("show-loan-details", n))
433
+ onClick: s[1] || (s[1] = (t) => n.$emit("show-loan-details", t))
395
434
  }, {
396
- default: a(() => [
397
- f("span", W, [
398
- s[7] || (s[7] = m(" View loan ")),
399
- _(x, {
435
+ default: r(() => [
436
+ h("span", z, [
437
+ s[9] || (s[9] = f(" View loan ")),
438
+ y(P, {
400
439
  class: "tw-w-3 tw-h-3 tw-align-middle",
401
440
  icon: d.mdiChevronRight
402
441
  }, null, 8, ["icon"])
403
442
  ])
404
443
  ]),
405
444
  _: 1
406
- }, 8, ["state", "to", "href"])) : e.useFormSubmit ? (i(), l("form", {
445
+ }, 8, ["state", "to", "href"])) : e.useFormSubmit ? (o(), i("form", {
407
446
  key: 4,
408
447
  class: "tw-w-full tw-flex",
409
- onSubmit: s[6] || (s[6] = B((...n) => e.addToBasket && e.addToBasket(...n), ["prevent"]))
448
+ onSubmit: s[8] || (s[8] = A((...t) => e.addToBasket && e.addToBasket(...t), ["prevent"]))
410
449
  }, [
411
- f("fieldset", {
412
- class: h(["tw-w-full tw-flex", {
413
- "tw-flex-col md:tw-flex-row md:tw-justify-between tw-min-w-0": o.showPresetAmounts,
414
- "tw-gap-1.5": o.showPresetAmounts && !e.isLendAmountButton && !o.isAdding
450
+ h("fieldset", {
451
+ class: w(["tw-w-full tw-flex", {
452
+ "tw-flex-col md:tw-flex-row md:tw-justify-between tw-min-w-0": l.showPresetAmounts && !e.isNarrowDesktop,
453
+ "tw-flex-col tw-min-w-0": l.showPresetAmounts && e.isNarrowDesktop,
454
+ "tw-gap-1.5": l.showPresetAmounts && !e.isLendAmountButton && !l.isAdding && !e.isNarrowDesktop
415
455
  }]),
416
- disabled: o.isAdding,
456
+ disabled: l.isAdding,
417
457
  "data-testid": "bp-lend-cta-select-and-button"
418
458
  }, [
419
- o.showPresetAmounts && !o.isAdding && !e.isLendAmountButton && e.presetButtonsPrices.length > 1 ? (i(), l("div", z, [
420
- f("div", H, [
421
- f("div", j, [
422
- (i(!0), l(k, null, A(e.presetButtonsPrices, (n) => (i(), r(w, {
423
- key: n,
459
+ l.showPresetAmounts && !l.isAdding && !e.isLendAmountButton && e.presetButtonsPrices.length > 1 && !e.isNarrowDesktop ? (o(), i("div", j, [
460
+ h("div", q, [
461
+ h("div", G, [
462
+ (o(!0), i(k, null, p(e.presetButtonsPrices, (t) => (o(), a(m, {
463
+ key: t,
424
464
  variant: "secondary",
425
- class: h(["preset-option tw-flex-1 tw-min-w-0", { "selected-option": d.selectedOption == n }]),
465
+ class: w(["preset-option tw-flex-1 tw-min-w-0", { "selected-option": d.selectedOption == t }]),
426
466
  "data-testid": "bp-lend-cta-lend-button-mobile",
427
- onClick: (D) => e.clickPresetButton(n)
467
+ onClick: (b) => e.clickPresetButton(t)
428
468
  }, {
429
- default: a(() => [
430
- m(" $ " + u(n), 1)
469
+ default: r(() => [
470
+ f(" $ " + u(t), 1)
431
471
  ]),
432
472
  _: 2
433
473
  }, 1032, ["class", "onClick"]))), 128)),
434
- e.showFilteredDropdown && d.viewportWidth >= d.MOBILE_DROPDOWN_BREAKPOINT ? (i(), r(v, {
474
+ e.showFilteredDropdown && d.viewportWidth >= d.MOBILE_DROPDOWN_BREAKPOINT ? (o(), a(B, {
435
475
  key: 0,
436
476
  id: `LoanAmountDropdownMobile_${e.loanId}`,
437
477
  modelValue: d.selectedDropdownOption,
438
478
  "onUpdate:modelValue": [
439
- s[2] || (s[2] = (n) => d.selectedDropdownOption = n),
479
+ s[2] || (s[2] = (t) => d.selectedDropdownOption = t),
440
480
  e.trackLendAmountSelection
441
481
  ],
442
- class: h(["filtered-dropdown mobile-dropdown tw-flex-1 tw-rounded", {
482
+ class: w(["filtered-dropdown mobile-dropdown tw-flex-1 tw-rounded", {
443
483
  "unselected-dropdown": !e.selectedDropdown,
444
484
  "selected-dropdown": e.selectedDropdown
445
485
  }]),
446
486
  "aria-label": "Lend amount",
447
- onClick: B(e.clickDropdown, ["stop"])
487
+ onClick: A(e.clickDropdown, ["stop"])
448
488
  }, {
449
- default: a(() => [
450
- (i(!0), l(k, null, A(e.presetDropdownPrices, (n) => (i(), l("option", {
451
- key: n,
452
- value: n
453
- }, u(n !== d.OTHER_OPTION ? `$${n}` : n), 9, q))), 128))
489
+ default: r(() => [
490
+ (o(!0), i(k, null, p(e.presetDropdownPrices, (t) => (o(), i("option", {
491
+ key: t,
492
+ value: t
493
+ }, u(t !== d.OTHER_OPTION ? `$${t}` : t), 9, J))), 128))
454
494
  ]),
455
495
  _: 1
456
496
  }, 8, ["id", "modelValue", "class", "onUpdate:modelValue", "onClick"])) : c("", !0)
457
497
  ]),
458
- f("div", G, [
459
- e.showFilteredDropdown && d.viewportWidth < d.MOBILE_DROPDOWN_BREAKPOINT ? (i(), r(v, {
498
+ h("div", Q, [
499
+ e.showFilteredDropdown && d.viewportWidth < d.MOBILE_DROPDOWN_BREAKPOINT ? (o(), a(B, {
460
500
  key: 0,
461
501
  id: `LoanAmountDropdownMobile_Small_${e.loanId}`,
462
502
  modelValue: d.selectedDropdownOption,
463
503
  "onUpdate:modelValue": [
464
- s[3] || (s[3] = (n) => d.selectedDropdownOption = n),
504
+ s[3] || (s[3] = (t) => d.selectedDropdownOption = t),
465
505
  e.trackLendAmountSelection
466
506
  ],
467
- class: h(["filtered-dropdown mobile-dropdown-small tw-rounded tw-w-2/5", {
507
+ class: w(["filtered-dropdown mobile-dropdown-small tw-rounded tw-w-2/5", {
468
508
  "unselected-dropdown": !e.selectedDropdown,
469
509
  "selected-dropdown": e.selectedDropdown
470
510
  }]),
471
511
  "aria-label": "Lend amount",
472
- onClick: B(e.clickDropdown, ["stop"])
512
+ onClick: A(e.clickDropdown, ["stop"])
473
513
  }, {
474
- default: a(() => [
475
- (i(!0), l(k, null, A(e.presetDropdownPrices, (n) => (i(), l("option", {
476
- key: "small-" + n,
477
- value: n
478
- }, u(n !== d.OTHER_OPTION ? `$${n}` : n), 9, J))), 128))
514
+ default: r(() => [
515
+ (o(!0), i(k, null, p(e.presetDropdownPrices, (t) => (o(), i("option", {
516
+ key: "small-" + t,
517
+ value: t
518
+ }, u(t !== d.OTHER_OPTION ? `$${t}` : t), 9, X))), 128))
479
519
  ]),
480
520
  _: 1
481
521
  }, 8, ["id", "modelValue", "class", "onUpdate:modelValue", "onClick"])) : c("", !0),
482
- _(w, {
483
- class: h(["tw-inline-flex tw-flex-1 button-ellipsis", d.viewportWidth < d.MOBILE_DROPDOWN_BREAKPOINT ? "tw-w-3/5" : "tw-w-full"]),
522
+ y(m, {
523
+ class: w(["tw-inline-flex tw-flex-1 button-ellipsis", d.viewportWidth < d.MOBILE_DROPDOWN_BREAKPOINT ? "tw-w-3/5" : "tw-w-full"]),
484
524
  "data-testid": "bp-lend-cta-mobile-lend-button",
485
525
  type: "submit"
486
526
  }, {
487
- default: a(() => [
488
- f("span", Q, [
489
- f("span", X, u(e.ctaButtonText), 1)
527
+ default: r(() => [
528
+ h("span", Y, [
529
+ h("span", Z, u(e.ctaButtonText), 1)
530
+ ])
531
+ ]),
532
+ _: 1
533
+ }, 8, ["class"])
534
+ ])
535
+ ])
536
+ ])) : c("", !0),
537
+ l.showPresetAmounts && !l.isAdding && !e.isLendAmountButton && e.presetButtonsPrices.length > 1 && e.isNarrowDesktop ? (o(), i("div", $, [
538
+ h("div", ee, [
539
+ h("div", te, [
540
+ (o(!0), i(k, null, p(e.presetButtonsPrices, (t) => (o(), a(m, {
541
+ key: t,
542
+ variant: "secondary",
543
+ class: w(["preset-option tw-flex-1 tw-min-w-0", { "selected-option": d.selectedOption == t }]),
544
+ "data-testid": "bp-lend-cta-lend-button-narrow-desktop",
545
+ onClick: (b) => e.clickPresetButton(t)
546
+ }, {
547
+ default: r(() => [
548
+ f(" $ " + u(t), 1)
549
+ ]),
550
+ _: 2
551
+ }, 1032, ["class", "onClick"]))), 128)),
552
+ e.showFilteredDropdown && d.componentWidth >= d.NARROW_SIDEBAR_DROPDOWN_BREAKPOINT ? (o(), a(B, {
553
+ key: 0,
554
+ id: `LoanAmountDropdownNarrowDesktop_${e.loanId}`,
555
+ modelValue: d.selectedDropdownOption,
556
+ "onUpdate:modelValue": [
557
+ s[4] || (s[4] = (t) => d.selectedDropdownOption = t),
558
+ e.trackLendAmountSelection
559
+ ],
560
+ class: w(["filtered-dropdown mobile-dropdown tw-flex-1 tw-rounded", {
561
+ "unselected-dropdown": !e.selectedDropdown,
562
+ "selected-dropdown": e.selectedDropdown
563
+ }]),
564
+ "aria-label": "Lend amount",
565
+ onClick: A(e.clickDropdown, ["stop"])
566
+ }, {
567
+ default: r(() => [
568
+ (o(!0), i(k, null, p(e.presetDropdownPrices, (t) => (o(), i("option", {
569
+ key: t,
570
+ value: t
571
+ }, u(t !== d.OTHER_OPTION ? `${t}` : t), 9, ne))), 128))
572
+ ]),
573
+ _: 1
574
+ }, 8, ["id", "modelValue", "class", "onUpdate:modelValue", "onClick"])) : c("", !0)
575
+ ]),
576
+ h("div", se, [
577
+ e.showFilteredDropdown && d.componentWidth < d.NARROW_SIDEBAR_DROPDOWN_BREAKPOINT ? (o(), a(B, {
578
+ key: 0,
579
+ id: `LoanAmountDropdownNarrowDesktop_Small_${e.loanId}`,
580
+ modelValue: d.selectedDropdownOption,
581
+ "onUpdate:modelValue": [
582
+ s[5] || (s[5] = (t) => d.selectedDropdownOption = t),
583
+ e.trackLendAmountSelection
584
+ ],
585
+ class: w(["filtered-dropdown mobile-dropdown-small tw-rounded tw-w-2/5", {
586
+ "unselected-dropdown": !e.selectedDropdown,
587
+ "selected-dropdown": e.selectedDropdown
588
+ }]),
589
+ "aria-label": "Lend amount",
590
+ onClick: A(e.clickDropdown, ["stop"])
591
+ }, {
592
+ default: r(() => [
593
+ (o(!0), i(k, null, p(e.presetDropdownPrices, (t) => (o(), i("option", {
594
+ key: "narrow-small-" + t,
595
+ value: t
596
+ }, u(t !== d.OTHER_OPTION ? `${t}` : t), 9, oe))), 128))
597
+ ]),
598
+ _: 1
599
+ }, 8, ["id", "modelValue", "class", "onUpdate:modelValue", "onClick"])) : c("", !0),
600
+ y(m, {
601
+ class: w(["tw-inline-flex tw-flex-1 button-ellipsis", d.componentWidth < d.NARROW_SIDEBAR_DROPDOWN_BREAKPOINT ? "tw-w-3/5" : "tw-w-full"]),
602
+ "data-testid": "bp-lend-cta-narrow-desktop-lend-button",
603
+ type: "submit"
604
+ }, {
605
+ default: r(() => [
606
+ h("span", le, [
607
+ h("span", de, u(e.ctaButtonText), 1)
490
608
  ])
491
609
  ]),
492
610
  _: 1
@@ -494,126 +612,126 @@ function ee(t, s, o, L, d, e) {
494
612
  ])
495
613
  ])
496
614
  ])) : c("", !0),
497
- o.showPresetAmounts && !o.isAdding ? (i(), l("div", {
498
- key: 1,
499
- class: h({
615
+ l.showPresetAmounts && !l.isAdding && !e.isNarrowDesktop ? (o(), i("div", {
616
+ key: 2,
617
+ class: w({
500
618
  "tw-flex tw-gap-0.5 md:tw-gap-1 lg:tw-gap-1 tw-flex-wrap md:tw-flex-nowrap": !0,
501
619
  "tw-hidden md:tw-flex": !e.isLendAmountButton && e.presetButtonsPrices.length > 1
502
620
  })
503
621
  }, [
504
- e.isLendAmountButton ? c("", !0) : (i(!0), l(k, { key: 0 }, A(e.presetButtonsPrices, (n) => (i(), r(w, {
505
- key: n,
622
+ e.isLendAmountButton ? c("", !0) : (o(!0), i(k, { key: 0 }, p(e.presetButtonsPrices, (t) => (o(), a(m, {
623
+ key: t,
506
624
  variant: "secondary",
507
- class: h(["tw-inline-flex tw-flex-1 preset-option tw-w-8", { "selected-option": d.selectedOption == n }]),
625
+ class: w(["tw-inline-flex tw-flex-1 preset-option tw-w-8", { "selected-option": d.selectedOption == t }]),
508
626
  "data-testid": "bp-lend-cta-lend-button",
509
- onClick: (D) => e.clickPresetButton(n)
627
+ onClick: (b) => e.clickPresetButton(t)
510
628
  }, {
511
- default: a(() => [
512
- m(" $" + u(n), 1)
629
+ default: r(() => [
630
+ f(" $" + u(t), 1)
513
631
  ]),
514
632
  _: 2
515
633
  }, 1032, ["class", "onClick"]))), 128)),
516
- e.showFilteredDropdown ? (i(), r(v, {
634
+ e.showFilteredDropdown ? (o(), a(B, {
517
635
  key: 1,
518
636
  id: `LoanAmountDropdown_${e.loanId}`,
519
637
  modelValue: d.selectedDropdownOption,
520
638
  "onUpdate:modelValue": [
521
- s[4] || (s[4] = (n) => d.selectedDropdownOption = n),
639
+ s[6] || (s[6] = (t) => d.selectedDropdownOption = t),
522
640
  e.trackLendAmountSelection
523
641
  ],
524
- class: h(["tw-min-w-12 tw-rounded filtered-dropdown tw-w-full", {
642
+ class: w(["tw-min-w-12 tw-rounded filtered-dropdown tw-w-full", {
525
643
  "unselected-dropdown": !e.selectedDropdown,
526
644
  "selected-dropdown": e.selectedDropdown
527
645
  }]),
528
646
  "aria-label": "Lend amount",
529
- onClick: B(e.clickDropdown, ["stop"])
647
+ onClick: A(e.clickDropdown, ["stop"])
530
648
  }, {
531
- default: a(() => [
532
- (i(!0), l(k, null, A(e.presetDropdownPrices, (n) => (i(), l("option", {
533
- key: n,
534
- value: n
535
- }, u(n !== d.OTHER_OPTION ? `$${n}` : n), 9, Y))), 128))
649
+ default: r(() => [
650
+ (o(!0), i(k, null, p(e.presetDropdownPrices, (t) => (o(), i("option", {
651
+ key: t,
652
+ value: t
653
+ }, u(t !== d.OTHER_OPTION ? `$${t}` : t), 9, ie))), 128))
536
654
  ]),
537
655
  _: 1
538
656
  }, 8, ["id", "modelValue", "class", "onUpdate:modelValue", "onClick"])) : c("", !0)
539
- ], 2)) : o.showPresetAmounts ? c("", !0) : (i(), l("div", Z, [
540
- e.hideShowLendDropdown && !e.isLessThan25 ? (i(), r(v, {
657
+ ], 2)) : l.showPresetAmounts ? c("", !0) : (o(), i("div", re, [
658
+ e.hideShowLendDropdown && !e.isLessThan25 ? (o(), a(B, {
541
659
  key: 0,
542
660
  id: `LoanAmountDropdown_${e.loanId}`,
543
661
  modelValue: d.selectedOption,
544
662
  "onUpdate:modelValue": [
545
- s[5] || (s[5] = (n) => d.selectedOption = n),
663
+ s[7] || (s[7] = (t) => d.selectedOption = t),
546
664
  e.trackLendAmountSelection
547
665
  ],
548
666
  class: "tw-min-w-12",
549
667
  style: { "border-radius": "14px 0 0 14px" },
550
668
  "aria-label": "Lend amount",
551
- onClick: B(e.clickDropdown, ["stop"])
669
+ onClick: A(e.clickDropdown, ["stop"])
552
670
  }, {
553
- default: a(() => [
554
- (i(!0), l(k, null, A(e.prices, (n) => (i(), l("option", {
555
- key: n,
556
- value: n
557
- }, " $" + u(n), 9, $))), 128))
671
+ default: r(() => [
672
+ (o(!0), i(k, null, p(e.prices, (t) => (o(), i("option", {
673
+ key: t,
674
+ value: t
675
+ }, " $" + u(t), 9, ae))), 128))
558
676
  ]),
559
677
  _: 1
560
678
  }, 8, ["id", "modelValue", "onUpdate:modelValue", "onClick"])) : c("", !0)
561
679
  ])),
562
- f("div", {
563
- class: h({
564
- "tw-min-w-0": o.showPresetAmounts,
565
- lendButtonWrapper: e.hideShowLendDropdown && !o.showPresetAmounts,
566
- "tw-hidden": e.hideLendButton || !e.isLendAmountButton && e.presetButtonsPrices.length > 1 && o.showPresetAmounts,
567
- "md:tw-block tw-hidden": !e.isLendAmountButton && e.presetButtonsPrices.length > 1 && o.showPresetAmounts
680
+ h("div", {
681
+ class: w({
682
+ "tw-min-w-0": l.showPresetAmounts && !e.isNarrowDesktop,
683
+ lendButtonWrapper: e.hideShowLendDropdown && !l.showPresetAmounts,
684
+ "tw-hidden": e.hideLendButton || l.showPresetAmounts && !l.isAdding && !e.isLendAmountButton && e.presetButtonsPrices.length > 1 && (e.isNarrowComponent() || e.isNarrowDesktop),
685
+ "md:tw-block tw-hidden": !e.isLendAmountButton && e.presetButtonsPrices.length > 1 && l.showPresetAmounts && !e.isNarrowDesktop
568
686
  })
569
687
  }, [
570
- e.lendButtonVisibility && !e.isLessThan25 ? (i(), r(w, {
688
+ e.lendButtonVisibility && !e.isLessThan25 ? (o(), a(m, {
571
689
  key: "lendButton",
572
- class: h(["tw-inline-flex tw-flex-1", { "button-ellipsis tw-w-full": o.showPresetAmounts }]),
690
+ class: w(["tw-inline-flex tw-flex-1", { "button-ellipsis tw-w-full": l.showPresetAmounts }]),
573
691
  "data-testid": "bp-lend-cta-lend-button",
574
692
  type: "submit"
575
693
  }, {
576
- default: a(() => [
577
- m(u(e.ctaButtonText), 1)
694
+ default: r(() => [
695
+ f(u(e.ctaButtonText), 1)
578
696
  ]),
579
697
  _: 1
580
- }, 8, ["class"])) : e.showLendAgain ? (i(), r(w, {
698
+ }, 8, ["class"])) : e.showLendAgain ? (o(), a(m, {
581
699
  key: "lendAgainButton",
582
- class: h(["lend-again", { "tw-w-full": o.showPresetAmounts }]),
700
+ class: w(["lend-again", { "tw-w-full": l.showPresetAmounts }]),
583
701
  "data-testid": "bp-lend-cta-lend-again-button",
584
702
  type: "submit"
585
703
  }, {
586
- default: a(() => [
587
- m(u(o.primaryButtonText || "Lend") + " again ", 1)
704
+ default: r(() => [
705
+ f(u(l.primaryButtonText || "Lend") + " again ", 1)
588
706
  ]),
589
707
  _: 1
590
708
  }, 8, ["class"])) : c("", !0)
591
709
  ], 2),
592
- e.isLendAmountButton && !o.enableFiveDollarsNotes ? (i(), r(T, {
593
- key: 3,
710
+ e.isLendAmountButton && !l.enableFiveDollarsNotes ? (o(), a(O, {
711
+ key: 4,
594
712
  class: "tw-w-full",
595
713
  "loan-id": e.loanId,
596
714
  "show-now": !1,
597
715
  "amount-left": e.amountForLendAmountButton,
598
- "is-adding": o.isAdding,
716
+ "is-adding": l.isAdding,
599
717
  onAddToBasket: e.addToBasket
600
718
  }, null, 8, ["loan-id", "amount-left", "is-adding", "onAddToBasket"])) : c("", !0),
601
- !o.isLoading && o.isAdding ? (i(), r(w, {
602
- key: 4,
719
+ !l.isLoading && l.isAdding ? (o(), a(m, {
720
+ key: 5,
603
721
  class: "tw-inline-flex tw-flex-1"
604
722
  }, {
605
- default: a(() => s[8] || (s[8] = [
606
- m(" Adding to basket ")
723
+ default: r(() => s[10] || (s[10] = [
724
+ f(" Adding to basket ")
607
725
  ])),
608
726
  _: 1
609
727
  })) : c("", !0)
610
- ], 10, U)
728
+ ], 10, H)
611
729
  ], 32)) : c("", !0)
612
- ]);
730
+ ], 512);
613
731
  }
614
- const me = /* @__PURE__ */ V(R, [["render", ee], ["__scopeId", "data-v-d161d592"]]);
732
+ const be = /* @__PURE__ */ W(K, [["render", ue], ["__scopeId", "data-v-629f4bdf"]]);
615
733
  export {
616
- ce as KV_LEND_CTA_FRAGMENT,
617
- we as KV_LEND_CTA_USER_FRAGMENT,
618
- me as default
734
+ De as KV_LEND_CTA_FRAGMENT,
735
+ ye as KV_LEND_CTA_USER_FRAGMENT,
736
+ be as default
619
737
  };