@snabcentr/common-lib 2.13.0 → 2.13.2

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.
@@ -4,6 +4,6 @@
4
4
  "name": "public-api",
5
5
  "src": "src/public-api.ts",
6
6
  "isEntry": true,
7
- "integrity": "sha384-tS7eh9lwqXKFrRXXT0E1I6HrhaJ+TRGP1fF1GhEC9APTtTrwdZSYrIWq8Rir66fL"
7
+ "integrity": "sha384-k94EE7cklvk/FVMCJL13IFGFYEzQOXIE7f4xFE3mVM7TnAnJELSek0MzJeuHx6/V"
8
8
  }
9
9
  }
@@ -1,4 +1,4 @@
1
- ## 2.13.0 (2026-07-21)
1
+ ## 2.13.2 (2026-07-22)
2
2
 
3
3
  No changes.
4
4
 
@@ -2,13 +2,13 @@ var Nr = Object.defineProperty;
2
2
  var Ur = (n, r, e) => r in n ? Nr(n, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[r] = e;
3
3
  var s = (n, r, e) => Ur(n, typeof r != "symbol" ? r + "" : r, e);
4
4
  import { jwtDecode as ur } from "jwt-decode";
5
- import { merge as he, isNil as $, isEmpty as re, noop as v, mapValues as pr, isArray as H, every as Fr, split as Hr, isString as a, constant as Mr, toUpper as Br, cloneDeep as jr, toLower as Gr, isFunction as Me, map as ye, forEach as zr, isDate as qe, isObject as Be, omitBy as hr } from "lodash-es";
5
+ import { merge as he, isNil as $, isEmpty as re, noop as v, mapValues as pr, isArray as H, every as Fr, split as Hr, isString as a, constant as Br, toUpper as Mr, cloneDeep as jr, toLower as Gr, isFunction as Be, map as ye, forEach as zr, isDate as qe, isObject as Me, omitBy as hr } from "lodash-es";
6
6
  import { objectToCamel as je, objectToSnake as Ye } from "ts-case-convert";
7
7
  import { defineStore as W } from "pinia";
8
8
  import { ref as y, markRaw as Wr, computed as R } from "vue";
9
9
  import { isAfter as Xe, parseISO as C, startOfToday as Ne, format as L, addBusinessDays as Jr, endOfTomorrow as Vr, startOfTomorrow as Er, endOfYesterday as Kr, startOfYesterday as Qr, endOfToday as Yr, endOfDay as Xr, startOfDay as Zr, addSeconds as et } from "date-fns";
10
10
  import rt, { CanceledError as tt } from "axios";
11
- class M {
11
+ class B {
12
12
  /**
13
13
  * Инициализирует экземпляр класса {@link JwtPayload}.
14
14
  *
@@ -107,11 +107,11 @@ class M {
107
107
  * @param jwtToken JWT-ключ доступа.
108
108
  */
109
109
  static getJwtPayload(r) {
110
- const e = ur(r), t = new M(je(e));
110
+ const e = ur(r), t = new B(je(e));
111
111
  return t.resourceAccess = e.resource_access, t;
112
112
  }
113
113
  }
114
- class Et extends M {
114
+ class Et extends B {
115
115
  /**
116
116
  * Инициализирует экземпляр класса {@link DetailedJwtPayload}.
117
117
  *
@@ -151,7 +151,7 @@ class Et extends M {
151
151
  * @param jwtToken JWT-ключ доступа.
152
152
  */
153
153
  static getJwtPayload(e) {
154
- return new M(je(ur(e)));
154
+ return new B(je(ur(e)));
155
155
  }
156
156
  }
157
157
  class st {
@@ -470,7 +470,7 @@ class Pe {
470
470
  }
471
471
  function Ze(n) {
472
472
  try {
473
- const r = M.getJwtPayload(n);
473
+ const r = B.getJwtPayload(n);
474
474
  return new Date(r.exp * 1e3);
475
475
  } catch {
476
476
  return;
@@ -492,7 +492,7 @@ const Q = W("common.auth_state_private", () => {
492
492
  ), r = y(void 0), e = y(void 0), t = Wr(/* @__PURE__ */ new Map());
493
493
  function i() {
494
494
  e.value = void 0, $(n.value) || n.value.then((o) => {
495
- const c = M.getJwtPayload(o);
495
+ const c = B.getJwtPayload(o);
496
496
  e.value = c.exp * 1e3 > Date.now() ? pr(c.resourceAccess, (u) => (u == null ? void 0 : u.roles) ?? []) : void 0;
497
497
  }).catch(v);
498
498
  }
@@ -543,7 +543,7 @@ const Q = W("common.auth_state_private", () => {
543
543
  function i(o) {
544
544
  const c = Q();
545
545
  !$(c.jwtToken) && $(c.userPermissions) && c.jwtToken.then((m) => {
546
- const f = M.getJwtPayload(m);
546
+ const f = B.getJwtPayload(m);
547
547
  c.userPermissions = f.exp * 1e3 > Date.now() ? pr(f.resourceAccess, (D) => (D == null ? void 0 : D.roles) ?? []) : void 0;
548
548
  }).catch(v);
549
549
  const u = H(o) ? o.join(" && ") : o;
@@ -631,7 +631,7 @@ class S extends J {
631
631
  this.name = (e == null ? void 0 : e.name) ?? "";
632
632
  }
633
633
  }
634
- class I extends S {
634
+ class _ extends S {
635
635
  /**
636
636
  * Инициализирует экземпляр класса {@link UserShortInfo}.
637
637
  *
@@ -682,7 +682,7 @@ class lt extends S {
682
682
  * Дата и время удаления.
683
683
  */
684
684
  s(this, "deletedAt");
685
- this.costCoefficient = (e == null ? void 0 : e.costCoefficient) ?? 0, this.isLowPriceAllowed = (e == null ? void 0 : e.isLowPriceAllowed) ?? !1, this.publishedAt = a(e == null ? void 0 : e.publishedAt) ? C(e.publishedAt) : e == null ? void 0 : e.publishedAt, this.description = (e == null ? void 0 : e.description) ?? void 0, this.percent = (e == null ? void 0 : e.percent) ?? 0, this.owner = new I(e == null ? void 0 : e.owner), this.deletedAt = a(e == null ? void 0 : e.deletedAt) ? C(e.deletedAt) : e == null ? void 0 : e.deletedAt;
685
+ this.costCoefficient = (e == null ? void 0 : e.costCoefficient) ?? 0, this.isLowPriceAllowed = (e == null ? void 0 : e.isLowPriceAllowed) ?? !1, this.publishedAt = a(e == null ? void 0 : e.publishedAt) ? C(e.publishedAt) : e == null ? void 0 : e.publishedAt, this.description = (e == null ? void 0 : e.description) ?? void 0, this.percent = (e == null ? void 0 : e.percent) ?? 0, this.owner = new _(e == null ? void 0 : e.owner), this.deletedAt = a(e == null ? void 0 : e.deletedAt) ? C(e.deletedAt) : e == null ? void 0 : e.deletedAt;
686
686
  }
687
687
  }
688
688
  class gr extends S {
@@ -716,7 +716,11 @@ class Z extends gr {
716
716
  * Дата и время создания шаблона.
717
717
  */
718
718
  s(this, "createdAt");
719
- this.description = (e == null ? void 0 : e.description) ?? "", this.createdAt = a(e == null ? void 0 : e.createdAt) ? C(e.createdAt) : (e == null ? void 0 : e.createdAt) ?? /* @__PURE__ */ new Date();
719
+ /**
720
+ * Данные о пользователе, создавшем шаблон прайс-листа.
721
+ */
722
+ s(this, "owner");
723
+ this.description = (e == null ? void 0 : e.description) ?? "", this.createdAt = a(e == null ? void 0 : e.createdAt) ? C(e.createdAt) : (e == null ? void 0 : e.createdAt) ?? /* @__PURE__ */ new Date(), this.owner = e != null && e.owner ? new _(e.owner) : void 0;
720
724
  }
721
725
  }
722
726
  var mr = /* @__PURE__ */ ((n) => (n.K0 = "k0", n.K1 = "k1", n.K2 = "k2", n.K3 = "k3", n.K4 = "k4", n.Retail = "retail", n))(mr || {});
@@ -744,7 +748,7 @@ class de extends w {
744
748
  * Возвращает значение справочника коэффициента розничной цены.
745
749
  */
746
750
  static getRetailPriceCoefficient() {
747
- return { id: -2, slug: mr.Retail, name: "Розн. цена", guid: "", isNewRec: Mr(!0) };
751
+ return { id: -2, slug: mr.Retail, name: "Розн. цена", guid: "", isNewRec: Br(!0) };
748
752
  }
749
753
  }
750
754
  class Ge {
@@ -988,7 +992,7 @@ class Ue extends yr {
988
992
  this.isPrimary = (e == null ? void 0 : e.isPrimary) ?? !1;
989
993
  }
990
994
  }
991
- class _ extends pt {
995
+ class I extends pt {
992
996
  /**
993
997
  * Инициализирует экземпляр класса {@link Product}.
994
998
  *
@@ -1089,7 +1093,7 @@ class _ extends pt {
1089
1093
  }
1090
1094
  }
1091
1095
  var ze = /* @__PURE__ */ ((n) => (n.Discount = "discount", n.PriceTemplate = "price_template", n.ClientPrice = "client_price", n.Product = "product", n))(ze || {});
1092
- class B extends _ {
1096
+ class M extends I {
1093
1097
  /**
1094
1098
  * Инициализирует экземпляр класса {@link ClientProduct}.
1095
1099
  *
@@ -1152,7 +1156,7 @@ class ve extends Ue {
1152
1156
  * Список коэффициентов пересчёта из валют в рубли в формате ключ значение.
1153
1157
  */
1154
1158
  s(this, "currencyRates");
1155
- this.isHidden = (e == null ? void 0 : e.isHidden) ?? !1, this.parentCategoryId = e == null ? void 0 : e.parentCategoryId, this.properties = e == null ? void 0 : e.properties, this.type = "category", this.currencyRates = e != null && e.currencyRates ? Object.fromEntries(Object.entries(e.currencyRates).map(([t, i]) => [Br(t), i])) : void 0;
1159
+ this.isHidden = (e == null ? void 0 : e.isHidden) ?? !1, this.parentCategoryId = e == null ? void 0 : e.parentCategoryId, this.properties = e == null ? void 0 : e.properties, this.type = "category", this.currencyRates = e != null && e.currencyRates ? Object.fromEntries(Object.entries(e.currencyRates).map(([t, i]) => [Mr(t), i])) : void 0;
1156
1160
  }
1157
1161
  }
1158
1162
  class wr extends J {
@@ -1231,7 +1235,7 @@ class wr extends J {
1231
1235
  * @inheritDoc
1232
1236
  */
1233
1237
  s(this, "replacementId");
1234
- this.product = new B(e.product), this.quantity = e.quantity ?? 0, this.marker = e.marker, this.category = e.category ?? new ve(), this.currency = e.currency ? new x(e.currency) : void 0, this.height = e.height, this.length = e.length, this.width = e.width, this.configurator = e.configurator, this.configuratorParams = e.configuratorParams && jr(e.configuratorParams), this.isAdditionalSale = e.isAdditionalSale, this.creator = e.creator && new I(e.creator), this.isRemoved = e.isRemoved, this.ord = e.ord, this.onOrder = e.onOrder, this.originalId = e.originalId, this.replacementId = e.replacementId;
1238
+ this.product = new M(e.product), this.quantity = e.quantity ?? 0, this.marker = e.marker, this.category = e.category ?? new ve(), this.currency = e.currency ? new x(e.currency) : void 0, this.height = e.height, this.length = e.length, this.width = e.width, this.configurator = e.configurator, this.configuratorParams = e.configuratorParams && jr(e.configuratorParams), this.isAdditionalSale = e.isAdditionalSale, this.creator = e.creator && new _(e.creator), this.isRemoved = e.isRemoved, this.ord = e.ord, this.onOrder = e.onOrder, this.originalId = e.originalId, this.replacementId = e.replacementId;
1235
1239
  }
1236
1240
  }
1237
1241
  let vr = class extends wr {
@@ -1723,7 +1727,7 @@ class N extends ve {
1723
1727
  * Список продуктов категории.
1724
1728
  */
1725
1729
  s(this, "products");
1726
- this.categories = (t = e == null ? void 0 : e.categories) == null ? void 0 : t.map((o) => new N(o)), this.products = (i = e == null ? void 0 : e.products) == null ? void 0 : i.map((o) => new _(o));
1730
+ this.categories = (t = e == null ? void 0 : e.categories) == null ? void 0 : t.map((o) => new N(o)), this.products = (i = e == null ? void 0 : e.products) == null ? void 0 : i.map((o) => new I(o));
1727
1731
  }
1728
1732
  }
1729
1733
  class ar {
@@ -1890,7 +1894,7 @@ class Re extends ft {
1890
1894
  * Список продуктов категории.
1891
1895
  */
1892
1896
  s(this, "products");
1893
- this.categories = (t = e == null ? void 0 : e.categories) == null ? void 0 : t.map((o) => new Re(o)), this.products = (i = e == null ? void 0 : e.products) == null ? void 0 : i.map((o) => new B(o));
1897
+ this.categories = (t = e == null ? void 0 : e.categories) == null ? void 0 : t.map((o) => new Re(o)), this.products = (i = e == null ? void 0 : e.products) == null ? void 0 : i.map((o) => new M(o));
1894
1898
  }
1895
1899
  }
1896
1900
  class Pr {
@@ -2108,7 +2112,7 @@ class _e extends Pr {
2108
2112
  * Базовые данные о продукте.
2109
2113
  */
2110
2114
  s(this, "product");
2111
- this.product = new _(e == null ? void 0 : e.product);
2115
+ this.product = new I(e == null ? void 0 : e.product);
2112
2116
  }
2113
2117
  }
2114
2118
  class Dr extends w {
@@ -2192,6 +2196,10 @@ class Yt {
2192
2196
  * Описание шаблона прайс-листа.
2193
2197
  */
2194
2198
  s(this, "description");
2199
+ /**
2200
+ * ФИО автора шаблона прайс-листа.
2201
+ */
2202
+ s(this, "ownerName");
2195
2203
  /**
2196
2204
  * Период создания.
2197
2205
  */
@@ -2200,7 +2208,7 @@ class Yt {
2200
2208
  * Период изменения.
2201
2209
  */
2202
2210
  s(this, "updatedAt", new A());
2203
- this.id = r == null ? void 0 : r.id, this.name = r == null ? void 0 : r.name, this.description = r == null ? void 0 : r.description, this.createdAt = new A(r == null ? void 0 : r.createdAt), this.updatedAt = new A(r == null ? void 0 : r.updatedAt);
2211
+ this.id = r == null ? void 0 : r.id, this.name = r == null ? void 0 : r.name, this.description = r == null ? void 0 : r.description, this.ownerName = r == null ? void 0 : r.ownerName, this.createdAt = new A(r == null ? void 0 : r.createdAt), this.updatedAt = new A(r == null ? void 0 : r.updatedAt);
2204
2212
  }
2205
2213
  /**
2206
2214
  * Выполняет сброс указанного фильтра в значение по умолчанию.
@@ -2212,6 +2220,7 @@ class Yt {
2212
2220
  case "id":
2213
2221
  case "name":
2214
2222
  case "description":
2223
+ case "ownerName":
2215
2224
  this[r] = void 0;
2216
2225
  break;
2217
2226
  case "createdAt":
@@ -2233,7 +2242,7 @@ class Yt {
2233
2242
  return Object.keys(this).forEach((c) => {
2234
2243
  const u = this[c];
2235
2244
  // eslint-disable-next-line prettier/prettier
2236
- $(u) || a(u) && u.trim().length === 0 || Me(u.isNewRec) && u.isNewRec() || (r[c] = u);
2245
+ $(u) || a(u) && u.trim().length === 0 || Be(u.isNewRec) && u.isNewRec() || (r[c] = u);
2237
2246
  }), !((e = r == null ? void 0 : r.createdAt) != null && e.from) && !((t = r == null ? void 0 : r.createdAt) != null && t.to) && delete r.createdAt, !((i = r == null ? void 0 : r.updatedAt) != null && i.from) && !((o = r == null ? void 0 : r.updatedAt) != null && o.to) && delete r.updatedAt, r;
2238
2247
  }
2239
2248
  }
@@ -2449,7 +2458,7 @@ class Zt extends h {
2449
2458
  price_coefficient_id: (i = t.coefficient) == null ? void 0 : i.id,
2450
2459
  increase_percent: t.value
2451
2460
  },
2452
- (o) => new B(o.data)
2461
+ (o) => new M(o.data)
2453
2462
  );
2454
2463
  }
2455
2464
  /**
@@ -2461,7 +2470,7 @@ class Zt extends h {
2461
2470
  * @see /doc/api/internal#/operations/api_internal_client_price_products_remove
2462
2471
  */
2463
2472
  removeProductPrice(r, e) {
2464
- return this.delete(`/internal/clients/${r}/price/products/${e}`, (t) => new B(t.data));
2473
+ return this.delete(`/internal/clients/${r}/price/products/${e}`, (t) => new M(t.data));
2465
2474
  }
2466
2475
  /**
2467
2476
  * Добавляет указанный продукт в список товаров для дополнительных продаж.
@@ -2676,7 +2685,7 @@ class rs extends h {
2676
2685
  showHidden: t,
2677
2686
  withPriceCoefficients: e
2678
2687
  },
2679
- (i) => ye(i.data, (o) => new _(o))
2688
+ (i) => ye(i.data, (o) => new I(o))
2680
2689
  );
2681
2690
  }
2682
2691
  /**
@@ -2718,7 +2727,7 @@ class ts extends h {
2718
2727
  * @see /doc/api/internal#/Каталог/api_internal_catalog_products_get
2719
2728
  */
2720
2729
  getProductData(r, e = !1) {
2721
- return this.get(`/internal/catalog/products/${r}`, { withPriceCoefficients: e }, (t) => new _(t.data));
2730
+ return this.get(`/internal/catalog/products/${r}`, { withPriceCoefficients: e }, (t) => new I(t.data));
2722
2731
  }
2723
2732
  /**
2724
2733
  * Возвращает публичные данные об указанном продукте.
@@ -2726,7 +2735,7 @@ class ts extends h {
2726
2735
  * @param productId Идентификатор продукта.
2727
2736
  */
2728
2737
  getPublicProductData(r) {
2729
- return this.get(`/public/catalog/products/${r}`, {}, (e) => new _(e.data));
2738
+ return this.get(`/public/catalog/products/${r}`, {}, (e) => new I(e.data));
2730
2739
  }
2731
2740
  /**
2732
2741
  * Возвращает данные о коэффициентах цен для указанного продукта.
@@ -2751,7 +2760,7 @@ class ts extends h {
2751
2760
  publicSimpleSearch(r, e = 10) {
2752
2761
  return new Promise((t, i) => {
2753
2762
  this.get(`/public/catalog/search/simple?limit=${e}&term=${r}`).then((o) => {
2754
- t(o.products.map((c) => new _(c)));
2763
+ t(o.products.map((c) => new I(c)));
2755
2764
  }).catch((o) => {
2756
2765
  i(o);
2757
2766
  });
@@ -2816,7 +2825,7 @@ class ss extends h {
2816
2825
  showHidden: i,
2817
2826
  withPriceCoefficients: t
2818
2827
  },
2819
- (o) => ye(o.data, (c) => new B(c))
2828
+ (o) => ye(o.data, (c) => new M(c))
2820
2829
  );
2821
2830
  }
2822
2831
  }
@@ -2837,7 +2846,7 @@ class is extends h {
2837
2846
  clientId: e,
2838
2847
  withPriceCoefficients: t
2839
2848
  },
2840
- (i) => new B(i.data)
2849
+ (i) => new M(i.data)
2841
2850
  );
2842
2851
  }
2843
2852
  }
@@ -2873,7 +2882,7 @@ class tr {
2873
2882
  field: this.field,
2874
2883
  op: this.op
2875
2884
  };
2876
- return qe(this.value) ? e.value = L(this.value, r) : Be(this.value) ? e.value = {
2885
+ return qe(this.value) ? e.value = L(this.value, r) : Me(this.value) ? e.value = {
2877
2886
  from: this.value.from ? L(this.value.from, r) : null,
2878
2887
  to: this.value.to ? L(this.value.to, r) : null
2879
2888
  } : e.value = this.value, e;
@@ -2909,7 +2918,7 @@ class j {
2909
2918
  toPrimitive() {
2910
2919
  return {
2911
2920
  groupOp: this.groupOp,
2912
- filters: this.filters.map((r) => r instanceof tr && Me(r.toPrimitive) ? r.toPrimitive() : r),
2921
+ filters: this.filters.map((r) => r instanceof tr && Be(r.toPrimitive) ? r.toPrimitive() : r),
2913
2922
  groups: this.groups.map((r) => r instanceof j ? r.toPrimitive() : r)
2914
2923
  };
2915
2924
  }
@@ -3649,7 +3658,7 @@ class ls extends h {
3649
3658
  showHidden: i,
3650
3659
  withPriceCoefficients: t
3651
3660
  },
3652
- (o) => ye(o.data, (c) => new _(c))
3661
+ (o) => ye(o.data, (c) => new I(c))
3653
3662
  );
3654
3663
  }
3655
3664
  }
@@ -3845,7 +3854,7 @@ class Ar extends dr {
3845
3854
  */
3846
3855
  s(this, "updater");
3847
3856
  if (e) {
3848
- if (this.opf = new z(e.opf), this.comment = e.comment, this.alternativeName = e.alternativeName, this.createdAt = a(e == null ? void 0 : e.createdAt) ? C(e.createdAt) : e.createdAt, this.creator = e.creator ? new I(e.creator) : void 0, this.updater = e.updater ? new I(e.updater) : void 0, e.partnerGroup && (this.partnerGroup = new se(e.partnerGroup)), e.contacts) {
3857
+ if (this.opf = new z(e.opf), this.comment = e.comment, this.alternativeName = e.alternativeName, this.createdAt = a(e == null ? void 0 : e.createdAt) ? C(e.createdAt) : e.createdAt, this.creator = e.creator ? new _(e.creator) : void 0, this.updater = e.updater ? new _(e.updater) : void 0, e.partnerGroup && (this.partnerGroup = new se(e.partnerGroup)), e.contacts) {
3849
3858
  const t = [];
3850
3859
  e.contacts.forEach((i) => {
3851
3860
  t.push(new G(i));
@@ -4077,7 +4086,7 @@ class Qe {
4077
4086
  return Object.keys(this).forEach((e) => {
4078
4087
  const t = this[e];
4079
4088
  $(t) || // eslint-disable-next-line prettier/prettier,lodash/prefer-lodash-method
4080
- a(t) && t.trim().length === 0 || Me(t.isNewRec) && t.isNewRec() || (r[e] = t);
4089
+ a(t) && t.trim().length === 0 || Be(t.isNewRec) && t.isNewRec() || (r[e] = t);
4081
4090
  }), r;
4082
4091
  }
4083
4092
  }
@@ -4274,7 +4283,7 @@ class kr extends J {
4274
4283
  * @inheritDoc
4275
4284
  */
4276
4285
  s(this, "creator");
4277
- this.createdAt = a(e == null ? void 0 : e.createdAt) ? C(e.createdAt) : (e == null ? void 0 : e.createdAt) ?? /* @__PURE__ */ new Date(), this.creator = new I(e == null ? void 0 : e.creator);
4286
+ this.createdAt = a(e == null ? void 0 : e.createdAt) ? C(e.createdAt) : (e == null ? void 0 : e.createdAt) ?? /* @__PURE__ */ new Date(), this.creator = new _(e == null ? void 0 : e.creator);
4278
4287
  }
4279
4288
  }
4280
4289
  class at extends S {
@@ -5128,7 +5137,7 @@ class gs extends h {
5128
5137
  const o = this.get(
5129
5138
  `internal/catalog/categories/${r.id}/configurators/${(c = r.properties) == null ? void 0 : c.configurator}/product`,
5130
5139
  { params: t, client_id: e },
5131
- (u) => new _(u.data)
5140
+ (u) => new I(u.data)
5132
5141
  );
5133
5142
  return o.catch((u) => {
5134
5143
  this.errorResponseHandler(u, i);
@@ -5545,7 +5554,7 @@ class Ir extends kr {
5545
5554
  date: a((u = e == null ? void 0 : e.delivery) == null ? void 0 : u.date) ? C(e.delivery.date) : ((p = e == null ? void 0 : e.delivery) == null ? void 0 : p.date) ?? /* @__PURE__ */ new Date(),
5546
5555
  address: (m = e == null ? void 0 : e.delivery) != null && m.address ? new pe(e.delivery.address) : void 0,
5547
5556
  warehouse: (f = e == null ? void 0 : e.delivery) != null && f.warehouse ? new we(e.delivery.warehouse) : void 0
5548
- }, this.attachedUser = e != null && e.attachedUser ? new I(e == null ? void 0 : e.attachedUser) : void 0, this.status = new $e(e == null ? void 0 : e.status), this.statusDetail = e != null && e.statusDetail ? new w(e.statusDetail) : void 0, this.salesDirection = new q(e == null ? void 0 : e.salesDirection), this.attachedAt = a(e == null ? void 0 : e.attachedAt) ? C(e.attachedAt) : e == null ? void 0 : e.attachedAt, this.isOnOrder = (e == null ? void 0 : e.isOnOrder) ?? !1, this.isNotInStock = (e == null ? void 0 : e.isNotInStock) ?? !1, this.sum = (e == null ? void 0 : e.sum) ?? 0, this.isLargeOrder = (e == null ? void 0 : e.isLargeOrder) ?? !1;
5557
+ }, this.attachedUser = e != null && e.attachedUser ? new _(e == null ? void 0 : e.attachedUser) : void 0, this.status = new $e(e == null ? void 0 : e.status), this.statusDetail = e != null && e.statusDetail ? new w(e.statusDetail) : void 0, this.salesDirection = new q(e == null ? void 0 : e.salesDirection), this.attachedAt = a(e == null ? void 0 : e.attachedAt) ? C(e.attachedAt) : e == null ? void 0 : e.attachedAt, this.isOnOrder = (e == null ? void 0 : e.isOnOrder) ?? !1, this.isNotInStock = (e == null ? void 0 : e.isNotInStock) ?? !1, this.sum = (e == null ? void 0 : e.sum) ?? 0, this.isLargeOrder = (e == null ? void 0 : e.isLargeOrder) ?? !1;
5549
5558
  }
5550
5559
  }
5551
5560
  class dt extends wr {
@@ -5605,7 +5614,7 @@ class dt extends wr {
5605
5614
  * Продукт, которым заменена текущая запись.
5606
5615
  */
5607
5616
  s(this, "replacement");
5608
- this.product = new B(e.product), this.currency = new x(e.currency), this.cost = e.cost, this.costOne = e.costOne, this.costOneRub = e.costOneRub, this.costRub = e.costRub, this.logicGroupId = e.logicGroupId, this.salesDirection = e.salesDirection, this.specificationImgUrl = e.specificationImgUrl, this.sawing = e.sawing, t && (this.replacement = t, this.quantity !== t.quantity && this.changedFields.push("quantity"), this.length !== t.length && this.changedFields.push("length"));
5617
+ this.product = new M(e.product), this.currency = new x(e.currency), this.cost = e.cost, this.costOne = e.costOne, this.costOneRub = e.costOneRub, this.costRub = e.costRub, this.logicGroupId = e.logicGroupId, this.salesDirection = e.salesDirection, this.specificationImgUrl = e.specificationImgUrl, this.sawing = e.sawing, t && (this.replacement = t, this.quantity !== t.quantity && this.changedFields.push("quantity"), this.length !== t.length && this.changedFields.push("length"));
5609
5618
  }
5610
5619
  }
5611
5620
  class b extends Ir {
@@ -5848,6 +5857,17 @@ class Cs extends Ce {
5848
5857
  deleteOfferProduct(r, e) {
5849
5858
  return this.delete(`/internal/orders/offers/${r}/products/${e}`, (t) => new X(t.data));
5850
5859
  }
5860
+ /**
5861
+ * Возвращает содержимое печатной формы заказа-черновика в формате HTML.
5862
+ *
5863
+ * @param offerId Идентификатор записи заказа-черновика.
5864
+ * @param recipientText Текст блока «Кому» в документе.
5865
+ *
5866
+ * @see /doc/api/internal#/Заказы/api_internal_order_commercial_offer_view_html
5867
+ */
5868
+ getOfferHtml(r, e) {
5869
+ return this.get(`/internal/orders/offers/${r}/view`, e ? { recipientText: e } : {}, (t) => new Blob([t.data], { type: "text/html" }));
5870
+ }
5851
5871
  /**
5852
5872
  * Возвращает файл заказа-черновика в формате PDF.
5853
5873
  *
@@ -6048,7 +6068,7 @@ class Rs extends Qe {
6048
6068
  * @inheritDoc
6049
6069
  */
6050
6070
  s(this, "onlyMyRegions");
6051
- this.attachedUsers = (t = e == null ? void 0 : e.attachedUsers) == null ? void 0 : t.map((u) => "isActive" in u ? new ae(u) : new Or(u)), this.clientSearchTerm = e == null ? void 0 : e.clientSearchTerm, this.client = e != null && e.client ? new V(e.client) : void 0, this.contragent = e == null ? void 0 : e.contragent, this.createdAt = new A(e == null ? void 0 : e.createdAt), this.creator = e != null && e.creator ? new I(e.creator) : void 0, this.deliveryDate = new A(e == null ? void 0 : e.deliveryDate), this.deliveryAddressSearch = e == null ? void 0 : e.deliveryAddressSearch, this.clientCities = (i = e == null ? void 0 : e.clientCities) == null ? void 0 : i.map((u) => new Ae(u)), this.id = e == null ? void 0 : e.id, this.isApproved = e == null ? void 0 : e.isApproved, this.isNotInStock = e == null ? void 0 : e.isNotInStock, this.isOnOrder = e == null ? void 0 : e.isOnOrder, this.isLargeOrder = e == null ? void 0 : e.isLargeOrder, this.attachedAt = new A(e == null ? void 0 : e.attachedAt), this.salesDirections = (o = e == null ? void 0 : e.salesDirections) == null ? void 0 : o.map((u) => new q(u)), this.status = e == null ? void 0 : e.status, this.statusDetail = e == null ? void 0 : e.statusDetail, this.deliveryType = e != null && e.deliveryType ? new F(e.deliveryType) : void 0, this.paymentType = e != null && e.paymentType ? new xr(e.paymentType) : void 0, this.warehouses = (c = e == null ? void 0 : e.warehouses) == null ? void 0 : c.map((u) => new we(u)), this.isToProcess = e == null ? void 0 : e.isToProcess;
6071
+ this.attachedUsers = (t = e == null ? void 0 : e.attachedUsers) == null ? void 0 : t.map((u) => "isActive" in u ? new ae(u) : new Or(u)), this.clientSearchTerm = e == null ? void 0 : e.clientSearchTerm, this.client = e != null && e.client ? new V(e.client) : void 0, this.contragent = e == null ? void 0 : e.contragent, this.createdAt = new A(e == null ? void 0 : e.createdAt), this.creator = e != null && e.creator ? new _(e.creator) : void 0, this.deliveryDate = new A(e == null ? void 0 : e.deliveryDate), this.deliveryAddressSearch = e == null ? void 0 : e.deliveryAddressSearch, this.clientCities = (i = e == null ? void 0 : e.clientCities) == null ? void 0 : i.map((u) => new Ae(u)), this.id = e == null ? void 0 : e.id, this.isApproved = e == null ? void 0 : e.isApproved, this.isNotInStock = e == null ? void 0 : e.isNotInStock, this.isOnOrder = e == null ? void 0 : e.isOnOrder, this.isLargeOrder = e == null ? void 0 : e.isLargeOrder, this.attachedAt = new A(e == null ? void 0 : e.attachedAt), this.salesDirections = (o = e == null ? void 0 : e.salesDirections) == null ? void 0 : o.map((u) => new q(u)), this.status = e == null ? void 0 : e.status, this.statusDetail = e == null ? void 0 : e.statusDetail, this.deliveryType = e != null && e.deliveryType ? new F(e.deliveryType) : void 0, this.paymentType = e != null && e.paymentType ? new xr(e.paymentType) : void 0, this.warehouses = (c = e == null ? void 0 : e.warehouses) == null ? void 0 : c.map((u) => new we(u)), this.isToProcess = e == null ? void 0 : e.isToProcess;
6052
6072
  }
6053
6073
  /**
6054
6074
  * @inheritDoc
@@ -6120,7 +6140,7 @@ class $t {
6120
6140
  * @inheritDoc
6121
6141
  */
6122
6142
  s(this, "createdAt");
6123
- this.user = new I(r == null ? void 0 : r.user), this.status = new $e(r == null ? void 0 : r.status), this.statusDetail = r != null && r.statusDetail ? new w(r.statusDetail) : void 0, this.createdAt = a(r == null ? void 0 : r.createdAt) ? C(r.createdAt) : (r == null ? void 0 : r.createdAt) ?? /* @__PURE__ */ new Date();
6143
+ this.user = new _(r == null ? void 0 : r.user), this.status = new $e(r == null ? void 0 : r.status), this.statusDetail = r != null && r.statusDetail ? new w(r.statusDetail) : void 0, this.createdAt = a(r == null ? void 0 : r.createdAt) ? C(r.createdAt) : (r == null ? void 0 : r.createdAt) ?? /* @__PURE__ */ new Date();
6124
6144
  }
6125
6145
  }
6126
6146
  class Ds extends Ce {
@@ -6532,7 +6552,7 @@ class Oe {
6532
6552
  * Источник клиентской цены.
6533
6553
  */
6534
6554
  s(this, "source");
6535
- this.client = new V(r == null ? void 0 : r.client), this.product = new _(r == null ? void 0 : r.product), this.cost = (r == null ? void 0 : r.cost) ?? 0, this.costCoefficient = (r == null ? void 0 : r.costCoefficient) ?? 0, this.source = (r == null ? void 0 : r.source) ?? ze.Product;
6555
+ this.client = new V(r == null ? void 0 : r.client), this.product = new I(r == null ? void 0 : r.product), this.cost = (r == null ? void 0 : r.cost) ?? 0, this.costCoefficient = (r == null ? void 0 : r.costCoefficient) ?? 0, this.source = (r == null ? void 0 : r.source) ?? ze.Product;
6536
6556
  }
6537
6557
  }
6538
6558
  const xe = (n) => {
@@ -6546,7 +6566,7 @@ const xe = (n) => {
6546
6566
  salesDirections: (o = n.salesDirections) == null ? void 0 : o.map((c) => c.id),
6547
6567
  hideNotActive: n.hideNotActive
6548
6568
  },
6549
- (c) => $(c) || (H(c) || Be(c)) && re(c)
6569
+ (c) => $(c) || (H(c) || Me(c)) && re(c)
6550
6570
  ) : {};
6551
6571
  }, or = (n) => {
6552
6572
  const r = {};
@@ -6660,7 +6680,7 @@ class Tt {
6660
6680
  * @inheritDoc
6661
6681
  */
6662
6682
  s(this, "currency");
6663
- this.cost = r.cost ?? 0, this.isLowCost = r.isLowCost ?? !1, this.isRetail = r.isRetail ?? !1, this.costDate = a(r.costDate) ? C(r.costDate) : r.costDate ?? /* @__PURE__ */ new Date(), this.discountName = r.discountName, this.priceTemplateName = r.priceTemplateName, this.product = r.product ? new ge(r.product) : void 0, this.client = r.client ? new I(r.client) : void 0, this.executor = r.executor ? new I(r.executor) : void 0, this.currency = r.currency ? new x(r.currency) : void 0;
6683
+ this.cost = r.cost ?? 0, this.isLowCost = r.isLowCost ?? !1, this.isRetail = r.isRetail ?? !1, this.costDate = a(r.costDate) ? C(r.costDate) : r.costDate ?? /* @__PURE__ */ new Date(), this.discountName = r.discountName, this.priceTemplateName = r.priceTemplateName, this.product = r.product ? new ge(r.product) : void 0, this.client = r.client ? new _(r.client) : void 0, this.executor = r.executor ? new _(r.executor) : void 0, this.currency = r.currency ? new x(r.currency) : void 0;
6664
6684
  }
6665
6685
  }
6666
6686
  class bt extends ge {
@@ -6695,7 +6715,7 @@ class As extends h {
6695
6715
  to: qe((u = r.costDate) == null ? void 0 : u.to) ? L(r.costDate.to, e) : (p = r.costDate) == null ? void 0 : p.to
6696
6716
  }
6697
6717
  }),
6698
- (f) => $(f) || (H(f) || Be(f)) && re(f)
6718
+ (f) => $(f) || (H(f) || Me(f)) && re(f)
6699
6719
  ), i = ((m = r.product) == null ? void 0 : m[0]) ?? 0;
6700
6720
  return delete t.product, this.get(`/internal/price/products/${i}/history`, t).then((f) => [
6701
6721
  new bt(he(f[0], { history: f }))
@@ -7473,7 +7493,7 @@ export {
7473
7493
  O as ClientDataProvider,
7474
7494
  Zt as ClientPriceProvider,
7475
7495
  es as ClientPriceTemplateProvider,
7476
- B as ClientProduct,
7496
+ M as ClientProduct,
7477
7497
  ss as ClientProductCategoryDataProvider,
7478
7498
  is as ClientProductDataProvider,
7479
7499
  V as ClientShortInfo,
@@ -7518,7 +7538,7 @@ export {
7518
7538
  h as HttpRequester,
7519
7539
  J as Identity,
7520
7540
  ht as Image,
7521
- M as JwtPayload,
7541
+ B as JwtPayload,
7522
7542
  ae as Manager,
7523
7543
  Je as ManagerCommon,
7524
7544
  vs as ManagerDataFactory,
@@ -7566,7 +7586,7 @@ export {
7566
7586
  ue as PricingRole,
7567
7587
  os as PricingRoleProvider,
7568
7588
  Ue as PrimaryCatalogableItem,
7569
- _ as Product,
7589
+ I as Product,
7570
7590
  rs as ProductCategoryDataProvider,
7571
7591
  ts as ProductDataProvider,
7572
7592
  xt as ProductFileType,
@@ -7605,7 +7625,7 @@ export {
7605
7625
  Rr as UserCommonInfo,
7606
7626
  Ft as UserDataProvider,
7607
7627
  Cr as UserPricingRole,
7608
- I as UserShortInfo,
7628
+ _ as UserShortInfo,
7609
7629
  Nt as UserTypeEnum,
7610
7630
  hs as VersionConfig,
7611
7631
  we as Warehouse,