PageSourceSearch

https://spa-cart.websupport.sk/assets/CartView-Cs27gtd8.js

js websupport.sk collected 2026-10-02 02:24:59 UTC 30,894 bytes, 744 lines download raw bytes

1var __defProp = Object.defineProperty;
2var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3var __hasOwnProp = Object.prototype.hasOwnProperty;
4var __propIsEnum = Object.prototype.propertyIsEnumerable;
5var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6var __spreadValues = (a, b2) => {
7  for (var prop in b2 || (b2 = {}))
8    if (__hasOwnProp.call(b2, prop))
9      __defNormalProp(a, prop, b2[prop]);
10  if (__getOwnPropSymbols)
11    for (var prop of __getOwnPropSymbols(b2)) {
12      if (__propIsEnum.call(b2, prop))
13        __defNormalProp(a, prop, b2[prop]);
14    }
15  return a;
16};
17var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
18var __async = (__this, __arguments, generator) => {
19  return new Promise((resolve, reject) => {
20    var fulfilled = (value) => {
21      try {
22        step(generator.next(value));
23      } catch (e) {
24        reject(e);
25      }
26    };
27    var rejected = (value) => {
28      try {
29        step(generator.throw(value));
30      } catch (e) {
31        reject(e);
32      }
33    };
34    var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
35    step((generator = generator.apply(__this, __arguments)).next());
36  });
37};
38import { ak as Watch, ad as Component, aq as Ref, al as Prop, ao as useRouter } from "./vendor-CZvMt8Uf.js";
39import { x as mapState, V as Vue, v as mapGetters, k as defineComponent, r as ref$1, l as onMounted } from "./vendor-vue-CIEl4Ose.js";
40import { c as config, z as ensureCartLoaded, S as StateMutations, w as fetchCart, K as StoreActions, W as setAssistance, n as normalizeComponent, X as INVALID_FORM_ERROR, Y as applyCoupon, Z as removeCoupon, _ as checkQueryParam, g as getLoginUrl, R as ROUTENAMES, $ as SidePanels, a0 as navigateToStep, I as STEPS, a1 as performQuickOrder, a2 as setUserStep, a3 as canFillMissingDomainFields, a4 as goToFillMissingDomainFields, m as logError, J as isStandardWorkflow, j as useCartItemsStore, e as store, E as setEditMode, a5 as updateNote, a6 as deleteNote, a7 as reloadCfgAndValidate } from "./main-DJeuKYas.js";
41import { T as Throttle, f as byteConvert, a as redirect, j as scrollToTop } from "./odin-utils-Dx2y7OLM.js";
42import EmptyCart from "./EmptyCart-D1H9zoZt.js";
43import { W as WsMessage } from "./WsMessage-B8QbwDBN.js";
44import { k, e as b, l as d, a1 as W, W as q, E, w, C, b as ot, J as A, a as m } from "./index.es.es-CGxJBMfD.js";
45import { u as useMessages, T as Theme, N, b as useI18n } from "./odin-DIiukhnD.js";
46import { g as get } from "./vendor-utils-j6SE9MGc.js";
47import { S as SidebarLayout } from "./SidebarLayout-Dkm35uWK.js";
48import { S as SideSummary } from "./SideSummary-Crp6IJ04.js";
49import CartItems from "./CartItems-DQQe-4Cb.js";
50import { p as QExpansionItem, f as QItemLabel, e as QItemSection, g as QItem, h as QForm, n as QCardSection } from "./vendor-quasar-Dptu3ldj.js";
51import { r as required, v as validateForm } from "./validation.service-Ych1Lo-0.js";
52import { I as Icon } from "./odin-assets-D7LmUGe7.js";
53import "./vendor-sentry-DRCyJRFj.js";
54import "./odin-vue2-utils-DSRbPlxj.js";
55import "./vendor-axios-B5u-j0E8.js";
56import "./vendor-qrcode-DVLuOpww.js";
57import "./cary-sorry-CXMGK7tP.js";
58import "./DomainSearchBar-DdDZ_QOu.js";
59import "./ProfileInfo-BFP3QeTA.js";
60import "./PaymentOptions-qMPRYcYH.js";
61import "./xss-ba7intEK.js";
62import "./WsRadioList-eThdI595.js";
63import "./WsBadge-ChhzhpmT.js";
64import "./bankImages-Gfq_XC_n.js";
65import "./PremiumBadge-CQYIiVqV.js";
66import "./WsSelectNumber-DXWAXEZK.js";
67import "./WsModal-BnQLK91w.js";
68import "./PricePeriod-BmfE5D1A.js";
69import "./OrderProcessError-D7xbGl8W.js";
70var __defProp$3 = Object.defineProperty;
71var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
72var __decorateClass$4 = (decorators, target, key, kind) => {
73  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
74  for (var i = decorators.length - 1, decorator; i >= 0; i--)
75    if (decorator = decorators[i])
76      result = (kind ? decorator(target, key, result) : decorator(result)) || result;
77  if (kind && result) __defProp$3(target, key, result);
78  return result;
79};
80const { postMessage: postMessage$2, handleUnstructuredError: handleUnstructuredError$3 }
80 = useMessages();
81const UPLOAD_URL = "/promotion-for-migration";
82const UPLOAD_FILES_PATH = "migrationPromotion.uploadedFiles";
83const MESSAGES_PATH = "cart." + UPLOAD_FILES_PATH;
84const ALLOWED_TYPES = {
85  "jpg": "image/jpeg",
86  // 'image/png',
87  "pdf": "application/pdf"
88};
89const ALLOWED_SIZE = {
90  value: 5242880,
91  text: "5MB"
92};
93let MigrationUpload$1 = class MigrationUpload extends Vue {
94  constructor() {
95    super(...arguments);
96    __publicField(this, "cart");
97    __publicField(this, "wsUploader");
98    __publicField(this, "config", config);
99    // null => no migration, false => do no need assistance with migration,
100    // true => do need assistance
101    __publicField(this, "needAssistance", null);
102    __publicField(this, "uploadReveal", false);
103    __publicField(this, "loading", false);
104    __publicField(this, "uploadUrl", UPLOAD_URL);
105    __publicField(this, "Theme", Theme);
106    __publicField(this, "allowedTypes", ALLOWED_TYPES);
107  }
108  created() {
109    ensureCartLoaded(() => this.uploadReveal = !!this.filesFromCart.length);
110    this.uploadUrl = this.config.apiUrl + UPLOAD_URL;
111  }
112  get filesFromCart() {
113    return this.cart && this.cart.migrationPromotion && this.cart.migrationPromotion.uploadedFiles || [];
114  }
115  get filesProcessed() {
116    return this.filesFromCart.map((file) => {
117      file.name = file.clientFileName || "unknown file name";
118      if (file.fileSize) {
119        file.__sizeLabel = byteConvert(file.fileSize);
120      }
121      return file;
122    });
123  }
124  filesFilter(files) {
125    return files.filter((file) => {
126      let allowed = false;
127      if (!this.isAllowedFileType(file.type)) {
128        postMessage$2(MESSAGES_PATH, this.$t("ws_uploader.validation.file_type"));
129      } else if (!this.isAllowedFileSize(file.size)) {
130        postMessage$2(MESSAGES_PATH, this.$t("ws_uploader.validation.file_size", { limit: ALLOWED_SIZE.text }));
131      } else {
132        allowed = true;
133      }
134      return allowed;
135    });
136  }
137  isAllowedFileType(type) {
138    return Object.values(ALLOWED_TYPES).includes(type);
139  }
140  isAllowedFileSize(size) {
141    return size < ALLOWED_SIZE.value;
142  }
143  processUploaded(info) {
144    const xhr = info.xhr;
145    let file;
146    try {
147      file = JSON.parse(xhr.response);
148    } catch (error) {
149      handleUnstructuredError$3(null, error, [], MESSAGES_PATH);
150    }
151    this.$store.commit(StateMutations.SET_STATE, {
152      path: MESSAGES_PATH,
153      value: file
154    });
155    if (this.filesFromCart.length === 1) {
156      fetchCart();
157    }
158  }
159  removeFile(file) {
160    if (!file.clientFileName) {
161      file = this.filesFromCart.find(
162        (f) => f.clientFileName === file.name
163      ) || file;
164    }
165    this.$store.dispatch(StoreActions.REMOVE_FILE, {
166      file,
167      path: MESSAGES_PATH
168    }).then(() => this.onFileRemoved(file)).catch((err) => handleUnstructuredError$3(null, err, [], MESSAGES_PATH));
169  }
170  onFileRemoved(file) {
171    var _a;
172    if (this.filesFromCart.length === 0) {
173      fetchCart();
174    }
175    (_a = this.wsUploader) == null ? void 0 : _a.removeFile(file);
176  }
177  onCartAssistanceChange(newVal) {
178    if (this.needAssistance !== newVal) {
179      this.needAssistance = newVal;
180    }
181  }
182  onRevealChange(newVal, oldVal) {
183    let needAssistance = get(
184      this.cart,
185      "migrationPromotion.needAssistance",
186      null
187    );
188    if (!newVal) {
189      needAssistance = null;
190      if (oldVal !== void 0) {
191        this.filesFromCart.forEach((fileFromCart) => {
192          var _a;
193          if (!this.filesFromCart.length) {
194            return;
195          }
196          this.removeFile(fileFromCart);
197          (_a = this.wsUploader) == null ? void 0 : _a.reset();
198        });
199      }
200    } else if (needAssistance === null) {
201      needAssistance = false;
202    }
203    if (this.needAssistance !== needAssistance) {
204      this.needAssistance = needAssistance;
205    }
206  }
207  onAssistanceChange(newVal) {
208    this.setAssistance(newVal);
209  }
210  setAssistance(newVal) {
211    if (get(this.cart, "migrationPromotion.applicable")) {
212      setAssistance(newVal);
213    }
214  }
215  destroyed() {
216    if (this.filesFromCart.length === 0) {
217      this.setAssistance(null);
218    }
219  }
220};
221__decorateClass$4([
222  Ref("wsUploader")
223], MigrationUpload$1.prototype, "wsUploader", 2);
224__decorateClass$4([
225  Watch("cart.migrationPromotion.needAssistance", { immediate: true })
226], MigrationUpload$1.prototype, "onCartAssistanceChange", 1);
227__decorateClass$4([
228  Watch("uploadReveal", { immediate: true })
229], MigrationUpload$1.prototype, "onRevealChange", 1);
230__decorateClass$4([
231  Watch("needAssistance")
232], MigrationUpload$1.prototype, "onAssistanceChange", 1);
233__decorateClass$4([
234  Throttle(500)
235], MigrationUpload$1.prototype, "setAssistance", 1);
236MigrationUpload$1 = __decorateClass$4([
237  Component({
238    components: {
239      WsUploader: W,
240      WsRadio: d,
241      WsMessage,
242      WsLabelLink: b,
243      WsCheckbox: k
244    },
245    computed: __spreadValues({}, mapState(["cart"]))
246  })
247], MigrationUpload$1);
248var _sfc_render$4 = function render() {
249  var _vm = this, _c = _vm._self._c;
250  _vm._self._setupProxy;
251  return _c("div", { staticClass: "row cmp-migration-upload" }, [_c("div", { staticClass: "col" }, [_c("ws-checkbox", { attrs: { "label": _vm.$t("cart.extra_settings.upload.label") }, model: { value: _vm.uploadReveal, callback: function($$v) {
252    _vm.uploadReveal = $$v;
253  }, expression: "uploadReveal" } }, [_c("div", { staticClass: "label-text q-mt-sm" }, [_vm._v(" " + _vm._s(_vm.$t("cart.extra_settings.upload.text")) + " "), _vm.config.migrationInfoUrl ? _c("ws-label-link", { attrs: { "info": "", "target": "_blank", "href": _vm.config.migrationInfoUrl } }, [_vm._v(" " + _vm._s(_vm.$t("cart.extra_settings.upload.link")) + " ")]) : _vm._e()], 1)]), _c("transition", { attrs: { "name": "slide-fade-vertical" } }, [_c("div", { directives: [{ name: "show", rawName: "v-show", value: _vm.uploadReveal, expression: "uploadReveal" }], staticClass: "row q-pl-lg q-py-sm" }, [_c("div", { staticClass: "col q-mt-sm" }, [_c("ws-uploader", { ref: "wsUploader", attrs: { "url": _vm.uploadUrl, "multiple": "", "auto-upload": "", "hide-upload-btn": "", "square": "", "flat": "", "bodered": "", "field-name": "invoice", "supported-file-types": Object.keys(_vm.allowedTypes), "files": _vm.filesProcessed, "filter": _vm.filesFilter, "block-remove": _vm.loading }, on: { "remove-file": _vm.removeFile, "uploaded": _vm.processUploaded } }), _c("ws-message", { attrs: { "type": "alert", "path": "cart.migrationPromotion.uploadedFiles" } }), _c("ws-radio", { staticClass: "full-width flex items-center q-mt-lg", attrs: { "color": _vm.isTheme(_vm.Theme.ADMIN) ? "blue" : "green", "val": false }, model: { value: _vm.needAssistance, callback: function($$v) {
254    _vm.needAssistance = $$v;
255  }, expression: "needAssistance" } }, [_c("small", [_vm._v(_vm._s(_vm.$t("cart.extra_settings.upload.no_assistance")))])]), _c("ws-radio", { staticClass: "full-width flex items-center q-mt-sm", attrs: { "color": _vm.isTheme(_vm.Theme.ADMIN) ? "blue" : "green", "val": true }, model: { value: _vm.needAssistance, callback: function($$v) {
256    _vm.needAssistance = $$v;
257  }, expression: "needAssistance" } }, [_c("small", [_vm._v(_vm._s(_vm.$t("cart.extra_settings.upload.need_assistance")))])])], 1)])])], 1)]);
258};
259var _sfc_staticRenderFns$4 = [];
260var __component__$4 = /* @__PURE__ */ normalizeComponent(
261  MigrationUpload$1,
262  _sfc_render$4,
263  _sfc_staticRenderFns$4,
264  false,
265  null,
266  "54a96b85"
267);
268const MigrationUpload2 = __component__$4.exports;
269var __defProp$2 = Object.defineProperty;
270var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
271var __decorateClass$3 = (decorators, target, key, kind) => {
272  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target;
273  for (var i = decorators.length - 1, decorator; i >= 0; i--)
274    if (decorator = decorators[i])
275      result = (kind ? decorator(target, key, result) : decorator(result)) || result;
276  if (kind && result) __defProp$2(target, key, result);
277  return result;
278};
279let BonusList = class extends Vue {
280  constructor() {
281    super(...arguments);
282    __publicField(this, "bonuses");
283    __publicField(this, "info");
284    __publicField(this, "Icon", Icon);
285  }
286  bonusValue(bonus) {
287    if (bonus.property === "bonus.property.price" && !bonus.percentage) {
288      return this.$n(bonus.value, "currency");
289    }
290    return bonus.value + (bonus.percentage ? "%" : "");
291  }
292};
293__decorateClass$3([
294  Prop()
295], BonusList.prototype, "bonuses", 2);
296__decorateClass$3([
297  Prop()
298], BonusList.prototype, "info", 2);
299BonusList = __decorateClass$3([
300  Component({
301    components: {
302      WsIcon: E,
303      WsTooltip: q
304    }
305  })
306], BonusList);
307var __defProp$1 = Object.defineProperty;
308var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
309var __decorateClass$2 = (decorators, target, key, kind) => {
310  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target;
311  for (var i = decorators.length - 1, decorator; i >= 0; i--)
312    if (decorator = decorators[i])
313      result = (kind ? decorator(target, key, result) : decorator(result)) || result;
314  if (kind && result) __defProp$1(target, key, result);
315  return result;
316};
317const { postMessage: postMessage$1, handleUnstructuredError: handleUnstructuredError$2 }
317 = useMessages();
318const testNames$2 = {};
319let CouponList$1 = class CouponList extends Vue {
320  constructor() {
321    super(...arguments);
322    __publicField(this, "testNames", testNames$2);
323    __publicField(this, "cart");
324    __publicField(this, "code", "");
325    __publicField(this, "loaders", { submit: false });
326    __publicField(this, "expansion", false);
327    __publicField(this, "required", required);
328    __publicField(this, "WsButtonEnum", N);
329    __publicField(this, "Icon", Icon);
330  }
331  get items() {
332    return get(this.cart, "summary.coupons", []);
333  }
334  onItemsChanged(items) {
335    if (items.length) {
336      this.expansion = true;
337    }
338  }
339  onCodeChanged(code) {
340    if (!code) {
341      this.$refs.input.cmp_vm.component.refs.qfield.resetValidation();
342    }
343  }
344  submit(event) {
345    if (event && typeof event.preventDefault === "function") {
346      event.preventDefault();
347    }
348    if (this.loaders.submit || !this.code) {
349      return;
350    }
351    this.loaders.submit = true;
352    validateForm(this.$refs.form).then((result) => {
353      if (!result) {
354        return Promise.reject(INVALID_FORM_ERROR);
355      }
356      return applyCoupon(this.code).then(() => this.cleanForm());
357    }).catch((e) => {
358      postMessage$1("cart.summary.discount", this.$t(e.response.data.key));
359    }).finally(() => this.loaders.submit = false);
360  }
361  removeItem(code) {
362    if (this.loaders[code]) {
363      return;
364    }
365    Vue.set(this.loaders, code, true);
366    removeCoupon(code).catch((err) => handleUnstructuredError$2("cart.summary.discount_rm", err)).finally(() => this.loaders[code] = false);
367  }
368  cleanForm() {
369    this.code = "";
370    this.$refs.input.cmp_vm.component.refs.qfield.blur();
371    this.$refs.form.resetValidation();
372    setTimeout(() => {
373      this.$refs.form.resetValidation();
374    }, 0);
375  }
376};
377__decorateClass$2([
378  Watch("items", { immediate: true })
379], CouponList$1.prototype, "onItemsChanged", 1);
380__decorateClass$2([
381  Watch("code")
382], CouponList$1.prototype, "onCodeChanged", 1);
383CouponList$1 = __decorateClass$2([
384  Component({
385    components: {
386      QForm,
387      QItem,
388      QItemSection,
389      QItemLabel,
390      QExpansionItem,
391      WsInput: C,
392      WsIcon: E,
393      WsButton: w,
394      WsMessage,
395      BonusList
396    },
397    computed: __spreadValues({}, mapState(["cart"]))
398  })
399], CouponList$1);
400const _sfc_main$1 = CouponList$1;
401var _sfc_render$3 = function render2() {
402  var _vm = this, _c = _vm._self._c;
403  _vm._self._setupProxy;
404  return _c("q-expansion-item", { staticClass: "cmp-coupon-list", attrs: { "dense": "", "switch-toggle-side": "", "label": _vm.$t("summary.coupon_label"), "header-class": "expansion-header", "data-test": _vm.testNames.expansion }, on: { "hide": _vm.cleanForm }, model: { value: _vm.expansion, callback: function($$v) {
405    _vm.expansion = $$v;
406  }, expression: "expansion" } }, [_c("q-form", { ref: "form", attrs: { "novalidate": "", "greedy": "" }, on: { "submit": function($event) {
407    $event.preventDefault();
408  } } }, [_c("ws-input", { ref: "input", attrs: { "path": "cart.summary.discount", "label": _vm.$t("summary.coupon_input"), "rules": [], "data-test": _vm.testNames.input }, scopedSlots: _vm._u([{ key: "after", fn: function() {
409    return [_c("ws-button", { attrs: { "submit": "", "type": _vm.WsButtonEnum.Type.GHOST, "size": _vm.WsButtonEnum.Size.MEDIUM, "disable": _vm.loaders.submit, "loading": _vm.loaders.submit, "label": _vm.$t("summary.coupon_apply"), "data-test": _vm.testNames.applyButton }, on: { "click": _vm.submit } })];
410  }, proxy: true }]), model: { value: _vm.code, callback: function($$v) {
411    _vm.code = $$v;
412  }, expression: "code" } }), _c("div", { staticClass: "q-py-sm" }, _vm._l(_vm.items, function(item) {
413    return _c("q-item", { key: item.code, staticClass: "bonus" }, [_c("q-item-section", [_c("q-item-label", { staticClass: "text-positive text-left" }, [_c("ws-icon", { staticClass: "q-mr-xs", attrs: { "name": _vm.Icon.CIRCLE } }), _c("small", [_c("bonus-list", { staticClass: "inline", attrs: { "bonuses": item.bonuses } })], 1)], 1), _c("q-item-label", { staticClass: "text-left q-ml-md q-pl-xs", attrs: { "caption": "" } }, [_vm._v(" " + _vm._s(item.code) + " ")])], 1), _c("q-item-section", { staticClass: "rm-section", attrs: { "side": "" } }, [_c("ws-button", { attrs: { "type": _vm.WsButtonEnum.Type.DANGER, "loading": _vm.loaders[item.code], "icon": _vm.Icon.CLOSE, "data-test": _vm.testNames.removeButton }, on: { "click": function($event) {
414      return _vm.removeItem(item.code);
415    } } })], 1)], 1);
416  }), 1), _c("ws-message", { attrs: { "path": "cart.summary.discount_rm", "type": "alert" } })], 1)], 1);
417};
418var _sfc_staticRenderFns$3 = [];
419var __component__$3 = /* @__PURE__ */ normalizeComponent(
420  _sfc_main$1,
421  _sfc_render$3,
422  _sfc_staticRenderFns$3,
423  false,
424  null,
425  "d7a33383"
426);
427const CouponList2 = __component__$3.exports;
428var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
429var __decorateClass$1 = (decorators, target, key, kind) => {
430  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
431  for (var i = decorators.length - 1, decorator; i >= 0; i--)
432    if (decorator = decorators[i])
433      result = decorator(result) || result;
434  return result;
435};
436const { handleUnstructuredError: handleUnstructuredError$1, deleteMessage: deleteMessage$1 }
436 = useMessages();
437const testNames$1 = {};
438let QuickOrderButton$1 = class QuickOrderButton extends Vue {
439  constructor() {
440    super(...arguments);
441    __publicField(this, "testNames", testNames$1);
442    __publicField(this, "firstStepWithIssues");
443    __publicField(this, "loggedIn");
444    __publicField(this, "loading", false);
445    __publicField(this, "path", "cart.summary.quick_order");
446    __publicField(this, "WsButtonEnum", N);
447  }
448  mounted() {
449    const searchParam = checkQueryParam("orderRefId");
450    if (searchParam.exists) {
451      this.openSideBar();
452    }
453  }
454  login() {
455    redirect(getLoginUrl(this.$router, ROUTENAMES.CART));
456  }
457  goNext() {
458    if (!this.loggedIn) {
459      this.openSideBar();
460      return;
461    }
462    this.startQuickOrder();
463  }
464  openSideBar() {
465    this.$store.commit(StateMutations.MERGE_STATE, {
466      ui: { sidePanel: SidePanels.Login }
467    });
468  }
469  startQuickOrder() {
470    return __async(this, null, function* () {
471      deleteMessage$1(this.path);
472      this.loading = true;
473      try {
474        yield navigateToStep(STEPS.BILLING_PROFILE, false);
475      } catch (error) {
476        this.loading = false;
477        return Promise.reject();
478      }
479      return performQuickOrder().then(() => setUserStep(STEPS.RECAPITULATION)).catch(this.handleError).finally(() => this.loading = false);
480    });
481  }
482  goToRecapitulation() {
483    return __async(this, null, function* () {
484      yield setUserStep(STEPS.RECAPITULATION);
485      yield navigateToStep(STEPS.BILLING_PROFILE, false);
486    });
487  }
488  // Example error can be found in checkout.mock.ts, see 'const quickOrderMultiError'...
489  handleError(error) {
490    return __async(this, null, function* () {
491      var _a;
492      const { status } = (_a = error == null ? void 0 : error.response) == null ? void 0 : _a.data;
493      if (status === 401) {
494        this.login();
495        return;
496      }
497      if (canFillMissingDomainFields()) {
498        yield goToFillMissingDomainFields();
499      } else {
500        yield this.goToRecapitulation();
501      }
502      handleUnstructuredError$1(this.path, error);
503    });
504  }
505};
506QuickOrderButton$1 = __decorateClass$1([
507  Component({
508    components: {
509      QCardSection,
510      WsButton: w,
511      WsDelimiter: ot
512    },
513    computed: __spreadValues({}, mapGetters(["firstStepWithIssues", "loggedIn"]))
514  })
515], QuickOrderButton$1);
516var _sfc_render$2 = function render3() {
517  var _vm = this, _c = _vm._self._c;
518  _vm._self._setupProxy;
519  return _c("q-card-section", { staticClass: "cmp-quick-order q-pa-none" }, [_c("ws-button", { attrs: { "type": _vm.loggedIn ? _vm.WsButtonEnum.Type.TERTIARY_NEUTRAL : _vm.WsButtonEnum.Type.PRIMARY, "size": _vm.WsButtonEnum.Size.XL, "disable": _vm.loading, "loading": _vm.loading, "loader-color": "dark", "full-width": "", "data-test": _vm.testNames.quickOrderButton }, on: { "click": _vm.goNext } }, [_vm._v(" " + _vm._s(_vm.$t("summary.continue_btn")) + " ")])], 1);
520};
521var _sfc_staticRenderFns$2 = [];
522var __component__$2 = /* @__PURE__ */ normalizeComponent(
523  QuickOrderButton$1,
524  _sfc_render$2,
525  _sfc_staticRenderFns$2,
526  false,
527  null,
528  "db87d04d"
529);
530const QuickOrderButton2 = __component__$2.exports;
531const _sfc_main = defineComponent({
532  components: {
533    WsCarySpinner: m,
534    WsStateBanner: A
535  },
536  setup() {
537    const router = useRouter();
538    const { t } = useI18n();
539    const loadingCoupon = ref$1(false);
540    const autoInsertError = ref$1(false);
541    const checkForCoupon = () => __async(null, null, function* () {
542      autoInsertError.value = false;
543      const coupon = router.currentRoute.query.coupon;
544      if (!coupon) {
545        return;
546      }
547      yield addCoupon(coupon.toString());
548    });
549    const addCoupon = (coupon) => __async(null, null, function* () {
550      loadingCoupon.value = true;
551      autoInsertError.value = false;
552      try {
553        yield applyCoupon(coupon);
554      } catch (e) {
555        logError("Error while auto-insert coupon", e);
556        autoInsertError.value = true;
557      } finally {
558        loadingCoupon.value = false;
559      }
560    });
561    onMounted(() => __async(null, null, function* () {
562      yield checkForCoupon();
563    }));
564    return { t, loadingCoupon, autoInsertError };
565  }
566});
567var _sfc_render$1 = function render4() {
568  var _vm = this, _c = _vm._self._c;
569  _vm._self._setupProxy;
570  return _c("div", [_vm.loadingCoupon ? _c("div", [_c("ws-cary-spinner", { attrs: { "height": "20px" } }), _c("span", { staticClass: "coupon-auto-insert__loading-text" }, [_vm._v(" " + _vm._s(_vm.t("general.coupon_auto_insert")) + " ")])], 1) : _vm.autoInsertError ? _c("ws-state-banner", { staticClass: "q-mb-md", attrs: { "type": "error" } }, [_vm._v(" " + _vm._s(_vm.t("validation.coupon_not_applicable")) + " ")]) : _vm._e()], 1);
571};
572var _sfc_staticRenderFns$1 = [];
573var __component__$1 = /* @__PURE__ */ normalizeComponent(
574  _sfc_main,
575  _sfc_render$1,
576  _sfc_staticRenderFns$1,
577  false,
578  null,
579  "91ee8dae"
580);
581const CouponAutoInsert = __component__$1.exports;
582var __defProp2 = Object.defineProperty;
583var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
584var __decorateClass = (decorators, target, key, kind) => {
585  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
586  for (var i = decorators.length - 1, decorator; i >= 0; i--)
587    if (decorator = decorators[i])
588      result = (kind ? decorator(target, key, result) : decorator(result)) || result;
589  if (kind && result) __defProp2(target, key, result);
590  return result;
591};
592const testNames = {};
593const { deleteMessage, handleUnstructuredError, postMessage }
593 = useMessages();
594const FREE_PRODUCTS_LIMIT_REACHED_KEY = "exception.integrity.free_products_limit_reached";
595let CartView$1 = class CartView extends Vue {
596  constructor() {
597    super(...arguments);
598    __publicField(this, "cart");
599    __publicField(this, "orderSteps");
600    __publicField(this, "loggedIn");
601    __publicField(this, "cartDomains");
602    __publicField(this, "quickOrderInProgress");
603    __publicField(this, "noteReveal", false);
604    __publicField(this, "loading", false);
605    __publicField(this, "note", "");
606    __publicField(this, "isStandardWorkflow", isStandardWorkflow);
607    __publicField(this, "testNames", testNames);
608    __publicField(this, "cartItemsStore", useCartItemsStore());
609  }
610  created() {
611    deleteMessage("general");
612    store.dispatch(StoreActions.SET_USER_STEP, {
613      step: STEPS.CART
614    });
615    setEditMode(STEPS.CART);
616    scrollToTop();
617  }
618  cartNoteChanged(note, previousNote) {
619    if (note && !previousNote && !this.loading) {
620      this.note = note;
621      this.noteReveal = true;
622    }
623  }
624  cartRevealChanged(noteReveal) {
625    if (!noteReveal) {
626      this.note = "";
627      this.updateNote("");
628    }
629  }
630  updateNote(note) {
631    note = note.trim();
632    this.loading = true;
633    if (note) {
634      updateNote(note).finally(() => this.loading = false);
635    } else {
636      deleteNote().finally(() => this.loading = false);
637    }
638  }
639  beforeRouteLeave(to, from, next) {
640    return __async(this, null, function* () {
641      if (!this.cartItemsStore.cartItems.length || !this.loggedIn) {
642        return next();
643      }
644      try {
645        yield this.validateCart();
646        next();
647      } catch (error) {
648        logError("Cart validation failed", error);
649        yield setUserStep(STEPS.CART);
650        next(false);
651      }
652    });
653  }
654  validateCart() {
655    return __async(this, null, function* () {
656      if (this.cartItemsStore.cartItems.length) {
657        try {
658          yield reloadCfgAndValidate();
659        } catch (error) {
660          this.handleValidationError(error);
661          throw error instanceof Error ? error : new Error((error == null ? void 0 : error.message) || "Cart validation failed");
662        }
663      }
664    });
665  }
666  handleValidationError(error) {
667    const errors = get(error, "response.data.context.errors");
668    const isFreeProductsLimitReached = Array.isArray(errors) && errors.some((err) => (err == null ? void 0 : err.key) === FREE_PRODUCTS_LIMIT_REACHED_KEY);
669    if (isFreeProductsLimitReached) {
670      deleteMessage("general");
671      postMessage("general", this.$t(FREE_PRODUCTS_LIMIT_REACHED_KEY));
672    } else {
673      handleUnstructuredError(null, error);
674    }
675  }
676  destroyed() {
677    deleteMessage("general");
678  }
679};
680__decorateClass([
681  Watch("cart.note", { immediate: true })
682], CartView$1.prototype, "cartNoteChanged", 1);
683__decorateClass([
684  Watch("noteReveal")
685], CartView$1.prototype, "cartRevealChanged", 1);
686CartView$1 = __decorateClass([
687  Component({
688    components: {
689      CouponAutoInsert,
690      QuickOrderButton: QuickOrderButton2,
691      WsMessage,
692      WsCheckbox: k,
693      WsInput: C,
694      EmptyCart,
695      SidebarLayout,
696      SideSummary,
697      CartItems,
698      CouponList: CouponList2,
699      MigrationUpload: MigrationUpload2
700    },
701    computed: __spreadValues(__spreadValues({}, mapState(["cart", "quickOrderInProgress"])), mapGetters(["orderSteps", "loggedIn", "cartDomains"]))
702  })
703], CartView$1);
704var _sfc_render = function render5() {
705  var _vm = this, _c = _vm._self._c;
706  _vm._self._setupProxy;
707  return _vm.cart.items.length ? _c("sidebar-layout", { staticClass: "view-cart ws-typography", class: {
708    "q-pt-2xl q-pb-3xl": _vm.desktop,
709    "q-pt-md q-pb-2xl": _vm.tablet,
710    "q-pt-md": _vm.mobile
711  }, attrs: { "view-title": "general.headings.your_cart" }, scopedSlots: _vm._u([{ key: "side", fn: function() {
712    return [_c("side-summary", { scopedSlots: _vm._u([{ key: "default", fn: function() {
713      return [_c("div", { staticClass: "text-center" }, [_c("coupon-auto-insert", { staticClass: "q-mt-lg" }), _c("coupon-list", { staticClass: "q-mb-sm", class: {
714        "q-mt-2xl": _vm.desktop,
715        "q-mt-md": _vm.tablet,
716        "q-mt-sm": _vm.mobile
717      } })], 1), _c("quick-order-button", { staticClass: "q-mt-sm" })];
718    }, proxy: true }], null, false, 4242451807) })];
719  }, proxy: true }], null, false, 1081010930) }, [_c("cart-items", { attrs: { "xsell": "", "bordered": "", "settings-icon-visible": "" } }), !_vm.quickOrderInProgress ? _c("ws-message", { staticClass: "error q-mt-md", attrs: { "path": "general" } }) : _vm._e(), _vm.isStandardWorkflow || _vm.cart.migrationPromotion.applicable ? _c("div", { staticClass: "row extra-settings", class: {
720    "q-mb-sm": _vm.cart.migrationPromotion.applicable,
721    "q-mt-3xl": _vm.desktop,
722    "q-mt-xl": _vm.tablet,
723    "q-mt-lg": _vm.mobile
724  } }, [_c("div", { staticClass: "col" }, [_c("h6", { class: _vm.mobile ? "q-mb-md" : "q-mb-lg" }, [_vm._v(" " + _vm._s(_vm.$t("cart.extra_settings.title")) + " "), _c("span", { staticClass: "text-normal text-small text-ws-base110" }, [_vm._v("(" + _vm._s(_vm.$t("uikit:general.optional")) + ")")]
724)]), _vm.isStandardWorkflow ? _c("ws-checkbox", { attrs: { "data-test": _vm.testNames.noteRevealCheckbox, "label": _vm.$t("cart.extra_settings.note.label") }, model: { value: _vm.noteReveal, callback: function($$v) {
725    _vm.noteReveal = $$v;
726  }, expression: "noteReveal" } }) : _vm._e(), _c("transition", { attrs: { "name": "slide-fade-vertical" } }, [_vm.noteReveal && _vm.isStandardWorkflow ? _c("div", { staticClass: "row q-pl-lg q-py-sm" }, [_c("div", { staticClass: "col" }, [_c("ws-input", { staticClass: "ws-textarea", attrs: { "type": "textarea", "data-test": _vm.testNames.noteInput, "autogrow": "", "placeholder": _vm.$t("cart.extra_settings.note.text"), "debounce": "600", "required": "" }, on: { "input": _vm.updateNote }, model: { value: _vm.note, callback: function($$v) {
727    _vm.note = $$v;
728  }, expression: "note" } }), _c("ws-message", { attrs: { "type": "alert", "path": "note" } })], 1)]) : _vm._e()])], 1)]) : _vm._e(), _vm.cart.migrationPromotion.applicable ? _c("migration-upload") : _vm._e()], 1) : _c("empty-cart");
729};
730var _sfc_staticRenderFns = [];
731var __component__ = /* @__PURE__ */ normalizeComponent(
732  CartView$1,
733  _sfc_render,
734  _sfc_staticRenderFns,
735  false,
736  null,
737  "3ed75db9"
738);
739const CartView2 = __component__.exports;
740export {
741  CartView2 as default,
742  testNames
743};
744//# sourceMappingURL=CartView-Cs27gtd8.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.