@snabcentr/common-lib 3.13.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (653) hide show
  1. package/dist/manifest.json +1 -1
  2. package/dist/readme.md +2 -0
  3. package/dist/release_notes.tmp +0 -6
  4. package/dist/sc-common-lib.js +3104 -9910
  5. package/dist/sc-common-lib.js.map +1 -1
  6. package/dist/sc-common-lib.umd.cjs +1 -1
  7. package/dist/sc-common-lib.umd.cjs.map +1 -1
  8. package/dist/src/blog/classes/blog-post-media-file.d.ts +1 -1
  9. package/dist/src/blog/classes/blog-post-media-file.d.ts.map +1 -1
  10. package/dist/src/blog/classes/blog-posts-list-filters.d.ts +1 -1
  11. package/dist/src/blog/classes/blog-posts-list-filters.d.ts.map +1 -1
  12. package/dist/src/blog/interfaces/i-blog-post-media-file.d.ts +1 -1
  13. package/dist/src/blog/interfaces/i-blog-post-media-file.d.ts.map +1 -1
  14. package/dist/src/blog/interfaces/i-blog-posts-list-filters.d.ts +1 -1
  15. package/dist/src/blog/interfaces/i-blog-posts-list-filters.d.ts.map +1 -1
  16. package/dist/src/blog/providers/blog-provider.d.ts +1 -2
  17. package/dist/src/blog/providers/blog-provider.d.ts.map +1 -1
  18. package/dist/src/cart/classes/order-item.d.ts +1 -1
  19. package/dist/src/cart/classes/order-item.d.ts.map +1 -1
  20. package/dist/src/cart/interfaces/i-base-cart-validation-result.d.ts +1 -1
  21. package/dist/src/cart/interfaces/i-base-cart-validation-result.d.ts.map +1 -1
  22. package/dist/src/cart/interfaces/i-order-item-base.d.ts +1 -2
  23. package/dist/src/cart/interfaces/i-order-item-base.d.ts.map +1 -1
  24. package/dist/src/cart/providers/cart-provider.d.ts +1 -2
  25. package/dist/src/cart/providers/cart-provider.d.ts.map +1 -1
  26. package/dist/src/catalog/classes/category-pricing-rule.d.ts +1 -1
  27. package/dist/src/catalog/classes/category-pricing-rule.d.ts.map +1 -1
  28. package/dist/src/catalog/classes/client-price-catalogable-item.d.ts.map +1 -1
  29. package/dist/src/catalog/classes/client-product.d.ts +1 -1
  30. package/dist/src/catalog/classes/client-product.d.ts.map +1 -1
  31. package/dist/src/catalog/classes/discount-short-info.d.ts.map +1 -1
  32. package/dist/src/catalog/classes/index.d.ts +0 -1
  33. package/dist/src/catalog/classes/index.d.ts.map +1 -1
  34. package/dist/src/catalog/classes/internal/base/base-client-category.d.ts +1 -1
  35. package/dist/src/catalog/classes/internal/base/base-client-category.d.ts.map +1 -1
  36. package/dist/src/catalog/classes/price-catalogable-item.d.ts +1 -1
  37. package/dist/src/catalog/classes/price-catalogable-item.d.ts.map +1 -1
  38. package/dist/src/catalog/classes/price-template.d.ts +1 -1
  39. package/dist/src/catalog/classes/price-template.d.ts.map +1 -1
  40. package/dist/src/catalog/classes/pricing-role.d.ts +1 -1
  41. package/dist/src/catalog/classes/pricing-role.d.ts.map +1 -1
  42. package/dist/src/catalog/classes/product-price-coefficient.d.ts +1 -1
  43. package/dist/src/catalog/classes/product-price-coefficient.d.ts.map +1 -1
  44. package/dist/src/catalog/classes/product.d.ts +1 -1
  45. package/dist/src/catalog/classes/product.d.ts.map +1 -1
  46. package/dist/src/catalog/classes/property.d.ts +1 -2
  47. package/dist/src/catalog/classes/property.d.ts.map +1 -1
  48. package/dist/src/catalog/classes/stock-count.d.ts +1 -1
  49. package/dist/src/catalog/classes/stock-count.d.ts.map +1 -1
  50. package/dist/src/catalog/classes/templates-list-filters.d.ts +1 -1
  51. package/dist/src/catalog/classes/templates-list-filters.d.ts.map +1 -1
  52. package/dist/src/catalog/enums/index.d.ts +0 -2
  53. package/dist/src/catalog/enums/index.d.ts.map +1 -1
  54. package/dist/src/catalog/interfaces/i-category-pricing-rule.d.ts +1 -1
  55. package/dist/src/catalog/interfaces/i-category-pricing-rule.d.ts.map +1 -1
  56. package/dist/src/catalog/interfaces/i-client-price-catalogable-item.d.ts +1 -1
  57. package/dist/src/catalog/interfaces/i-client-price-catalogable-item.d.ts.map +1 -1
  58. package/dist/src/catalog/interfaces/i-client-product.d.ts +1 -1
  59. package/dist/src/catalog/interfaces/i-client-product.d.ts.map +1 -1
  60. package/dist/src/catalog/interfaces/i-price-catalogable-item.d.ts +1 -1
  61. package/dist/src/catalog/interfaces/i-price-catalogable-item.d.ts.map +1 -1
  62. package/dist/src/catalog/interfaces/i-price-template-create-data.d.ts +1 -1
  63. package/dist/src/catalog/interfaces/i-price-template-create-data.d.ts.map +1 -1
  64. package/dist/src/catalog/interfaces/i-price-template.d.ts +1 -1
  65. package/dist/src/catalog/interfaces/i-price-template.d.ts.map +1 -1
  66. package/dist/src/catalog/interfaces/i-price-update-data.d.ts +1 -1
  67. package/dist/src/catalog/interfaces/i-price-update-data.d.ts.map +1 -1
  68. package/dist/src/catalog/interfaces/i-pricing-role-create-data.d.ts +1 -1
  69. package/dist/src/catalog/interfaces/i-pricing-role-create-data.d.ts.map +1 -1
  70. package/dist/src/catalog/interfaces/i-pricing-role.d.ts +1 -1
  71. package/dist/src/catalog/interfaces/i-pricing-role.d.ts.map +1 -1
  72. package/dist/src/catalog/interfaces/i-product-price-coefficient.d.ts +1 -1
  73. package/dist/src/catalog/interfaces/i-product-price-coefficient.d.ts.map +1 -1
  74. package/dist/src/catalog/interfaces/i-product.d.ts +1 -1
  75. package/dist/src/catalog/interfaces/i-product.d.ts.map +1 -1
  76. package/dist/src/catalog/interfaces/i-property.d.ts +1 -2
  77. package/dist/src/catalog/interfaces/i-property.d.ts.map +1 -1
  78. package/dist/src/catalog/interfaces/i-stock-count.d.ts +1 -1
  79. package/dist/src/catalog/interfaces/i-stock-count.d.ts.map +1 -1
  80. package/dist/src/catalog/interfaces/i-templates-list-filters.d.ts +1 -1
  81. package/dist/src/catalog/interfaces/i-templates-list-filters.d.ts.map +1 -1
  82. package/dist/src/catalog/interfaces/index.d.ts +0 -1
  83. package/dist/src/catalog/interfaces/index.d.ts.map +1 -1
  84. package/dist/src/catalog/interfaces/internal/base/i-base-client-category.d.ts +1 -1
  85. package/dist/src/catalog/interfaces/internal/base/i-base-client-category.d.ts.map +1 -1
  86. package/dist/src/catalog/providers/catalog-provider.d.ts +1 -1
  87. package/dist/src/catalog/providers/catalog-provider.d.ts.map +1 -1
  88. package/dist/src/catalog/providers/client-price-provider.d.ts +1 -1
  89. package/dist/src/catalog/providers/client-price-provider.d.ts.map +1 -1
  90. package/dist/src/catalog/providers/client-price-template-provider.d.ts +1 -1
  91. package/dist/src/catalog/providers/client-price-template-provider.d.ts.map +1 -1
  92. package/dist/src/catalog/providers/client-product-category-data-provider.d.ts +1 -1
  93. package/dist/src/catalog/providers/client-product-category-data-provider.d.ts.map +1 -1
  94. package/dist/src/catalog/providers/client-product-data-provider.d.ts +1 -1
  95. package/dist/src/catalog/providers/client-product-data-provider.d.ts.map +1 -1
  96. package/dist/src/catalog/providers/price-template-provider.d.ts +1 -2
  97. package/dist/src/catalog/providers/price-template-provider.d.ts.map +1 -1
  98. package/dist/src/catalog/providers/pricing-role-provider.d.ts +1 -1
  99. package/dist/src/catalog/providers/pricing-role-provider.d.ts.map +1 -1
  100. package/dist/src/catalog/providers/product-category-data-provider.d.ts +1 -1
  101. package/dist/src/catalog/providers/product-category-data-provider.d.ts.map +1 -1
  102. package/dist/src/catalog/providers/product-data-provider.d.ts +1 -1
  103. package/dist/src/catalog/providers/product-data-provider.d.ts.map +1 -1
  104. package/dist/src/catalog/providers/properties-provider.d.ts +1 -1
  105. package/dist/src/catalog/providers/properties-provider.d.ts.map +1 -1
  106. package/dist/src/catalog/providers/template-product-category-data-provider.d.ts +1 -1
  107. package/dist/src/catalog/providers/template-product-category-data-provider.d.ts.map +1 -1
  108. package/dist/src/clients/classes/bank-account.d.ts +1 -2
  109. package/dist/src/clients/classes/bank-account.d.ts.map +1 -1
  110. package/dist/src/clients/classes/client-additional-data.d.ts +1 -5
  111. package/dist/src/clients/classes/client-additional-data.d.ts.map +1 -1
  112. package/dist/src/clients/classes/client-short-info.d.ts +1 -4
  113. package/dist/src/clients/classes/client-short-info.d.ts.map +1 -1
  114. package/dist/src/clients/classes/client.d.ts +1 -5
  115. package/dist/src/clients/classes/client.d.ts.map +1 -1
  116. package/dist/src/clients/classes/clients-list-filters.d.ts +1 -9
  117. package/dist/src/clients/classes/clients-list-filters.d.ts.map +1 -1
  118. package/dist/src/clients/classes/contragent/contragent-base.d.ts +1 -2
  119. package/dist/src/clients/classes/contragent/contragent-base.d.ts.map +1 -1
  120. package/dist/src/clients/classes/contragent/contragent-factory.d.ts.map +1 -1
  121. package/dist/src/clients/classes/contragent/contragent-ul-nr.d.ts +1 -1
  122. package/dist/src/clients/classes/contragent/contragent-ul-nr.d.ts.map +1 -1
  123. package/dist/src/clients/classes/delivery-address.d.ts +1 -1
  124. package/dist/src/clients/classes/delivery-address.d.ts.map +1 -1
  125. package/dist/src/clients/enums/index.d.ts +0 -1
  126. package/dist/src/clients/enums/index.d.ts.map +1 -1
  127. package/dist/src/clients/interfaces/contragent/i-contragent-base.d.ts +1 -2
  128. package/dist/src/clients/interfaces/contragent/i-contragent-base.d.ts.map +1 -1
  129. package/dist/src/clients/interfaces/contragent/i-contragent-ul-nr.d.ts +1 -1
  130. package/dist/src/clients/interfaces/contragent/i-contragent-ul-nr.d.ts.map +1 -1
  131. package/dist/src/clients/interfaces/i-bank-account.d.ts +1 -2
  132. package/dist/src/clients/interfaces/i-bank-account.d.ts.map +1 -1
  133. package/dist/src/clients/interfaces/i-client-additional-data.d.ts +1 -5
  134. package/dist/src/clients/interfaces/i-client-additional-data.d.ts.map +1 -1
  135. package/dist/src/clients/interfaces/i-client-short-info.d.ts +1 -4
  136. package/dist/src/clients/interfaces/i-client-short-info.d.ts.map +1 -1
  137. package/dist/src/clients/interfaces/i-client.d.ts +1 -5
  138. package/dist/src/clients/interfaces/i-client.d.ts.map +1 -1
  139. package/dist/src/clients/interfaces/i-clients-list-filters.d.ts +1 -9
  140. package/dist/src/clients/interfaces/i-clients-list-filters.d.ts.map +1 -1
  141. package/dist/src/clients/interfaces/i-delivery-address.d.ts +1 -1
  142. package/dist/src/clients/interfaces/i-delivery-address.d.ts.map +1 -1
  143. package/dist/src/clients/providers/client-data-provider.d.ts +1 -4
  144. package/dist/src/clients/providers/client-data-provider.d.ts.map +1 -1
  145. package/dist/src/clients/providers/unknown-client-data-provider.d.ts +1 -1
  146. package/dist/src/clients/providers/unknown-client-data-provider.d.ts.map +1 -1
  147. package/dist/src/config/classes/index.d.ts +0 -5
  148. package/dist/src/config/classes/index.d.ts.map +1 -1
  149. package/dist/src/config/index.d.ts +0 -1
  150. package/dist/src/config/index.d.ts.map +1 -1
  151. package/dist/src/config/interfaces/index.d.ts +0 -5
  152. package/dist/src/config/interfaces/index.d.ts.map +1 -1
  153. package/dist/src/configurator/providers/configurator-provider.d.ts +1 -2
  154. package/dist/src/configurator/providers/configurator-provider.d.ts.map +1 -1
  155. package/dist/src/contacts/classes/contact-relation.d.ts +1 -1
  156. package/dist/src/contacts/classes/contact-relation.d.ts.map +1 -1
  157. package/dist/src/contacts/classes/index.d.ts +0 -1
  158. package/dist/src/contacts/classes/index.d.ts.map +1 -1
  159. package/dist/src/contacts/interfaces/i-contact-relation.d.ts +1 -1
  160. package/dist/src/contacts/interfaces/i-contact-relation.d.ts.map +1 -1
  161. package/dist/src/contacts/interfaces/i-contact.d.ts +1 -1
  162. package/dist/src/contacts/interfaces/i-contact.d.ts.map +1 -1
  163. package/dist/src/contacts/interfaces/index.d.ts +0 -1
  164. package/dist/src/contacts/interfaces/index.d.ts.map +1 -1
  165. package/dist/src/date-time/helpers/calendar-helper.d.ts +1 -1
  166. package/dist/src/date-time/helpers/calendar-helper.d.ts.map +1 -1
  167. package/dist/src/date-time/helpers/index.d.ts +0 -1
  168. package/dist/src/date-time/helpers/index.d.ts.map +1 -1
  169. package/dist/src/date-time/interfaces/i-labeled-period.d.ts +1 -1
  170. package/dist/src/date-time/interfaces/i-labeled-period.d.ts.map +1 -1
  171. package/dist/src/date-time/interfaces/i-unix-timestamp-period.d.ts +1 -1
  172. package/dist/src/date-time/interfaces/i-unix-timestamp-period.d.ts.map +1 -1
  173. package/dist/src/discounts/classes/discount-client.d.ts +1 -2
  174. package/dist/src/discounts/classes/discount-client.d.ts.map +1 -1
  175. package/dist/src/discounts/classes/discount-conditions.d.ts +1 -5
  176. package/dist/src/discounts/classes/discount-conditions.d.ts.map +1 -1
  177. package/dist/src/discounts/interfaces/i-discount-client.d.ts +1 -2
  178. package/dist/src/discounts/interfaces/i-discount-client.d.ts.map +1 -1
  179. package/dist/src/discounts/interfaces/i-discount-conditions-save-data.d.ts +1 -1
  180. package/dist/src/discounts/interfaces/i-discount-conditions-save-data.d.ts.map +1 -1
  181. package/dist/src/discounts/interfaces/i-discount-conditions-save-request-data.d.ts +1 -1
  182. package/dist/src/discounts/interfaces/i-discount-conditions-save-request-data.d.ts.map +1 -1
  183. package/dist/src/discounts/interfaces/i-discount-conditions.d.ts +1 -5
  184. package/dist/src/discounts/interfaces/i-discount-conditions.d.ts.map +1 -1
  185. package/dist/src/discounts/providers/discount-provider.d.ts +1 -2
  186. package/dist/src/discounts/providers/discount-provider.d.ts.map +1 -1
  187. package/dist/src/faq/classes/faq-group.d.ts +1 -1
  188. package/dist/src/faq/classes/faq-group.d.ts.map +1 -1
  189. package/dist/src/faq/classes/faq.d.ts +1 -1
  190. package/dist/src/faq/classes/faq.d.ts.map +1 -1
  191. package/dist/src/faq/interfaces/i-faq-group.d.ts +1 -1
  192. package/dist/src/faq/interfaces/i-faq-group.d.ts.map +1 -1
  193. package/dist/src/faq/interfaces/i-faq.d.ts +1 -1
  194. package/dist/src/faq/interfaces/i-faq.d.ts.map +1 -1
  195. package/dist/src/faq/providers/faq-provider.d.ts +1 -2
  196. package/dist/src/faq/providers/faq-provider.d.ts.map +1 -1
  197. package/dist/src/index.d.ts +1 -3
  198. package/dist/src/index.d.ts.map +1 -1
  199. package/dist/src/managers/classes/curator.d.ts +1 -3
  200. package/dist/src/managers/classes/curator.d.ts.map +1 -1
  201. package/dist/src/managers/classes/index.d.ts +0 -2
  202. package/dist/src/managers/classes/index.d.ts.map +1 -1
  203. package/dist/src/managers/classes/manager-data-factory.d.ts +1 -1
  204. package/dist/src/managers/classes/manager-data-factory.d.ts.map +1 -1
  205. package/dist/src/managers/index.d.ts +0 -1
  206. package/dist/src/managers/index.d.ts.map +1 -1
  207. package/dist/src/managers/interfaces/i-curator.d.ts +1 -3
  208. package/dist/src/managers/interfaces/i-curator.d.ts.map +1 -1
  209. package/dist/src/managers/interfaces/index.d.ts +0 -2
  210. package/dist/src/managers/interfaces/index.d.ts.map +1 -1
  211. package/dist/src/offers/classes/offer-actualization.d.ts.map +1 -1
  212. package/dist/src/offers/classes/offers-list-filters.d.ts +1 -1
  213. package/dist/src/offers/classes/offers-list-filters.d.ts.map +1 -1
  214. package/dist/src/offers/interfaces/i-offers-list-filters.d.ts +1 -1
  215. package/dist/src/offers/interfaces/i-offers-list-filters.d.ts.map +1 -1
  216. package/dist/src/offers/providers/offers-data-provider.d.ts +1 -2
  217. package/dist/src/offers/providers/offers-data-provider.d.ts.map +1 -1
  218. package/dist/src/orders/classes/order-info.d.ts +1 -3
  219. package/dist/src/orders/classes/order-info.d.ts.map +1 -1
  220. package/dist/src/orders/classes/order-item-base.d.ts +1 -2
  221. package/dist/src/orders/classes/order-item-base.d.ts.map +1 -1
  222. package/dist/src/orders/classes/order-item.d.ts +1 -1
  223. package/dist/src/orders/classes/order-item.d.ts.map +1 -1
  224. package/dist/src/orders/classes/order-status-history-info.d.ts +1 -2
  225. package/dist/src/orders/classes/order-status-history-info.d.ts.map +1 -1
  226. package/dist/src/orders/classes/order.d.ts +1 -2
  227. package/dist/src/orders/classes/order.d.ts.map +1 -1
  228. package/dist/src/orders/classes/orders-list-filters.d.ts +1 -10
  229. package/dist/src/orders/classes/orders-list-filters.d.ts.map +1 -1
  230. package/dist/src/orders/interfaces/i-order-info.d.ts +1 -4
  231. package/dist/src/orders/interfaces/i-order-info.d.ts.map +1 -1
  232. package/dist/src/orders/interfaces/i-order-item-base.d.ts +1 -2
  233. package/dist/src/orders/interfaces/i-order-item-base.d.ts.map +1 -1
  234. package/dist/src/orders/interfaces/i-order-status-history-info.d.ts +1 -3
  235. package/dist/src/orders/interfaces/i-order-status-history-info.d.ts.map +1 -1
  236. package/dist/src/orders/interfaces/i-order.d.ts +1 -2
  237. package/dist/src/orders/interfaces/i-order.d.ts.map +1 -1
  238. package/dist/src/orders/interfaces/i-orders-list-filters.d.ts +1 -10
  239. package/dist/src/orders/interfaces/i-orders-list-filters.d.ts.map +1 -1
  240. package/dist/src/orders/providers/orders-data-provider.d.ts +1 -4
  241. package/dist/src/orders/providers/orders-data-provider.d.ts.map +1 -1
  242. package/dist/src/pagination/filters/pagination-filters-base.d.ts.map +1 -1
  243. package/dist/src/pagination/index.d.ts +0 -1
  244. package/dist/src/pagination/index.d.ts.map +1 -1
  245. package/dist/src/pagination/providers/base-pagination-provider.d.ts +1 -2
  246. package/dist/src/pagination/providers/base-pagination-provider.d.ts.map +1 -1
  247. package/dist/src/price-analyze/converters/price-analyze-params.d.ts +1 -1
  248. package/dist/src/price-analyze/converters/price-analyze-params.d.ts.map +1 -1
  249. package/dist/src/price-analyze/interfaces/i-price-analyze-filters.d.ts +1 -4
  250. package/dist/src/price-analyze/interfaces/i-price-analyze-filters.d.ts.map +1 -1
  251. package/dist/src/price-analyze/interfaces/i-price-analyze-params.d.ts +1 -1
  252. package/dist/src/price-analyze/interfaces/i-price-analyze-params.d.ts.map +1 -1
  253. package/dist/src/price-analyze/providers/price-analyze-provider.d.ts +1 -2
  254. package/dist/src/price-analyze/providers/price-analyze-provider.d.ts.map +1 -1
  255. package/dist/src/price-history/classes/price-history-item.d.ts +1 -1
  256. package/dist/src/price-history/classes/price-history-item.d.ts.map +1 -1
  257. package/dist/src/price-history/interfaces/i-price-history-item.d.ts +1 -1
  258. package/dist/src/price-history/interfaces/i-price-history-item.d.ts.map +1 -1
  259. package/dist/src/price-history/interfaces/i-price-history-request-params.d.ts +1 -1
  260. package/dist/src/price-history/interfaces/i-price-history-request-params.d.ts.map +1 -1
  261. package/dist/src/price-history/providers/price-history-data-provider.d.ts +1 -1
  262. package/dist/src/price-history/providers/price-history-data-provider.d.ts.map +1 -1
  263. package/dist/src/recommendations/providers/recommendations-data-provider.d.ts +1 -1
  264. package/dist/src/recommendations/providers/recommendations-data-provider.d.ts.map +1 -1
  265. package/dist/src/references/classes/index.d.ts +0 -24
  266. package/dist/src/references/classes/index.d.ts.map +1 -1
  267. package/dist/src/references/classes/product-unit.d.ts +1 -1
  268. package/dist/src/references/classes/product-unit.d.ts.map +1 -1
  269. package/dist/src/references/classes/reference-data-factory.d.ts +1 -2
  270. package/dist/src/references/classes/reference-data-factory.d.ts.map +1 -1
  271. package/dist/src/references/index.d.ts +0 -3
  272. package/dist/src/references/index.d.ts.map +1 -1
  273. package/dist/src/references/interfaces/i-product-unit.d.ts +1 -1
  274. package/dist/src/references/interfaces/i-product-unit.d.ts.map +1 -1
  275. package/dist/src/references/interfaces/index.d.ts +0 -23
  276. package/dist/src/references/interfaces/index.d.ts.map +1 -1
  277. package/dist/src/seo/classes/seo.d.ts +1 -1
  278. package/dist/src/seo/classes/seo.d.ts.map +1 -1
  279. package/dist/src/seo/interfaces/i-seo.d.ts +1 -1
  280. package/dist/src/seo/interfaces/i-seo.d.ts.map +1 -1
  281. package/dist/src/seo/providers/seo-data-provider.d.ts +1 -3
  282. package/dist/src/seo/providers/seo-data-provider.d.ts.map +1 -1
  283. package/dist/src/statistics/classes/search-product-statistic.d.ts +1 -1
  284. package/dist/src/statistics/classes/search-product-statistic.d.ts.map +1 -1
  285. package/dist/src/statistics/interfaces/i-search-product-statistic.d.ts +1 -1
  286. package/dist/src/statistics/interfaces/i-search-product-statistic.d.ts.map +1 -1
  287. package/dist/src/statistics/providers/statistics-provider.d.ts +1 -2
  288. package/dist/src/statistics/providers/statistics-provider.d.ts.map +1 -1
  289. package/dist/src/suggestion/helpers/address-quality-helper.d.ts +1 -1
  290. package/dist/src/suggestion/helpers/address-quality-helper.d.ts.map +1 -1
  291. package/dist/src/suggestion/interfaces/i-address-suggestion.d.ts +1 -2
  292. package/dist/src/suggestion/interfaces/i-address-suggestion.d.ts.map +1 -1
  293. package/dist/src/suggestion/interfaces/i-bank-suggestion.d.ts +1 -1
  294. package/dist/src/suggestion/interfaces/i-bank-suggestion.d.ts.map +1 -1
  295. package/dist/src/suggestion/interfaces/i-organization-suggestion.d.ts +1 -2
  296. package/dist/src/suggestion/interfaces/i-organization-suggestion.d.ts.map +1 -1
  297. package/dist/src/suggestion/providers/data-suggestion-provider.d.ts +1 -2
  298. package/dist/src/suggestion/providers/data-suggestion-provider.d.ts.map +1 -1
  299. package/dist/src/system/classes/coded-identity.d.ts +1 -1
  300. package/dist/src/system/classes/coded-identity.d.ts.map +1 -1
  301. package/dist/src/system/classes/creatable-identity.d.ts +1 -1
  302. package/dist/src/system/classes/creatable-identity.d.ts.map +1 -1
  303. package/dist/src/system/classes/date-period.d.ts +1 -1
  304. package/dist/src/system/classes/date-period.d.ts.map +1 -1
  305. package/dist/src/system/classes/deletable-identity.d.ts.map +1 -1
  306. package/dist/src/system/classes/deletable-named-identity.d.ts +1 -1
  307. package/dist/src/system/classes/deletable-named-identity.d.ts.map +1 -1
  308. package/dist/src/system/classes/index.d.ts +0 -4
  309. package/dist/src/system/classes/index.d.ts.map +1 -1
  310. package/dist/src/system/index.d.ts +0 -1
  311. package/dist/src/system/index.d.ts.map +1 -1
  312. package/dist/src/system/interfaces/i-coded-identity.d.ts +1 -1
  313. package/dist/src/system/interfaces/i-coded-identity.d.ts.map +1 -1
  314. package/dist/src/system/interfaces/i-creatable-identity.d.ts +1 -2
  315. package/dist/src/system/interfaces/i-creatable-identity.d.ts.map +1 -1
  316. package/dist/src/system/interfaces/i-deletable-named-identity.d.ts +1 -1
  317. package/dist/src/system/interfaces/i-deletable-named-identity.d.ts.map +1 -1
  318. package/dist/src/system/interfaces/index.d.ts +0 -9
  319. package/dist/src/system/interfaces/index.d.ts.map +1 -1
  320. package/dist/src/system/types/index.d.ts +0 -1
  321. package/dist/src/system/types/index.d.ts.map +1 -1
  322. package/dist/src/table-data/classes/filter-item.d.ts +1 -1
  323. package/dist/src/table-data/classes/filter-item.d.ts.map +1 -1
  324. package/dist/src/table-data/interfaces/i-filter-item.d.ts +1 -1
  325. package/dist/src/table-data/interfaces/i-filter-item.d.ts.map +1 -1
  326. package/dist/src/user/classes/index.d.ts +0 -3
  327. package/dist/src/user/classes/index.d.ts.map +1 -1
  328. package/dist/src/user/classes/user-short-info.d.ts +1 -2
  329. package/dist/src/user/classes/user-short-info.d.ts.map +1 -1
  330. package/dist/src/user/index.d.ts +0 -2
  331. package/dist/src/user/index.d.ts.map +1 -1
  332. package/dist/src/user/interfaces/i-user-short-info.d.ts +1 -2
  333. package/dist/src/user/interfaces/i-user-short-info.d.ts.map +1 -1
  334. package/dist/src/user/interfaces/index.d.ts +0 -4
  335. package/dist/src/user/interfaces/index.d.ts.map +1 -1
  336. package/dist/src/user/providers/index.d.ts +0 -1
  337. package/dist/src/user/providers/index.d.ts.map +1 -1
  338. package/dist/src/user/providers/user-auth-data-provider.d.ts +1 -1
  339. package/dist/src/user/providers/user-auth-data-provider.d.ts.map +1 -1
  340. package/dist/src/user-regions/classes/index.d.ts +0 -1
  341. package/dist/src/user-regions/classes/index.d.ts.map +1 -1
  342. package/dist/src/user-regions/classes/user-region-employee.d.ts +1 -1
  343. package/dist/src/user-regions/classes/user-region-employee.d.ts.map +1 -1
  344. package/dist/src/user-regions/classes/user-region.d.ts +1 -2
  345. package/dist/src/user-regions/classes/user-region.d.ts.map +1 -1
  346. package/dist/src/user-regions/interfaces/i-user-region-employee.d.ts +1 -1
  347. package/dist/src/user-regions/interfaces/i-user-region-employee.d.ts.map +1 -1
  348. package/dist/src/user-regions/interfaces/i-user-region.d.ts +1 -2
  349. package/dist/src/user-regions/interfaces/i-user-region.d.ts.map +1 -1
  350. package/dist/src/user-regions/interfaces/index.d.ts +0 -1
  351. package/dist/src/user-regions/interfaces/index.d.ts.map +1 -1
  352. package/dist/src/user-regions/providers/user-region-provider.d.ts +1 -3
  353. package/dist/src/user-regions/providers/user-region-provider.d.ts.map +1 -1
  354. package/dist/src/validation/index.d.ts +0 -1
  355. package/dist/src/validation/index.d.ts.map +1 -1
  356. package/dist/src/validation/interfaces/i-form-validation-result.d.ts +1 -1
  357. package/dist/src/validation/interfaces/i-form-validation-result.d.ts.map +1 -1
  358. package/dist/src/validation/interfaces/index.d.ts +0 -1
  359. package/dist/src/validation/interfaces/index.d.ts.map +1 -1
  360. package/package.json +23 -32
  361. package/readme.md +2 -0
  362. package/dist/src/auth/classes/detailed-jwt-payload.d.ts +0 -46
  363. package/dist/src/auth/classes/detailed-jwt-payload.d.ts.map +0 -1
  364. package/dist/src/auth/classes/index.d.ts +0 -3
  365. package/dist/src/auth/classes/index.d.ts.map +0 -1
  366. package/dist/src/auth/classes/jwt-payload.d.ts +0 -109
  367. package/dist/src/auth/classes/jwt-payload.d.ts.map +0 -1
  368. package/dist/src/auth/index.d.ts +0 -4
  369. package/dist/src/auth/index.d.ts.map +0 -1
  370. package/dist/src/auth/interfaces/i-base-resource-access.d.ts +0 -24
  371. package/dist/src/auth/interfaces/i-base-resource-access.d.ts.map +0 -1
  372. package/dist/src/auth/interfaces/i-detailed-jwt-payload.d.ts +0 -33
  373. package/dist/src/auth/interfaces/i-detailed-jwt-payload.d.ts.map +0 -1
  374. package/dist/src/auth/interfaces/i-jwt-payload.d.ts +0 -118
  375. package/dist/src/auth/interfaces/i-jwt-payload.d.ts.map +0 -1
  376. package/dist/src/auth/interfaces/i-realm-access.d.ts +0 -12
  377. package/dist/src/auth/interfaces/i-realm-access.d.ts.map +0 -1
  378. package/dist/src/auth/interfaces/i-resource-roles.d.ts +0 -11
  379. package/dist/src/auth/interfaces/i-resource-roles.d.ts.map +0 -1
  380. package/dist/src/auth/interfaces/i-user-address.d.ts +0 -30
  381. package/dist/src/auth/interfaces/i-user-address.d.ts.map +0 -1
  382. package/dist/src/auth/interfaces/index.d.ts +0 -7
  383. package/dist/src/auth/interfaces/index.d.ts.map +0 -1
  384. package/dist/src/auth/states/auth-store.d.ts +0 -87
  385. package/dist/src/auth/states/auth-store.d.ts.map +0 -1
  386. package/dist/src/auth/states/index.d.ts +0 -2
  387. package/dist/src/auth/states/index.d.ts.map +0 -1
  388. package/dist/src/catalog/classes/property-type.d.ts +0 -9
  389. package/dist/src/catalog/classes/property-type.d.ts.map +0 -1
  390. package/dist/src/catalog/enums/price-coefficient-enum.d.ts +0 -30
  391. package/dist/src/catalog/enums/price-coefficient-enum.d.ts.map +0 -1
  392. package/dist/src/catalog/enums/property-type-enum.d.ts +0 -38
  393. package/dist/src/catalog/enums/property-type-enum.d.ts.map +0 -1
  394. package/dist/src/catalog/interfaces/i-property-type.d.ts +0 -8
  395. package/dist/src/catalog/interfaces/i-property-type.d.ts.map +0 -1
  396. package/dist/src/clients/enums/opf-enum.d.ts +0 -22
  397. package/dist/src/clients/enums/opf-enum.d.ts.map +0 -1
  398. package/dist/src/config/classes/app-base-config.d.ts +0 -57
  399. package/dist/src/config/classes/app-base-config.d.ts.map +0 -1
  400. package/dist/src/config/classes/device-type-resolution-config.d.ts +0 -25
  401. package/dist/src/config/classes/device-type-resolution-config.d.ts.map +0 -1
  402. package/dist/src/config/classes/http-params-config.d.ts +0 -25
  403. package/dist/src/config/classes/http-params-config.d.ts.map +0 -1
  404. package/dist/src/config/classes/sentry-config.d.ts +0 -71
  405. package/dist/src/config/classes/sentry-config.d.ts.map +0 -1
  406. package/dist/src/config/classes/websocket-config.d.ts +0 -38
  407. package/dist/src/config/classes/websocket-config.d.ts.map +0 -1
  408. package/dist/src/config/interfaces/i-app-base-config.d.ts +0 -69
  409. package/dist/src/config/interfaces/i-app-base-config.d.ts.map +0 -1
  410. package/dist/src/config/interfaces/i-device-type-resolution-config.d.ts +0 -18
  411. package/dist/src/config/interfaces/i-device-type-resolution-config.d.ts.map +0 -1
  412. package/dist/src/config/interfaces/i-http-params-config.d.ts +0 -18
  413. package/dist/src/config/interfaces/i-http-params-config.d.ts.map +0 -1
  414. package/dist/src/config/interfaces/i-sentry-config.d.ts +0 -64
  415. package/dist/src/config/interfaces/i-sentry-config.d.ts.map +0 -1
  416. package/dist/src/config/interfaces/i-websocket-config.d.ts +0 -34
  417. package/dist/src/config/interfaces/i-websocket-config.d.ts.map +0 -1
  418. package/dist/src/config/states/config-store.d.ts +0 -333
  419. package/dist/src/config/states/config-store.d.ts.map +0 -1
  420. package/dist/src/config/states/index.d.ts +0 -2
  421. package/dist/src/config/states/index.d.ts.map +0 -1
  422. package/dist/src/contacts/classes/contact-links.d.ts +0 -21
  423. package/dist/src/contacts/classes/contact-links.d.ts.map +0 -1
  424. package/dist/src/contacts/interfaces/i-contact-links.d.ts +0 -14
  425. package/dist/src/contacts/interfaces/i-contact-links.d.ts.map +0 -1
  426. package/dist/src/date-time/helpers/date-helper.d.ts +0 -26
  427. package/dist/src/date-time/helpers/date-helper.d.ts.map +0 -1
  428. package/dist/src/geo/classes/geo-coordinates.d.ts +0 -21
  429. package/dist/src/geo/classes/geo-coordinates.d.ts.map +0 -1
  430. package/dist/src/geo/classes/index.d.ts +0 -2
  431. package/dist/src/geo/classes/index.d.ts.map +0 -1
  432. package/dist/src/geo/index.d.ts +0 -3
  433. package/dist/src/geo/index.d.ts.map +0 -1
  434. package/dist/src/geo/interfaces/i-geo-coordinates.d.ts +0 -14
  435. package/dist/src/geo/interfaces/i-geo-coordinates.d.ts.map +0 -1
  436. package/dist/src/geo/interfaces/index.d.ts +0 -2
  437. package/dist/src/geo/interfaces/index.d.ts.map +0 -1
  438. package/dist/src/http/classes/http-cached-requester.d.ts +0 -45
  439. package/dist/src/http/classes/http-cached-requester.d.ts.map +0 -1
  440. package/dist/src/http/classes/http-requester.d.ts +0 -234
  441. package/dist/src/http/classes/http-requester.d.ts.map +0 -1
  442. package/dist/src/http/classes/index.d.ts +0 -3
  443. package/dist/src/http/classes/index.d.ts.map +0 -1
  444. package/dist/src/http/enums/index.d.ts +0 -2
  445. package/dist/src/http/enums/index.d.ts.map +0 -1
  446. package/dist/src/http/enums/interceptors-enum.d.ts +0 -38
  447. package/dist/src/http/enums/interceptors-enum.d.ts.map +0 -1
  448. package/dist/src/http/index.d.ts +0 -5
  449. package/dist/src/http/index.d.ts.map +0 -1
  450. package/dist/src/http/interfaces/i-http-response-error.d.ts +0 -37
  451. package/dist/src/http/interfaces/i-http-response-error.d.ts.map +0 -1
  452. package/dist/src/http/interfaces/index.d.ts +0 -2
  453. package/dist/src/http/interfaces/index.d.ts.map +0 -1
  454. package/dist/src/http/types/error-response-notification-handler.d.ts +0 -11
  455. package/dist/src/http/types/error-response-notification-handler.d.ts.map +0 -1
  456. package/dist/src/http/types/http-request-params.d.ts +0 -5
  457. package/dist/src/http/types/http-request-params.d.ts.map +0 -1
  458. package/dist/src/http/types/index.d.ts +0 -4
  459. package/dist/src/http/types/index.d.ts.map +0 -1
  460. package/dist/src/http/types/request-hook.d.ts +0 -14
  461. package/dist/src/http/types/request-hook.d.ts.map +0 -1
  462. package/dist/src/managers/classes/manager-common.d.ts +0 -36
  463. package/dist/src/managers/classes/manager-common.d.ts.map +0 -1
  464. package/dist/src/managers/classes/manager.d.ts +0 -61
  465. package/dist/src/managers/classes/manager.d.ts.map +0 -1
  466. package/dist/src/managers/interfaces/i-manager-common.d.ts +0 -29
  467. package/dist/src/managers/interfaces/i-manager-common.d.ts.map +0 -1
  468. package/dist/src/managers/interfaces/i-manager.d.ts +0 -54
  469. package/dist/src/managers/interfaces/i-manager.d.ts.map +0 -1
  470. package/dist/src/managers/providers/index.d.ts +0 -2
  471. package/dist/src/managers/providers/index.d.ts.map +0 -1
  472. package/dist/src/managers/providers/manager-data-provider.d.ts +0 -20
  473. package/dist/src/managers/providers/manager-data-provider.d.ts.map +0 -1
  474. package/dist/src/pagination/interfaces/i-paginated-response.d.ts +0 -78
  475. package/dist/src/pagination/interfaces/i-paginated-response.d.ts.map +0 -1
  476. package/dist/src/pagination/interfaces/index.d.ts +0 -2
  477. package/dist/src/pagination/interfaces/index.d.ts.map +0 -1
  478. package/dist/src/references/classes/any-reference.d.ts +0 -8
  479. package/dist/src/references/classes/any-reference.d.ts.map +0 -1
  480. package/dist/src/references/classes/channel-primary-interest.d.ts +0 -8
  481. package/dist/src/references/classes/channel-primary-interest.d.ts.map +0 -1
  482. package/dist/src/references/classes/city-with-region-and-country.d.ts +0 -19
  483. package/dist/src/references/classes/city-with-region-and-country.d.ts.map +0 -1
  484. package/dist/src/references/classes/city-with-user-region.d.ts +0 -19
  485. package/dist/src/references/classes/city-with-user-region.d.ts.map +0 -1
  486. package/dist/src/references/classes/city.d.ts +0 -8
  487. package/dist/src/references/classes/city.d.ts.map +0 -1
  488. package/dist/src/references/classes/contact-position.d.ts +0 -8
  489. package/dist/src/references/classes/contact-position.d.ts.map +0 -1
  490. package/dist/src/references/classes/country.d.ts +0 -8
  491. package/dist/src/references/classes/country.d.ts.map +0 -1
  492. package/dist/src/references/classes/curated-direction.d.ts +0 -8
  493. package/dist/src/references/classes/curated-direction.d.ts.map +0 -1
  494. package/dist/src/references/classes/currency.d.ts +0 -30
  495. package/dist/src/references/classes/currency.d.ts.map +0 -1
  496. package/dist/src/references/classes/delivery-type.d.ts +0 -8
  497. package/dist/src/references/classes/delivery-type.d.ts.map +0 -1
  498. package/dist/src/references/classes/operator.d.ts +0 -8
  499. package/dist/src/references/classes/operator.d.ts.map +0 -1
  500. package/dist/src/references/classes/opf.d.ts +0 -13
  501. package/dist/src/references/classes/opf.d.ts.map +0 -1
  502. package/dist/src/references/classes/order-payment-status.d.ts +0 -8
  503. package/dist/src/references/classes/order-payment-status.d.ts.map +0 -1
  504. package/dist/src/references/classes/order-status-detail.d.ts +0 -9
  505. package/dist/src/references/classes/order-status-detail.d.ts.map +0 -1
  506. package/dist/src/references/classes/order-status.d.ts +0 -9
  507. package/dist/src/references/classes/order-status.d.ts.map +0 -1
  508. package/dist/src/references/classes/partner-group.d.ts +0 -8
  509. package/dist/src/references/classes/partner-group.d.ts.map +0 -1
  510. package/dist/src/references/classes/payment-type.d.ts +0 -8
  511. package/dist/src/references/classes/payment-type.d.ts.map +0 -1
  512. package/dist/src/references/classes/price-coefficient.d.ts +0 -13
  513. package/dist/src/references/classes/price-coefficient.d.ts.map +0 -1
  514. package/dist/src/references/classes/product-file-type.d.ts +0 -8
  515. package/dist/src/references/classes/product-file-type.d.ts.map +0 -1
  516. package/dist/src/references/classes/region.d.ts +0 -19
  517. package/dist/src/references/classes/region.d.ts.map +0 -1
  518. package/dist/src/references/classes/resource-type.d.ts +0 -8
  519. package/dist/src/references/classes/resource-type.d.ts.map +0 -1
  520. package/dist/src/references/classes/sales-direction.d.ts +0 -8
  521. package/dist/src/references/classes/sales-direction.d.ts.map +0 -1
  522. package/dist/src/references/classes/source-primary-interest.d.ts +0 -8
  523. package/dist/src/references/classes/source-primary-interest.d.ts.map +0 -1
  524. package/dist/src/references/classes/warehouse.d.ts +0 -36
  525. package/dist/src/references/classes/warehouse.d.ts.map +0 -1
  526. package/dist/src/references/enums/index.d.ts +0 -3
  527. package/dist/src/references/enums/index.d.ts.map +0 -1
  528. package/dist/src/references/enums/order-status-detail-enum.d.ts +0 -26
  529. package/dist/src/references/enums/order-status-detail-enum.d.ts.map +0 -1
  530. package/dist/src/references/enums/order-status-enum.d.ts +0 -42
  531. package/dist/src/references/enums/order-status-enum.d.ts.map +0 -1
  532. package/dist/src/references/interfaces/i-channel-primary-interest.d.ts +0 -7
  533. package/dist/src/references/interfaces/i-channel-primary-interest.d.ts.map +0 -1
  534. package/dist/src/references/interfaces/i-city-with-region-and-country.d.ts +0 -12
  535. package/dist/src/references/interfaces/i-city-with-region-and-country.d.ts.map +0 -1
  536. package/dist/src/references/interfaces/i-city-with-user-region.d.ts +0 -12
  537. package/dist/src/references/interfaces/i-city-with-user-region.d.ts.map +0 -1
  538. package/dist/src/references/interfaces/i-city.d.ts +0 -7
  539. package/dist/src/references/interfaces/i-city.d.ts.map +0 -1
  540. package/dist/src/references/interfaces/i-contact-position.d.ts +0 -7
  541. package/dist/src/references/interfaces/i-contact-position.d.ts.map +0 -1
  542. package/dist/src/references/interfaces/i-country.d.ts +0 -7
  543. package/dist/src/references/interfaces/i-country.d.ts.map +0 -1
  544. package/dist/src/references/interfaces/i-curated-direction.d.ts +0 -7
  545. package/dist/src/references/interfaces/i-curated-direction.d.ts.map +0 -1
  546. package/dist/src/references/interfaces/i-currency.d.ts +0 -23
  547. package/dist/src/references/interfaces/i-currency.d.ts.map +0 -1
  548. package/dist/src/references/interfaces/i-delivery-type.d.ts +0 -7
  549. package/dist/src/references/interfaces/i-delivery-type.d.ts.map +0 -1
  550. package/dist/src/references/interfaces/i-operator.d.ts +0 -7
  551. package/dist/src/references/interfaces/i-operator.d.ts.map +0 -1
  552. package/dist/src/references/interfaces/i-opf.d.ts +0 -8
  553. package/dist/src/references/interfaces/i-opf.d.ts.map +0 -1
  554. package/dist/src/references/interfaces/i-order-payment-status.d.ts +0 -7
  555. package/dist/src/references/interfaces/i-order-payment-status.d.ts.map +0 -1
  556. package/dist/src/references/interfaces/i-order-status-detail.d.ts +0 -8
  557. package/dist/src/references/interfaces/i-order-status-detail.d.ts.map +0 -1
  558. package/dist/src/references/interfaces/i-order-status.d.ts +0 -8
  559. package/dist/src/references/interfaces/i-order-status.d.ts.map +0 -1
  560. package/dist/src/references/interfaces/i-partner-group.d.ts +0 -7
  561. package/dist/src/references/interfaces/i-partner-group.d.ts.map +0 -1
  562. package/dist/src/references/interfaces/i-payment-type.d.ts +0 -7
  563. package/dist/src/references/interfaces/i-payment-type.d.ts.map +0 -1
  564. package/dist/src/references/interfaces/i-price-coefficient.d.ts +0 -8
  565. package/dist/src/references/interfaces/i-price-coefficient.d.ts.map +0 -1
  566. package/dist/src/references/interfaces/i-product-file-type.d.ts +0 -7
  567. package/dist/src/references/interfaces/i-product-file-type.d.ts.map +0 -1
  568. package/dist/src/references/interfaces/i-region.d.ts +0 -12
  569. package/dist/src/references/interfaces/i-region.d.ts.map +0 -1
  570. package/dist/src/references/interfaces/i-resource-type.d.ts +0 -7
  571. package/dist/src/references/interfaces/i-resource-type.d.ts.map +0 -1
  572. package/dist/src/references/interfaces/i-sales-direction.d.ts +0 -7
  573. package/dist/src/references/interfaces/i-sales-direction.d.ts.map +0 -1
  574. package/dist/src/references/interfaces/i-source-primary-interest.d.ts +0 -7
  575. package/dist/src/references/interfaces/i-source-primary-interest.d.ts.map +0 -1
  576. package/dist/src/references/interfaces/i-warehouse.d.ts +0 -29
  577. package/dist/src/references/interfaces/i-warehouse.d.ts.map +0 -1
  578. package/dist/src/references/providers/index.d.ts +0 -2
  579. package/dist/src/references/providers/index.d.ts.map +0 -1
  580. package/dist/src/references/providers/reference-data-provider.d.ts +0 -188
  581. package/dist/src/references/providers/reference-data-provider.d.ts.map +0 -1
  582. package/dist/src/references/states/index.d.ts +0 -2
  583. package/dist/src/references/states/index.d.ts.map +0 -1
  584. package/dist/src/references/states/references-store.d.ts +0 -255
  585. package/dist/src/references/states/references-store.d.ts.map +0 -1
  586. package/dist/src/system/classes/identity.d.ts +0 -26
  587. package/dist/src/system/classes/identity.d.ts.map +0 -1
  588. package/dist/src/system/classes/named-identity.d.ts +0 -22
  589. package/dist/src/system/classes/named-identity.d.ts.map +0 -1
  590. package/dist/src/system/classes/reference.d.ts +0 -22
  591. package/dist/src/system/classes/reference.d.ts.map +0 -1
  592. package/dist/src/system/classes/updatable-named-identity.d.ts +0 -22
  593. package/dist/src/system/classes/updatable-named-identity.d.ts.map +0 -1
  594. package/dist/src/system/interfaces/i-created-at.d.ts +0 -10
  595. package/dist/src/system/interfaces/i-created-at.d.ts.map +0 -1
  596. package/dist/src/system/interfaces/i-date-period.d.ts +0 -7
  597. package/dist/src/system/interfaces/i-date-period.d.ts.map +0 -1
  598. package/dist/src/system/interfaces/i-identity.d.ts +0 -18
  599. package/dist/src/system/interfaces/i-identity.d.ts.map +0 -1
  600. package/dist/src/system/interfaces/i-named-identity.d.ts +0 -12
  601. package/dist/src/system/interfaces/i-named-identity.d.ts.map +0 -1
  602. package/dist/src/system/interfaces/i-named.d.ts +0 -10
  603. package/dist/src/system/interfaces/i-named.d.ts.map +0 -1
  604. package/dist/src/system/interfaces/i-reference.d.ts +0 -15
  605. package/dist/src/system/interfaces/i-reference.d.ts.map +0 -1
  606. package/dist/src/system/interfaces/i-typed-nullable-range.d.ts +0 -14
  607. package/dist/src/system/interfaces/i-typed-nullable-range.d.ts.map +0 -1
  608. package/dist/src/system/interfaces/i-updatable-named-identity.d.ts +0 -9
  609. package/dist/src/system/interfaces/i-updatable-named-identity.d.ts.map +0 -1
  610. package/dist/src/system/interfaces/i-updated-at.d.ts +0 -10
  611. package/dist/src/system/interfaces/i-updated-at.d.ts.map +0 -1
  612. package/dist/src/system/providers/index.d.ts +0 -3
  613. package/dist/src/system/providers/index.d.ts.map +0 -1
  614. package/dist/src/system/providers/preferences-storage-provider.d.ts +0 -28
  615. package/dist/src/system/providers/preferences-storage-provider.d.ts.map +0 -1
  616. package/dist/src/system/providers/typed-instance-factory.d.ts +0 -28
  617. package/dist/src/system/providers/typed-instance-factory.d.ts.map +0 -1
  618. package/dist/src/system/types/dynamic-field.d.ts +0 -7
  619. package/dist/src/system/types/dynamic-field.d.ts.map +0 -1
  620. package/dist/src/user/classes/user-common-info.d.ts +0 -39
  621. package/dist/src/user/classes/user-common-info.d.ts.map +0 -1
  622. package/dist/src/user/classes/user-pricing-role.d.ts +0 -26
  623. package/dist/src/user/classes/user-pricing-role.d.ts.map +0 -1
  624. package/dist/src/user/classes/user.d.ts +0 -32
  625. package/dist/src/user/classes/user.d.ts.map +0 -1
  626. package/dist/src/user/enums/index.d.ts +0 -2
  627. package/dist/src/user/enums/index.d.ts.map +0 -1
  628. package/dist/src/user/enums/user-type-enum.d.ts +0 -30
  629. package/dist/src/user/enums/user-type-enum.d.ts.map +0 -1
  630. package/dist/src/user/interfaces/i-user-common-info.d.ts +0 -32
  631. package/dist/src/user/interfaces/i-user-common-info.d.ts.map +0 -1
  632. package/dist/src/user/interfaces/i-user-pricing-role.d.ts +0 -19
  633. package/dist/src/user/interfaces/i-user-pricing-role.d.ts.map +0 -1
  634. package/dist/src/user/interfaces/i-user-type.d.ts +0 -11
  635. package/dist/src/user/interfaces/i-user-type.d.ts.map +0 -1
  636. package/dist/src/user/interfaces/i-user.d.ts +0 -21
  637. package/dist/src/user/interfaces/i-user.d.ts.map +0 -1
  638. package/dist/src/user/providers/user-data-provider.d.ts +0 -12
  639. package/dist/src/user/providers/user-data-provider.d.ts.map +0 -1
  640. package/dist/src/user/states/index.d.ts +0 -2
  641. package/dist/src/user/states/index.d.ts.map +0 -1
  642. package/dist/src/user/states/user-store.d.ts +0 -34
  643. package/dist/src/user/states/user-store.d.ts.map +0 -1
  644. package/dist/src/user-regions/classes/user-region-short-info.d.ts +0 -18
  645. package/dist/src/user-regions/classes/user-region-short-info.d.ts.map +0 -1
  646. package/dist/src/user-regions/interfaces/i-user-region-short-info.d.ts +0 -11
  647. package/dist/src/user-regions/interfaces/i-user-region-short-info.d.ts.map +0 -1
  648. package/dist/src/validation/classes/field-validation-result-data.d.ts +0 -26
  649. package/dist/src/validation/classes/field-validation-result-data.d.ts.map +0 -1
  650. package/dist/src/validation/classes/index.d.ts +0 -2
  651. package/dist/src/validation/classes/index.d.ts.map +0 -1
  652. package/dist/src/validation/interfaces/i-field-validation-result-data.d.ts +0 -18
  653. package/dist/src/validation/interfaces/i-field-validation-result-data.d.ts.map +0 -1
@@ -1 +1 @@
1
- (function(c,I){typeof exports=="object"&&typeof module<"u"?I(exports,require("jwt-decode"),require("lodash-es"),require("ts-case-convert"),require("pinia"),require("vue"),require("date-fns"),require("axios")):typeof define=="function"&&define.amd?define(["exports","jwt-decode","lodash-es","ts-case-convert","pinia","vue","date-fns","axios"],I):(c=typeof globalThis<"u"?globalThis:c||self,I(c["SC Common Lib"]={},c["jwt-decode"],c["lodash-es"],c["ts-case-convert"],c.pinia,c.vue,c["date-fns"],c.axios))})(this,function(c,I,u,Be,ee,f,l,rt){"use strict";var Yi=Object.defineProperty;var Qi=(c,I,u)=>I in c?Yi(c,I,{enumerable:!0,configurable:!0,writable:!0,value:u}):c[I]=u;var i=(c,I,u)=>Qi(c,typeof I!="symbol"?I+"":I,u);class re{constructor(r){i(this,"exp",0);i(this,"iat",0);i(this,"authTime",0);i(this,"jti","");i(this,"iss","");i(this,"aud",[]);i(this,"sub","");i(this,"typ","Bearer");i(this,"azp","");i(this,"sid","");i(this,"acr","");i(this,"allowedOrigins",[]);i(this,"realmAccess",{roles:[]});i(this,"resourceAccess",{});i(this,"scope","");i(this,"emailVerified",!1);i(this,"name","");i(this,"guid","");i(this,"preferredUsername","");i(this,"givenName","");i(this,"email","");u.merge(this,r)}static getJwtPayload(r){const e=I.jwtDecode(r),t=new re(Be.objectToCamel(e));return t.resourceAccess=e.resource_access,t}}class pr extends re{constructor(e){super(e);i(this,"familyName");i(this,"middleName");i(this,"locale");i(this,"phoneNumber");i(this,"phoneNumberVerified");i(this,"address");u.merge(this,e)}static getJwtPayload(e){const t=I.jwtDecode(e),s=new pr(Be.objectToCamel(t));return s.resourceAccess=t.resource_access,s}}class tt{constructor(r){i(this,"phone");i(this,"tablet");i(this,"laptop");this.phone=(r==null?void 0:r.phone)??360,this.tablet=(r==null?void 0:r.tablet)??600,this.laptop=(r==null?void 0:r.laptop)??1024}}class it{constructor(r){i(this,"portalApiUrl");i(this,"mediaUrl");i(this,"responseDataCacheTimeout");this.portalApiUrl=(r==null?void 0:r.portalApiUrl)??"",this.mediaUrl=(r==null?void 0:r.mediaUrl)??"",this.responseDataCacheTimeout=(r==null?void 0:r.responseDataCacheTimeout)??3*60*60}}class st{constructor(r){i(this,"dsn");i(this,"environment");i(this,"ignoreErrors");i(this,"trace");i(this,"replay");i(this,"additionalParams");var e,t,s,o;this.dsn=(r==null?void 0:r.dsn)??"",this.environment=(r==null?void 0:r.environment)??"production",this.ignoreErrors=(r==null?void 0:r.ignoreErrors)??[/Network\s{1,3}Error/,/Request\s{1,3}aborted/,/Request\s{1,3}failed\s{1,3}with\s{1,3}status\s{1,3}code\s{1,3}(401|403|404|422)/],this.trace={allowedTargets:((e=r==null?void 0:r.trace)==null?void 0:e.allowedTargets)??[/^\//],sampleRate:((t=r==null?void 0:r.trace)==null?void 0:t.sampleRate)??0},this.replay={replaysOnErrorSampleRate:((s=r==null?void 0:r.replay)==null?void 0:s.replaysOnErrorSampleRate)??0,replaysSessionSampleRate:((o=r==null?void 0:r.replay)==null?void 0:o.replaysSessionSampleRate)??0},this.additionalParams=(r==null?void 0:r.additionalParams)??{}}}class nt{constructor(r){i(this,"broadcaster");i(this,"key");i(this,"wsHost");i(this,"wsPort");i(this,"wssPort");i(this,"forceTLS");i(this,"enabledTransports");this.broadcaster=r.broadcaster??"reverb",this.key=r.key??"",this.wsHost=r.wsHost??"",this.wsPort=r.wsPort??8080,this.wssPort=r.wssPort??8080,this.forceTLS=r.forceTLS??!1,this.enabledTransports=r.enabledTransports??["wss"]}}class ot{constructor(r){i(this,"environment");i(this,"devMode");i(this,"http");i(this,"deviceTypeByResolution");i(this,"sentry");i(this,"tableDefaultHeightCoefficient");i(this,"urls");i(this,"websocket");i(this,"dateFormats");i(this,"numberPrecision");var e,t,s,o;this.environment=(r==null?void 0:r.environment)??"production",this.devMode=(r==null?void 0:r.devMode)??{},this.http=new it(r==null?void 0:r.http),this.deviceTypeByResolution=new tt(r==null?void 0:r.deviceTypeByResolution),this.sentry=new st({environment:this.environment,...r==null?void 0:r.sentry}),this.tableDefaultHeightCoefficient=(r==null?void 0:r.tableDefaultHeightCoefficient)??.7,this.urls=r==null?void 0:r.urls,this.websocket=r!=null&&r.websocket?new nt(r.websocket):void 0,this.dateFormats={api:((e=r==null?void 0:r.dateFormats)==null?void 0:e.api)??"yyyy-MM-dd HH:mm:ss",uiDate:((t=r==null?void 0:r.dateFormats)==null?void 0:t.uiDate)??"dd.MM.yyyy",uiDateWithTime:((s=r==null?void 0:r.dateFormats)==null?void 0:s.uiDateWithTime)??"dd.MM.yyyy HH:mm"},this.numberPrecision={priceCoefficient:((o=r==null?void 0:r.numberPrecision)==null?void 0:o.priceCoefficient)??7}}}const b=ee.defineStore("common.config",()=>{const n=f.ref(new ot);return{config:n,getConfig:()=>n.value,setConfig:t=>{n.value=u.merge(n.value,t)}}});class Re{static getActualDataFromStorage(r){if(!this.isLocalStorageAvailable())return;let e=null;try{e=localStorage.getItem(r)}catch{return}if(e)try{const t=JSON.parse(e);if(!t.availableFor||l.isAfter(l.parseISO(t.availableFor)||l.startOfToday(),new Date)){if(u.isNil(t.data)||u.isEmpty(t.data))throw new Error("Data is empty");return t.data}localStorage.removeItem(r)}catch{try{localStorage.removeItem(r)}catch{}}}static saveActualDataToStorage(r,e,t){if(this.isLocalStorageAvailable())try{if(u.isNil(e)||u.isEmpty(e))throw new Error("Data is empty");const s=JSON.stringify({availableFor:t,data:e});localStorage.setItem(r,s)}catch(s){if(s instanceof DOMException&&s.code===DOMException.QUOTA_EXCEEDED_ERR){this.clearOldData();try{const o=JSON.stringify({availableFor:t,data:e});localStorage.setItem(r,o)}catch{}}else try{localStorage.removeItem(r)}catch{}}}static isLocalStorageAvailable(){try{const r="__localStorage_test__";return localStorage.setItem(r,"test"),localStorage.removeItem(r),!0}catch{return!1}}static clearOldData(){try{const r=[];for(let e=0;e<localStorage.length;e++){const t=localStorage.key(e);if(t)try{const s=localStorage.getItem(t);if(s){const o=JSON.parse(s);o.availableFor&&!l.isAfter(l.parseISO(o.availableFor)||l.startOfToday(),new Date)&&r.push(t)}}catch{r.push(t)}}r.forEach(e=>{try{localStorage.removeItem(e)}catch{}})}catch{}}}function ct(n){try{const r=re.getJwtPayload(n);return new Date(r.exp*1e3)}catch{return}}const ue=ee.defineStore("common.auth_private",()=>{const n=f.ref((()=>{var g;const o=Re.getActualDataFromStorage("sc.token");if(o)return Promise.resolve(o);const p=(g=b().config.devMode)==null?void 0:g.initAuthBearerToken;return p?Promise.resolve(p):void 0})()),r=f.ref(void 0),e=f.ref(void 0),t=f.markRaw(new Map);function s(){e.value=void 0,u.isNil(n.value)||n.value.then(o=>{const p=re.getJwtPayload(o);e.value=p.exp*1e3>Date.now()?u.mapValues(p.resourceAccess,g=>(g==null?void 0:g.roles)??[]):void 0}).catch(u.noop)}return{jwtToken:n,jwtTokenUpdater:r,userPermissions:e,userPermissionsComputedRefs:t,recalculateUserPermissions:s}}),Te=ee.defineStore("common.auth",()=>{const n=f.computed(()=>{const o=ue();if(u.isNil(o.jwtToken)&&!u.isNil(o.jwtTokenUpdater)){const p=o.jwtTokenUpdater();o.jwtToken=p,p.then(g=>{o.jwtToken=Promise.resolve(g),Re.saveActualDataToStorage("sc.token",g,ct(g)),o.recalculateUserPermissions()}).catch(u.noop)}return o.jwtToken});function r(o){ue().jwtTokenUpdater=o}function e(o){const p=ue();p.jwtToken=Promise.resolve(o),Re.saveActualDataToStorage("sc.token",o,ct(o)),p.recalculateUserPermissions()}function t(){const o=ue();o.jwtToken=void 0,o.userPermissions=void 0,Re.saveActualDataToStorage("sc.token",void 0)}function s(o){const p=ue();!u.isNil(p.jwtToken)&&u.isNil(p.userPermissions)&&p.jwtToken.then(a=>{const P=re.getJwtPayload(a);p.userPermissions=P.exp*1e3>Date.now()?u.mapValues(P.resourceAccess,T=>(T==null?void 0:T.roles)??[]):void 0}).catch(u.noop);const g=u.isArray(o)?o.join(" && "):o;if(p.userPermissionsComputedRefs.has(g))return p.userPermissionsComputedRefs.get(g);const m=f.computed(()=>{const a=P=>{var ve;const T=u.split(P,".");if(T.length<2)return!1;const[Me,He]=T,Pe=(ve=ue().userPermissions)==null?void 0:ve[Me];return u.isArray(Pe)&&Pe.includes(He)};return u.isArray(o)?u.every(o,P=>a(P)):a(o)});return p.userPermissionsComputedRefs.set(g,m),m}return{jwtToken:n,setJwtTokenUpdater:r,setJwtToken:e,invalidateJwtToken:t,hasUserPermission:s}});var Se=(n=>(n.Image="image",n.Video="video",n))(Se||{});class G{constructor(r,e){i(this,"id");i(this,"guid");this.id=r==null?void 0:r.id,u.isNil(this.id)&&(u.isNil(e)?typeof(r==null?void 0:r.id)=="number"?this.id=-1:typeof(r==null?void 0:r.id)=="string"&&(this.id=""):this.id=e),this.guid=(r==null?void 0:r.guid)??""}isNewRec(){return typeof this.id=="number"?this.id===-1:typeof this.id=="string"?this.id==="":u.isNil(this.id)}}class We extends G{constructor(e){super(e,"");i(this,"mediaType");i(this,"isCover");i(this,"isUnused");i(this,"url");i(this,"urlWebp");this.mediaType=(e==null?void 0:e.mediaType)??Se.Image,this.isCover=(e==null?void 0:e.isCover)??!1,this.isUnused=(e==null?void 0:e.isUnused)??!1,this.url=(e==null?void 0:e.url)??"",this.urlWebp=e==null?void 0:e.urlWebp}isImage(){return this.mediaType===Se.Image}isVideo(){return this.mediaType===Se.Video}}var be=(n=>(n.Draft="draft",n.Published="published",n.Scheduled="scheduled",n))(be||{});class A{static parse(r){if(u.isNil(r))return;const e=u.isString(r)?l.parseISO(r):r;return l.isValid(e)?e:void 0}static toApiFormat(r){return u.isNil(r)||!l.isValid(r)?null:l.format(r,b().config.dateFormats.api)}static periodToApiFormat(r){return{from:A.toApiFormat(r.from),to:A.toApiFormat(r.to)}}}class Ae extends G{constructor(e,t){super(e,t);i(this,"createdAt");this.createdAt=A.parse(e==null?void 0:e.createdAt)??new Date}}class pe extends Ae{constructor(e){super(e,-1);i(this,"slug");i(this,"title");i(this,"publishedAt");this.slug=(e==null?void 0:e.slug)??"",this.title=(e==null?void 0:e.title)??"",this.publishedAt=pe.parseDate(e==null?void 0:e.publishedAt)}static resolvePublicationStatus(e){return u.isNil(e)?be.Draft:e.getTime()>Date.now()?be.Scheduled:be.Published}static getSlugError(e){return e?/[^a-z0-9-]/.test(e)?"Допустимы только строчные латинские буквы, цифры и дефис: пример «kak-vybrat-podokonnik».":u.startsWith(e,"-")||u.endsWith(e,"-")?"Обозначение не может начинаться или заканчиваться дефисом.":u.includes(e,"--")?"Дефисы не могут идти подряд: разделяйте слова одним дефисом.":"":""}static parseDate(e){return u.isNil(e)?null:u.isString(e)?l.parseISO(e):e}getPublicationStatus(){return pe.resolvePublicationStatus(this.publishedAt)}}class Ge extends pe{constructor(e){super(e);i(this,"content");i(this,"media");this.content=(e==null?void 0:e.content)??"",this.media=((e==null?void 0:e.media)??[]).map(t=>new We(t))}toSaveData(e=!1){return{title:this.title,slug:this.slug.length>0?this.slug:void 0,content:e?this.content:void 0,publishedAt:this.publishedAt}}getCover(){return this.media.find(e=>e.isCover)}getUnusedMedia(){return this.media.filter(e=>e.isUnused)}}class te{asClearRaw(){const r={};return Object.keys(this).forEach(e=>{const t=this[e];u.isNil(t)||u.isString(t)&&t.trim().length===0||u.isFunction(t.isNewRec)&&t.isNewRec()||(r[e]=t)}),r}}class R{constructor(r){i(this,"from");i(this,"to");this.from=u.isString(r==null?void 0:r.from)?l.parseISO(r.from):(r==null?void 0:r.from)??null,this.to=u.isString(r==null?void 0:r.to)?l.parseISO(r.to):(r==null?void 0:r.to)??null}}class xt extends te{constructor(e){super();i(this,"id");i(this,"title");i(this,"slug");i(this,"content");i(this,"publicationStatus");i(this,"publishedAt");i(this,"createdAt");this.id=e==null?void 0:e.id,this.title=e==null?void 0:e.title,this.slug=e==null?void 0:e.slug,this.content=e==null?void 0:e.content,this.publicationStatus=e==null?void 0:e.publicationStatus,this.publishedAt=new R(e==null?void 0:e.publishedAt),this.createdAt=new R(e==null?void 0:e.createdAt)}resetFilterValue(e){switch(e){case"id":case"title":case"slug":case"content":case"publicationStatus":this[e]=void 0;break;case"publishedAt":this.publishedAt.from=null,this.publishedAt.to=null;break;case"createdAt":this.createdAt.from=null,this.createdAt.to=null;break}return this}asClearRaw(){var t,s,o,p;const e=super.asClearRaw();return!((t=e==null?void 0:e.publishedAt)!=null&&t.from)&&!((s=e==null?void 0:e.publishedAt)!=null&&s.to)&&delete e.publishedAt,!((o=e==null?void 0:e.createdAt)!=null&&o.from)&&!((p=e==null?void 0:e.createdAt)!=null&&p.to)&&delete e.createdAt,e}}var U=(n=>(n.BASE_URL_REQUEST_INTERCEPTOR="baseUrlRequestInterceptor",n.DEFAULT_REQUEST_INTERCEPTOR="defaultRequestInterceptor",n.AUTH_REQUEST_INTERCEPTOR="authRequestInterceptor",n.DATA_CONVERTER_REQUEST_INTERCEPTOR="dataConverterRequestInterceptor",n.CONVERT_HTTP_ERROR_RESPONSE_INTERCEPTOR="convertHttpErrorResponseInterceptor",n.CANCELED_RESPONSE_INTERCEPTOR="canceledResponseInterceptor",n.AUTH_ERRORS_RESPONSE_INTERCEPTOR="authErrorsResponseInterceptor",n.DATA_CONVERTER_RESPONSE_INTERCEPTOR="dataConverterResponseInterceptor",n))(U||{});class L{static simpleInstanceInitializer(r){return new r}static instanceInitializer(r,e){return new r(e)}static instanceListInitializer(r,e){if(!u.isArray(e))throw new TypeError(`Ожидался список данных для инициализации "${r.name}", получены данные типа "${typeof e}".`);return u.map(e,t=>L.instanceInitializer(r,t))}}const w=class w{constructor(){i(this,"httpClient");i(this,"baseUrl",`${b().config.http.portalApiUrl}/api`);i(this,"interceptorIds",{request:{},response:{}});i(this,"setBaseUrlRequestInterceptor",r=>(r.baseURL=this.baseUrl,r));i(this,"authRequestInterceptor",async r=>{const e=Te().jwtToken,t=u.isNil(e)?void 0:await e;return t&&r.headers.set("Authorization",`Bearer ${t}`),r});i(this,"dataConverterRequestInterceptor",r=>(r.method&&(r.method==="get"&&!u.isNil(r.params)&&(r.params=w.toSnakeCaseData(r.params)),["put","patch","post"].includes(u.toLower(r.method))&&!u.isNil(r.data)&&(r.data=w.toSnakeCaseData(r.data))),r));i(this,"authErrorsResponseInterceptors",async r=>{var t;const e=r.rawError?(t=r.rawError)==null?void 0:t.config:void 0;if(r.status===401){if(!e||e.__isRetryRequest)return Promise.reject(r);e.__isRetryRequest=!0;try{await w.isStaleUnauthorizedRequest(e)||await w.refreshAccessToken()}catch{return Promise.reject(r)}return this.httpClient(e)}return Promise.reject(r)});i(this,"canceledResponseInterceptor",r=>{const e=r.rawError??r;if(e.name==="CanceledError"||e.code==="ERR_CANCELED")throw new rt.CanceledError("Request canceled");return Promise.reject(r)});i(this,"dataConverterResponseInterceptor",r=>(r.data=w.toCamelCaseData(r.data),r));this.httpClient=rt.create({headers:{Accept:"application/json","Content-Type":"application/json"}}),this.interceptorIds.request[U.DATA_CONVERTER_REQUEST_INTERCEPTOR]=this.httpClient.interceptors.request.use(this.dataConverterRequestInterceptor,r=>Promise.reject(r)),this.interceptorIds.request[U.AUTH_REQUEST_INTERCEPTOR]=this.httpClient.interceptors.request.use(this.authRequestInterceptor,r=>Promise.reject(r)),this.interceptorIds.request[U.DEFAULT_REQUEST_INTERCEPTOR]=this.httpClient.interceptors.request.use(r=>w.applyDefaultRequestHook(r),r=>Promise.reject(r)),this.interceptorIds.request[U.BASE_URL_REQUEST_INTERCEPTOR]=this.httpClient.interceptors.request.use(this.setBaseUrlRequestInterceptor,r=>Promise.reject(r)),this.interceptorIds.response[U.CONVERT_HTTP_ERROR_RESPONSE_INTERCEPTOR]=this.httpClient.interceptors.response.use(r=>r,r=>w.convertHttpErrorResponse(r)),this.interceptorIds.response[U.CANCELED_RESPONSE_INTERCEPTOR]=this.httpClient.interceptors.response.use(r=>r,this.canceledResponseInterceptor),this.interceptorIds.response[U.AUTH_ERRORS_RESPONSE_INTERCEPTOR]=this.httpClient.interceptors.response.use(r=>r,this.authErrorsResponseInterceptors),this.interceptorIds.response[U.DATA_CONVERTER_RESPONSE_INTERCEPTOR]=this.httpClient.interceptors.response.use(this.dataConverterResponseInterceptor,r=>Promise.reject(r))}static setDefaultErrorsResponseHandler(r){w.defaultErrorsResponseHandler=r}static setDefaultRequestHook(r){w.defaultRequestHook=r}static canConvertCaseKeys(r){return u.isObject(r)?!(r instanceof Blob||r instanceof FormData||r instanceof ArrayBuffer||u.isDate(r)||ArrayBuffer.isView(r)):!1}static toCamelCaseData(r){return w.canConvertCaseKeys(r)?Be.objectToCamel(r):r}static toSnakeCaseData(r){return w.canConvertCaseKeys(r)?Be.objectToSnake(r):r}static getRequestAccessToken(r){const e=r.headers.get("Authorization"),t=u.isString(e)?e:void 0,s="Bearer ";if(u.isNil(t)||!u.startsWith(t,s))return;const o=t.slice(s.length);return o===""?void 0:o}static async isStaleUnauthorizedRequest(r){const e=w.getRequestAccessToken(r);if(u.isNil(e))return!1;const t=Te().jwtToken;if(u.isNil(t))return!1;try{return await t!==e}catch{return!1}}static refreshAccessToken(){if(!u.isNil(w.tokenRefreshPromise))return w.tokenRefreshPromise;Te().invalidateJwtToken();const e=Te().jwtToken??Promise.resolve();return w.tokenRefreshPromise=e.finally(()=>{w.tokenRefreshPromise=void 0}),w.tokenRefreshPromise}static applyDefaultRequestHook(r){return u.isNil(w.defaultRequestHook)?r:w.defaultRequestHook(r)}static getInstance(r){return Object.prototype.hasOwnProperty.call(w.instances,r.name)||(w.instances[r.name]=L.simpleInstanceInitializer(r)),w.instances[r.name]}static toHttpResponseError(r){if(u.isObject(r)&&"status"in r)return r;const e=u.isError(r)?r.message:"Не удалось обработать данные ответа сервера.";return u.assign(new Error(e),{name:"HttpResponseError",status:0,statusText:"Invalid response data",headers:{},rawError:u.isError(r)?r:new Error(String(r))})}static convertHttpErrorResponse(r){var e,t;if(u.isNil(r)||!u.isNil(r.request)||!u.isNil(r.response)){const s=u.isNil(r)?{}:r==null?void 0:r.response;return Promise.reject(u.assign(new Error(((e=s==null?void 0:s.data)==null?void 0:e.message)??"Unknown Error. Probably network error."),{name:"HttpResponseError",status:(s==null?void 0:s.status)??0,statusText:(s==null?void 0:s.statusText)??"Unknown",errors:(t=s==null?void 0:s.data)==null?void 0:t.errors,headers:(s==null?void 0:s.headers)??{},data:s==null?void 0:s.data,rawError:r}))}return Promise.reject(r)}request(r,e=void 0,t={},s=!1){const o=this.httpClient.request(r).then(p=>e?e(p):p.data);return o.catch(p=>{(p==null?void 0:p.name)!=="CanceledError"&&w.defaultErrorsResponseHandler(w.toHttpResponseError(p),t,s)}),o}get(r,e={},t=void 0,s=!1,o=void 0){return this.request({method:"GET",url:r,params:e,signal:o},t,{},s)}getTypedList(r,e,t={},s=!1,o=void 0){return this.get(e,t,p=>L.instanceListInitializer(r,p.data),s,o)}getBlob(r,e={},t=void 0,s=!1,o=void 0){return this.request({method:"GET",url:r,params:e,responseType:"blob",signal:o},t,{},s)}patch(r,e={},t=void 0,s={},o=!1,p=void 0){return this.request({method:"PATCH",url:r,data:e,signal:p},t,s,o)}post(r,e={},t=void 0,s={},o=!1,p=void 0){return this.request({method:"POST",url:r,data:e,signal:p},t,s,o)}delete(r,e=void 0,t=!1,s=void 0){return this.request({method:"DELETE",url:r,signal:s},e,{},t)}};i(w,"instances",{}),i(w,"defaultErrorsResponseHandler",u.noop),i(w,"defaultRequestHook"),i(w,"tokenRefreshPromise");let y=w;var ze=(n=>(n.BeginWith="bw",n.Contains="cn",n.Custom="custom",n.EndsWith="ew",n.Equals="eq",n.GreaterOrEqual="ge",n.GreaterThan="gt",n.InList="in",n.LessOrEqual="le",n.LessThan="lt",n.NotBeginWith="bn",n.NotContains="nc",n.NotEndsWith="en",n.NotEqual="ne",n.NotInList="ni",n.NotNull="nn",n.Null="nu",n))(ze||{});class hr{constructor(r){i(this,"field");i(this,"op");i(this,"value");this.field=(r==null?void 0:r.field)??"",this.op=(r==null?void 0:r.op)??ze.Equals,this.value=(r==null?void 0:r.value)??""}toPrimitive(){const r=b().config.dateFormats.api,e={field:this.field,op:this.op};if(u.isDate(this.value))e.value=l.format(this.value,r);else if(u.isPlainObject(this.value)){const t=this.value;e.value={from:t.from?l.format(t.from,r):null,to:t.to?l.format(t.to,r):null}}else e.value=this.value;return e}}class J{constructor(r){i(this,"groupOp");i(this,"filters");i(this,"groups");var e,t;this.groupOp=(r==null?void 0:r.groupOp)??"and",this.filters=((e=r==null?void 0:r.filters)==null?void 0:e.map(s=>new hr(s)))??[],this.groups=((t=r==null?void 0:r.groups)==null?void 0:t.map(s=>new J(s)))??[]}toPrimitive(){return{groupOp:this.groupOp,filters:this.filters.map(r=>r instanceof hr&&u.isFunction(r.toPrimitive)?r.toPrimitive():r),groups:this.groups.map(r=>r instanceof J?r.toPrimitive():r)}}}class _ extends y{getPaginated(r,e,t,s,o,p,g,m){let a={page:(s==null?void 0:s.page)??1,perPage:(s==null?void 0:s.pageSize)??10};return e&&(a.filters=JSON.stringify((e instanceof J?e:new J(e)).toPrimitive())),u.isEmpty(t)||(a.sort=u.isArray(t)?t:[t]),o&&(a={...a,...o}),this.get(r,a,p,g,m)}getTypedPaginated(r,e,t,s,o,p,g,m){return this.getPaginated(e,t,s,o,p,a=>({...a.data,data:L.instanceListInitializer(r,a.data.data)}),g,m)}}class je extends _{static preparePostSaveData(r){const e={};if(u.isUndefined(r.title)||(e.title=r.title),u.isUndefined(r.slug)||(e.slug=r.slug),u.isUndefined(r.content)||(e.content=r.content),!u.isUndefined(r.publishedAt)){const t=b().config.dateFormats.api;e.publishedAt=u.isNil(r.publishedAt)?null:l.format(r.publishedAt,t)}return e}getPostList(r,e,t){return this.getPaginated("/internal/blog",r,e,t,{},s=>({...s.data,data:s.data.data.map(o=>new pe(o))}))}getPost(r){return this.get(`/internal/blog/${r}`,{},e=>new Ge(e.data))}createPost(r,e={}){return this.post("/internal/blog",je.preparePostSaveData(r),t=>new Ge(t.data),e)}updatePost(r,e,t={}){return this.patch(`/internal/blog/${r}`,je.preparePostSaveData(e),s=>new Ge(s.data),t)}removePost(r){return this.delete(`/internal/blog/${r}`)}uploadMedia(r,e,t,s,o={}){return this.request({method:"POST",url:`/internal/blog/${r}/media`,data:{file:e,isCover:t??!1},onUploadProgress:p=>{s&&s(p.total?Math.round(p.loaded/p.total*100):0)}},p=>new We(p.data),o)}updateMedia(r,e,t,s={}){return this.patch(`/internal/blog/${r}/media/${e}`,{isCover:t},o=>new We(o.data),s)}removeMedia(r,e){return this.delete(`/internal/blog/${r}/media/${e}`)}}class d extends G{constructor(e){super(e);i(this,"name","");this.name=(e==null?void 0:e.name)??""}nameOrGuid(){return u.isEmpty(this.name)?this.guid:this.name}}class Oe extends d{constructor(e){super(e);i(this,"createdAt");i(this,"updatedAt");this.createdAt=A.parse(e==null?void 0:e.createdAt),this.updatedAt=A.parse(e==null?void 0:e.updatedAt)}}class $e extends Oe{constructor(e){super(e);i(this,"deletedAt");this.deletedAt=A.parse(e==null?void 0:e.deletedAt)}}class k extends d{constructor(e){super(e);i(this,"type");i(this,"isActive");this.type=e==null?void 0:e.type,this.isActive=(e==null?void 0:e.isActive)??!0}}class Ye extends $e{constructor(e){super(e);i(this,"costCoefficient");i(this,"isLowPriceAllowed");i(this,"publishedAt");i(this,"description");i(this,"percent");i(this,"owner");this.costCoefficient=(e==null?void 0:e.costCoefficient)??0,this.isLowPriceAllowed=(e==null?void 0:e.isLowPriceAllowed)??!1,this.publishedAt=A.parse(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 k(e==null?void 0:e.owner)}}class ie extends Oe{constructor(e){super(e);i(this,"description");i(this,"owner");this.description=(e==null?void 0:e.description)??"",this.owner=e!=null&&e.owner?new k(e.owner):void 0}}var gr=(n=>(n.K0="k0",n.K1="k1",n.K2="k2",n.K3="k3",n.K4="k4",n.Retail="retail",n))(gr||{});class v extends d{constructor(e){super(e);i(this,"slug");i(this,"description");this.description=e==null?void 0:e.description,this.slug=e==null?void 0:e.slug}}class x extends v{static getRetailPriceCoefficient(){const r=new x({id:-2,slug:gr.Retail,name:"Розн. цена",guid:""});return r.isNewRec=u.constant(!0),r}}class Qe{constructor(r){i(this,"coefficient");i(this,"value");i(this,"cost");i(this,"percent");i(this,"readOnly");this.coefficient=new x(r==null?void 0:r.coefficient),this.value=(r==null?void 0:r.value)??0,this.cost=(r==null?void 0:r.cost)??0,this.percent=(r==null?void 0:r.percent)??0,this.readOnly=(r==null?void 0:r.readOnly)??!0}}class fr{constructor(r){i(this,"lat");i(this,"long");this.lat=(r==null?void 0:r.lat)??0,this.long=(r==null?void 0:r.long)??0}}class z extends v{}class he extends v{constructor(e){var t;super(e);i(this,"address");i(this,"isMain");i(this,"deliveryTypes");i(this,"regions");i(this,"coordinates");this.address=(e==null?void 0:e.address)??"",this.isMain=(e==null?void 0:e.isMain)??!1,this.deliveryTypes=((t=e==null?void 0:e.deliveryTypes)==null?void 0:t.map(s=>new z(s)))??[],this.regions=(e==null?void 0:e.regions)??[],this.coordinates=new fr(e==null?void 0:e.coordinates)}}class lt{constructor(r){i(this,"warehouse");i(this,"count");this.warehouse=new he(r==null?void 0:r.warehouse),this.count=(r==null?void 0:r.count)??0}}class M extends d{constructor(e){super(e);i(this,"signature","");i(this,"code");i(this,"symbol","");i(this,"precision");e&&(this.signature=e.signature??"",this.code=e.code,this.symbol=e.symbol??"",this.precision=e.precision)}}class mr extends d{constructor(e){super(e);i(this,"slug","");i(this,"description");i(this,"isSquare",!1);i(this,"isLinear",!1);e&&(this.slug=e.slug??"",this.description=e.description,this.isSquare=e.isSquare??!1,this.isLinear=e.isLinear??!1)}}class ge extends d{constructor(e){super(e);i(this,"code","");this.code=(e==null?void 0:e.code)??""}}class yr extends ge{constructor(e){super(e);i(this,"slug");i(this,"type");this.slug=(e==null?void 0:e.slug)??""}}class ut extends yr{constructor(e){super(e);i(this,"isHidden");this.isHidden=(e==null?void 0:e.isHidden)??!1}}class pt{constructor(r,e){i(this,"image");i(this,"preview");i(this,"isDefault");this.image=`${e??""}${r.image}`,this.preview=`${e??""}${r.preview}`,this.isDefault=r.isDefault}}class Ve extends yr{constructor(e){super(e);i(this,"isPrimary");this.isPrimary=(e==null?void 0:e.isPrimary)??!1}}class N extends ut{constructor(e){var s,o,p,g;super(e);i(this,"supplierSku");i(this,"unit");i(this,"pack");i(this,"minCount");i(this,"currency");i(this,"cost");i(this,"costRub");i(this,"costDate");i(this,"onOrder");i(this,"stockCount");i(this,"category");i(this,"categories");i(this,"images");i(this,"properties");i(this,"retailCost");i(this,"retailCostRub");i(this,"priceCoefficients");this.supplierSku=e==null?void 0:e.supplierSku,this.unit=e!=null&&e.unit?new mr(e.unit):new mr,this.pack=e==null?void 0:e.pack,this.minCount=e==null?void 0:e.minCount,this.currency=e!=null&&e.currency?new M(e.currency):new M,this.cost=(e==null?void 0:e.cost)??0,this.costRub=(e==null?void 0:e.costRub)??0,this.costDate=u.isString(e==null?void 0:e.costDate)?l.parseISO(e.costDate):e==null?void 0:e.costDate,this.onOrder=(e==null?void 0:e.onOrder)??!1,this.stockCount=((s=e==null?void 0:e.stockCount)==null?void 0:s.map(m=>new lt(m)))??[],this.type="product";const t=(e==null?void 0:e.category)??((o=e==null?void 0:e.categories)==null?void 0:o.find(m=>m.isPrimary));t&&(this.category=new Ve({...t,isPrimary:!0}),this.categories=[this.category]),e!=null&&e.categories&&(this.categories=e.categories.map(m=>new Ve(m))),this.images=((p=e==null?void 0:e.images)==null?void 0:p.map(m=>new pt(m,b().config.http.mediaUrl)))??[],this.properties=(e==null?void 0:e.properties)??{},this.retailCost=e==null?void 0:e.retailCost,this.retailCostRub=e==null?void 0:e.retailCostRub,this.priceCoefficients=((g=e==null?void 0:e.priceCoefficients)==null?void 0:g.map(m=>new Qe(m)))??[],e&&"codeNumber"in e&&!e.code&&(this.code=e==null?void 0:e.codeNumber)}getIsMeasurable(){return this.unit.isLinear||this.unit.isSquare}getRetailCost(){return this.retailCost??this.cost}getRetailCostRub(){return this.retailCostRub??this.costRub}}var Je=(n=>(n.Discount="discount",n.PriceTemplate="price_template",n.ClientPrice="client_price",n.Product="product",n))(Je||{});class se extends N{constructor(e){super(e);i(this,"costCoefficient");i(this,"costSource");i(this,"discount");i(this,"priceTemplate");i(this,"priceCoefficient");i(this,"increasePercent");i(this,"isPreviouslyOrdered");i(this,"isRequired");i(this,"isFavorite");this.costCoefficient=(e==null?void 0:e.costCoefficient)??0,this.costSource=(e==null?void 0:e.costSource)??Je.Product,this.discount=e!=null&&e.discount?new Ye(e.discount):void 0,this.priceTemplate=e!=null&&e.priceTemplate?new ie(e.priceTemplate):void 0,this.priceCoefficient=e!=null&&e.priceCoefficient?new x(e.priceCoefficient):void 0,this.increasePercent=e==null?void 0:e.increasePercent,this.isPreviouslyOrdered=e==null?void 0:e.isPreviouslyOrdered,this.isRequired=e==null?void 0:e.isRequired,this.isFavorite=e==null?void 0:e.isFavorite}}class ne extends Ve{constructor(e){super(e);i(this,"isHidden");i(this,"parentCategoryId");i(this,"properties");i(this,"currencyRates");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,s])=>[u.toUpper(t),s])):void 0}}class ar extends G{constructor(e){super(e);i(this,"category");i(this,"product");i(this,"quantity");i(this,"currency");i(this,"marker");i(this,"height");i(this,"length");i(this,"width");i(this,"configurator");i(this,"configuratorParams");i(this,"isAdditionalSale");i(this,"creator");i(this,"isRemoved");i(this,"ord");i(this,"onOrder");i(this,"originalId");i(this,"replacementId");this.product=new se(e.product),this.quantity=e.quantity??0,this.marker=e.marker,this.category=e.category??new ne,this.currency=e.currency?new M(e.currency):void 0,this.height=e.height,this.length=e.length,this.width=e.width,this.configurator=e.configurator,this.configuratorParams=e.configuratorParams&&u.cloneDeep(e.configuratorParams),this.isAdditionalSale=e.isAdditionalSale,this.creator=e.creator&&new k(e.creator),this.isRemoved=e.isRemoved,this.ord=e.ord,this.onOrder=e.onOrder,this.originalId=e.originalId,this.replacementId=e.replacementId}}let Cr=class extends ar{constructor(e){super(e);i(this,"cost");i(this,"costOne");i(this,"costOneRub");i(this,"costRub");i(this,"logicGroupId");i(this,"salesDirection");i(this,"specificationImgUrl");i(this,"sawing");i(this,"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=u.isArray(e.sawing)?e.sawing:e.sawing?[e.sawing]:void 0,this.currency=new M(e.currency)}};class fe{constructor(r){i(this,"items");i(this,"resultSum");i(this,"directionsSum");this.items=r.items.map(e=>new Cr(e)),this.resultSum=r.resultSum,this.directionsSum=r.directionsSum}}class Kt extends y{getCart(r){return this.get(`internal/clients/${r.id}/cart`,{},e=>new fe(e.data))}deleteCart(r){return this.delete(`internal/clients/${r.id}/cart`)}addCartItem(r,e,t={}){return this.patch(`internal/clients/${r.id}/cart`,{product_id:e.product.id,product_category_id:e.configurator?e.category.id:void 0,quantity:e.quantity,height:e.height,length:e.length,width:e.width,configurator:e.configurator,marker:e.marker,is_additional_sale:e.isAdditionalSale,...e.configuratorParams},s=>new fe(s.data),t)}patchCartItem(r,e,t={}){return this.patch(`internal/clients/${r.id}/cart/${e.id}`,{product_id:e.product.id,product_category_id:e.configurator?e.category.id:void 0,quantity:e.quantity,height:e.height,length:e.length,width:e.width,configurator:e.configurator,marker:e.marker,is_additional_sale:e.isAdditionalSale,...e.configuratorParams},s=>new fe(s.data),t)}deleteCartItem(r,e){return this.delete(`internal/clients/${r.id}/cart/${e.id}`,t=>new fe(t.data))}addCartItemFromCSV(r,e){return this.post(`internal/clients/${r.id}/cart/add-products-from-csv`,e,t=>new fe(t.data))}getCartItemFromCSVExample(r){return this.get(`internal/clients/${r.id}/cart/add-products-from-csv/example`,{},e=>new Blob([e.data],{type:"text/csv"}))}}var ht=(n=>(n.m2Cost="m2Cost",n.percent="percent",n.value="value",n))(ht||{}),gt=(n=>(n.Unknown="unknown",n.Bool="bool",n.Integer="integer",n.Float="float",n.String="string",n.Range="range",n.Json="json",n.Object="object",n))(gt||{}),Dr=(n=>(n.Checkbox="checkbox",n.Range="range",n.Toggle="toggle",n))(Dr||{});class H extends ne{constructor(e){var t,s;super(e);i(this,"categories");i(this,"products");this.categories=(t=e==null?void 0:e.categories)==null?void 0:t.map(o=>new H(o)),this.products=(s=e==null?void 0:e.products)==null?void 0:s.map(o=>new N(o))}}class wr{constructor(r){i(this,"phone");i(this,"email");this.phone=/^\d+$/.test(r.phone??"")?`+${r.phone}`:r.phone,this.email=r.email}}class q extends v{}class xe extends Oe{constructor(e){super(e);i(this,"salesDirection");i(this,"photo");i(this,"contacts");i(this,"isDefault");i(this,"isRegionalDirector");this.salesDirection=e!=null&&e.salesDirection?new q(e.salesDirection):new q,this.photo=e==null?void 0:e.photo,this.contacts=e!=null&&e.contacts?new wr(e.contacts):void 0,this.isDefault=(e==null?void 0:e.isDefault)??!1,this.isRegionalDirector=(e==null?void 0:e.isRegionalDirector)??!1}}class Ke extends v{}class Pr extends d{constructor(e){super(e);i(this,"description");i(this,"canChangeLowCost");i(this,"parentRoleId");this.description=e.description,this.canChangeLowCost=e.canChangeLowCost,this.parentRoleId=e.parentRoleId}}class de extends d{constructor(e){super(e);i(this,"abbr");this.abbr=(e==null?void 0:e.abbr)??""}}class j extends xe{constructor(e){var t,s,o;super(e);i(this,"isActive");i(this,"isSupervisor");i(this,"canDoReclamations");i(this,"supervisorId");i(this,"pricingRole");i(this,"curatedDirections");i(this,"showAllCosts");i(this,"authAsOperator");i(this,"managerRegions");i(this,"managers");i(this,"lastLoginAt");this.isActive=(e==null?void 0:e.isActive)??!1,this.isSupervisor=(e==null?void 0:e.isSupervisor)??!1,this.canDoReclamations=(e==null?void 0:e.canDoReclamations)??!1,this.supervisorId=e==null?void 0:e.supervisorId,this.pricingRole=e!=null&&e.pricingRole?new Pr(e.pricingRole):void 0,this.curatedDirections=((t=e==null?void 0:e.curatedDirections)==null?void 0:t.map(p=>new Ke(p)))??[],this.showAllCosts=e==null?void 0:e.showAllCosts,this.authAsOperator=e==null?void 0:e.authAsOperator,this.managerRegions=(s=e==null?void 0:e.managerRegions)==null?void 0:s.map(p=>new de(p)),this.managers=(o=e==null?void 0:e.managers)==null?void 0:o.map(p=>new j(p)),this.lastLoginAt=u.isString(e==null?void 0:e.lastLoginAt)?l.parseISO(e.lastLoginAt):e==null?void 0:e.lastLoginAt}}class Xt extends ne{constructor(e){super(e);i(this,"isDisabled");i(this,"isRequired");i(this,"isFavorite");i(this,"hidingComment");i(this,"manager");this.isDisabled=(e==null?void 0:e.isDisabled)??!1,this.isRequired=(e==null?void 0:e.isRequired)??!1,this.isFavorite=(e==null?void 0:e.isFavorite)??!1,this.hidingComment=e==null?void 0:e.hidingComment,this.manager=e!=null&&e.manager?new j(e.manager):void 0}}class ke extends Xt{constructor(e){var t,s;super(e);i(this,"categories");i(this,"products");this.categories=(t=e==null?void 0:e.categories)==null?void 0:t.map(o=>new ke(o)),this.products=(s=e==null?void 0:e.products)==null?void 0:s.map(o=>new se(o))}}class vr{constructor(r){i(this,"priceCoefficient");i(this,"increasePercent");this.priceCoefficient=(r==null?void 0:r.priceCoefficient)&&new x(r.priceCoefficient),this.increasePercent=r==null?void 0:r.increasePercent}}class Rr extends vr{constructor(r){super(r)}}class Xe extends Rr{constructor(e){super(e);i(this,"productCategory");this.productCategory=new ne(e==null?void 0:e.productCategory)}}class Ee extends d{constructor(e){super(e);i(this,"photo");i(this,"contacts");i(this,"curatedDirection");this.photo=e.photo,this.contacts=new wr(e.contacts),this.curatedDirection=new Ke(e.curatedDirection)}}class oe extends v{}class K extends v{constructor(e){super(e);i(this,"country",new oe);e&&(this.country=new oe(e.country))}}class Y extends v{constructor(e){super(e);i(this,"region",new K);e&&(this.region=new K(e.region))}}class Tr extends Oe{constructor(e){super(e);i(this,"phone");i(this,"email");i(this,"getNews");i(this,"salesDirection");i(this,"lastLoginAt");i(this,"isActive");this.phone=/^\d+$/.test((e==null?void 0:e.phone)??"")?`+${e==null?void 0:e.phone}`:(e==null?void 0:e.phone)??"",this.email=(e==null?void 0:e.email)??"",this.getNews=(e==null?void 0:e.getNews)??!1,this.salesDirection=e!=null&&e.salesDirection?new q(e.salesDirection):void 0,this.lastLoginAt=u.isString(e==null?void 0:e.lastLoginAt)?l.parseISO(e.lastLoginAt):e==null?void 0:e.lastLoginAt,this.isActive=(e==null?void 0:e.isActive)??!1}}class X extends Tr{constructor(e){var t,s;super(e);i(this,"salesDirection");i(this,"debt");i(this,"alternativeName");i(this,"city");i(this,"comment");i(this,"isPhoneApproved");i(this,"isEmailApproved");i(this,"managers");i(this,"curators");this.salesDirection=new q(e==null?void 0:e.salesDirection),this.debt=(e==null?void 0:e.debt)??0,this.alternativeName=(e==null?void 0:e.alternativeName)??"",this.city=new Y(e==null?void 0:e.city),this.comment=e==null?void 0:e.comment,this.isPhoneApproved=(e==null?void 0:e.isPhoneApproved)??!1,this.isEmailApproved=(e==null?void 0:e.isEmailApproved)??!1,this.managers=((t=e==null?void 0:e.managers)==null?void 0:t.map(o=>new xe(o)))??[],this.curators=((s=e==null?void 0:e.curators)==null?void 0:s.map(o=>new Ee(o)))??void 0}}class ft extends Ae{constructor(e,t){super(e,t);i(this,"deletedAt");this.deletedAt=A.parse(e==null?void 0:e.deletedAt)}}class me extends ft{constructor(e){super(e);i(this,"client");i(this,"priceTemplate");this.client=new X(e==null?void 0:e.client),this.priceTemplate=new ie(e==null?void 0:e.priceTemplate)}}class Ze extends Rr{constructor(e){super(e);i(this,"product");this.product=new N(e==null?void 0:e.product)}}class Sr extends v{}class ce extends d{constructor(e){super(e);i(this,"type");i(this,"description");i(this,"metadata");i(this,"isFilterable");this.type=new Sr(e==null?void 0:e.type),this.description=(e==null?void 0:e.description)??"",this.metadata=e==null?void 0:e.metadata,this.isFilterable=e==null?void 0:e.isFilterable}}class le{constructor(r){i(this,"property");i(this,"value");this.property=new ce(r==null?void 0:r.property),this.value=(r==null?void 0:r.value)??""}}class Et{constructor(r){i(this,"id");i(this,"name");i(this,"description");i(this,"ownerName");i(this,"createdAt",new R);i(this,"updatedAt",new R);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 R(r==null?void 0:r.createdAt),this.updatedAt=new R(r==null?void 0:r.updatedAt)}resetFilterValue(r){switch(r){case"id":case"name":case"description":case"ownerName":this[r]=void 0;break;case"createdAt":this.createdAt.from=null,this.createdAt.to=null;break;case"updatedAt":this.updatedAt.from=null,this.updatedAt.to=null;break}return this}asClearRaw(){var e,t,s,o;const r={};return Object.keys(this).forEach(p=>{const g=this[p];u.isNil(g)||u.isString(g)&&g.trim().length===0||u.isFunction(g.isNewRec)&&g.isNewRec()||(r[p]=g)}),!((e=r==null?void 0:r.createdAt)!=null&&e.from)&&!((t=r==null?void 0:r.createdAt)!=null&&t.to)&&delete r.createdAt,!((s=r==null?void 0:r.updatedAt)!=null&&s.from)&&!((o=r==null?void 0:r.updatedAt)!=null&&o.to)&&delete r.updatedAt,r}}class br extends vr{constructor(e){super(e);i(this,"executor");i(this,"createdAt");this.executor=e!=null&&e.executor?new k(e.executor):void 0,this.createdAt=A.parse(e==null?void 0:e.createdAt)}}class Fe extends br{constructor(e){super(e);i(this,"product");this.product=new N(e==null?void 0:e.product)}}class Ar extends br{constructor(e){super(e);i(this,"productCategory");this.productCategory=new ne(e==null?void 0:e.productCategory)}}class ye extends d{constructor(e){super(e);i(this,"description");i(this,"canChangeLowCost");i(this,"parentRoleId");i(this,"subRoles",[]);i(this,"parentRole");i(this,"level",0);this.description=e==null?void 0:e.description,this.canChangeLowCost=(e==null?void 0:e.canChangeLowCost)??!1,this.parentRoleId=e==null?void 0:e.parentRoleId}}class Or{constructor(r){i(this,"role");i(this,"category");i(this,"minCoefficient");this.role=new ye(r==null?void 0:r.role),this.category=new ne(r==null?void 0:r.category),this.minCoefficient=new x(r==null?void 0:r.minCoefficient)}}class mt{constructor(r){i(this,"isFake");i(this,"isHidden");i(this,"isMultiple");i(this,"type");i(this,"ord");this.isFake=(r==null?void 0:r.isFake)??!1,this.isHidden=(r==null?void 0:r.isHidden)??!1,this.isMultiple=(r==null?void 0:r.isMultiple)??null,this.type=(r==null?void 0:r.type)??null,this.ord=(r==null?void 0:r.ord)??0}}class $r{constructor(r){i(this,"category");i(this,"property");i(this,"settings");this.category=new ne(r==null?void 0:r.category),this.property=new ce(r==null?void 0:r.property),this.settings=new mt(r==null?void 0:r.settings)}}class yt{constructor(r){i(this,"id");i(this,"label");this.id=(r==null?void 0:r.id)??"",this.label=(r==null?void 0:r.label)??""}}class at{constructor(r){i(this,"id");i(this,"label");i(this,"type");i(this,"ord");i(this,"isMultiple");i(this,"values");i(this,"min");i(this,"max");var e;this.id=(r==null?void 0:r.id)??"",this.label=(r==null?void 0:r.label)??"",this.type=(r==null?void 0:r.type)??Dr.Checkbox,this.ord=(r==null?void 0:r.ord)??0,this.isMultiple=(r==null?void 0:r.isMultiple)??null,this.values=((e=r==null?void 0:r.values)==null?void 0:e.map(t=>new yt(t)))??[],this.min=(r==null?void 0:r.min)??null,this.max=(r==null?void 0:r.max)??null}}class Zt extends y{search(r,e=!1){return this.get("/internal/catalog/search",{term:r,show_hidden:e})}getPriceExportLink(r="csv",e=!1,t=void 0,s=void 0){let p=`${b().config.http.portalApiUrl}/api/internal/price/export?format=${r}&show_hidden=${e}`;return t&&(p+=`&category_id=${t}`),s&&(p+=`&client_id=${s}`),p}}class Ft extends y{importPrices(r,e,t=!1){return this.post(`/internal/clients/${r}/price/import`,e,void 0,{},t)}getCategoryPrices(r){return this.getTypedList(Ar,`/internal/clients/${r}/price/categories`)}getCategoryPrice(r,e){return this.get(`/internal/clients/${r}/price/categories/${e}`,{},t=>new Ar(t.data))}updateCategoryPrices(r,e,t,s=!1){var o;return this.request({method:"PATCH",url:`/internal/clients/${r}/price/categories/${e}`,data:{price_coefficient_id:(o=t.coefficient)==null?void 0:o.id,increase_percent:t.value},params:s?{recursively:!0}:{}})}removeCategoryPrices(r,e,t=!1){return this.request({method:"DELETE",url:`/internal/clients/${r}/price/categories/${e}`,params:t?{recursively:!0}:{}})}removeCategoryProductsPrices(r,e,t=!1){return this.request({method:"DELETE",url:`/internal/clients/${r}/price/categories/${e}/products`,params:t?{recursively:!0}:{}})}markCategoryRequired(r,e){return this.post(`/internal/clients/${r}/price/categories/${e}/required`)}unmarkCategoryRequired(r,e){return this.delete(`/internal/clients/${r}/price/categories/${e}/required`)}markCategoryDisabled(r,e,t){return this.post(`/internal/clients/${r}/price/categories/${e}/disabled`,{comment:t})}unmarkCategoryDisabled(r,e){return this.delete(`/internal/clients/${r}/price/categories/${e}/disabled`)}addCategoryManager(r,e,t){return this.post(`/internal/clients/${r}/price/categories/${e}/manager`,{manager_id:t})}removeCategoryManager(r,e){return this.delete(`/internal/clients/${r}/price/categories/${e}/manager`)}getProductPrices(r){return this.getTypedList(Fe,`/internal/clients/${r}/price/products`)}getProductPrice(r,e){return this.get(`/internal/clients/${r}/price/products/${e}`,{},t=>new Fe(t.data))}updateProductPrice(r,e,t){var s;return this.patch(`/internal/clients/${r}/price/products/${e}`,{price_coefficient_id:(s=t.coefficient)==null?void 0:s.id,increase_percent:t.value},o=>new Fe(o.data))}removeProductPrice(r,e){return this.delete(`/internal/clients/${r}/price/products/${e}`)}markProductRequired(r,e){return this.post(`/internal/clients/${r}/price/products/${e}/required`)}unmarkProductRequired(r,e){return this.delete(`/internal/clients/${r}/price/products/${e}/required`)}getCommercialOfferHtml(r,e){return this.get(`/internal/clients/${r}/price/commercial-offer/view`,e,t=>new Blob([t.data],{type:"text/html"}))}getCommercialOfferPdf(r,e){return this.getBlob(`/internal/clients/${r}/price/commercial-offer/download`,e,t=>new Blob([t.request.response],{type:"application/pdf"}))}sendCommercialOffer(r,e){return this.post(`/internal/clients/${r}/price/commercial-offer/send`,e)}}class ei extends y{getTemplateList(r){return this.getTypedList(me,`/internal/clients/${r}/price/templates`)}getActiveTemplate(r){return this.get(`/internal/clients/${r}/price/templates/active`,{},e=>new me(e.data),!0)}attachTemplate(r,e,t){const s=b().config.dateFormats.api;return this.post(`/internal/clients/${r}/price/templates/${e}`,t&&{startAt:t.startAt&&l.format(t.startAt,s),endAt:t.endAt&&l.format(t.endAt,s)},o=>new me(o.data),{},!0)}applyTemplate(r,e){return this.post(`/internal/clients/${r}/price/templates/${e}/apply`,{},void 0,{},!0)}changeTemplate(r,e,t,s){const o=b().config.dateFormats.api;return this.patch(`/internal/clients/${r}/price/templates/${e}/${t}`,s&&{startAt:s.startAt&&l.format(s.startAt,o),endAt:s.endAt&&l.format(s.endAt,o)},p=>new me(p.data))}detachTemplate(r,e,t){return this.delete(`/internal/clients/${r}/price/templates/${e}/${t}`)}}class ri extends y{getRootCategoriesList(r=!1){return this.getTypedList(H,"/internal/catalog/categories",{showHidden:r})}getCategoryData(r,e=!1,t=!1){return this.get(`/internal/catalog/categories/${r}`,{showHidden:e,withNestedCategories:t},s=>new H(s.data))}getPublicCategoryData(r){return this.get(`/public/catalog/categories/${r}`,{},e=>new H(e.data))}getCategoryProductsList(r,e=!0,t=!1){return this.get(`/internal/catalog/categories/${r}/products`,{showHidden:t,withPriceCoefficients:e},s=>u.map(s.data,o=>new N(o)))}getCategoryProductsCoefficients(r){return this.get(`/internal/catalog/categories/${r}/products/coefficients`,{},e=>{const{data:t}=e;return u.forEach(t,s=>s.map(o=>new Qe(o))),t})}publicSimpleSearch(r,e=10){return new Promise((t,s)=>{this.get(`/public/catalog/search/simple?limit=${e}&term=${r}`).then(o=>{t(o.categories.map(p=>new H(p)))}).catch(o=>{s(o)})})}}class ti extends _{getProductData(r,e=!1){return this.get(`/internal/catalog/products/${r}`,{withPriceCoefficients:e},t=>new N(t.data))}getPublicProductData(r){return this.get(`/public/catalog/products/${r}`,{},e=>new N(e.data))}getProductPriceCoefficients(r){return this.get(`/internal/catalog/products/${r}/coefficients`,{},e=>u.map(e.data,t=>new Qe(t)))}getNewProducts(r,e,t=!0){const s=b().config.dateFormats.api;return this.getTypedPaginated(N,"/internal/catalog/products/new",void 0,void 0,e,{period:{from:l.format(r,s)},withPriceCoefficients:t})}publicSimpleSearch(r,e=10){return new Promise((t,s)=>{this.get(`/public/catalog/search/simple?limit=${e}&term=${r}`).then(o=>{t(o.products.map(p=>new N(p)))}).catch(o=>{s(o)})})}}class ii extends y{getRootCategoriesList(r,e=!1){return this.getTypedList(ke,"/internal/catalog/categories",{clientId:r,showHidden:e})}getCategoryData(r,e,t=!1,s=!1){return this.get(`/internal/catalog/categories/${e}`,{clientId:r,showHidden:t,withNestedCategories:s},o=>new ke(o.data))}getCategoryProductsList(r,e,t=!0,s=!1){return this.get(`/internal/catalog/categories/${e}/products`,{client_id:r,showHidden:s,withPriceCoefficients:t},o=>u.map(o.data,p=>new se(p)))}}class si extends _{getProductData(r,e,t=!1){return this.get(`/internal/catalog/products/${r}`,{clientId:e,withPriceCoefficients:t},s=>new se(s.data))}getNewProducts(r,e,t,s=!0){const o=b().config.dateFormats.api;return this.getTypedPaginated(se,"/internal/catalog/products/new",void 0,void 0,t,{clientId:r,period:{from:l.format(e,o)},withPriceCoefficients:s})}}class ni extends _{getTemplateList(r,e,t){return this.getTypedPaginated(ie,"/internal/price/templates",r,e,t)}createTemplate(r,e={}){return this.post("/internal/price/templates",r,t=>new ie(t.data),e)}getTemplate(r){return this.get(`/internal/price/templates/${r}`,{},e=>new ie(e.data))}updateTemplate(r,e,t={}){return this.patch(`/internal/price/templates/${r}`,e,s=>new ie(s.data),t)}removeTemplate(r){return this.delete(`/internal/price/templates/${r}`)}getProductTemplatePrices(r){return this.getTypedList(Ze,`/internal/price/templates/${r}/products`)}getProductTemplatePrice(r,e){return this.get(`/internal/price/templates/${r}/products/${e}`,{},t=>new Ze(t.data))}saveProductTemplatePrice(r,e,t){var s;return this.post(`/internal/price/templates/${r}/products/${e}`,{price_coefficient_id:(s=t.coefficient)==null?void 0:s.id,increase_percent:t.value},o=>new Ze(o.data))}deleteProductTemplatePrice(r,e){return this.delete(`/internal/price/templates/${r}/products/${e}`)}getCategoryTemplatePrices(r){return this.getTypedList(Xe,`/internal/price/templates/${r}/categories`)}getCategoryTemplatePrice(r,e){return this.get(`/internal/price/templates/${r}/categories/${e}`,{},t=>new Xe(t.data))}saveCategoryTemplatePrice(r,e,t,s=!1){var o;return this.request({method:"POST",url:`/internal/price/templates/${r}/categories/${e}`,data:{price_coefficient_id:(o=t.coefficient)==null?void 0:o.id,increase_percent:t.value},params:s?{recursively:!0}:{}},p=>new Xe(p.data))}deleteCategoryTemplatePrice(r,e,t=!1){return this.request({method:"DELETE",url:`/internal/price/templates/${r}/categories/${e}`,params:t?{recursively:!0}:{}})}getTemplateClients(r){return this.getTypedList(me,`/internal/price/templates/${r}/clients`)}}class oi extends y{getRoles(){return this.getTypedList(ye,"/internal/price/roles")}createRole(r){return this.post("/internal/price/roles",r,e=>new ye(e.data))}getRole(r){return this.get(`/internal/price/roles/${r}`,{},e=>new ye(e.data))}updateRole(r,e){return this.patch(`/internal/price/roles/${r}`,e,t=>new ye(t.data))}deleteRole(r){return this.delete(`/internal/price/roles/${r}`)}getCategoryRules(r){return this.getTypedList(Or,`/internal/price/roles/rules/categories/${r}`)}updateCategoryRules(r,e){return this.patch(`/internal/price/roles/rules/categories/${r}`,e,t=>L.instanceListInitializer(Or,t.data))}}class ci extends _{getProperties(r,e,t){return this.getTypedPaginated(ce,"/internal/catalog/properties",r,e,t)}createProperty(r){const{typeId:e,...t}=r;return this.post("/internal/catalog/properties",{...t,type:e},s=>new ce(s.data))}getProperty(r){return this.get(`/internal/catalog/properties/${r}`,{},e=>new ce(e.data))}updateProperty(r,e){const{typeId:t,...s}=e;return this.patch(`/internal/catalog/properties/${r}`,{...s,type:t},o=>new ce(o.data))}deleteProperty(r){return this.delete(`/internal/catalog/properties/${r}`)}getProductProperties(r){return this.getTypedList(le,`/internal/catalog/products/${r}/properties`)}getProductProperty(r,e){return this.get(`/internal/catalog/products/${r}/properties/${e}`,{},t=>new le(t.data))}updateProductProperty(r,e,t){return this.patch(`/internal/catalog/products/${r}/properties/${e}`,{value:t},s=>new le(s.data))}deleteProductProperty(r,e){return this.delete(`/internal/catalog/products/${r}/properties/${e}`)}getProductDescription(r){return this.get(`/internal/catalog/products/${r}/properties/description`)}updateProductDescription(r,e){return this.patch(`/internal/catalog/products/${r}/properties/description`,{text:e})}deleteProductDescription(r){return this.delete(`/internal/catalog/products/${r}/properties/description`)}getProductSpecification(r){return this.get(`/internal/catalog/products/${r}/properties/specification`)}updateProductSpecification(r,e){return this.patch(`/internal/catalog/products/${r}/properties/specification`,{text:e})}deleteProductSpecification(r){return this.delete(`/internal/catalog/products/${r}/properties/specification`)}getProductFiles(r){return this.get(`/internal/catalog/products/${r}/properties/files`)}addProductFile(r,e){return this.post(`/internal/catalog/products/${r}/properties/files`,e)}updateProductFile(r,e,t){return this.patch(`/internal/catalog/products/${r}/properties/files/${e}`,t)}deleteProductFile(r,e){return this.delete(`/internal/catalog/products/${r}/properties/files/${e}`)}updateProductSlug(r,e){return this.patch(`/internal/catalog/products/${r}/properties/slug`,{slug:e})}getCategoryProperties(r){return this.getTypedList(le,`/internal/catalog/categories/${r}/properties`)}getCategoryProperty(r,e){return this.get(`/internal/catalog/categories/${r}/properties/${e}`,{},t=>new le(t.data))}updateCategoryProperty(r,e,t){return this.patch(`/internal/catalog/categories/${r}/properties/${e}`,{value:t},s=>new le(s.data))}deleteCategoryProperty(r,e){return this.delete(`/internal/catalog/categories/${r}/properties/${e}`)}getCategoryDescription(r){return this.get(`/internal/catalog/categories/${r}/properties/description`)}updateCategoryDescription(r,e){return this.patch(`/internal/catalog/categories/${r}/properties/description`,{text:e})}deleteCategoryDescription(r){return this.delete(`/internal/catalog/categories/${r}/properties/description`)}getCategorySpecification(r){return this.get(`/internal/catalog/categories/${r}/properties/specification`)}updateCategorySpecification(r,e){return this.patch(`/internal/catalog/categories/${r}/properties/specification`,{text:e})}deleteCategorySpecification(r){return this.delete(`/internal/catalog/categories/${r}/properties/specification`)}getCategoryFiles(r){return this.get(`/internal/catalog/categories/${r}/properties/files`)}addCategoryFile(r,e){return this.post(`/internal/catalog/categories/${r}/properties/files`,e)}updateCategoryFile(r,e,t){return this.patch(`/internal/catalog/categories/${r}/properties/files/${e}`,t)}deleteCategoryFile(r,e){return this.delete(`/internal/catalog/categories/${r}/properties/files/${e}`)}updateCategorySlug(r,e){return this.patch(`/internal/catalog/categories/${r}/properties/slug`,{slug:e})}updateCategoryImage(r,e){return this.post(`/internal/catalog/categories/${r}/image`,{image:e})}getCategoryFilters(r,e=!1){return this.get(`/internal/catalog/categories/${r}/filters`,{recursively:e},t=>t.data.map(s=>new at(s)))}getCategoryFilterSettings(r){return this.getTypedList($r,`/internal/catalog/categories/${r}/filter-settings`)}saveCategoryFilterSetting(r,e,t){return this.patch(`/internal/catalog/categories/${r}/filter-settings/${e}`,t,s=>new $r(s.data))}deleteCategoryFilterSetting(r,e){return this.delete(`/internal/catalog/categories/${r}/filter-settings/${e}`)}}class li extends y{getRootCategoriesList(r,e=!1){return this.getTypedList(H,"/internal/catalog/categories",{priceTemplateId:r,showHidden:e})}getCategoryData(r,e,t=!1,s=!1){return this.get(`/internal/catalog/categories/${e}`,{priceTemplateId:r,showHidden:t,withNestedCategories:s},o=>new H(o.data))}getCategoryProductsList(r,e,t=!0,s=!1){return this.get(`/internal/catalog/categories/${e}/products`,{priceTemplateId:r,showHidden:s,withPriceCoefficients:t},o=>u.map(o.data,p=>new N(p)))}}function dr(n,r,e){let t;return n.some(s=>{if(s.type===e&&s.id===r)return t=s,!0;if(s.type==="product")return!1;const o=s;if(o.products&&o.products.length>0){const p=dr(o.products,r,e);if(p)return t=p,!0}if(o.categories&&o.categories.length>0){const p=dr(o.categories,r,e);if(p)return t=p,!0}return!1}),t}function kr(n){const r=[];return n.forEach(e=>{if(r.push(e),e.type==="category"){const t=e;t.products&&t.products.length>0&&r.push(...kr(t.products)),t.categories&&t.categories.length>0&&r.push(...kr(t.categories))}}),r}var Ct=(n=>(n.LastOrder="last_order",n.Contacts="contacts",n.PartnerGroups="partner_groups",n.PreferredDeliveryType="preferred_delivery_type",n.SalesDirection="sales_direction",n.Managers="managers",n.Curators="curators",n))(Ct||{}),Q=(n=>(n.Person="individual",n.Ic="entrepreneur",n.UlR="legal",n.UlNr="non_resident_legal",n))(Q||{});class er extends G{constructor(e){super(e);i(this,"bankName","");i(this,"bic","");i(this,"accountNumber","");i(this,"correspondentAccount","");i(this,"currency",new M);e&&(this.bankName=e.bankName??"",this.bic=e.bic??"",this.accountNumber=e.accountNumber??"",this.correspondentAccount=e.correspondentAccount??"",this.currency=new M(e.currency))}}class rr extends $e{constructor(e){super(e);i(this,"phone");i(this,"email");this.email=e==null?void 0:e.email,this.phone=/^\d+$/.test((e==null?void 0:e.phone)??"")?`+${e==null?void 0:e.phone}`:e==null?void 0:e.phone}}class E extends rr{constructor(e){super(e);i(this,"isPrimary");i(this,"position");i(this,"notDisturb");i(this,"comment");this.isPrimary=(e==null?void 0:e.isPrimary)??!1,this.position=e==null?void 0:e.position,this.notDisturb=(e==null?void 0:e.notDisturb)??!1,this.comment=e==null?void 0:e.comment}}class Z extends v{static generatePersonItem(){return new Z({id:1,guid:"",slug:Q.Person,name:""})}}class F extends v{}class Ir extends $e{constructor(e){super(e);i(this,"opf",Z.generatePersonItem());i(this,"partnerGroup",new F);i(this,"contacts",[]);i(this,"bankAccounts",[]);i(this,"comment");i(this,"alternativeName");i(this,"creator");i(this,"updater");if(e){if(this.opf=new Z(e.opf),this.comment=e.comment,this.alternativeName=e.alternativeName,this.creator=e.creator?new k(e.creator):void 0,this.updater=e.updater?new k(e.updater):void 0,e.partnerGroup&&(this.partnerGroup=new F(e.partnerGroup)),e.contacts){const t=[];e.contacts.forEach(s=>{t.push(new E(s))}),this.contacts=t}if(e.bankAccounts){const t=[];e.bankAccounts.forEach(s=>{t.push(new er(s))}),this.bankAccounts=t}}}}class Dt extends Ir{constructor(r){super(r)}}class Lr extends Ir{constructor(e){super(e);i(this,"inn","");i(this,"okpo","");i(this,"ogrn","");i(this,"directorName","");i(this,"directorPosition","");i(this,"directorActsOn","");i(this,"legalAddress","");i(this,"postalAddress","");i(this,"actualAddress","");e&&(this.inn=e.inn??"",this.okpo=e.okpo??"",this.ogrn=e.ogrn??"",this.directorName=e.directorName??"",this.directorPosition=e.directorPosition??"",this.directorActsOn=e.directorActsOn??"",this.legalAddress=e.legalAddress??"",this.postalAddress=e.postalAddress??"",this.actualAddress=e.actualAddress??"")}}class Nr extends Lr{constructor(e){super(e);i(this,"kpp","");e&&(this.kpp=e.kpp??"")}}class wt extends Nr{constructor(e){super(e);i(this,"registrationCountry",new oe);i(this,"registrationNumber","");i(this,"taxNumber","");e&&(this.registrationCountry=new oe(e.registrationCountry),this.registrationNumber=e.registrationNumber??"",this.taxNumber=e.taxNumber??"")}}class Ie{static createInstance(r){switch(r.opf.slug){case Q.Ic:return new Lr(r);case Q.UlR:return new Nr(r);case Q.UlNr:return new wt(r);default:return new Dt(r)}}}class ae extends $e{constructor(e){var t;super(e);i(this,"address","");i(this,"coordinates");i(this,"contacts");i(this,"comment");i(this,"operatingHours");i(this,"isOneTime");i(this,"isTransportCompanyAddress");this.address=(e==null?void 0:e.address)??"",this.coordinates=new fr(e==null?void 0:e.coordinates),this.contacts=((t=e==null?void 0:e.contacts)==null?void 0:t.map(s=>new E(s)))??[],this.comment=e==null?void 0:e.comment,this.operatingHours=e==null?void 0:e.operatingHours,this.isOneTime=e==null?void 0:e.isOneTime,this.isTransportCompanyAddress=e==null?void 0:e.isTransportCompanyAddress}}class _r extends v{}class qr extends v{}class Ur extends X{constructor(e){var t,s,o,p;super(e);i(this,"contragents");i(this,"partnerGroups");i(this,"contacts");i(this,"deliveryAddresses");i(this,"channelPrimaryInterest");i(this,"sourcePrimaryInterest");i(this,"preferredDeliveryType");i(this,"primaryDemand");i(this,"preferredWarehouse");i(this,"extraData");this.contragents=((t=e==null?void 0:e.contragents)==null?void 0:t.map(g=>Ie.createInstance(g)))??[],this.partnerGroups=((s=e==null?void 0:e.partnerGroups)==null?void 0:s.map(g=>new F(g)))??[],this.contacts=((o=e==null?void 0:e.contacts)==null?void 0:o.map(g=>new E(g)))??[],this.deliveryAddresses=((p=e==null?void 0:e.deliveryAddresses)==null?void 0:p.map(g=>new ae(g)))??[],this.channelPrimaryInterest=new _r(e==null?void 0:e.channelPrimaryInterest),this.sourcePrimaryInterest=new qr(e==null?void 0:e.sourcePrimaryInterest),this.preferredDeliveryType=new z(e==null?void 0:e.preferredDeliveryType),this.primaryDemand=e==null?void 0:e.primaryDemand,this.preferredWarehouse=e!=null&&e.preferredWarehouse?new he(e.preferredWarehouse):void 0,this.extraData=(e==null?void 0:e.extraData)??{}}}class ui extends te{constructor(e){var t,s,o,p,g,m,a,P;super();i(this,"id");i(this,"guid");i(this,"name");i(this,"alternativeName");i(this,"searchTerm");i(this,"cities");i(this,"region");i(this,"country");i(this,"phone");i(this,"email");i(this,"isActive");i(this,"createdAt",new R);i(this,"lastLoginDate",new R);i(this,"lastLoginDateHasOrder");i(this,"managers");i(this,"includeSubordinateManagers");i(this,"curators");i(this,"isManagerRequired");i(this,"salesDirections");i(this,"contragentInn");i(this,"contragentType");i(this,"preferredDeliveryType");i(this,"partnerGroups");i(this,"contact");i(this,"lastOrder");i(this,"noOrdersPeriod",new R);this.id=e==null?void 0:e.id,this.guid=e==null?void 0:e.guid,this.name=e==null?void 0:e.name,this.alternativeName=e==null?void 0:e.alternativeName,this.searchTerm=e==null?void 0:e.searchTerm,this.cities=(t=e==null?void 0:e.cities)==null?void 0:t.map(T=>new Y(T)),this.region=new K(e==null?void 0:e.region),this.country=new oe(e==null?void 0:e.country),this.phone=e==null?void 0:e.phone,this.email=e==null?void 0:e.email,this.isActive=e&&Object.prototype.hasOwnProperty.call(e,"isActive")?e==null?void 0:e.isActive:!0,this.createdAt=new R(e==null?void 0:e.createdAt),this.lastLoginDate=new R(e==null?void 0:e.lastLoginDate),this.lastLoginDateHasOrder=(e==null?void 0:e.lastLoginDateHasOrder)??void 0,this.managers=((s=e==null?void 0:e.managers)==null?void 0:s.map(T=>new j(T)))??[],this.includeSubordinateManagers=(e==null?void 0:e.includeSubordinateManagers)??!0,this.curators=((o=e==null?void 0:e.curators)==null?void 0:o.map(T=>new Ee(T)))??[],this.salesDirections=(p=e==null?void 0:e.salesDirections)==null?void 0:p.map(T=>new q(T)),this.contragentInn=e==null?void 0:e.contragentInn,this.contragentType=new Z(e==null?void 0:e.contragentType),this.preferredDeliveryType=e!=null&&e.preferredDeliveryType?new z(e==null?void 0:e.preferredDeliveryType):void 0,this.partnerGroups=(g=e==null?void 0:e.partnerGroups)==null?void 0:g.map(T=>new F(T)),this.contact=new rr(e==null?void 0:e.contact),this.lastOrder={createdAt:new R((m=e==null?void 0:e.lastOrder)==null?void 0:m.createdAt),creator:(a=e==null?void 0:e.lastOrder)==null?void 0:a.creator,isApproved:(P=e==null?void 0:e.lastOrder)==null?void 0:P.isApproved},this.noOrdersPeriod=new R(e==null?void 0:e.noOrdersPeriod)}resetFilterValue(e){switch(e){case"cities":this.cities=[];break;case"region":this.region=new K;break;case"isActive":this.isActive=!0;break;case"createdAt":this.createdAt.from=null,this.createdAt.to=null;break;case"lastLoginDate":this.lastLoginDate.from=null,this.lastLoginDate.to=null;break;case"noOrdersPeriod":this.noOrdersPeriod.from=null,this.noOrdersPeriod.to=null;break;case"lastOrder":this.lastOrder={};break;case"managers":this.managers=[];break;case"curators":this.curators=[];break;case"salesDirections":this.salesDirections=[];break;case"contragentType":this.contragentType=new Z;break;case"preferredDeliveryType":this.preferredDeliveryType=new z;break;case"partnerGroups":this.partnerGroups=[];break;case"contact":this.contact=new rr;break;default:this[e]=void 0;break}return this}asClearRaw(){var t,s,o,p,g,m;const e=super.asClearRaw();return!((t=e==null?void 0:e.createdAt)!=null&&t.from)&&!((s=e==null?void 0:e.createdAt)!=null&&s.to)&&delete e.createdAt,!((o=e==null?void 0:e.lastLoginDate)!=null&&o.from)&&!((p=e==null?void 0:e.lastLoginDate)!=null&&p.to)&&delete e.lastLoginDate,!((g=e==null?void 0:e.noOrdersPeriod)!=null&&g.from)&&!((m=e==null?void 0:e.noOrdersPeriod)!=null&&m.to)&&delete e.noOrdersPeriod,e}}class Mr extends Ae{constructor(e){super(e);i(this,"creator");this.creator=new k(e==null?void 0:e.creator)}}class Pt extends d{constructor(e){var t,s,o,p;super(e);i(this,"contacts",[]);i(this,"preferredDeliveryType");i(this,"partnerGroups",[]);i(this,"lastOrder");i(this,"salesDirection");i(this,"managers");i(this,"curators");this.contacts=((t=e.contacts)==null?void 0:t.map(g=>new E(g)))??void 0,this.lastOrder=e.lastOrder?new Mr(e.lastOrder):void 0,this.partnerGroups=((s=e.partnerGroups)==null?void 0:s.map(g=>new F(g)))??void 0,this.preferredDeliveryType=e.preferredDeliveryType?new z(e.preferredDeliveryType):void 0,this.salesDirection=e.salesDirection?new q(e.salesDirection):void 0,this.managers=((o=e.managers)==null?void 0:o.map(g=>new xe(g)))??void 0,this.curators=((p=e.curators)==null?void 0:p.map(g=>new Ee(g)))??void 0}}class tr extends G{constructor(e){super(e);i(this,"isPrimary");this.isPrimary=e.isPrimary}}class vt extends E{constructor(e){super(e);i(this,"relations",{clients:[],contragents:[],addresses:[]});e.relations&&(e.relations.addresses&&(this.relations.addresses=e.relations.addresses.map(t=>new tr(t))),e.relations.clients&&(this.relations.clients=e.relations.clients.map(t=>new tr(t))),e.relations.contragents&&(this.relations.contragents=e.relations.contragents.map(t=>new tr(t))))}}class B extends _{static transformClientDataToRequest(r){var t;return{name:r.name,alternative_name:r.alternativeName,partner_groups:r.partnerGroups.map(s=>s.id),phone:r.phone,email:r.email,city_id:r.city.id,get_news:r.getNews,channel_primary_interest_id:r.channelPrimaryInterest.id,source_primary_interest_id:r.sourcePrimaryInterest.id,primary_demand:r.primaryDemand,preferred_warehouse_id:(t=r.preferredWarehouse)==null?void 0:t.id}}static transformContragentClientDataToRequest(r){var p,g,m,a;let e;const t=r,s=r,o=r;switch(r.opf.slug){case Q.Ic:e={opf:t.opf.slug,name:t.name,alternative_name:t.alternativeName,partner_group_id:(p=t.partnerGroup)==null?void 0:p.id,comment:t.comment,inn:t.inn,okpo:t.okpo,ogrn:t.ogrn||void 0,director_name:t.directorName,director_position:t.directorPosition,director_acts_on:t.directorActsOn,legal_address:t.legalAddress,postal_address:t.postalAddress,actual_address:t.actualAddress};break;case Q.UlR:e={opf:s.opf.slug,name:s.name,alternative_name:s.alternativeName,partner_group_id:(g=s.partnerGroup)==null?void 0:g.id,comment:s.comment,inn:s.inn,kpp:s.kpp,okpo:s.okpo,ogrn:s.ogrn||void 0,director_name:s.directorName,director_position:s.directorPosition,director_acts_on:s.directorActsOn,legal_address:s.legalAddress,postal_address:s.postalAddress,actual_address:s.actualAddress};break;case Q.UlNr:e={opf:o.opf.slug,name:o.name,alternative_name:o.alternativeName,partner_group_id:(m=o.partnerGroup)==null?void 0:m.id,comment:o.comment,director_name:o.directorName,director_position:o.directorPosition,director_acts_on:o.directorActsOn,legal_address:o.legalAddress,postal_address:o.postalAddress,actual_address:o.actualAddress,registration_country_id:o.registrationCountry.id,registration_number:o.registrationNumber,tax_number:o.taxNumber||void 0};break;default:e={opf:r.opf.slug,name:r.name,alternative_name:r.alternativeName,partner_group_id:(a=r.partnerGroup)==null?void 0:a.id,comment:r.comment};break}return e}static transformClientDeliveryAddressToRequest(r){var t,s;const e={address:r.address,is_one_time:r.isOneTime??!1,is_transport_company_address:r.isTransportCompanyAddress??!1,comment:r.comment??""};return r.coordinates&&(e.coordinates={lat:(t=r.coordinates)==null?void 0:t.lat,long:(s=r.coordinates)==null?void 0:s.long}),r.operatingHours&&(e.operating_hours={from:r.operatingHours.from,to:r.operatingHours.to}),e}static transformClientContragentBankAccountToRequest(r){return{bank_name:r.bankName,bic:r.bic,account_number:r.accountNumber,correspondent_account:r.correspondentAccount,currency_id:r.currency.id}}getClient(r){return this.get(`/internal/clients/${r}`,{},e=>new Ur(e.data))}getClientsList(r,e,t,s,o){return this.getTypedPaginated(X,"/internal/clients",r,e,t,s,void 0,o)}searchClient(r){return this.getClientsList(void 0,void 0,void 0,{searchTerm:r}).then(e=>e.data)}getClientByPhone(r){return this.getClientsList({groupOp:"and",groups:[],filters:[{field:"phone",op:ze.Contains,value:r}]})}getAdditionalClientsData(r,e){const t=r.map(s=>s.id);return this.post("/internal/clients/additional-data",{clients:t,requested_data_types:e},s=>L.instanceListInitializer(Pt,s.data))}getAllClientContacts(r){return this.getTypedList(vt,`/internal/clients/${r}/contacts/all`)}createClientCommonData(r,e={}){return this.post("/internal/clients",B.transformClientDataToRequest(r),t=>new Ur(t.data),e)}updateClientCommonData(r,e={}){return this.patch(`/internal/clients/${r.id}`,B.transformClientDataToRequest(r),void 0,e)}updateClientNotDistribCommonData(r,e={}){const t={get_news:r.getNews};return this.patch(`/internal/clients/${r.id}`,t,void 0,e)}changeClientPassword(r,e,t,s={}){return this.patch(`/internal/clients/${r}`,{password:e,password_confirmation:t},void 0,s)}updateClientComment(r){return this.patch(`/internal/clients/${r.id}`,{comment:r.comment})}changeClientActivation(r){return this.patch(`/internal/clients/${r.id}`,{is_active:r.isActive})}async attachClientToManagers(r,e){const t=e.map(s=>this.patch(`/internal/clients/${r}/managers/${s.id}/attach`,{is_primary:s.isDefault}));await Promise.all(t)}async detachClientFromManagers(r,e){const t=e.map(s=>this.patch(`/internal/clients/${r}/managers/${s.id}/detach`));await Promise.all(t)}attachToCurator(r,e,t){return this.patch(`/internal/clients/${r}/curators/${e}/attach`,{curated_direction_id:t.id})}detachFromCurator(r,e,t){return this.patch(`/internal/clients/${r}/curators/${e}/detach`,{curated_direction_id:t.id})}setCurators(r,e){return this.patch(`/internal/clients/${r}/curators`,{curators:e.map(t=>({curator_id:t.curatorId,curated_direction_id:t.curatedDirection.id}))})}createContragentClientData(r,e,t={}){return this.post(`/internal/clients/${r}/contragents`,B.transformContragentClientDataToRequest(e),s=>Ie.createInstance(s.data),t)}updateContragentClientData(r,e,t={}){return this.patch(`/internal/clients/${r}/contragents/${e.id}`,B.transformContragentClientDataToRequest(e),s=>Ie.createInstance(s.data),t)}deleteClientContragent(r,e){return this.delete(`/internal/clients/${r}/contragents/${e.id}`)}getClientDeliveryAddresses(r){return this.getTypedList(ae,`/internal/clients/${r}/delivery-addresses`)}createClientDeliveryAddress(r,e,t={}){return this.post(`/internal/clients/${r}/delivery-addresses`,B.transformClientDeliveryAddressToRequest(e),s=>new ae(s.data),t)}updateClientDeliveryAddress(r,e,t={}){return this.patch(`/internal/clients/${r}/delivery-addresses/${e.id}`,B.transformClientDeliveryAddressToRequest(e),s=>new ae(s.data),t)}deleteClientDeliveryAddress(r,e){return this.delete(`/internal/clients/${r}/delivery-addresses/${e.id}`)}createContragentBankAccount(r,e,t,s={}){return this.post(`/internal/clients/${r}/contragents/${e}/bank-accounts`,B.transformClientContragentBankAccountToRequest(t),o=>new er(o.data),s)}updateContragentBankAccount(r,e,t,s={}){return this.patch(`/internal/clients/${r}/contragents/${e}/bank-accounts/${t.id}`,B.transformClientContragentBankAccountToRequest(t),o=>new er(o.data),s)}deleteContragentBankAccount(r,e,t){return this.delete(`/internal/clients/${r}/contragents/${e}/bank-accounts/${t.id}`)}createClientContact(r,e,t={}){return this.createContact(r,e,{client:{id:r,is_primary:e.isPrimary??!1,not_disturb:e.notDisturb??!1}},t)}updateClientContact(r,e,t={}){return this.patch(`/internal/clients/${r}/contacts/${e.id}`,{name:e.name,position:e.position,phone:e.phone,email:e.email,comment:e.comment,not_disturb:e.notDisturb},s=>new E(s.data),t)}setPrimaryClientContact(r,e){return this.setPrimaryContact(`/internal/clients/${r}/contacts/${e.id}/primary`,e.isPrimary??!1)}detachClientContact(r,e){return this.detachContact(`/internal/clients/${r}/contacts/${e.id}/detach`)}createContragentContact(r,e,t,s={}){return this.createContact(r,t,{contragents:[{id:e,is_primary:t.isPrimary??!1,not_disturb:t.notDisturb??!1}]},s)}setPrimaryContragentContact(r,e,t){return this.setPrimaryContact(`/internal/clients/${r}/contragents/${e}/contacts/${t.id}/primary`,t.isPrimary??!1)}detachContragentContact(r,e,t){return this.detachContact(`/internal/clients/${r}/contragents/${e}/contacts/${t.id}/detach`)}createDeliveryAddressContact(r,e,t,s={}){return this.createContact(r,t,{addresses:[{id:e,is_primary:t.isPrimary??!1,not_disturb:t.notDisturb??!1}]},s)}setPrimaryDeliveryAddressContact(r,e,t){return this.setPrimaryContact(`/internal/clients/${r}/delivery-addresses/${e}/contacts/${t.id}/primary`,t.isPrimary??!1)}detachDeliveryAddressContact(r,e,t){return this.detachContact(`/internal/clients/${r}/delivery-addresses/${e}/contacts/${t.id}/detach`)}createContact(r,e,t,s={}){var p,g;const o={name:e.name,position:e.position,comment:e.comment,...t};return(p=e.phone)!=null&&p.length&&(o.phone=e.phone),(g=e.email)!=null&&g.length&&(o.email=e.email),this.post(`/internal/clients/${r}/contacts`,o,m=>new E(m.data),s)}setPrimaryContact(r,e){return this.patch(r,{is_primary:e})}detachContact(r){return this.patch(r)}sendClientEmailConfirmation(r){return this.get(`/internal/clients/${r.id}/verification/email?email=${r.email}`)}}class pi extends y{checkPhoneIsBusy(r){return new Promise((e,t)=>{this.request({method:"GET",url:"/public/user/verification/phone/check",params:{phone:r}}).then(s=>{e(!!s.isBusy)}).catch(t)})}}class hi{constructor(r){i(this,"date");i(this,"name");i(this,"version");this.date=u.isString(r==null?void 0:r.date)?l.parseISO(r.date):(r==null?void 0:r.date)??new Date,this.name=(r==null?void 0:r.name)??"",this.version=(r==null?void 0:r.version)??"0.0.0"}}var Rt=(n=>(n.Kozyrek="kozyrek",n.Mosquitto="mosquitto",n.Strip="strip",n.MetalForDoors="metal_for_doors",n.Sandwich="sandwich",n.SandwichM2="sandwich_m2",n))(Rt||{});class gi extends y{getConfiguratorSettings(r,e){var t;return this.get(`internal/catalog/categories/${r.id}/configurators/${(t=r.properties)==null?void 0:t.configurator}/settings?client_id=${e}`)}searchProduct(r,e,t,s={}){var o;return this.request({method:"GET",url:`internal/catalog/categories/${r.id}/configurators/${(o=r.properties)==null?void 0:o.configurator}/product`,params:{params:t,client_id:e}},p=>new N(p.data),s)}createTemplate(r,e,t,s={}){var o;return this.post(`internal/catalog/categories/${r.id}/configurators/${(o=r.properties)==null?void 0:o.configurator}/template?client_id=${e}`,{...t},()=>{},s)}removeTemplate(r,e,t){var s;return this.delete(`internal/catalog/categories/${r.id}/configurators/${(s=r.properties)==null?void 0:s.configurator}/template/${t}?client_id=${e}`)}calculate(r,e,t){var s;return this.get(`internal/catalog/categories/${r.id}/configurators/${(s=r.properties)==null?void 0:s.configurator}/calculate`,{client_id:e,...t})}}class Tt{constructor(r){i(this,"page",1);i(this,"pageSize",50);this.page=(r==null?void 0:r.page)??1,this.pageSize=(r==null?void 0:r.pageSize)??50}}class fi extends Tt{constructor(e){super(e);i(this,"itemCount",0);i(this,"pageCount",1);i(this,"pageSlot",5);i(this,"pageSizes",[25,50,100]);i(this,"showSizePicker",!0);this.itemCount=(e==null?void 0:e.itemCount)??0,this.pageCount=(e==null?void 0:e.pageCount)??1,this.pageSlot=(e==null?void 0:e.pageSlot)??5,this.pageSizes=(e==null?void 0:e.pageSizes)??[25,50,100],this.showSizePicker=(e==null?void 0:e.showSizePicker)??!0}}class mi{constructor(r){i(this,"field");i(this,"direction");this.field=(r==null?void 0:r.field)??"",this.direction=(r==null?void 0:r.direction)??"asc"}}class D{static decadeInterval(r){const[e,t]=D.shiftedDecadeBounds(r,0);return{from:e,to:t}}static shiftDecadeInterval(r,e){const[t,s]=D.shiftedDecadeBounds(r,e);return{from:t,to:s}}static startOfHalfYear(r){return new Date(r.getFullYear(),r.getMonth()<6?0:6,1)}static endOfHalfYear(r){return l.endOfMonth(new Date(r.getFullYear(),r.getMonth()<6?5:11,1))}static addHalfYears(r,e){return l.addMonths(r,e*6)}static intervalTillSameDate(r,e,t){const s=l.differenceInCalendarMonths(l.startOfMonth(t),l.startOfMonth(r)),o=l.startOfMonth(l.addMonths(e,s)),p=Math.min(l.getDate(t),l.getDaysInMonth(o));return{from:l.startOfDay(e),to:l.endOfDay(l.setDate(o,p))}}static weekTillSameWeekday(r,e){const t=l.startOfWeek(l.addWeeks(r,e),{weekStartsOn:1}),s=l.differenceInCalendarDays(r,l.startOfWeek(r,{weekStartsOn:1}));return{from:t,to:l.endOfDay(l.addDays(t,s))}}static decadeTillSameDayNumber(r,e){const[t]=D.shiftedDecadeBounds(r,0),s=l.differenceInCalendarDays(r,t)+1,[o,p]=D.shiftedDecadeBounds(r,e),g=l.differenceInCalendarDays(p,o)+1;return{from:o,to:l.endOfDay(l.addDays(o,Math.min(s,g)-1))}}static shiftedDecadeBounds(r,e){const t=l.getDate(r);let s=2;t<=10?s=0:t<=20&&(s=1);const o=s+e,p=Math.floor(o/3),g=(o%3+3)%3,m=l.startOfMonth(l.addMonths(r,p)),a=l.addDays(m,g*10),P=g===2?l.endOfMonth(m):l.endOfDay(l.addDays(a,9));return[a,P]}}function yi(n){return l.format(l.subDays(l.startOfToday(),n),"yyyy-MM-dd")}function St(n,r){const e=[2,0,1,1,1,2],t=Math.floor(Math.abs(n));return r[t%100>4&&t%100<20?2:e[Math.min(t%10,5)]]}function ai(n){const r=l.parseISO(n),e=l.differenceInCalendarDays(l.startOfToday(),r);switch(!0){case e===0:return"Сегодня";case e===1:return"Вчера";case e<0:return n;default:return`${e} ${St(e,["день","дня","дней"])} назад`}}class Ci{static defaultDateRanges(r){const e=l.addBusinessDays(new Date,1),t=new Date,s=l.startOfYear(r===void 0?t:new Date(r,0,1)),o=l.endOfYear(s);return{nextWorkingDay:{label:"Следующий рабочий день",from:l.startOfDay(e),to:l.endOfDay(e)},today:{label:"Сегодня",from:l.startOfToday(),to:l.endOfToday()},yesterday:{label:"Вчера",from:l.startOfYesterday(),to:l.endOfYesterday()},tomorrow:{label:"Завтра",from:l.startOfTomorrow(),to:l.endOfTomorrow()},currentWeek:{label:"Неделя",from:l.startOfWeek(t,{weekStartsOn:1}),to:l.endOfWeek(t,{weekStartsOn:1})},currentMonth:{label:"Месяц",from:l.startOfMonth(t),to:l.endOfMonth(t)},oneMonth:{label:"1 месяц",from:s,to:l.endOfMonth(s)},threeMonths:{label:"3 месяца",from:s,to:l.endOfMonth(l.addMonths(s,2))},nineMonths:{label:"9 месяцев",from:s,to:l.endOfMonth(l.addMonths(s,8))},firstQuarter:{label:"I квартал",from:s,to:l.endOfMonth(l.addMonths(s,2))},secondQuarter:{label:"II квартал",from:l.addMonths(s,3),to:l.endOfMonth(l.addMonths(s,5))},thirdQuarter:{label:"III квартал",from:l.addMonths(s,6),to:l.endOfMonth(l.addMonths(s,8))},fourthQuarter:{label:"IV квартал",from:l.addMonths(s,9),to:l.endOfMonth(l.addMonths(s,11))},firstHalfYear:{label:"I полугодие",from:s,to:l.endOfMonth(l.addMonths(s,5))},secondHalfYear:{label:"II полугодие",from:l.addMonths(s,6),to:o},currentYear:{label:"12 месяцев",from:s,to:o}}}static standardPeriods(r=new Date){const e={weekStartsOn:1},t=l.startOfDay(r),s=l.endOfDay(r),o=D.decadeInterval(r),p=l.startOfMonth(r),g=l.startOfQuarter(r),m=D.startOfHalfYear(r),a=l.startOfYear(r),P=D.addHalfYears(r,-1),T=D.addHalfYears(r,1);return{yesterday:{label:"Вчера",group:"day",from:l.startOfDay(l.subDays(r,1)),to:l.endOfDay(l.subDays(r,1))},today:{label:"Сегодня",group:"day",from:t,to:s},tomorrow:{label:"Завтра",group:"day",from:l.startOfDay(l.addDays(r,1)),to:l.endOfDay(l.addDays(r,1))},lastWeek:{label:"Прошлая неделя",group:"week",from:l.startOfWeek(l.subWeeks(r,1),e),to:l.endOfWeek(l.subWeeks(r,1),e)},thisWeek:{label:"Эта неделя",group:"week",from:l.startOfWeek(r,e),to:l.endOfWeek(r,e)},nextWeek:{label:"Следующая неделя",group:"week",from:l.startOfWeek(l.addWeeks(r,1),e),to:l.endOfWeek(l.addWeeks(r,1),e)},lastTenDays:{label:"Прошлая декада",group:"decade",...D.shiftDecadeInterval(r,-1)},thisTenDays:{label:"Эта декада",group:"decade",...o},nextTenDays:{label:"Следующая декада",group:"decade",...D.shiftDecadeInterval(r,1)},lastMonth:{label:"Прошлый месяц",group:"month",from:l.startOfMonth(l.subMonths(r,1)),to:l.endOfMonth(l.subMonths(r,1))},thisMonth:{label:"Этот месяц",group:"month",from:p,to:l.endOfMonth(r)},nextMonth:{label:"Следующий месяц",group:"month",from:l.startOfMonth(l.addMonths(r,1)),to:l.endOfMonth(l.addMonths(r,1))},lastQuarter:{label:"Прошлый квартал",group:"quarter",from:l.startOfQuarter(l.subQuarters(r,1)),to:l.endOfQuarter(l.subQuarters(r,1))},thisQuarter:{label:"Этот квартал",group:"quarter",from:g,to:l.endOfQuarter(r)},nextQuarter:{label:"Следующий квартал",group:"quarter",from:l.startOfQuarter(l.addQuarters(r,1)),to:l.endOfQuarter(l.addQuarters(r,1))},lastHalfYear:{label:"Прошлое полугодие",group:"halfYear",from:D.startOfHalfYear(P),to:D.endOfHalfYear(P)},thisHalfYear:{label:"Это полугодие",group:"halfYear",from:m,to:D.endOfHalfYear(r)},nextHalfYear:{label:"Следующее полугодие",group:"halfYear",from:D.startOfHalfYear(T),to:D.endOfHalfYear(T)},lastYear:{label:"Прошлый год",group:"year",from:l.startOfYear(l.subYears(r,1)),to:l.endOfYear(l.subYears(r,1))},thisYear:{label:"Этот год",group:"year",from:a,to:l.endOfYear(r)},nextYear:{label:"Следующий год",group:"year",from:l.startOfYear(l.addYears(r,1)),to:l.endOfYear(l.addYears(r,1))},fromBeginningOfThisWeek:{label:"С начала этой недели",group:"other",section:"fromBeginning",from:l.startOfWeek(r,e),to:s},fromBeginningOfThisTenDays:{label:"С начала этой декады",group:"other",section:"fromBeginning",from:o.from,to:s},fromBeginningOfThisMonth:{label:"С начала этого месяца",group:"other",section:"fromBeginning",from:p,to:s},fromBeginningOfThisQuarter:{label:"С начала этого квартала",group:"other",section:"fromBeginning",from:g,to:s},fromBeginningOfThisHalfYear:{label:"С начала этого полугодия",group:"other",section:"fromBeginning",from:m,to:s},fromBeginningOfThisYear:{label:"С начала этого года",group:"other",section:"fromBeginning",from:a,to:s},tillEndOfThisWeek:{label:"До конца этой недели",group:"other",section:"tillEnd",from:t,to:l.endOfWeek(r,e)},tillEndOfThisTenDays:{label:"До конца этой декады",group:"other",section:"tillEnd",from:t,to:o.to},tillEndOfThisMonth:{label:"До конца этого месяца",group:"other",section:"tillEnd",from:t,to:l.endOfMonth(r)},tillEndOfThisQuarter:{label:"До конца этого квартала",group:"other",section:"tillEnd",from:t,to:l.endOfQuarter(r)},tillEndOfThisHalfYear:{label:"До конца этого полугодия",group:"other",section:"tillEnd",from:t,to:D.endOfHalfYear(r)},tillEndOfThisYear:{label:"До конца этого года",group:"other",section:"tillEnd",from:t,to:l.endOfYear(r)},lastWeekTillSameWeekDay:{label:"Прошлая неделя, до такого же дня недели",group:"other",section:"lastTillSame",...D.weekTillSameWeekday(r,-1)},lastTenDaysTillSameDayNumber:{label:"Прошлая декада, до такого же номера дня",group:"other",section:"lastTillSame",...D.decadeTillSameDayNumber(r,-1)},lastMonthTillSameDate:{label:"Прошлый месяц, до такой же даты",group:"other",section:"lastTillSame",...D.intervalTillSameDate(p,l.startOfMonth(l.subMonths(r,1)),r)},lastQuarterTillSameDate:{label:"Прошлый квартал, до такой же даты",group:"other",section:"lastTillSame",...D.intervalTillSameDate(g,l.startOfQuarter(l.subQuarters(r,1)),r)},lastHalfYearTillSameDate:{label:"Прошлое полугодие, до такой же даты",group:"other",section:"lastTillSame",...D.intervalTillSameDate(m,D.startOfHalfYear(P),r)},lastYearTillSameDate:{label:"Прошлый год, до такой же даты",group:"other",section:"lastTillSame",...D.intervalTillSameDate(a,l.startOfYear(l.subYears(r,1)),r)},nextWeekTillSameWeekDay:{label:"Следующая неделя, до такого же дня недели",group:"other",section:"nextTillSame",...D.weekTillSameWeekday(r,1)},nextTenDaysTillSameDayNumber:{label:"Следующая декада, до такого же номера дня",group:"other",section:"nextTillSame",...D.decadeTillSameDayNumber(r,1)},nextMonthTillSameDate:{label:"Следующий месяц, до такой же даты",group:"other",section:"nextTillSame",...D.intervalTillSameDate(p,l.startOfMonth(l.addMonths(r,1)),r)},nextQuarterTillSameDate:{label:"Следующий квартал, до такой же даты",group:"other",section:"nextTillSame",...D.intervalTillSameDate(g,l.startOfQuarter(l.addQuarters(r,1)),r)},nextHalfYearTillSameDate:{label:"Следующее полугодие, до такой же даты",group:"other",section:"nextTillSame",...D.intervalTillSameDate(m,D.startOfHalfYear(T),r)},nextYearTillSameDate:{label:"Следующий год, до такой же даты",group:"other",section:"nextTillSame",...D.intervalTillSameDate(a,l.startOfYear(l.addYears(r,1)),r)},last7Days:{label:"Последние 7 дней",group:"other",section:"rollingDays",from:l.startOfDay(l.subDays(r,6)),to:s},next7Days:{label:"Следующие 7 дней",group:"other",section:"rollingDays",from:t,to:l.endOfDay(l.addDays(r,6))}}}}const Di=[{key:"day",label:"День"},{key:"week",label:"Неделя"},{key:"decade",label:"Декада"},{key:"month",label:"Месяц"},{key:"quarter",label:"Квартал"},{key:"halfYear",label:"Полугодие"},{key:"year",label:"Год"},{key:"other",label:"Прочее"}],wi=[{key:"fromBeginning",label:"С начала периода"},{key:"tillEnd",label:"До конца периода"},{key:"lastTillSame",label:"Прошлые, до такой же даты"},{key:"nextTillSame",label:"Следующие, до такой же даты"},{key:"rollingDays",label:"7 дней"}];class ir extends d{constructor(e){super(e);i(this,"city");i(this,"isActive");this.city=e!=null&&e.city?new Y(e.city):void 0,this.isActive=(e==null?void 0:e.isActive)??!1}}class bt{constructor(r){i(this,"salesDirections");i(this,"partnerGroups");i(this,"managers");i(this,"additionalClients");i(this,"fixedClients");i(this,"regions");i(this,"cities");i(this,"lastLoginDate");i(this,"lastOrderDate");this.salesDirections=u.map((r==null?void 0:r.salesDirections)??[],e=>new q(e)),this.partnerGroups=u.map((r==null?void 0:r.partnerGroups)??[],e=>new F(e)),this.managers=u.map((r==null?void 0:r.managers)??[],e=>new k(e)),this.additionalClients=u.map((r==null?void 0:r.additionalClients)??[],e=>new ir(e)),this.fixedClients=u.map((r==null?void 0:r.fixedClients)??[],e=>new ir(e)),this.regions=u.map((r==null?void 0:r.regions)??[],e=>new K(e)),this.cities=u.map((r==null?void 0:r.cities)??[],e=>new Y(e)),this.lastLoginDate=new R(r==null?void 0:r.lastLoginDate),this.lastOrderDate=new R(r==null?void 0:r.lastOrderDate)}hasClientConditions(){return u.some([this.salesDirections,this.partnerGroups,this.managers,this.additionalClients,this.fixedClients,this.regions,this.cities],r=>!u.isEmpty(r))||u.some([this.lastLoginDate,this.lastOrderDate],r=>!!r.from||!!r.to)}setPeriod(r,e){return this[r]=new R({from:e!=null&&e.from?l.startOfDay(e.from):null,to:e!=null&&e.to?l.endOfDay(e.to):null}),this}toSaveData(){return{salesDirections:u.map(this.salesDirections,"id"),partnerGroups:u.map(this.partnerGroups,"id"),managers:u.map(this.managers,"id"),additionalClients:u.map(this.additionalClients,"id"),regions:u.map(this.regions,"id"),cities:u.map(this.cities,"id"),lastLoginDate:new R(this.lastLoginDate),lastOrderDate:new R(this.lastOrderDate)}}}var Le=(n=>(n.Active="active",n.Scheduled="scheduled",n.Completed="completed",n))(Le||{});class At{static resolve(r,e=new Date){return r.deletedAt&&r.deletedAt.getTime()<=e.getTime()?Le.Completed:r.publishedAt&&r.publishedAt.getTime()>e.getTime()?Le.Scheduled:Le.Active}}class sr extends Ye{constructor(e){super(e);i(this,"conditions");i(this,"products");i(this,"productCategories");i(this,"countDiscountedPrices");i(this,"expectedCountDiscountedPrices");i(this,"countDiscountedProducts");i(this,"countDiscountedClients");this.conditions=new bt(e==null?void 0:e.conditions),this.products=u.map((e==null?void 0:e.products)??[],t=>new N(t)),this.productCategories=u.map((e==null?void 0:e.productCategories)??[],t=>new H(t)),this.countDiscountedPrices=(e==null?void 0:e.countDiscountedPrices)??0,this.expectedCountDiscountedPrices=(e==null?void 0:e.expectedCountDiscountedPrices)??0,this.countDiscountedProducts=(e==null?void 0:e.countDiscountedProducts)??0,this.countDiscountedClients=(e==null?void 0:e.countDiscountedClients)??0}getState(e=new Date){return At.resolve(this,e)}assignCounters(e){this.countDiscountedPrices=e.countDiscountedPrices,this.expectedCountDiscountedPrices=e.expectedCountDiscountedPrices,this.countDiscountedProducts=e.countDiscountedProducts,this.countDiscountedClients=e.countDiscountedClients}isPricesUpdating(){return this.countDiscountedPrices!==this.expectedCountDiscountedPrices}toSaveData(){return{name:this.name,percent:this.percent,isLowPriceAllowed:this.isLowPriceAllowed,publishedAt:this.publishedAt??null,deletedAt:this.deletedAt??null,description:this.description??"",products:u.map(this.products,"id"),productCategories:u.map(this.productCategories,"id"),conditions:this.conditions.toSaveData()}}}class Hr{constructor(r){i(this,"client");i(this,"additionalClientsCondition");i(this,"fixedClientsCondition");i(this,"partnerGroupsCondition");i(this,"managersCondition");i(this,"citiesCondition");i(this,"regionsCondition");i(this,"salesDirectionsCondition");this.client=new ir(r==null?void 0:r.client),this.additionalClientsCondition=(r==null?void 0:r.additionalClientsCondition)??!1,this.fixedClientsCondition=(r==null?void 0:r.fixedClientsCondition)??!1,this.partnerGroupsCondition=(r==null?void 0:r.partnerGroupsCondition)??!1,this.managersCondition=(r==null?void 0:r.managersCondition)??!1,this.citiesCondition=(r==null?void 0:r.citiesCondition)??!1,this.regionsCondition=(r==null?void 0:r.regionsCondition)??!1,this.salesDirectionsCondition=(r==null?void 0:r.salesDirectionsCondition)??!1}isEligible(){return this.additionalClientsCondition||this.fixedClientsCondition||this.partnerGroupsCondition||this.managersCondition||this.citiesCondition||this.regionsCondition||this.salesDirectionsCondition}}class Pi extends te{constructor(e){super();i(this,"id");i(this,"name");i(this,"states");this.id=e==null?void 0:e.id,this.name=e==null?void 0:e.name,this.states=e==null?void 0:e.states}resetFilterValue(e){switch(e){case"id":case"name":case"states":this[e]=void 0;break}return this}}class nr extends _{static prepareSaveData(r,e){return{...r,publishedAt:A.toApiFormat(r.publishedAt),deletedAt:A.toApiFormat(r.deletedAt),conditions:{...r.conditions,lastLoginDate:A.periodToApiFormat(r.conditions.lastLoginDate),lastOrderDate:A.periodToApiFormat(r.conditions.lastOrderDate),updateFixedClients:e}}}getDiscountsList(r,e,t,s){return this.getTypedPaginated(Ye,"/internal/price/discounts",r,e,t,{},void 0,s)}getDiscount(r){return this.get(`/internal/price/discounts/${r}`,{},e=>new sr(e.data))}createDiscount(r,e,t={}){return this.post("/internal/price/discounts",nr.prepareSaveData(r,e),s=>new sr(s.data),t)}updateDiscount(r,e,t,s={}){return this.patch(`/internal/price/discounts/${r}`,nr.prepareSaveData(e,t),o=>new sr(o.data),s)}removeDiscount(r){return this.delete(`/internal/price/discounts/${r}`)}getEligibleClients(r){return this.getTypedList(Hr,`/internal/price/discounts/${r}/clients`)}checkClient(r,e){return this.get(`/internal/price/discounts/${r}/clients/${e}/check`,{},t=>new Hr(t.data))}}class Ne extends d{constructor(r){super(r)}}class _e extends G{constructor(e){super(e,-1);i(this,"question");i(this,"answer");i(this,"groups");this.question=(e==null?void 0:e.question)??"",this.answer=(e==null?void 0:e.answer)??"",this.groups=u.map((e==null?void 0:e.groups)??[],t=>new Ne(t))}toSaveData(){return{question:this.question,answer:this.answer,groups:u.map(this.groups,"id")}}}class vi extends _{getFaqList(r,e){return this.getTypedPaginated(_e,"/internal/faq",void 0,void 0,e,u.isNil(r)?{}:{group:r})}getFaq(r){return this.get(`/internal/faq/${r}`,{},e=>new _e(e.data))}createFaq(r,e={}){return this.post("/internal/faq",r,t=>new _e(t.data),e)}updateFaq(r,e,t={}){return this.patch(`/internal/faq/${r}`,e,s=>new _e(s.data),t)}removeFaq(r){return this.delete(`/internal/faq/${r}`)}getGroupsList(){return this.getTypedList(Ne,"/internal/faq/groups")}createGroup(r,e={}){return this.post("/internal/faq/groups",r,t=>new Ne(t.data),e)}updateGroup(r,e,t={}){return this.patch(`/internal/faq/groups/${r}`,e,s=>new Ne(s.data),t)}removeGroup(r){return this.delete(`/internal/faq/groups/${r}`)}}function Ri(n){const r=u.round(n*100);return`${r>=0?"+":""}${r}%`}class Br{static productIsMeasurable(r){return r.unit.isLinear||r.unit.isSquare}static getProductMultiplicity(r){var e,t;return!((e=r.properties)!=null&&e.ignoreMinCountCheck)&&((t=r.properties)==null?void 0:t.minCount)!=null&&!Br.productIsMeasurable(r)?r.properties.minCount:1}static getProductLengthMultiplicity(r){var e,t,s;return((e=r.properties)==null?void 0:e.lengthStep)!=null?r.properties.lengthStep:!((t=r.properties)!=null&&t.ignoreMinCountCheck)&&((s=r.properties)==null?void 0:s.minCount)!=null?r.properties.minCount:.01}}const we=class we extends y{constructor(){super();i(this,"responseDataCacheTimeout");this.responseDataCacheTimeout=b().config.http.responseDataCacheTimeout}static getCachedResponse(e){const t=we.responseDataCache.get(e);if(t&&t.validTo>new Date)return t.val}cacheResponse(e,t){we.responseDataCache.set(e,{validTo:l.addSeconds(new Date,this.responseDataCacheTimeout),val:t})}getTypedDataArrayRequester(e,t,s=!1,o={},p=void 0){const g=t+(u.isEmpty(o)?"":` >>> ${JSON.stringify(o)}`),m=s?we.getCachedResponse(g):void 0;return m?Promise.resolve(m):this.getTypedList(e,t,o,!1,p).then(a=>(s&&a&&this.cacheResponse(g,a),a))}};i(we,"responseDataCache",new Map);let Ce=we;class Ti{static generateUndefinedManagerInstance(){return new j({id:0,name:"- Не назначен -",isActive:!0,guid:"-undefined-"})}static isUndefinedManagerInstance(r){return r.id===0&&r.guid==="-undefined-"}}class Wr extends Ce{async getManagers(){const r="/internal/managers",e=Ce.getCachedResponse(r);if(e)return e;const t=await this.get(r),s=L.instanceListInitializer(j,t.data);return this.cacheResponse(r,s),s}getManager(r){return this.get(`/internal/managers/${r}`,{},e=>new j(e.data))}}var De=(n=>(n.Processing="processing",n.Completed="completed",n.Error="error",n.NeedsActualization="needs_actualization",n))(De||{});class Ot{constructor(r){i(this,"status");i(this,"actualizedAt");i(this,"expiresAt");i(this,"error");this.status=(r==null?void 0:r.status)??De.Processing,this.actualizedAt=A.parse(r==null?void 0:r.actualizedAt),this.expiresAt=A.parse(r==null?void 0:r.expiresAt),this.error=r==null?void 0:r.error}get isProcessing(){return this.status===De.Processing}get isOutdated(){return this.isOutdatedAt(new Date)}get isOrderAllowed(){return this.isOrderAllowedAt(new Date)}isOutdatedAt(r){return this.status!==De.Completed||u.isNil(this.actualizedAt)?!0:!u.isNil(this.expiresAt)&&this.expiresAt.getTime()<r.getTime()}isOrderAllowedAt(r){return this.status===De.Completed&&!this.isOutdatedAt(r)}}class Gr extends Ae{constructor(e){super(e);i(this,"name");i(this,"client");i(this,"sum");i(this,"isProfstroy");i(this,"actualization");i(this,"file");this.name=e==null?void 0:e.name,this.client=new X(e==null?void 0:e.client),this.sum=e==null?void 0:e.sum,this.isProfstroy=e==null?void 0:e.isProfstroy,this.actualization=(e==null?void 0:e.actualization)&&new Ot(e.actualization),this.file=e==null?void 0:e.file}}class $t extends Cr{constructor(e){super(e);i(this,"groupName");i(this,"supplierSku");i(this,"isIgnored");i(this,"lineError");this.groupName=e.groupName,this.supplierSku=e.supplierSku??e.product.supplierSku,this.isIgnored=e.isIgnored,this.lineError=e.lineError}get isProductStub(){return u.isNil(this.product.id)}get isOrderable(){return!this.isProductStub&&!this.isIgnored&&u.isEmpty(this.lineError)}}class W extends Gr{constructor(e){super(e);i(this,"sum");i(this,"products");this.sum=e.sum??0,this.products=(e.products??[]).map(t=>e.isProfstroy?new $t(t):new Cr(t))}}class Si extends te{constructor(e){super();i(this,"id");i(this,"clientSearchTerm");i(this,"name");i(this,"createdAt",new R);this.id=e==null?void 0:e.id,this.clientSearchTerm=e==null?void 0:e.clientSearchTerm,this.name=e==null?void 0:e.name,this.createdAt=new R(e==null?void 0:e.createdAt)}resetFilterValue(e){return e==="createdAt"?(this.createdAt.from=null,this.createdAt.to=null):this[e]=void 0,this}asClearRaw(){var t,s;const e=super.asClearRaw();return!((t=e==null?void 0:e.createdAt)!=null&&t.from)&&!((s=e==null?void 0:e.createdAt)!=null&&s.to)&&delete e.createdAt,e}}class qe extends v{}class zr extends Mr{constructor(e){var t,s,o,p,g,m,a,P;super(e);i(this,"client");i(this,"payment");i(this,"delivery");i(this,"attachedUser");i(this,"status");i(this,"statusDetail");i(this,"salesDirection");i(this,"attachedAt");i(this,"isOnOrder");i(this,"isProfstroy");i(this,"isNotInStock");i(this,"sum");i(this,"isLargeOrder");this.client=new X(e==null?void 0:e.client),this.payment={type:((t=e==null?void 0:e.payment)==null?void 0:t.type)??-1,status:((s=e==null?void 0:e.payment)==null?void 0:s.status)??-1,onlinePaymentLink:(o=e==null?void 0:e.payment)==null?void 0:o.onlinePaymentLink},this.delivery={type:((p=e==null?void 0:e.delivery)==null?void 0:p.type)??-1,date:u.isString((g=e==null?void 0:e.delivery)==null?void 0:g.date)?l.parseISO(e.delivery.date):((m=e==null?void 0:e.delivery)==null?void 0:m.date)??new Date,address:(a=e==null?void 0:e.delivery)!=null&&a.address?new ae(e.delivery.address):void 0,warehouse:(P=e==null?void 0:e.delivery)!=null&&P.warehouse?new he(e.delivery.warehouse):void 0},this.attachedUser=e!=null&&e.attachedUser?new k(e==null?void 0:e.attachedUser):void 0,this.status=new qe(e==null?void 0:e.status),this.statusDetail=e!=null&&e.statusDetail?new v(e.statusDetail):void 0,this.salesDirection=new q(e==null?void 0:e.salesDirection),this.attachedAt=u.isString(e==null?void 0:e.attachedAt)?l.parseISO(e.attachedAt):e==null?void 0:e.attachedAt,this.isOnOrder=(e==null?void 0:e.isOnOrder)??!1,this.isProfstroy=(e==null?void 0:e.isProfstroy)??!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}}class dt extends ar{constructor(e,t){super(e);i(this,"product");i(this,"cost");i(this,"costOne");i(this,"costOneRub");i(this,"costRub");i(this,"logicGroupId");i(this,"salesDirection");i(this,"specificationImgUrl");i(this,"sawing");i(this,"currency");i(this,"changedFields",[]);i(this,"replacement");this.product=new se(e.product),this.currency=new M(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=u.isArray(e.sawing)?e.sawing:e.sawing?[e.sawing]:void 0,t&&(this.replacement=t,this.quantity!==t.quantity&&this.changedFields.push("quantity"),this.length!==t.length&&this.changedFields.push("length"))}}class $ extends zr{constructor(e){var t;super(e);i(this,"products");i(this,"invoices");i(this,"comment");i(this,"image");i(this,"contragent");i(this,"barcode");i(this,"orderSource");i(this,"isAllowProcessingWithoutPayment");i(this,"nextStatuses");i(this,"actions");i(this,"operatorsComment");i(this,"operatorsForWarehouseComment");i(this,"erpOrderUrl");i(this,"numberDoc");this.products=(e.products??[]).map(s=>{var p;const o=s.replacementId?(p=e.products)==null?void 0:p.find(g=>g.id===s.replacementId):void 0;return new dt(s,o)}),this.invoices=e.invoices??[],this.comment=e.comment,this.image=e.image,this.contragent=e.contragent?Ie.createInstance(e.contragent):void 0,this.barcode=e.barcode,this.orderSource=e.orderSource?new v(e.orderSource):void 0,this.isAllowProcessingWithoutPayment=e.isAllowProcessingWithoutPayment,this.nextStatuses=(t=e.nextStatuses)==null?void 0:t.map(s=>new qe(s)),this.actions=e.actions,this.operatorsComment=e.operatorsComment,this.operatorsForWarehouseComment=e.operatorsForWarehouseComment,this.erpOrderUrl=e.erpOrderUrl,this.numberDoc=e.numberDoc}}class bi extends _{getOffers(r,e,t,s){return this.getTypedPaginated(Gr,"/internal/orders/offers",r,e,t,{},void 0,s)}createOfferFromCart(r,e,t){return this.post(`/internal/orders/offers/${r}`,{name:e,items:t!=null&&t.length?t:void 0},s=>new W(s.data))}createProfstroyOffer(r,e,t,s={}){return this.post(`/internal/orders/offers/${r}/profstroy`,{file:e,name:t},o=>new W(o.data),s)}actualizeProfstroyOffer(r){return this.post(`/internal/orders/offers/${r}/profstroy/actualize`,{},e=>new W(e.data))}reloadProfstroyOffer(r){return this.post(`/internal/orders/offers/${r}/profstroy/reload`,{},e=>new W(e.data))}getOffer(r){return this.get(`/internal/orders/offers/${r}`,{},e=>new W(e.data))}updateOffer(r,e){return this.patch(`/internal/orders/offers/${r}`,{name:e},t=>new W(t.data))}deleteOffer(r){return this.delete(`/internal/orders/offers/${r}`)}createOrderFromDraft(r,e,t,s={}){const o=b().config.dateFormats.api;return this.post(`/internal/orders/offers/${r}/create-order`,{...e,deliveryDate:e.deliveryDate?l.format(e.deliveryDate,o):void 0,items:t!=null&&t.length?t:void 0},p=>L.instanceListInitializer($,p.data),s)}addOfferProduct(r,e,t={}){return this.post(`/internal/orders/offers/${r}/products`,{product_id:e.product.id,product_category_id:e.configurator?e.category.id:void 0,quantity:e.quantity,height:e.height,length:e.length,width:e.width,configurator:e.configurator,marker:e.marker,is_additional_sale:e.isAdditionalSale,...e.configuratorParams},s=>new W(s.data),t)}patchOfferProduct(r,e,t,s={}){return this.patch(`/internal/orders/offers/${r}/products/${e}`,{product_id:t.product.id,product_category_id:t.configurator?t.category.id:void 0,quantity:t.quantity,height:t.height,length:t.length,width:t.width,configurator:t.configurator,marker:t.marker,is_additional_sale:t.isAdditionalSale,...t.configuratorParams},o=>new W(o.data),s)}deleteOfferProduct(r,e){return this.delete(`/internal/orders/offers/${r}/products/${e}`,t=>new W(t.data))}getOfferHtml(r,e){return this.get(`/internal/orders/offers/${r}/view`,e?{recipientText:e}:{},t=>new Blob([t.data],{type:"text/html"}))}getOfferPdf(r,e){return this.getBlob(`/internal/orders/offers/${r}/download`,e?{recipientText:e}:{},t=>new Blob([t.request.response],{type:"application/pdf"}))}sendOffer(r,e){return this.post(`/internal/orders/offers/${r}/send`,e)}}class Ai{static isProfstroy(r){return!!(r!=null&&r.isProfstroy)}static isProfstroyOffer(r){return!u.isNil(r)&&r.isProfstroy===!0&&!u.isNil(r.actualization)}}var kt=(n=>(n.View="view",n.Share="share",n.EditTags="edit_tags",n.SaveOrderIgnoredProducts="save_order_ignored_products",n.ChangeStatus="change_status",n.ChangeProducts="change_products",n.ChangeOrderParameters="change_order_parameters",n.Recalculate="recalculate",n.AttachOrder="attach_order",n.DetachOrder="detach_order",n.ChangeAttachedOperator="change_attached_operator",n.SendOnlinePaymentLink="send_online_payment_link",n.ConfirmOnlineFullPayment="confirm_online_full_payment",n.MergeOrders="merge_orders",n.GetHistory="get_history",n.CloneOrder="clone_order",n.DeleteAttachedFile="delete_attached_file",n))(kt||{});class Oi{constructor(r){i(this,"paymentType");i(this,"deliveryType");i(this,"contragentId");i(this,"deliveryDate");i(this,"addressId");i(this,"warehouseId");i(this,"image");i(this,"comment");i(this,"barcode");i(this,"operatorsComment");i(this,"operatorsForWarehouseComment");i(this,"additionalEmails");i(this,"isAllowProcessingWithoutPayment");i(this,"isAdditionalSale");var e,t,s;this.paymentType=r==null?void 0:r.payment.type,this.deliveryType=r==null?void 0:r.delivery.type,this.contragentId=(e=r==null?void 0:r.contragent)==null?void 0:e.id,this.deliveryDate=r!=null&&r.delivery.date?new Date(r.delivery.date):void 0,this.addressId=(t=r==null?void 0:r.delivery.address)==null?void 0:t.id,this.warehouseId=(s=r==null?void 0:r.delivery.warehouse)==null?void 0:s.id,this.comment=r==null?void 0:r.comment,this.barcode=r==null?void 0:r.barcode,this.operatorsComment=r==null?void 0:r.operatorsComment,this.operatorsForWarehouseComment=r==null?void 0:r.operatorsForWarehouseComment,this.isAllowProcessingWithoutPayment=r==null?void 0:r.isAllowProcessingWithoutPayment}}class jr extends v{}class Yr extends v{}class $i extends te{constructor(e){var t,s,o,p;super();i(this,"attachedUsers");i(this,"clientSearchTerm");i(this,"client");i(this,"contragent");i(this,"createdAt",new R);i(this,"creator");i(this,"deliveryDate",new R);i(this,"deliveryAddressSearch");i(this,"clientCities");i(this,"id");i(this,"isApproved");i(this,"isNotInStock");i(this,"isOnOrder");i(this,"attachedAt",new R);i(this,"salesDirections");i(this,"status");i(this,"statusDetail");i(this,"deliveryType");i(this,"paymentType");i(this,"warehouses");i(this,"isLargeOrder");i(this,"isToProcess");i(this,"onlyMyRegions");this.attachedUsers=(t=e==null?void 0:e.attachedUsers)==null?void 0:t.map(g=>"isActive"in g?new j(g):new jr(g)),this.clientSearchTerm=e==null?void 0:e.clientSearchTerm,this.client=e!=null&&e.client?new X(e.client):void 0,this.contragent=e==null?void 0:e.contragent,this.createdAt=new R(e==null?void 0:e.createdAt),this.creator=e!=null&&e.creator?new k(e.creator):void 0,this.deliveryDate=new R(e==null?void 0:e.deliveryDate),this.deliveryAddressSearch=e==null?void 0:e.deliveryAddressSearch,this.clientCities=(s=e==null?void 0:e.clientCities)==null?void 0:s.map(g=>new Y(g)),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 R(e==null?void 0:e.attachedAt),this.salesDirections=(o=e==null?void 0:e.salesDirections)==null?void 0:o.map(g=>new q(g)),this.status=e==null?void 0:e.status,this.statusDetail=e==null?void 0:e.statusDetail,this.deliveryType=e!=null&&e.deliveryType?new z(e.deliveryType):void 0,this.paymentType=e!=null&&e.paymentType?new Yr(e.paymentType):void 0,this.warehouses=(p=e==null?void 0:e.warehouses)==null?void 0:p.map(g=>new he(g)),this.isToProcess=e==null?void 0:e.isToProcess}resetFilterValue(e){switch(e){case"createdAt":this.createdAt.from=null,this.createdAt.to=null;break;case"creator":this.creator=void 0;break;case"deliveryDate":this.deliveryDate.from=null,this.deliveryDate.to=null;break;case"deliveryType":this.deliveryType=new z;break;case"clientCities":this.clientCities=[];break;case"attachedAt":this.attachedAt.from=null,this.attachedAt.to=null;break;case"salesDirection":case"salesDirections":this.salesDirections=[];break;case"status":this.status=[];break;case"warehouse":case"warehouses":this.warehouses=[];break;default:this[e]=void 0;break}return this}asClearRaw(){var t,s,o,p,g,m;const e=super.asClearRaw();return!((t=e==null?void 0:e.createdAt)!=null&&t.from)&&!((s=e==null?void 0:e.createdAt)!=null&&s.to)&&delete e.createdAt,!((o=e==null?void 0:e.deliveryDate)!=null&&o.from)&&!((p=e==null?void 0:e.deliveryDate)!=null&&p.to)&&delete e.deliveryDate,!((g=e==null?void 0:e.attachedAt)!=null&&g.from)&&!((m=e==null?void 0:e.attachedAt)!=null&&m.to)&&delete e.attachedAt,e}}class It{constructor(r){i(this,"user");i(this,"status");i(this,"statusDetail");i(this,"createdAt");this.user=new k(r==null?void 0:r.user),this.status=new qe(r==null?void 0:r.status),this.statusDetail=r!=null&&r.statusDetail?new v(r.statusDetail):void 0,this.createdAt=u.isString(r==null?void 0:r.createdAt)?l.parseISO(r.createdAt):(r==null?void 0:r.createdAt)??new Date}}class di extends _{getOrders(r,e,t,s){return this.getTypedPaginated(zr,"/internal/orders",r,e,t,{},void 0,s)}getOrdersCount(r,e){return this.get("/internal/orders/count",r?{filters:JSON.stringify((r instanceof J?r:new J(r)).toPrimitive())}:{},void 0,void 0,e).then(t=>t.count)}getClientOrderStatistics(r,e){return this.get(`/internal/clients/${r}/orders/statistics`,e?{period:e}:{})}getOrder(r){return this.get(`/internal/orders/${r}`,{},e=>new $(e.data))}createClientOrder(r,e,t,s={}){const o=b().config.dateFormats.api;return this.post(`/internal/clients/${r}/orders`,{...e,deliveryDate:l.format(e.deliveryDate,o),items:t!=null&&t.length?t:void 0},p=>L.instanceListInitializer($,p.data),s)}attachOrder(r){return this.patch(`/internal/orders/${r}/attach`,{},e=>new $(e.data))}detachOrder(r){return this.patch(`/internal/orders/${r}/detach`,{},e=>new $(e.data))}mergeOrders(r,e){return this.patch(`/internal/orders/${r}/merge`,{ids:e},t=>new $(t.data))}recalculateOrder(r){return this.patch(`/internal/orders/${r}/recalculate`,{},e=>new $(e.data))}cloneOrder(r){return this.get(`/internal/orders/${r}/clone`,{})}updateOrder(r,e,t={}){const s=b().config.dateFormats.api;return this.patch(`/internal/orders/${r}`,{...e,deliveryDate:e.deliveryDate?l.format(e.deliveryDate,s):void 0},o=>new $(o.data),t)}addOrderProduct(r,e,t={}){return this.post(`/internal/orders/${r}/products`,{product_id:e.product.id,product_category_id:e.configurator?e.category.id:void 0,quantity:e.quantity,height:e.height,length:e.length,width:e.width,configurator:e.configurator,marker:e.marker,is_additional_sale:e.isAdditionalSale,...e.configuratorParams},s=>new $(s.data),t)}changeOrderStatus(r,e,t,s={}){return this.patch(`/internal/orders/${r}/status`,{status:e,statusDetail:t},o=>new $(o.data),s)}changeOrderStatusDetail(r,e){return this.patch(`/internal/orders/${r}/status`,{statusDetail:e},t=>new $(t.data))}getOrderStatusHistory(r){return this.getTypedList(It,`/internal/orders/${r}/history`)}getOrderPrintHtml(r,e){return this.get(`/internal/orders/${r}/print/view`,{...e},t=>new Blob([t.data],{type:"text/html"}))}getOrderPrintPdf(r,e){return this.getBlob(`/internal/orders/${r}/print/download`,{...e},t=>new Blob([t.request.response],{type:"application/pdf"}))}sendOrderPrint(r,e){return this.post(`/internal/orders/${r}/print/send`,e)}changeAttachedOperator(r,e){return this.patch(`/internal/orders/${r}/change-attached-operator`,{operatorId:e},t=>new $(t.data))}deleteOrderAttachedFile(r){return this.delete(`/internal/orders/${r}/file/attached`,e=>new $(e.data))}deleteOrderProduct(r,e){return this.delete(`/internal/orders/${r}/products/${e}`,t=>new $(t.data))}patchOrderProduct(r,e,t,s={}){return this.patch(`/internal/orders/${r}/products/${e}`,{product_id:t.product.id,product_category_id:t.configurator?t.category.id:void 0,quantity:t.quantity,height:t.height,length:t.length,width:t.width,configurator:t.configurator,marker:t.marker,is_additional_sale:t.isAdditionalSale,...t.configuratorParams},o=>new $(o.data),s)}getDeliveryNearestDates(r,e){return this.get(`/internal/orders/delivery/${r}/nearest-dates`,{},t=>t.data,void 0,e)}getSelfDeliveryNearestDates(r,e){return this.get(`/internal/orders/self-delivery/${r}/nearest-dates`,{},t=>t.data,void 0,e)}getDeliveryCost(r,e,t,s){const o=b().config.dateFormats.api;return this.get(`/internal/orders/delivery/${r}/cost`,{date:l.format(e,o),warehouse_id:t},p=>p.data,void 0,s)}}const ki=Symbol("currentOrder");class or{constructor(r){i(this,"client");i(this,"product");i(this,"cost");i(this,"costCoefficient");i(this,"source");this.client=new X(r==null?void 0:r.client),this.product=new N(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)??Je.Product}}const Qr=n=>{var r,e,t,s,o;return n?u.omitBy({cities:(r=n.cities)==null?void 0:r.map(p=>p.id),clients:(e=n.clients)==null?void 0:e.map(p=>p.id),managers:(t=n.managers)==null?void 0:t.map(p=>p.id),partnerGroups:(s=n.partnerGroups)==null?void 0:s.map(p=>p.id),salesDirections:(o=n.salesDirections)==null?void 0:o.map(p=>p.id),hideNotActive:n.hideNotActive},p=>u.isNil(p)||(u.isArray(p)||u.isObject(p))&&u.isEmpty(p)):{}},Lt=n=>{const r={};return n.from&&(n.from.coefficient||n.from.value)&&(r.from={},n.from.coefficient&&(r.from.priceCoefficientId=n.from.coefficient.id),n.from.value&&(r.from.increasePercent=n.from.value)),n.to&&(n.to.coefficient||n.to.value)&&(r.to={},n.to.coefficient&&(r.to.priceCoefficientId=n.to.coefficient.id),n.to.value&&(r.to.increasePercent=n.to.value)),r};class Ii extends y{analyzeProductPrices(r,e,t){return this.get(`/internal/price/products/${r}/analyze`,{...Lt(e),filters:Qr(t)},s=>L.instanceListInitializer(or,s.data))}analyzeCategoryPrices(r,e,t){return this.get(`/internal/price/categories/${r}/analyze`,{...Lt(e),filters:Qr(t)},s=>L.instanceListInitializer(or,s.data))}analyzeCategoryPricesBySquare(r,e,t){return this.get(`/internal/price/categories/${r}/analyze/square`,{...e,filters:Qr(t)},s=>L.instanceListInitializer(or,s.data))}}class Nt{constructor(r){i(this,"cost");i(this,"isLowCost");i(this,"isRetail");i(this,"costDate");i(this,"discountName");i(this,"priceTemplateName");i(this,"product");i(this,"client");i(this,"executor");i(this,"currency");this.cost=r.cost??0,this.isLowCost=r.isLowCost??!1,this.isRetail=r.isRetail??!1,this.costDate=u.isString(r.costDate)?l.parseISO(r.costDate):r.costDate??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 k(r.client):void 0,this.executor=r.executor?new k(r.executor):void 0,this.currency=r.currency?new M(r.currency):void 0}}class _t extends ge{constructor(e){super(e);i(this,"history");this.history=u.map(e.history,t=>new Nt(t))}}class Li extends y{getProductPriceHistory(r){var o,p,g,m,a;const e=b().config.dateFormats.api,t=u.omitBy(u.merge(r,{costDate:{from:u.isDate((o=r.costDate)==null?void 0:o.from)?l.format(r.costDate.from,e):(p=r.costDate)==null?void 0:p.from,to:u.isDate((g=r.costDate)==null?void 0:g.to)?l.format(r.costDate.to,e):(m=r.costDate)==null?void 0:m.to}}),P=>u.isNil(P)||(u.isArray(P)||u.isObject(P))&&u.isEmpty(P)),s=((a=r.product)==null?void 0:a[0])??0;return delete t.product,this.get(`/internal/price/products/${s}/history`,t).then(P=>[new _t(u.merge(P[0],{history:P}))])}}class Vr{constructor(r){i(this,"products",[]);i(this,"productCategories",[]);r!=null&&r.products&&(this.products=r.products.map(e=>new ge(e))),r!=null&&r.productCategories&&(this.productCategories=r.productCategories.map(e=>new ge(e)))}}class Ni extends y{getProductCategoryRecommendations(r){return this.get(`/internal/catalog/recommendations/categories/${r.id}`,{},e=>new Vr(e.data))}getProductRecommendations(r){return this.get(`/internal/catalog/recommendations/products/${r.id}`,{},e=>new Vr(e.data))}saveProductCategoryRecommendations(r,e){return this.post(`/internal/catalog/recommendations/categories/${r.id}`,{product_categories:e.productCategories.map(t=>t.id),products:e.products.map(t=>t.id)})}saveProductRecommendations(r,e){return this.post(`/internal/catalog/recommendations/products/${r.id}`,{product_categories:e.productCategories.map(t=>t.id),products:e.products.map(t=>t.id)})}}var qt=(n=>(n.New="new",n.Processing="processing",n.AwaitingSupplyProducts="awaiting_supply_products",n.InvoiceIssued="invoice_issued",n.ProcessingOnStock="processing_on_stock",n.Finished="finished",n.OrderUpdated="order_updated",n.Canceled="canceled",n.Error="error",n))(qt||{}),Ut=(n=>(n.CanceledBy1c="canceled_by1c",n.CanceledByClient="canceled_by_client",n.FinishedNotApproved="finished_not_approved",n.ProcessingByPurchasingDepartment="processing_by_purchasing_department",n.WillWaiting="will_waiting",n))(Ut||{});class Mt extends v{}class Ht extends v{}class Jr extends v{constructor(e){var t;super(e);i(this,"userRegions");this.userRegions=((t=e==null?void 0:e.userRegions)==null?void 0:t.map(s=>new de(s)))??[]}}class Bt extends v{}class Wt extends v{}class Gt extends v{}class zt extends v{}class _i{static generateUndefinedInstance(r,e="- Не определён -"){return new r({id:0,name:e,slug:"-undefined-"})}static isUndefinedInstance(r){return r.id===0&&r.slug==="-undefined-"}}class xr extends v{}const V=class V extends Ce{static withoutUnknownLocation(r){return r.filter(e=>e.id!==V.unknownLocationId)}getReference(r,e=!1){return this.getTypedDataArrayRequester(Mt,`/internal/references/${r}`,e)}getChannelPrimaryInterest(){return this.getTypedDataArrayRequester(_r,"/internal/references/channel-primary-interest",!0)}getContactPositions(){return this.getTypedDataArrayRequester(Bt,"/internal/references/contact-position",!0)}getCuratedDirection(){return this.getTypedDataArrayRequester(Ke,"/internal/references/curated-direction",!0)}getCurrency(){return this.getTypedDataArrayRequester(M,"/public/references/currency",!0)}getPartnerGroup(){return this.getTypedDataArrayRequester(F,"/internal/references/partner-group",!0)}getOpf(){return this.getTypedDataArrayRequester(Z,"/public/references/opf",!0)}getOperators(){return this.getTypedDataArrayRequester(jr,"/internal/references/operator",!0)}getOrderPaymentStatuses(){return this.getTypedDataArrayRequester(Wt,"/public/references/order-payment-status",!0)}getOrderStatuses(){return this.getTypedDataArrayRequester(qe,"/internal/references/order-status",!0)}getOrderStatusDetails(){return this.getTypedDataArrayRequester(Gt,"/internal/references/order-status-detail",!0)}getPaymentTypes(){return this.getTypedDataArrayRequester(Yr,"/public/references/payment-type",!0)}getResourceTypes(){return this.getTypedDataArrayRequester(xr,"/internal/references/resource-type",!0)}getSalesDirections(){return this.getTypedDataArrayRequester(q,"/public/references/sales-direction",!0)}getSourcePrimaryInterest(){return this.getTypedDataArrayRequester(qr,"/internal/references/source-primary-interest",!0)}searchCity(r){return this.getTypedDataArrayRequester(Y,`/internal/references/city-with-region-and-country/search?term=${r}`)}searchRegion(r){return this.getTypedDataArrayRequester(K,`/internal/references/region-with-country/search?term=${r}`)}getRegionsByCountry(r){return this.getTypedDataArrayRequester(K,"/internal/references/region",!1,{params:{countryId:r}}).then(e=>V.withoutUnknownLocation(e))}getCitiesByRegion(r){return this.getTypedDataArrayRequester(Ht,"/internal/references/city",!1,{params:{regionId:r}}).then(e=>V.withoutUnknownLocation(e))}getCitiesWithUserRegionByRegion(r){return this.getTypedDataArrayRequester(Jr,"/internal/references/city-with-user-region",!1,{params:{regionId:r}}).then(e=>V.withoutUnknownLocation(e))}searchCityWithRegion(r,e,t){return this.getTypedDataArrayRequester(Y,"/internal/references/city-with-region/search",!1,{term:r,...e?{params:{countryId:e}}:{}},t).then(s=>V.withoutUnknownLocation(s))}searchCityWithUserRegion(r,e){return this.getTypedDataArrayRequester(Jr,"/internal/references/city-with-user-region/search",!1,{term:r},e).then(t=>V.withoutUnknownLocation(t))}searchCountry(r){return this.getTypedDataArrayRequester(oe,`/internal/references/country/search?term=${r}`)}getDeliveryTypes(){return this.getTypedDataArrayRequester(z,"/internal/references/delivery-type",!0)}getWarehouses(){return this.getTypedDataArrayRequester(he,"/public/references/warehouse",!0)}getPropertyTypes(){return this.getTypedDataArrayRequester(Sr,"/internal/references/property-type",!0)}getPriceCoefficients(){return this.getTypedDataArrayRequester(x,"/internal/references/price-coefficient",!0)}getProductFileType(){return this.getTypedDataArrayRequester(zt,"/public/references/product-file-type",!0)}};i(V,"unknownLocationId",1);let S=V;const O=ee.defineStore("common.references_private",()=>{const n=f.ref({}),r=f.ref(void 0),e=f.ref(void 0),t=f.ref(void 0),s=f.ref(void 0),o=f.ref(void 0),p=f.ref(void 0),g=f.ref(void 0),m=f.ref(void 0),a=f.ref(void 0),P=f.ref(void 0),T=f.ref(void 0),Me=f.ref(void 0),He=f.ref(void 0),Pe=f.ref(void 0),ve=f.ref(void 0),Zr=f.ref(void 0),Fr=f.ref(void 0),et=f.ref(void 0),h=f.ref(void 0);return{dataLoaderList:n,channelPrimaryInterestReference:r,contactPositionsReference:e,currencyReference:t,deliveryTypeReference:s,managersList:o,opfReference:p,operatorReference:g,orderPaymentStatusReference:m,orderStatusReference:a,orderStatusDetailReference:P,paymentTypeReference:T,partnerGroupReference:Me,productFileTypeReference:He,resourceTypesReference:Pe,salesDirectionsReference:ve,sourcePrimaryInterestReference:Zr,warehousesReference:Fr,propertyTypesReference:et,priceCoefficientsReference:h}}),qi=ee.defineStore("common.references",()=>{const n=f.computed(()=>{const h=O();return!h.channelPrimaryInterestReference&&!h.dataLoaderList.channelPrimaryInterestReference&&(h.dataLoaderList.channelPrimaryInterestReference=!0,y.getInstance(S).getChannelPrimaryInterest().then(C=>{h.channelPrimaryInterestReference=C}).catch(u.noop)),h.channelPrimaryInterestReference}),r=f.computed(()=>{const h=O();return!h.contactPositionsReference&&!h.dataLoaderList.contactPositionsReference&&(h.dataLoaderList.contactPositionsReference=!0,y.getInstance(S).getContactPositions().then(C=>{h.contactPositionsReference=C}).catch(u.noop)),h.contactPositionsReference}),e=f.computed(()=>{const h=O();return!h.currencyReference&&!h.dataLoaderList.currencyReference&&(h.dataLoaderList.currencyReference=!0,y.getInstance(S).getCurrency().then(C=>{h.currencyReference=C}).catch(u.noop)),h.currencyReference}),t=f.computed(()=>{const h=O();return!h.opfReference&&!h.dataLoaderList.opfReference&&(h.dataLoaderList.opfReference=!0,y.getInstance(S).getOpf().then(C=>{h.opfReference=C}).catch(u.noop)),h.opfReference}),s=f.computed(()=>{const h=O();return!h.operatorReference&&!h.dataLoaderList.operatorReference&&(h.dataLoaderList.operatorReference=!0,y.getInstance(S).getOperators().then(C=>{h.operatorReference=C}).catch(u.noop)),h.operatorReference}),o=f.computed(()=>{const h=O();return!h.orderPaymentStatusReference&&!h.dataLoaderList.orderPaymentStatusReference&&(h.dataLoaderList.orderPaymentStatusReference=!0,y.getInstance(S).getOrderPaymentStatuses().then(C=>{h.orderPaymentStatusReference=C}).catch(u.noop)),h.orderPaymentStatusReference}),p=f.computed(()=>{const h=O();return!h.orderStatusReference&&!h.dataLoaderList.orderStatusReference&&(h.dataLoaderList.orderStatusReference=!0,y.getInstance(S).getOrderStatuses().then(C=>{h.orderStatusReference=C}).catch(u.noop)),h.orderStatusReference}),g=f.computed(()=>{const h=O();return!h.orderStatusDetailReference&&!h.dataLoaderList.orderStatusDetailReference&&(h.dataLoaderList.orderStatusDetailReference=!0,y.getInstance(S).getOrderStatusDetails().then(C=>{h.orderStatusDetailReference=C}).catch(u.noop)),h.orderStatusDetailReference}),m=f.computed(()=>{const h=O();return!h.paymentTypeReference&&!h.dataLoaderList.paymentTypeReference&&(h.dataLoaderList.paymentTypeReference=!0,y.getInstance(S).getPaymentTypes().then(C=>{h.paymentTypeReference=C}).catch(u.noop)),h.paymentTypeReference}),a=f.computed(()=>{const h=O();return!h.partnerGroupReference&&!h.dataLoaderList.partnerGroupReference&&(h.dataLoaderList.partnerGroupReference=!0,y.getInstance(S).getPartnerGroup().then(C=>{h.partnerGroupReference=C}).catch(u.noop)),h.partnerGroupReference}),P=f.computed(()=>{const h=O();return!h.productFileTypeReference&&!h.dataLoaderList.productFileTypeReference&&(h.dataLoaderList.productFileTypeReference=!0,y.getInstance(S).getProductFileType().then(C=>{h.productFileTypeReference=C}).catch(u.noop)),h.productFileTypeReference}),T=f.computed(()=>{const h=O();return!h.resourceTypesReference&&!h.dataLoaderList.resourceTypesReference&&(h.dataLoaderList.resourceTypesReference=!0,y.getInstance(S).getResourceTypes().then(C=>{h.resourceTypesReference=C}).catch(u.noop)),h.resourceTypesReference}),Me=f.computed(()=>{const h=O();return!h.salesDirectionsReference&&!h.dataLoaderList.salesDirectionsReference&&(h.dataLoaderList.salesDirectionsReference=!0,y.getInstance(S).getSalesDirections().then(C=>{h.salesDirectionsReference=C}).catch(u.noop)),h.salesDirectionsReference}),He=f.computed(()=>{const h=O();return!h.sourcePrimaryInterestReference&&!h.dataLoaderList.sourcePrimaryInterestReference&&(h.dataLoaderList.sourcePrimaryInterestReference=!0,y.getInstance(S).getSourcePrimaryInterest().then(C=>{h.sourcePrimaryInterestReference=C}).catch(u.noop)),h.sourcePrimaryInterestReference}),Pe=f.computed(()=>{const h=O();return!h.deliveryTypeReference&&!h.dataLoaderList.deliveryTypeReference&&(h.dataLoaderList.deliveryTypeReference=!0,y.getInstance(S).getDeliveryTypes().then(C=>{h.deliveryTypeReference=C}).catch(u.noop)),h.deliveryTypeReference}),ve=f.computed(()=>{const h=O();return!h.managersList&&!h.dataLoaderList.managersList&&(h.dataLoaderList.managersList=!0,y.getInstance(Wr).getManagers().then(C=>{h.managersList=C}).catch(u.noop)),h.managersList}),Zr=f.computed(()=>{const h=O();return!h.warehousesReference&&!h.dataLoaderList.warehousesReference&&(h.dataLoaderList.warehousesReference=!0,y.getInstance(S).getWarehouses().then(C=>{h.warehousesReference=C}).catch(u.noop)),h.warehousesReference}),Fr=f.computed(()=>{const h=O();return!h.propertyTypesReference&&!h.dataLoaderList.propertyTypesReference&&(h.dataLoaderList.propertyTypesReference=!0,y.getInstance(S).getPropertyTypes().then(C=>{h.propertyTypesReference=C}).catch(u.noop)),h.propertyTypesReference}),et=f.computed(()=>{const h=O();return!h.priceCoefficientsReference&&!h.dataLoaderList.priceCoefficientsReference&&(h.dataLoaderList.priceCoefficientsReference=!0,y.getInstance(S).getPriceCoefficients().then(C=>{h.priceCoefficientsReference=C}).catch(u.noop)),h.priceCoefficientsReference});return{channelPrimaryInterestsReference:n,contactPositionsReference:r,currencyReference:e,opfReference:t,operatorReference:s,orderPaymentStatusReference:o,orderStatusReference:p,orderStatusDetailReference:g,paymentTypeReference:m,partnerGroupsReference:a,productFilesTypesReference:P,resourceTypesReference:T,salesDirectionsReference:Me,sourcePrimaryInterestsReference:He,deliveryTypeReference:Pe,managersList:ve,warehousesReference:Zr,propertyTypesReference:Fr,priceCoefficientsReference:et}});class jt{constructor(r){i(this,"name");i(this,"content");this.name=r.name,this.content=r.content}}class Kr{constructor(r){i(this,"resourceType");i(this,"resourceId");i(this,"h1");i(this,"title");i(this,"description");i(this,"keywords");i(this,"meta");i(this,"tags");var e;this.resourceType=new xr(r==null?void 0:r.resourceType),this.resourceId=(r==null?void 0:r.resourceId)??"",this.h1=r==null?void 0:r.h1,this.title=r==null?void 0:r.title,this.description=r==null?void 0:r.description,this.keywords=r==null?void 0:r.keywords,this.meta=((e=r==null?void 0:r.meta)==null?void 0:e.map(t=>new jt(t)))??[],this.tags=r==null?void 0:r.tags}}class Ui extends y{getResourceSeoData(r,e){return this.get(`/internal/seo/${r.slug}/${e}`,{},t=>new Kr(t.data))}saveResourceSeoData(r,e={}){return this.post(`/internal/seo/${r.resourceType.slug}/${r.resourceId}`,r,t=>new Kr(t.data),e)}deleteResourceSeoData(r,e){return this.delete(`/internal/seo/${r.slug}/${e}`)}}class Yt extends G{constructor(e){super(e);i(this,"text");i(this,"searchCount");i(this,"lastSearchedAt");this.text=(e==null?void 0:e.text)??"",this.searchCount=(e==null?void 0:e.searchCount)??0,this.lastSearchedAt=A.parse(e==null?void 0:e.lastSearchedAt)}}class Mi extends y{getSearchProductsStatistics(r,e){return this.getTypedList(Yt,"/internal/statistics/search/products",{date:A.periodToApiFormat(r)},!1,e)}removeSearchProductStatistic(r){return this.delete(`/internal/statistics/search/products/${r}`)}}var Ue=(n=>(n[n.Undetermined=0]="Undetermined",n[n.Complete=1]="Complete",n[n.Incomplete=2]="Incomplete",n))(Ue||{});class cr{constructor(r,e){i(this,"showFeedback",!1);i(this,"feedback","");i(this,"validationStatus");this.showFeedback=!!r,this.feedback=r,this.validationStatus=e}}class Hi{static isBlocked(r,e){return e&&r===Ue.Incomplete}static getValidationResult(r,e){switch(r){case Ue.Incomplete:return e?new cr("Адрес неполный, выберите более точный вариант из подсказок","error"):new cr("Адрес неполный, проверьте его","warning");case Ue.Undetermined:return new cr("Не удалось определить полноту адреса, проверьте его","warning");default:return}}}class Bi extends y{searchAddresses(r){return this.execSuggestionQuery("/public/suggestions/address",r)}searchBank(r){return this.execSuggestionQuery("/public/suggestions/bank",r)}searchOrganization(r){return this.execSuggestionQuery("/public/suggestions/organization",r)}execSuggestionQuery(r,e){return this.get(r,{query:e}).then(t=>{const s=[...t];let o=1;return s.forEach(p=>{p.id=o++}),s})}}var Xr=(n=>(n.Admin="admin",n.Manager="manager",n.Operator="operator",n.Client="client",n.ExternalSeo="external_seo",n.Guest="guest",n))(Xr||{});class Qt extends Tr{constructor(e){super(e);i(this,"type");i(this,"canDoReclamations");i(this,"photo");i(this,"pricingRole");this.type=e==null?void 0:e.type,this.canDoReclamations=(e==null?void 0:e.canDoReclamations)??!1,this.photo=e==null?void 0:e.photo,this.pricingRole=e!=null&&e.pricingRole?new Pr(e.pricingRole):void 0}}class Wi extends y{constructor(){super(),this.baseUrl=`${b().config.http.portalApiUrl}/api`,this.interceptorIds.request.authRequestInterceptor&&this.httpClient.interceptors.request.eject(this.interceptorIds.request.authRequestInterceptor)}getAccessToken(){return this.get("internal/users/current-tokens").then(r=>r.accessToken)}}class Vt extends y{getCurrentUser(){return this.get("/internal/users/info",{},r=>new Qt(r.data),!0)}}const Er=ee.defineStore("common.user_private",()=>{const n=f.ref({}),r=f.ref(void 0),e=f.ref(void 0);return{dataLoaderList:n,currentUser:r,currentManager:e}});function Jt(n){const r=Er();(n==null?void 0:n.type)!==Xr.Manager||r.currentManager||r.dataLoaderList.currentManager||(r.dataLoaderList.currentManager=!0,y.getInstance(Wr).getManager(n.id).then(e=>{r.currentManager=e}).catch(u.noop).finally(()=>{r.dataLoaderList.currentManager=!1}))}const Gi=ee.defineStore("common.user",()=>{const n=f.computed(()=>{const e=Er();return!e.currentUser&&!e.dataLoaderList.currentUser&&(e.dataLoaderList.currentUser=!0,y.getInstance(Vt).getCurrentUser().then(t=>{e.currentUser=t,Jt(t)}).catch(u.noop).finally(()=>{e.dataLoaderList.currentUser=!1})),e.currentUser}),r=f.computed(()=>(Jt(n.value),Er().currentManager));return{currentUser:n,currentManager:r}});class lr{constructor(r){i(this,"user");i(this,"salesDirection");this.user=new k(r==null?void 0:r.user),this.salesDirection=new q(r==null?void 0:r.salesDirection)}}class ur extends de{constructor(e){var t,s;super(e);i(this,"cities");i(this,"users");this.cities=((t=e==null?void 0:e.cities)==null?void 0:t.map(o=>new Y(o)))??[],this.users=((s=e==null?void 0:e.users)==null?void 0:s.map(o=>new lr(o)))??[]}}class zi extends te{constructor(e){super();i(this,"id");i(this,"name");i(this,"abbr");this.id=e==null?void 0:e.id,this.name=e==null?void 0:e.name,this.abbr=e==null?void 0:e.abbr}resetFilterValue(e){switch(e){case"id":case"name":case"abbr":this[e]=void 0;break}return this}}class ji extends _{getRegionsList(r,e,t){return this.getTypedPaginated(de,"/internal/users/regions",r,e,t)}getRegion(r){return this.get(`/internal/users/regions/${r}`,{},e=>new ur(e.data))}createRegion(r,e={}){return this.post("/internal/users/regions",r,t=>new ur(t.data),e)}updateRegion(r,e,t={}){return this.patch(`/internal/users/regions/${r}`,e,s=>new ur(s.data),t)}removeRegion(r){return this.delete(`/internal/users/regions/${r}`)}getRegionEmployees(r){return this.getTypedList(lr,`/internal/users/regions/${r}/users`)}attachRegionEmployee(r,e,t){return this.post(`/internal/users/regions/${r}/users/${e}`,{salesDirectionId:t},s=>new lr(s.data))}detachRegionEmployee(r,e,t){return this.request({method:"DELETE",url:`/internal/users/regions/${r}/users/${e}`,params:{sales_direction_id:t}})}}c.AddressQualityEnum=Ue,c.AddressQualityHelper=Hi,c.AnyReference=Mt,c.AppBaseConfig=ot,c.BankAccount=er,c.BasePaginationProvider=_,c.BlogPost=Ge,c.BlogPostMediaFile=We,c.BlogPostMediaTypeEnum=Se,c.BlogPostPublicationStatusEnum=be,c.BlogPostShortInfo=pe,c.BlogPostsListFilters=xt,c.BlogProvider=je,c.CalculationTypeEnum=ht,c.CalendarHelper=D,c.Cart=fe,c.CartProvider=Kt,c.CatalogProvider=Zt,c.CatalogableItem=yr,c.Category=H,c.CategoryFilter=at,c.CategoryFilterSetting=$r,c.CategoryFilterValue=yt,c.CategoryPricingRule=Or,c.ChannelPrimaryInterest=_r,c.City=Ht,c.CityWithRegionAndCountry=Y,c.CityWithUserRegion=Jr,c.Client=Ur,c.ClientAdditionalData=Pt,c.ClientCategory=ke,c.ClientDataProvider=B,c.ClientPriceCatalogableItem=br,c.ClientPriceCategory=Ar,c.ClientPriceProduct=Fe,c.ClientPriceProvider=Ft,c.ClientPriceTemplateProvider=ei,c.ClientProduct=se,c.ClientProductCategoryDataProvider=ii,c.ClientProductDataProvider=si,c.ClientShortInfo=X,c.ClientsAdditionalDataRequestTypeEnum=Ct,c.ClientsListFilters=ui,c.CodedIdentity=ge,c.ConfiguratorProvider=gi,c.ConfiguratorsEnum=Rt,c.Contact=rr,c.ContactLinks=wr,c.ContactPerson=E,c.ContactPersonRelated=vt,c.ContactPosition=Bt,c.ContactRelation=tr,c.ContragentBase=Ir,c.ContragentFactory=Ie,c.ContragentIc=Lr,c.ContragentPerson=Dt,c.ContragentUlNr=wt,c.ContragentUlR=Nr,c.CostSourceEnum=Je,c.Country=oe,c.CreatableIdentity=Ae,c.CuratedDirection=Ke,c.Curator=Ee,c.Currency=M,c.DataSuggestionProvider=Bi,c.DateHelper=A,c.DateTimeProvider=Ci,c.DeletableIdentity=ft,c.DeletableNamedIdentity=$e,c.DeliveryAddress=ae,c.DeliveryType=z,c.DetailedJwtPayload=pr,c.DeviceTypeResolutionConfig=tt,c.Discount=sr,c.DiscountClient=ir,c.DiscountClientEligibility=Hr,c.DiscountConditions=bt,c.DiscountProvider=nr,c.DiscountShortInfo=Ye,c.DiscountStateEnum=Le,c.DiscountStateHelper=At,c.DiscountsListFilters=Pi,c.Faq=_e,c.FaqGroup=Ne,c.FaqProvider=vi,c.FieldValidationResultData=cr,c.FilterGroup=J,c.FilterItem=hr,c.FilterOpEnum=ze,c.FilterSettings=mt,c.GeoCoordinates=fr,c.HiddenCatalogableItem=ut,c.HttpCachedRequester=Ce,c.HttpParamsConfig=it,c.HttpRequester=y,c.Identity=G,c.Image=pt,c.InterceptorsEnum=U,c.JwtPayload=re,c.Manager=j,c.ManagerCommon=xe,c.ManagerDataFactory=Ti,c.ManagerDataProvider=Wr,c.MetaTagItem=jt,c.NamedIdentity=d,c.Offer=W,c.OfferActualization=Ot,c.OfferActualizationStatus=De,c.OfferHelper=Ai,c.OfferShortInfo=Gr,c.OffersDataProvider=bi,c.OffersListFilters=Si,c.Operator=jr,c.Opf=Z,c.OpfEnum=Q,c.Order=$,c.OrderAction=kt,c.OrderEditorData=Oi,c.OrderInfo=zr,c.OrderItem=dt,c.OrderItemBase=ar,c.OrderPaymentStatus=Wt,c.OrderShortInfo=Mr,c.OrderStatus=qe,c.OrderStatusDetail=Gt,c.OrderStatusDetailEnum=Ut,c.OrderStatusEnum=qt,c.OrderStatusHistoryInfo=It,c.OrdersDataProvider=di,c.OrdersListFilters=$i,c.PaginationFiltersBase=te,c.PartnerGroup=F,c.PaymentType=Yr,c.PreferencesStorageProvider=Re,c.PriceAnalyze=or,c.PriceAnalyzeProvider=Ii,c.PriceCatalogableItem=vr,c.PriceCoefficient=x,c.PriceCoefficientEnum=gr,c.PriceHistoryDataProvider=Li,c.PriceHistoryItem=Nt,c.PriceTemplate=ie,c.PriceTemplateCategory=Xe,c.PriceTemplateClient=me,c.PriceTemplateICatalogableItem=Rr,c.PriceTemplateProduct=Ze,c.PriceTemplateProvider=ni,c.PricingRole=ye,c.PricingRoleProvider=oi,c.PrimaryCatalogableItem=Ve,c.Product=N,c.ProductCategoryDataProvider=ri,c.ProductDataProvider=ti,c.ProductFileType=zt,c.ProductFilterTypeEnum=Dr,c.ProductPriceCoefficient=Qe,c.ProductPriceHistory=_t,c.ProductUnit=mr,c.ProfstroyOfferItem=$t,c.PropertiesProvider=ci,c.Property=ce,c.PropertyType=Sr,c.PropertyTypeEnum=gt,c.PropertyValue=le,c.RecommendationsDataProvider=Ni,c.RecommendationsList=Vr,c.Reference=v,c.ReferenceDataFactory=_i,c.ReferenceDataProvider=S,c.Region=K,c.ResourceType=xr,c.STANDARD_PERIOD_GROUPS=Di,c.STANDARD_PERIOD_SECTIONS=wi,c.SalesDirection=q,c.SearchProductStatistic=Yt,c.SentryConfig=st,c.Seo=Kr,c.SeoDataProvider=Ui,c.SourcePrimaryInterest=qr,c.StatisticsProvider=Mi,c.StockCount=lt,c.TableDataPagination=fi,c.TableDataPaginationRequestParams=Tt,c.TableDataSortRequestParams=mi,c.TemplateProductCategoryDataProvider=li,c.TemplatesListFilters=Et,c.TypedInstanceFactory=L,c.UnitsHelper=Br,c.UnknownClientDataProvider=pi,c.UpdatableNamedIdentity=Oe,c.User=Qt,c.UserAuthDataProvider=Wi,c.UserCommonInfo=Tr,c.UserDataProvider=Vt,c.UserPricingRole=Pr,c.UserRegion=ur,c.UserRegionEmployee=lr,c.UserRegionProvider=ji,c.UserRegionShortInfo=de,c.UserRegionsListFilters=zi,c.UserShortInfo=k,c.UserTypeEnum=Xr,c.VersionConfig=hi,c.Warehouse=he,c.WebSocketConfig=nt,c.currentOrderInjectionKey=ki,c.daysAgoIso=yi,c.findCatalogItemByIdRecursive=dr,c.flattenCatalogItems=kr,c.formatPercentChange=Ri,c.formatRelativeDate=ai,c.pluralize=St,c.useAuthStore=Te,c.useBaseConfigStore=b,c.useReferencesStore=qi,c.useUserStore=Gi,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@snabcentr/common-core"),require("date-fns"),require("lodash-es")):typeof define==`function`&&define.amd?define([`exports`,`@snabcentr/common-core`,`date-fns`,`lodash-es`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e[`SC Common Lib`]={},e[`@snabcentr/common-core`],e[`date-fns`],e[`lodash-es`]))})(this,function(e,t,n,r){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var i=function(e){return e.Image=`image`,e.Video=`video`,e}({}),a=class extends t.Identity{mediaType;isCover;isUnused;url;urlWebp;constructor(e){super(e,``),this.mediaType=e?.mediaType??i.Image,this.isCover=e?.isCover??!1,this.isUnused=e?.isUnused??!1,this.url=e?.url??``,this.urlWebp=e?.urlWebp}isImage(){return this.mediaType===i.Image}isVideo(){return this.mediaType===i.Video}},o=function(e){return e.Draft=`draft`,e.Published=`published`,e.Scheduled=`scheduled`,e}({}),s=class extends t.Identity{createdAt;constructor(e,n){super(e,n),this.createdAt=t.DateHelper.parse(e?.createdAt)??new Date}},c=class e extends s{static resolvePublicationStatus(e){return(0,r.isNil)(e)?o.Draft:e.getTime()>Date.now()?o.Scheduled:o.Published}static getSlugError(e){return e?/[^a-z0-9-]/.test(e)?`Допустимы только строчные латинские буквы, цифры и дефис: пример «kak-vybrat-podokonnik».`:(0,r.startsWith)(e,`-`)||(0,r.endsWith)(e,`-`)?`Обозначение не может начинаться или заканчиваться дефисом.`:(0,r.includes)(e,`--`)?`Дефисы не могут идти подряд: разделяйте слова одним дефисом.`:``:``}static parseDate(e){return(0,r.isNil)(e)?null:(0,r.isString)(e)?(0,n.parseISO)(e):e}slug;title;publishedAt;constructor(t){super(t,-1),this.slug=t?.slug??``,this.title=t?.title??``,this.publishedAt=e.parseDate(t?.publishedAt)}getPublicationStatus(){return e.resolvePublicationStatus(this.publishedAt)}},l=class extends c{content;media;constructor(e){super(e),this.content=e?.content??``,this.media=(e?.media??[]).map(e=>new a(e))}toSaveData(e=!1){return{title:this.title,slug:this.slug.length>0?this.slug:void 0,content:e?this.content:void 0,publishedAt:this.publishedAt}}getCover(){return this.media.find(e=>e.isCover)}getUnusedMedia(){return this.media.filter(e=>e.isUnused)}},u=class{asClearRaw(){let e={};return Object.keys(this).forEach(t=>{let n=this[t];(0,r.isNil)(n)||(0,r.isString)(n)&&n.trim().length===0||(0,r.isFunction)(n.isNewRec)&&n.isNewRec()||(e[t]=n)}),e}},d=class{from;to;constructor(e){this.from=(0,r.isString)(e?.from)?(0,n.parseISO)(e.from):e?.from??null,this.to=(0,r.isString)(e?.to)?(0,n.parseISO)(e.to):e?.to??null}},ee=class extends u{id;title;slug;content;publicationStatus;publishedAt;createdAt;constructor(e){super(),this.id=e?.id,this.title=e?.title,this.slug=e?.slug,this.content=e?.content,this.publicationStatus=e?.publicationStatus,this.publishedAt=new d(e?.publishedAt),this.createdAt=new d(e?.createdAt)}resetFilterValue(e){switch(e){case`id`:case`title`:case`slug`:case`content`:case`publicationStatus`:this[e]=void 0;break;case`publishedAt`:this.publishedAt.from=null,this.publishedAt.to=null;break;case`createdAt`:this.createdAt.from=null,this.createdAt.to=null}return this}asClearRaw(){let e=super.asClearRaw();return!e?.publishedAt?.from&&!e?.publishedAt?.to&&delete e.publishedAt,!e?.createdAt?.from&&!e?.createdAt?.to&&delete e.createdAt,e}},te=function(e){return e.BeginWith=`bw`,e.Contains=`cn`,e.Custom=`custom`,e.EndsWith=`ew`,e.Equals=`eq`,e.GreaterOrEqual=`ge`,e.GreaterThan=`gt`,e.InList=`in`,e.LessOrEqual=`le`,e.LessThan=`lt`,e.NotBeginWith=`bn`,e.NotContains=`nc`,e.NotEndsWith=`en`,e.NotEqual=`ne`,e.NotInList=`ni`,e.NotNull=`nn`,e.Null=`nu`,e}({}),ne=class{field;op;value;constructor(e){this.field=e?.field??``,this.op=e?.op??te.Equals,this.value=e?.value??``}toPrimitive(){let e=(0,t.useBaseConfigStore)().config.dateFormats.api,i={field:this.field,op:this.op};if((0,r.isDate)(this.value))i.value=(0,n.format)(this.value,e);else if((0,r.isPlainObject)(this.value)){let t=this.value;i.value={from:t.from?(0,n.format)(t.from,e):null,to:t.to?(0,n.format)(t.to,e):null}}else i.value=this.value;return i}},f=class e{groupOp;filters;groups;constructor(t){this.groupOp=t?.groupOp??`and`,this.filters=t?.filters?.map(e=>new ne(e))??[],this.groups=t?.groups?.map(t=>new e(t))??[]}toPrimitive(){return{groupOp:this.groupOp,filters:this.filters.map(e=>e instanceof ne&&(0,r.isFunction)(e.toPrimitive)?e.toPrimitive():e),groups:this.groups.map(t=>t instanceof e?t.toPrimitive():t)}}},p=class extends t.HttpRequester{getPaginated(e,t,n,i,a,o,s,c){let l={page:i?.page??1,perPage:i?.pageSize??10};return t&&(l.filters=JSON.stringify((t instanceof f?t:new f(t)).toPrimitive())),(0,r.isEmpty)(n)||(l.sort=(0,r.isArray)(n)?n:[n]),a&&(l={...l,...a}),this.get(e,l,o,s,c)}getTypedPaginated(e,n,r,i,a,o,s,c){return this.getPaginated(n,r,i,a,o,n=>({...n.data,data:t.TypedInstanceFactory.instanceListInitializer(e,n.data.data)}),s,c)}},re=class e extends p{static preparePostSaveData(e){let i={};if((0,r.isUndefined)(e.title)||(i.title=e.title),(0,r.isUndefined)(e.slug)||(i.slug=e.slug),(0,r.isUndefined)(e.content)||(i.content=e.content),!(0,r.isUndefined)(e.publishedAt)){let a=(0,t.useBaseConfigStore)().config.dateFormats.api;i.publishedAt=(0,r.isNil)(e.publishedAt)?null:(0,n.format)(e.publishedAt,a)}return i}getPostList(e,t,n){return this.getPaginated(`/internal/blog`,e,t,n,{},e=>({...e.data,data:e.data.data.map(e=>new c(e))}))}getPost(e){return this.get(`/internal/blog/${e}`,{},e=>new l(e.data))}createPost(t,n={}){return this.post(`/internal/blog`,e.preparePostSaveData(t),e=>new l(e.data),n)}updatePost(t,n,r={}){return this.patch(`/internal/blog/${t}`,e.preparePostSaveData(n),e=>new l(e.data),r)}removePost(e){return this.delete(`/internal/blog/${e}`)}uploadMedia(e,t,n,r,i={}){return this.request({method:`POST`,url:`/internal/blog/${e}/media`,data:{file:t,isCover:n??!1},onUploadProgress:e=>{r&&r(e.total?Math.round(e.loaded/e.total*100):0)}},e=>new a(e.data),i)}updateMedia(e,t,n,r={}){return this.patch(`/internal/blog/${e}/media/${t}`,{isCover:n},e=>new a(e.data),r)}removeMedia(e,t){return this.delete(`/internal/blog/${e}/media/${t}`)}},m=class extends t.UpdatableNamedIdentity{deletedAt;constructor(e){super(e),this.deletedAt=t.DateHelper.parse(e?.deletedAt)}},h=class extends t.NamedIdentity{type;isActive;constructor(e){super(e),this.type=e?.type,this.isActive=e?.isActive??!0}},g=class extends m{costCoefficient;isLowPriceAllowed;publishedAt;description;percent;owner;constructor(e){super(e),this.costCoefficient=e?.costCoefficient??0,this.isLowPriceAllowed=e?.isLowPriceAllowed??!1,this.publishedAt=t.DateHelper.parse(e?.publishedAt),this.description=e?.description??void 0,this.percent=e?.percent??0,this.owner=new h(e?.owner)}},_=class extends t.UpdatableNamedIdentity{description;owner;constructor(e){super(e),this.description=e?.description??``,this.owner=e?.owner?new h(e.owner):void 0}},v=class{coefficient;value;cost;percent;readOnly;constructor(e){this.coefficient=new t.PriceCoefficient(e?.coefficient),this.value=e?.value??0,this.cost=e?.cost??0,this.percent=e?.percent??0,this.readOnly=e?.readOnly??!0}},ie=class{warehouse;count;constructor(e){this.warehouse=new t.Warehouse(e?.warehouse),this.count=e?.count??0}},ae=class extends t.NamedIdentity{slug=``;description;isSquare=!1;isLinear=!1;constructor(e){super(e),e&&(this.slug=e.slug??``,this.description=e.description,this.isSquare=e.isSquare??!1,this.isLinear=e.isLinear??!1)}},y=class extends t.NamedIdentity{code=``;constructor(e){super(e),this.code=e?.code??``}},oe=class extends y{slug;type;constructor(e){super(e),this.slug=e?.slug??``}},se=class extends oe{isHidden;constructor(e){super(e),this.isHidden=e?.isHidden??!1}},ce=class{image;preview;isDefault;constructor(e,t){this.image=`${t??``}${e.image}`,this.preview=`${t??``}${e.preview}`,this.isDefault=e.isDefault}},b=class extends oe{isPrimary;constructor(e){super(e),this.isPrimary=e?.isPrimary??!1}},x=class extends se{supplierSku;unit;pack;minCount;currency;cost;costRub;costDate;onOrder;stockCount;category;categories;images;properties;retailCost;retailCostRub;priceCoefficients;constructor(e){super(e),this.supplierSku=e?.supplierSku,this.unit=e?.unit?new ae(e.unit):new ae,this.pack=e?.pack,this.minCount=e?.minCount,this.currency=e?.currency?new t.Currency(e.currency):new t.Currency,this.cost=e?.cost??0,this.costRub=e?.costRub??0,this.costDate=(0,r.isString)(e?.costDate)?(0,n.parseISO)(e.costDate):e?.costDate,this.onOrder=e?.onOrder??!1,this.stockCount=e?.stockCount?.map(e=>new ie(e))??[],this.type=`product`;let i=e?.category??e?.categories?.find(e=>e.isPrimary);i&&(this.category=new b({...i,isPrimary:!0}),this.categories=[this.category]),e?.categories&&(this.categories=e.categories.map(e=>new b(e))),this.images=e?.images?.map(e=>new ce(e,(0,t.useBaseConfigStore)().config.http.mediaUrl))??[],this.properties=e?.properties??{},this.retailCost=e?.retailCost,this.retailCostRub=e?.retailCostRub,this.priceCoefficients=e?.priceCoefficients?.map(e=>new v(e))??[],e&&`codeNumber`in e&&!e.code&&(this.code=e?.codeNumber)}getIsMeasurable(){return this.unit.isLinear||this.unit.isSquare}getRetailCost(){return this.retailCost??this.cost}getRetailCostRub(){return this.retailCostRub??this.costRub}},le=function(e){return e.Discount=`discount`,e.PriceTemplate=`price_template`,e.ClientPrice=`client_price`,e.Product=`product`,e}({}),S=class extends x{costCoefficient;costSource;discount;priceTemplate;priceCoefficient;increasePercent;isPreviouslyOrdered;isRequired;isFavorite;constructor(e){super(e),this.costCoefficient=e?.costCoefficient??0,this.costSource=e?.costSource??le.Product,this.discount=e?.discount?new g(e.discount):void 0,this.priceTemplate=e?.priceTemplate?new _(e.priceTemplate):void 0,this.priceCoefficient=e?.priceCoefficient?new t.PriceCoefficient(e.priceCoefficient):void 0,this.increasePercent=e?.increasePercent,this.isPreviouslyOrdered=e?.isPreviouslyOrdered,this.isRequired=e?.isRequired,this.isFavorite=e?.isFavorite}},C=class extends b{isHidden;parentCategoryId;properties;currencyRates;constructor(e){super(e),this.isHidden=e?.isHidden??!1,this.parentCategoryId=e?.parentCategoryId,this.properties=e?.properties,this.type=`category`,this.currencyRates=e?.currencyRates?Object.fromEntries(Object.entries(e.currencyRates).map(([e,t])=>[(0,r.toUpper)(e),t])):void 0}},ue=class extends t.Identity{category;product;quantity;currency;marker;height;length;width;configurator;configuratorParams;isAdditionalSale;creator;isRemoved;ord;onOrder;originalId;replacementId;constructor(e){super(e),this.product=new S(e.product),this.quantity=e.quantity??0,this.marker=e.marker,this.category=e.category??new C,this.currency=e.currency?new t.Currency(e.currency):void 0,this.height=e.height,this.length=e.length,this.width=e.width,this.configurator=e.configurator,this.configuratorParams=e.configuratorParams&&(0,r.cloneDeep)(e.configuratorParams),this.isAdditionalSale=e.isAdditionalSale,this.creator=e.creator&&new h(e.creator),this.isRemoved=e.isRemoved,this.ord=e.ord,this.onOrder=e.onOrder,this.originalId=e.originalId,this.replacementId=e.replacementId}},de=class extends ue{cost;costOne;costOneRub;costRub;logicGroupId;salesDirection;specificationImgUrl;sawing;currency;constructor(e){super(e),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=(0,r.isArray)(e.sawing)?e.sawing:e.sawing?[e.sawing]:void 0,this.currency=new t.Currency(e.currency)}},w=class{items;resultSum;directionsSum;constructor(e){this.items=e.items.map(e=>new de(e)),this.resultSum=e.resultSum,this.directionsSum=e.directionsSum}},fe=class extends t.HttpRequester{getCart(e){return this.get(`internal/clients/${e.id}/cart`,{},e=>new w(e.data))}deleteCart(e){return this.delete(`internal/clients/${e.id}/cart`)}addCartItem(e,t,n={}){return this.patch(`internal/clients/${e.id}/cart`,{product_id:t.product.id,product_category_id:t.configurator?t.category.id:void 0,quantity:t.quantity,height:t.height,length:t.length,width:t.width,configurator:t.configurator,marker:t.marker,is_additional_sale:t.isAdditionalSale,...t.configuratorParams},e=>new w(e.data),n)}patchCartItem(e,t,n={}){return this.patch(`internal/clients/${e.id}/cart/${t.id}`,{product_id:t.product.id,product_category_id:t.configurator?t.category.id:void 0,quantity:t.quantity,height:t.height,length:t.length,width:t.width,configurator:t.configurator,marker:t.marker,is_additional_sale:t.isAdditionalSale,...t.configuratorParams},e=>new w(e.data),n)}deleteCartItem(e,t){return this.delete(`internal/clients/${e.id}/cart/${t.id}`,e=>new w(e.data))}addCartItemFromCSV(e,t){return this.post(`internal/clients/${e.id}/cart/add-products-from-csv`,t,e=>new w(e.data))}getCartItemFromCSVExample(e){return this.get(`internal/clients/${e.id}/cart/add-products-from-csv/example`,{},e=>new Blob([e.data],{type:`text/csv`}))}},pe=function(e){return e.m2Cost=`m2Cost`,e.percent=`percent`,e.value=`value`,e}({}),me=function(e){return e.Checkbox=`checkbox`,e.Range=`range`,e.Toggle=`toggle`,e}({}),T=class e extends C{categories;products;constructor(t){super(t),this.categories=t?.categories?.map(t=>new e(t)),this.products=t?.products?.map(e=>new x(e))}},he=class extends C{isDisabled;isRequired;isFavorite;hidingComment;manager;constructor(e){super(e),this.isDisabled=e?.isDisabled??!1,this.isRequired=e?.isRequired??!1,this.isFavorite=e?.isFavorite??!1,this.hidingComment=e?.hidingComment,this.manager=e?.manager?new t.Manager(e.manager):void 0}},ge=class e extends he{categories;products;constructor(t){super(t),this.categories=t?.categories?.map(t=>new e(t)),this.products=t?.products?.map(e=>new S(e))}},_e=class{priceCoefficient;increasePercent;constructor(e){this.priceCoefficient=e?.priceCoefficient&&new t.PriceCoefficient(e.priceCoefficient),this.increasePercent=e?.increasePercent}},ve=class extends _e{constructor(e){super(e)}},E=class extends ve{productCategory;constructor(e){super(e),this.productCategory=new C(e?.productCategory)}},D=class extends t.NamedIdentity{photo;contacts;curatedDirection;constructor(e){super(e),this.photo=e.photo,this.contacts=new t.ContactLinks(e.contacts),this.curatedDirection=new t.CuratedDirection(e.curatedDirection)}},O=class extends t.UserCommonInfo{salesDirection;debt;alternativeName;city;comment;isPhoneApproved;isEmailApproved;managers;curators;constructor(e){super(e),this.salesDirection=new t.SalesDirection(e?.salesDirection),this.debt=e?.debt??0,this.alternativeName=e?.alternativeName??``,this.city=new t.CityWithRegionAndCountry(e?.city),this.comment=e?.comment,this.isPhoneApproved=e?.isPhoneApproved??!1,this.isEmailApproved=e?.isEmailApproved??!1,this.managers=e?.managers?.map(e=>new t.ManagerCommon(e))??[],this.curators=e?.curators?.map(e=>new D(e))??void 0}},ye=class extends s{deletedAt;constructor(e,n){super(e,n),this.deletedAt=t.DateHelper.parse(e?.deletedAt)}},k=class extends ye{client;priceTemplate;constructor(e){super(e),this.client=new O(e?.client),this.priceTemplate=new _(e?.priceTemplate)}},A=class extends ve{product;constructor(e){super(e),this.product=new x(e?.product)}},j=class extends t.NamedIdentity{type;description;metadata;isFilterable;constructor(e){super(e),this.type=new t.PropertyType(e?.type),this.description=e?.description??``,this.metadata=e?.metadata,this.isFilterable=e?.isFilterable}},M=class{property;value;constructor(e){this.property=new j(e?.property),this.value=e?.value??``}},be=class{id;name;description;ownerName;createdAt=new d;updatedAt=new d;constructor(e){this.id=e?.id,this.name=e?.name,this.description=e?.description,this.ownerName=e?.ownerName,this.createdAt=new d(e?.createdAt),this.updatedAt=new d(e?.updatedAt)}resetFilterValue(e){switch(e){case`id`:case`name`:case`description`:case`ownerName`:this[e]=void 0;break;case`createdAt`:this.createdAt.from=null,this.createdAt.to=null;break;case`updatedAt`:this.updatedAt.from=null,this.updatedAt.to=null}return this}asClearRaw(){let e={};return Object.keys(this).forEach(t=>{let n=this[t];(0,r.isNil)(n)||(0,r.isString)(n)&&n.trim().length===0||(0,r.isFunction)(n.isNewRec)&&n.isNewRec()||(e[t]=n)}),!e?.createdAt?.from&&!e?.createdAt?.to&&delete e.createdAt,!e?.updatedAt?.from&&!e?.updatedAt?.to&&delete e.updatedAt,e}},xe=class extends _e{executor;createdAt;constructor(e){super(e),this.executor=e?.executor?new h(e.executor):void 0,this.createdAt=t.DateHelper.parse(e?.createdAt)}},N=class extends xe{product;constructor(e){super(e),this.product=new x(e?.product)}},Se=class extends xe{productCategory;constructor(e){super(e),this.productCategory=new C(e?.productCategory)}},P=class extends t.NamedIdentity{description;canChangeLowCost;parentRoleId;subRoles=[];parentRole;level=0;constructor(e){super(e),this.description=e?.description,this.canChangeLowCost=e?.canChangeLowCost??!1,this.parentRoleId=e?.parentRoleId}},Ce=class{role;category;minCoefficient;constructor(e){this.role=new P(e?.role),this.category=new C(e?.category),this.minCoefficient=new t.PriceCoefficient(e?.minCoefficient)}},we=class{isFake;isHidden;isMultiple;type;ord;constructor(e){this.isFake=e?.isFake??!1,this.isHidden=e?.isHidden??!1,this.isMultiple=e?.isMultiple??null,this.type=e?.type??null,this.ord=e?.ord??0}},Te=class{category;property;settings;constructor(e){this.category=new C(e?.category),this.property=new j(e?.property),this.settings=new we(e?.settings)}},Ee=class{id;label;constructor(e){this.id=e?.id??``,this.label=e?.label??``}},De=class{id;label;type;ord;isMultiple;values;min;max;constructor(e){this.id=e?.id??``,this.label=e?.label??``,this.type=e?.type??me.Checkbox,this.ord=e?.ord??0,this.isMultiple=e?.isMultiple??null,this.values=e?.values?.map(e=>new Ee(e))??[],this.min=e?.min??null,this.max=e?.max??null}},Oe=class extends t.HttpRequester{search(e,t=!1){return this.get(`/internal/catalog/search`,{term:e,show_hidden:t})}getPriceExportLink(e=`csv`,n=!1,r=void 0,i=void 0){let a=`${(0,t.useBaseConfigStore)().config.http.portalApiUrl}/api/internal/price/export?format=${e}&show_hidden=${n}`;return r&&(a+=`&category_id=${r}`),i&&(a+=`&client_id=${i}`),a}},ke=class extends t.HttpRequester{importPrices(e,t,n=!1){return this.post(`/internal/clients/${e}/price/import`,t,void 0,{},n)}getCategoryPrices(e){return this.getTypedList(Se,`/internal/clients/${e}/price/categories`)}getCategoryPrice(e,t){return this.get(`/internal/clients/${e}/price/categories/${t}`,{},e=>new Se(e.data))}updateCategoryPrices(e,t,n,r=!1){return this.request({method:`PATCH`,url:`/internal/clients/${e}/price/categories/${t}`,data:{price_coefficient_id:n.coefficient?.id,increase_percent:n.value},params:r?{recursively:!0}:{}})}removeCategoryPrices(e,t,n=!1){return this.request({method:`DELETE`,url:`/internal/clients/${e}/price/categories/${t}`,params:n?{recursively:!0}:{}})}removeCategoryProductsPrices(e,t,n=!1){return this.request({method:`DELETE`,url:`/internal/clients/${e}/price/categories/${t}/products`,params:n?{recursively:!0}:{}})}markCategoryRequired(e,t){return this.post(`/internal/clients/${e}/price/categories/${t}/required`)}unmarkCategoryRequired(e,t){return this.delete(`/internal/clients/${e}/price/categories/${t}/required`)}markCategoryDisabled(e,t,n){return this.post(`/internal/clients/${e}/price/categories/${t}/disabled`,{comment:n})}unmarkCategoryDisabled(e,t){return this.delete(`/internal/clients/${e}/price/categories/${t}/disabled`)}addCategoryManager(e,t,n){return this.post(`/internal/clients/${e}/price/categories/${t}/manager`,{manager_id:n})}removeCategoryManager(e,t){return this.delete(`/internal/clients/${e}/price/categories/${t}/manager`)}getProductPrices(e){return this.getTypedList(N,`/internal/clients/${e}/price/products`)}getProductPrice(e,t){return this.get(`/internal/clients/${e}/price/products/${t}`,{},e=>new N(e.data))}updateProductPrice(e,t,n){return this.patch(`/internal/clients/${e}/price/products/${t}`,{price_coefficient_id:n.coefficient?.id,increase_percent:n.value},e=>new N(e.data))}removeProductPrice(e,t){return this.delete(`/internal/clients/${e}/price/products/${t}`)}markProductRequired(e,t){return this.post(`/internal/clients/${e}/price/products/${t}/required`)}unmarkProductRequired(e,t){return this.delete(`/internal/clients/${e}/price/products/${t}/required`)}getCommercialOfferHtml(e,t){return this.get(`/internal/clients/${e}/price/commercial-offer/view`,t,e=>new Blob([e.data],{type:`text/html`}))}getCommercialOfferPdf(e,t){return this.getBlob(`/internal/clients/${e}/price/commercial-offer/download`,t,e=>new Blob([e.request.response],{type:`application/pdf`}))}sendCommercialOffer(e,t){return this.post(`/internal/clients/${e}/price/commercial-offer/send`,t)}},Ae=class extends t.HttpRequester{getTemplateList(e){return this.getTypedList(k,`/internal/clients/${e}/price/templates`)}getActiveTemplate(e){return this.get(`/internal/clients/${e}/price/templates/active`,{},e=>new k(e.data),!0)}attachTemplate(e,r,i){let a=(0,t.useBaseConfigStore)().config.dateFormats.api;return this.post(`/internal/clients/${e}/price/templates/${r}`,i&&{startAt:i.startAt&&(0,n.format)(i.startAt,a),endAt:i.endAt&&(0,n.format)(i.endAt,a)},e=>new k(e.data),{},!0)}applyTemplate(e,t){return this.post(`/internal/clients/${e}/price/templates/${t}/apply`,{},void 0,{},!0)}changeTemplate(e,r,i,a){let o=(0,t.useBaseConfigStore)().config.dateFormats.api;return this.patch(`/internal/clients/${e}/price/templates/${r}/${i}`,a&&{startAt:a.startAt&&(0,n.format)(a.startAt,o),endAt:a.endAt&&(0,n.format)(a.endAt,o)},e=>new k(e.data))}detachTemplate(e,t,n){return this.delete(`/internal/clients/${e}/price/templates/${t}/${n}`)}},je=class extends t.HttpRequester{getRootCategoriesList(e=!1){return this.getTypedList(T,`/internal/catalog/categories`,{showHidden:e})}getCategoryData(e,t=!1,n=!1){return this.get(`/internal/catalog/categories/${e}`,{showHidden:t,withNestedCategories:n},e=>new T(e.data))}getPublicCategoryData(e){return this.get(`/public/catalog/categories/${e}`,{},e=>new T(e.data))}getCategoryProductsList(e,t=!0,n=!1){return this.get(`/internal/catalog/categories/${e}/products`,{showHidden:n,withPriceCoefficients:t},e=>(0,r.map)(e.data,e=>new x(e)))}getCategoryProductsCoefficients(e){return this.get(`/internal/catalog/categories/${e}/products/coefficients`,{},e=>{let{data:t}=e;return(0,r.forEach)(t,e=>e.map(e=>new v(e))),t})}publicSimpleSearch(e,t=10){return new Promise((n,r)=>{this.get(`/public/catalog/search/simple?limit=${t}&term=${e}`).then(e=>{n(e.categories.map(e=>new T(e)))}).catch(e=>{r(e)})})}},Me=class extends p{getProductData(e,t=!1){return this.get(`/internal/catalog/products/${e}`,{withPriceCoefficients:t},e=>new x(e.data))}getPublicProductData(e){return this.get(`/public/catalog/products/${e}`,{},e=>new x(e.data))}getProductPriceCoefficients(e){return this.get(`/internal/catalog/products/${e}/coefficients`,{},e=>(0,r.map)(e.data,e=>new v(e)))}getNewProducts(e,r,i=!0){let a=(0,t.useBaseConfigStore)().config.dateFormats.api;return this.getTypedPaginated(x,`/internal/catalog/products/new`,void 0,void 0,r,{period:{from:(0,n.format)(e,a)},withPriceCoefficients:i})}publicSimpleSearch(e,t=10){return new Promise((n,r)=>{this.get(`/public/catalog/search/simple?limit=${t}&term=${e}`).then(e=>{n(e.products.map(e=>new x(e)))}).catch(e=>{r(e)})})}},Ne=class extends t.HttpRequester{getRootCategoriesList(e,t=!1){return this.getTypedList(ge,`/internal/catalog/categories`,{clientId:e,showHidden:t})}getCategoryData(e,t,n=!1,r=!1){return this.get(`/internal/catalog/categories/${t}`,{clientId:e,showHidden:n,withNestedCategories:r},e=>new ge(e.data))}getCategoryProductsList(e,t,n=!0,i=!1){return this.get(`/internal/catalog/categories/${t}/products`,{client_id:e,showHidden:i,withPriceCoefficients:n},e=>(0,r.map)(e.data,e=>new S(e)))}},Pe=class extends p{getProductData(e,t,n=!1){return this.get(`/internal/catalog/products/${e}`,{clientId:t,withPriceCoefficients:n},e=>new S(e.data))}getNewProducts(e,r,i,a=!0){let o=(0,t.useBaseConfigStore)().config.dateFormats.api;return this.getTypedPaginated(S,`/internal/catalog/products/new`,void 0,void 0,i,{clientId:e,period:{from:(0,n.format)(r,o)},withPriceCoefficients:a})}},Fe=class extends p{getTemplateList(e,t,n){return this.getTypedPaginated(_,`/internal/price/templates`,e,t,n)}createTemplate(e,t={}){return this.post(`/internal/price/templates`,e,e=>new _(e.data),t)}getTemplate(e){return this.get(`/internal/price/templates/${e}`,{},e=>new _(e.data))}updateTemplate(e,t,n={}){return this.patch(`/internal/price/templates/${e}`,t,e=>new _(e.data),n)}removeTemplate(e){return this.delete(`/internal/price/templates/${e}`)}getProductTemplatePrices(e){return this.getTypedList(A,`/internal/price/templates/${e}/products`)}getProductTemplatePrice(e,t){return this.get(`/internal/price/templates/${e}/products/${t}`,{},e=>new A(e.data))}saveProductTemplatePrice(e,t,n){return this.post(`/internal/price/templates/${e}/products/${t}`,{price_coefficient_id:n.coefficient?.id,increase_percent:n.value},e=>new A(e.data))}deleteProductTemplatePrice(e,t){return this.delete(`/internal/price/templates/${e}/products/${t}`)}getCategoryTemplatePrices(e){return this.getTypedList(E,`/internal/price/templates/${e}/categories`)}getCategoryTemplatePrice(e,t){return this.get(`/internal/price/templates/${e}/categories/${t}`,{},e=>new E(e.data))}saveCategoryTemplatePrice(e,t,n,r=!1){return this.request({method:`POST`,url:`/internal/price/templates/${e}/categories/${t}`,data:{price_coefficient_id:n.coefficient?.id,increase_percent:n.value},params:r?{recursively:!0}:{}},e=>new E(e.data))}deleteCategoryTemplatePrice(e,t,n=!1){return this.request({method:`DELETE`,url:`/internal/price/templates/${e}/categories/${t}`,params:n?{recursively:!0}:{}})}getTemplateClients(e){return this.getTypedList(k,`/internal/price/templates/${e}/clients`)}},Ie=class extends t.HttpRequester{getRoles(){return this.getTypedList(P,`/internal/price/roles`)}createRole(e){return this.post(`/internal/price/roles`,e,e=>new P(e.data))}getRole(e){return this.get(`/internal/price/roles/${e}`,{},e=>new P(e.data))}updateRole(e,t){return this.patch(`/internal/price/roles/${e}`,t,e=>new P(e.data))}deleteRole(e){return this.delete(`/internal/price/roles/${e}`)}getCategoryRules(e){return this.getTypedList(Ce,`/internal/price/roles/rules/categories/${e}`)}updateCategoryRules(e,n){return this.patch(`/internal/price/roles/rules/categories/${e}`,n,e=>t.TypedInstanceFactory.instanceListInitializer(Ce,e.data))}},Le=class extends p{getProperties(e,t,n){return this.getTypedPaginated(j,`/internal/catalog/properties`,e,t,n)}createProperty(e){let{typeId:t,...n}=e;return this.post(`/internal/catalog/properties`,{...n,type:t},e=>new j(e.data))}getProperty(e){return this.get(`/internal/catalog/properties/${e}`,{},e=>new j(e.data))}updateProperty(e,t){let{typeId:n,...r}=t;return this.patch(`/internal/catalog/properties/${e}`,{...r,type:n},e=>new j(e.data))}deleteProperty(e){return this.delete(`/internal/catalog/properties/${e}`)}getProductProperties(e){return this.getTypedList(M,`/internal/catalog/products/${e}/properties`)}getProductProperty(e,t){return this.get(`/internal/catalog/products/${e}/properties/${t}`,{},e=>new M(e.data))}updateProductProperty(e,t,n){return this.patch(`/internal/catalog/products/${e}/properties/${t}`,{value:n},e=>new M(e.data))}deleteProductProperty(e,t){return this.delete(`/internal/catalog/products/${e}/properties/${t}`)}getProductDescription(e){return this.get(`/internal/catalog/products/${e}/properties/description`)}updateProductDescription(e,t){return this.patch(`/internal/catalog/products/${e}/properties/description`,{text:t})}deleteProductDescription(e){return this.delete(`/internal/catalog/products/${e}/properties/description`)}getProductSpecification(e){return this.get(`/internal/catalog/products/${e}/properties/specification`)}updateProductSpecification(e,t){return this.patch(`/internal/catalog/products/${e}/properties/specification`,{text:t})}deleteProductSpecification(e){return this.delete(`/internal/catalog/products/${e}/properties/specification`)}getProductFiles(e){return this.get(`/internal/catalog/products/${e}/properties/files`)}addProductFile(e,t){return this.post(`/internal/catalog/products/${e}/properties/files`,t)}updateProductFile(e,t,n){return this.patch(`/internal/catalog/products/${e}/properties/files/${t}`,n)}deleteProductFile(e,t){return this.delete(`/internal/catalog/products/${e}/properties/files/${t}`)}updateProductSlug(e,t){return this.patch(`/internal/catalog/products/${e}/properties/slug`,{slug:t})}getCategoryProperties(e){return this.getTypedList(M,`/internal/catalog/categories/${e}/properties`)}getCategoryProperty(e,t){return this.get(`/internal/catalog/categories/${e}/properties/${t}`,{},e=>new M(e.data))}updateCategoryProperty(e,t,n){return this.patch(`/internal/catalog/categories/${e}/properties/${t}`,{value:n},e=>new M(e.data))}deleteCategoryProperty(e,t){return this.delete(`/internal/catalog/categories/${e}/properties/${t}`)}getCategoryDescription(e){return this.get(`/internal/catalog/categories/${e}/properties/description`)}updateCategoryDescription(e,t){return this.patch(`/internal/catalog/categories/${e}/properties/description`,{text:t})}deleteCategoryDescription(e){return this.delete(`/internal/catalog/categories/${e}/properties/description`)}getCategorySpecification(e){return this.get(`/internal/catalog/categories/${e}/properties/specification`)}updateCategorySpecification(e,t){return this.patch(`/internal/catalog/categories/${e}/properties/specification`,{text:t})}deleteCategorySpecification(e){return this.delete(`/internal/catalog/categories/${e}/properties/specification`)}getCategoryFiles(e){return this.get(`/internal/catalog/categories/${e}/properties/files`)}addCategoryFile(e,t){return this.post(`/internal/catalog/categories/${e}/properties/files`,t)}updateCategoryFile(e,t,n){return this.patch(`/internal/catalog/categories/${e}/properties/files/${t}`,n)}deleteCategoryFile(e,t){return this.delete(`/internal/catalog/categories/${e}/properties/files/${t}`)}updateCategorySlug(e,t){return this.patch(`/internal/catalog/categories/${e}/properties/slug`,{slug:t})}updateCategoryImage(e,t){return this.post(`/internal/catalog/categories/${e}/image`,{image:t})}getCategoryFilters(e,t=!1){return this.get(`/internal/catalog/categories/${e}/filters`,{recursively:t},e=>e.data.map(e=>new De(e)))}getCategoryFilterSettings(e){return this.getTypedList(Te,`/internal/catalog/categories/${e}/filter-settings`)}saveCategoryFilterSetting(e,t,n){return this.patch(`/internal/catalog/categories/${e}/filter-settings/${t}`,n,e=>new Te(e.data))}deleteCategoryFilterSetting(e,t){return this.delete(`/internal/catalog/categories/${e}/filter-settings/${t}`)}},Re=class extends t.HttpRequester{getRootCategoriesList(e,t=!1){return this.getTypedList(T,`/internal/catalog/categories`,{priceTemplateId:e,showHidden:t})}getCategoryData(e,t,n=!1,r=!1){return this.get(`/internal/catalog/categories/${t}`,{priceTemplateId:e,showHidden:n,withNestedCategories:r},e=>new T(e.data))}getCategoryProductsList(e,t,n=!0,i=!1){return this.get(`/internal/catalog/categories/${t}/products`,{priceTemplateId:e,showHidden:i,withPriceCoefficients:n},e=>(0,r.map)(e.data,e=>new x(e)))}};function ze(e,t,n){let r;return e.some(e=>{if(e.type===n&&e.id===t)return r=e,!0;if(e.type===`product`)return!1;let i=e;if(i.products&&i.products.length>0){let e=ze(i.products,t,n);if(e)return r=e,!0}if(i.categories&&i.categories.length>0){let e=ze(i.categories,t,n);if(e)return r=e,!0}return!1}),r}function Be(e){let t=[];return e.forEach(e=>{if(t.push(e),e.type===`category`){let n=e;n.products&&n.products.length>0&&t.push(...Be(n.products)),n.categories&&n.categories.length>0&&t.push(...Be(n.categories))}}),t}var Ve=function(e){return e.LastOrder=`last_order`,e.Contacts=`contacts`,e.PartnerGroups=`partner_groups`,e.PreferredDeliveryType=`preferred_delivery_type`,e.SalesDirection=`sales_direction`,e.Managers=`managers`,e.Curators=`curators`,e}({}),F=class extends t.Identity{bankName=``;bic=``;accountNumber=``;correspondentAccount=``;currency=new t.Currency;constructor(e){super(e),e&&(this.bankName=e.bankName??``,this.bic=e.bic??``,this.accountNumber=e.accountNumber??``,this.correspondentAccount=e.correspondentAccount??``,this.currency=new t.Currency(e.currency))}},I=class extends m{phone;email;constructor(e){super(e),this.email=e?.email,this.phone=/^\d+$/.test(e?.phone??``)?`+${e?.phone}`:e?.phone}},L=class extends I{isPrimary;position;notDisturb;comment;constructor(e){super(e),this.isPrimary=e?.isPrimary??!1,this.position=e?.position,this.notDisturb=e?.notDisturb??!1,this.comment=e?.comment}},He=class extends m{opf=t.Opf.generatePersonItem();partnerGroup=new t.PartnerGroup;contacts=[];bankAccounts=[];comment;alternativeName;creator;updater;constructor(e){if(super(e),e){if(this.opf=new t.Opf(e.opf),this.comment=e.comment,this.alternativeName=e.alternativeName,this.creator=e.creator?new h(e.creator):void 0,this.updater=e.updater?new h(e.updater):void 0,e.partnerGroup&&(this.partnerGroup=new t.PartnerGroup(e.partnerGroup)),e.contacts){let t=[];e.contacts.forEach(e=>{t.push(new L(e))}),this.contacts=t}if(e.bankAccounts){let t=[];e.bankAccounts.forEach(e=>{t.push(new F(e))}),this.bankAccounts=t}}}},Ue=class extends He{constructor(e){super(e)}},We=class extends He{inn=``;okpo=``;ogrn=``;directorName=``;directorPosition=``;directorActsOn=``;legalAddress=``;postalAddress=``;actualAddress=``;constructor(e){super(e),e&&(this.inn=e.inn??``,this.okpo=e.okpo??``,this.ogrn=e.ogrn??``,this.directorName=e.directorName??``,this.directorPosition=e.directorPosition??``,this.directorActsOn=e.directorActsOn??``,this.legalAddress=e.legalAddress??``,this.postalAddress=e.postalAddress??``,this.actualAddress=e.actualAddress??``)}},Ge=class extends We{kpp=``;constructor(e){super(e),e&&(this.kpp=e.kpp??``)}},Ke=class extends Ge{registrationCountry=new t.Country;registrationNumber=``;taxNumber=``;constructor(e){super(e),e&&(this.registrationCountry=new t.Country(e.registrationCountry),this.registrationNumber=e.registrationNumber??``,this.taxNumber=e.taxNumber??``)}},R=class{static createInstance(e){switch(e.opf.slug){case t.OpfEnum.Ic:return new We(e);case t.OpfEnum.UlR:return new Ge(e);case t.OpfEnum.UlNr:return new Ke(e);default:return new Ue(e)}}},z=class extends m{address=``;coordinates;contacts;comment;operatingHours;isOneTime;isTransportCompanyAddress;constructor(e){super(e),this.address=e?.address??``,this.coordinates=new t.GeoCoordinates(e?.coordinates),this.contacts=e?.contacts?.map(e=>new L(e))??[],this.comment=e?.comment,this.operatingHours=e?.operatingHours,this.isOneTime=e?.isOneTime,this.isTransportCompanyAddress=e?.isTransportCompanyAddress}},qe=class extends O{contragents;partnerGroups;contacts;deliveryAddresses;channelPrimaryInterest;sourcePrimaryInterest;preferredDeliveryType;primaryDemand;preferredWarehouse;extraData;constructor(e){super(e),this.contragents=e?.contragents?.map(e=>R.createInstance(e))??[],this.partnerGroups=e?.partnerGroups?.map(e=>new t.PartnerGroup(e))??[],this.contacts=e?.contacts?.map(e=>new L(e))??[],this.deliveryAddresses=e?.deliveryAddresses?.map(e=>new z(e))??[],this.channelPrimaryInterest=new t.ChannelPrimaryInterest(e?.channelPrimaryInterest),this.sourcePrimaryInterest=new t.SourcePrimaryInterest(e?.sourcePrimaryInterest),this.preferredDeliveryType=new t.DeliveryType(e?.preferredDeliveryType),this.primaryDemand=e?.primaryDemand,this.preferredWarehouse=e?.preferredWarehouse?new t.Warehouse(e.preferredWarehouse):void 0,this.extraData=e?.extraData??{}}},Je=class extends u{id;guid;name;alternativeName;searchTerm;cities;region;country;phone;email;isActive;createdAt=new d;lastLoginDate=new d;lastLoginDateHasOrder;managers;includeSubordinateManagers;curators;isManagerRequired;salesDirections;contragentInn;contragentType;preferredDeliveryType;partnerGroups;contact;lastOrder;noOrdersPeriod=new d;constructor(e){super(),this.id=e?.id,this.guid=e?.guid,this.name=e?.name,this.alternativeName=e?.alternativeName,this.searchTerm=e?.searchTerm,this.cities=e?.cities?.map(e=>new t.CityWithRegionAndCountry(e)),this.region=new t.Region(e?.region),this.country=new t.Country(e?.country),this.phone=e?.phone,this.email=e?.email,this.isActive=e&&Object.prototype.hasOwnProperty.call(e,`isActive`)?e?.isActive:!0,this.createdAt=new d(e?.createdAt),this.lastLoginDate=new d(e?.lastLoginDate),this.lastLoginDateHasOrder=e?.lastLoginDateHasOrder??void 0,this.managers=e?.managers?.map(e=>new t.Manager(e))??[],this.includeSubordinateManagers=e?.includeSubordinateManagers??!0,this.curators=e?.curators?.map(e=>new D(e))??[],this.salesDirections=e?.salesDirections?.map(e=>new t.SalesDirection(e)),this.contragentInn=e?.contragentInn,this.contragentType=new t.Opf(e?.contragentType),this.preferredDeliveryType=e?.preferredDeliveryType?new t.DeliveryType(e?.preferredDeliveryType):void 0,this.partnerGroups=e?.partnerGroups?.map(e=>new t.PartnerGroup(e)),this.contact=new I(e?.contact),this.lastOrder={createdAt:new d(e?.lastOrder?.createdAt),creator:e?.lastOrder?.creator,isApproved:e?.lastOrder?.isApproved},this.noOrdersPeriod=new d(e?.noOrdersPeriod)}resetFilterValue(e){switch(e){case`cities`:this.cities=[];break;case`region`:this.region=new t.Region;break;case`isActive`:this.isActive=!0;break;case`createdAt`:this.createdAt.from=null,this.createdAt.to=null;break;case`lastLoginDate`:this.lastLoginDate.from=null,this.lastLoginDate.to=null;break;case`noOrdersPeriod`:this.noOrdersPeriod.from=null,this.noOrdersPeriod.to=null;break;case`lastOrder`:this.lastOrder={};break;case`managers`:this.managers=[];break;case`curators`:this.curators=[];break;case`salesDirections`:this.salesDirections=[];break;case`contragentType`:this.contragentType=new t.Opf;break;case`preferredDeliveryType`:this.preferredDeliveryType=new t.DeliveryType;break;case`partnerGroups`:this.partnerGroups=[];break;case`contact`:this.contact=new I;break;default:this[e]=void 0}return this}asClearRaw(){let e=super.asClearRaw();return!e?.createdAt?.from&&!e?.createdAt?.to&&delete e.createdAt,!e?.lastLoginDate?.from&&!e?.lastLoginDate?.to&&delete e.lastLoginDate,!e?.noOrdersPeriod?.from&&!e?.noOrdersPeriod?.to&&delete e.noOrdersPeriod,e}},Ye=class extends s{creator;constructor(e){super(e),this.creator=new h(e?.creator)}},Xe=class extends t.NamedIdentity{contacts=[];preferredDeliveryType;partnerGroups=[];lastOrder;salesDirection;managers;curators;constructor(e){super(e),this.contacts=e.contacts?.map(e=>new L(e))??void 0,this.lastOrder=e.lastOrder?new Ye(e.lastOrder):void 0,this.partnerGroups=e.partnerGroups?.map(e=>new t.PartnerGroup(e))??void 0,this.preferredDeliveryType=e.preferredDeliveryType?new t.DeliveryType(e.preferredDeliveryType):void 0,this.salesDirection=e.salesDirection?new t.SalesDirection(e.salesDirection):void 0,this.managers=e.managers?.map(e=>new t.ManagerCommon(e))??void 0,this.curators=e.curators?.map(e=>new D(e))??void 0}},B=class extends t.Identity{isPrimary;constructor(e){super(e),this.isPrimary=e.isPrimary}},Ze=class extends L{relations={clients:[],contragents:[],addresses:[]};constructor(e){super(e),e.relations&&(e.relations.addresses&&(this.relations.addresses=e.relations.addresses.map(e=>new B(e))),e.relations.clients&&(this.relations.clients=e.relations.clients.map(e=>new B(e))),e.relations.contragents&&(this.relations.contragents=e.relations.contragents.map(e=>new B(e))))}},Qe=class e extends p{static transformClientDataToRequest(e){return{name:e.name,alternative_name:e.alternativeName,partner_groups:e.partnerGroups.map(e=>e.id),phone:e.phone,email:e.email,city_id:e.city.id,get_news:e.getNews,channel_primary_interest_id:e.channelPrimaryInterest.id,source_primary_interest_id:e.sourcePrimaryInterest.id,primary_demand:e.primaryDemand,preferred_warehouse_id:e.preferredWarehouse?.id}}static transformContragentClientDataToRequest(e){let n,r=e,i=e,a=e;switch(e.opf.slug){case t.OpfEnum.Ic:n={opf:r.opf.slug,name:r.name,alternative_name:r.alternativeName,partner_group_id:r.partnerGroup?.id,comment:r.comment,inn:r.inn,okpo:r.okpo,ogrn:r.ogrn||void 0,director_name:r.directorName,director_position:r.directorPosition,director_acts_on:r.directorActsOn,legal_address:r.legalAddress,postal_address:r.postalAddress,actual_address:r.actualAddress};break;case t.OpfEnum.UlR:n={opf:i.opf.slug,name:i.name,alternative_name:i.alternativeName,partner_group_id:i.partnerGroup?.id,comment:i.comment,inn:i.inn,kpp:i.kpp,okpo:i.okpo,ogrn:i.ogrn||void 0,director_name:i.directorName,director_position:i.directorPosition,director_acts_on:i.directorActsOn,legal_address:i.legalAddress,postal_address:i.postalAddress,actual_address:i.actualAddress};break;case t.OpfEnum.UlNr:n={opf:a.opf.slug,name:a.name,alternative_name:a.alternativeName,partner_group_id:a.partnerGroup?.id,comment:a.comment,director_name:a.directorName,director_position:a.directorPosition,director_acts_on:a.directorActsOn,legal_address:a.legalAddress,postal_address:a.postalAddress,actual_address:a.actualAddress,registration_country_id:a.registrationCountry.id,registration_number:a.registrationNumber,tax_number:a.taxNumber||void 0};break;default:n={opf:e.opf.slug,name:e.name,alternative_name:e.alternativeName,partner_group_id:e.partnerGroup?.id,comment:e.comment}}return n}static transformClientDeliveryAddressToRequest(e){let t={address:e.address,is_one_time:e.isOneTime??!1,is_transport_company_address:e.isTransportCompanyAddress??!1,comment:e.comment??``};return e.coordinates&&(t.coordinates={lat:e.coordinates?.lat,long:e.coordinates?.long}),e.operatingHours&&(t.operating_hours={from:e.operatingHours.from,to:e.operatingHours.to}),t}static transformClientContragentBankAccountToRequest(e){return{bank_name:e.bankName,bic:e.bic,account_number:e.accountNumber,correspondent_account:e.correspondentAccount,currency_id:e.currency.id}}getClient(e){return this.get(`/internal/clients/${e}`,{},e=>new qe(e.data))}getClientsList(e,t,n,r,i){return this.getTypedPaginated(O,`/internal/clients`,e,t,n,r,void 0,i)}searchClient(e){return this.getClientsList(void 0,void 0,void 0,{searchTerm:e}).then(e=>e.data)}getClientByPhone(e){return this.getClientsList({groupOp:`and`,groups:[],filters:[{field:`phone`,op:te.Contains,value:e}]})}getAdditionalClientsData(e,n){let r=e.map(e=>e.id);return this.post(`/internal/clients/additional-data`,{clients:r,requested_data_types:n},e=>t.TypedInstanceFactory.instanceListInitializer(Xe,e.data))}getAllClientContacts(e){return this.getTypedList(Ze,`/internal/clients/${e}/contacts/all`)}createClientCommonData(t,n={}){return this.post(`/internal/clients`,e.transformClientDataToRequest(t),e=>new qe(e.data),n)}updateClientCommonData(t,n={}){return this.patch(`/internal/clients/${t.id}`,e.transformClientDataToRequest(t),void 0,n)}updateClientNotDistribCommonData(e,t={}){let n={get_news:e.getNews};return this.patch(`/internal/clients/${e.id}`,n,void 0,t)}changeClientPassword(e,t,n,r={}){return this.patch(`/internal/clients/${e}`,{password:t,password_confirmation:n},void 0,r)}updateClientComment(e){return this.patch(`/internal/clients/${e.id}`,{comment:e.comment})}changeClientActivation(e){return this.patch(`/internal/clients/${e.id}`,{is_active:e.isActive})}async attachClientToManagers(e,t){let n=t.map(t=>this.patch(`/internal/clients/${e}/managers/${t.id}/attach`,{is_primary:t.isDefault}));await Promise.all(n)}async detachClientFromManagers(e,t){let n=t.map(t=>this.patch(`/internal/clients/${e}/managers/${t.id}/detach`));await Promise.all(n)}attachToCurator(e,t,n){return this.patch(`/internal/clients/${e}/curators/${t}/attach`,{curated_direction_id:n.id})}detachFromCurator(e,t,n){return this.patch(`/internal/clients/${e}/curators/${t}/detach`,{curated_direction_id:n.id})}setCurators(e,t){return this.patch(`/internal/clients/${e}/curators`,{curators:t.map(e=>({curator_id:e.curatorId,curated_direction_id:e.curatedDirection.id}))})}createContragentClientData(t,n,r={}){return this.post(`/internal/clients/${t}/contragents`,e.transformContragentClientDataToRequest(n),e=>R.createInstance(e.data),r)}updateContragentClientData(t,n,r={}){return this.patch(`/internal/clients/${t}/contragents/${n.id}`,e.transformContragentClientDataToRequest(n),e=>R.createInstance(e.data),r)}deleteClientContragent(e,t){return this.delete(`/internal/clients/${e}/contragents/${t.id}`)}getClientDeliveryAddresses(e){return this.getTypedList(z,`/internal/clients/${e}/delivery-addresses`)}createClientDeliveryAddress(t,n,r={}){return this.post(`/internal/clients/${t}/delivery-addresses`,e.transformClientDeliveryAddressToRequest(n),e=>new z(e.data),r)}updateClientDeliveryAddress(t,n,r={}){return this.patch(`/internal/clients/${t}/delivery-addresses/${n.id}`,e.transformClientDeliveryAddressToRequest(n),e=>new z(e.data),r)}deleteClientDeliveryAddress(e,t){return this.delete(`/internal/clients/${e}/delivery-addresses/${t.id}`)}createContragentBankAccount(t,n,r,i={}){return this.post(`/internal/clients/${t}/contragents/${n}/bank-accounts`,e.transformClientContragentBankAccountToRequest(r),e=>new F(e.data),i)}updateContragentBankAccount(t,n,r,i={}){return this.patch(`/internal/clients/${t}/contragents/${n}/bank-accounts/${r.id}`,e.transformClientContragentBankAccountToRequest(r),e=>new F(e.data),i)}deleteContragentBankAccount(e,t,n){return this.delete(`/internal/clients/${e}/contragents/${t}/bank-accounts/${n.id}`)}createClientContact(e,t,n={}){return this.createContact(e,t,{client:{id:e,is_primary:t.isPrimary??!1,not_disturb:t.notDisturb??!1}},n)}updateClientContact(e,t,n={}){return this.patch(`/internal/clients/${e}/contacts/${t.id}`,{name:t.name,position:t.position,phone:t.phone,email:t.email,comment:t.comment,not_disturb:t.notDisturb},e=>new L(e.data),n)}setPrimaryClientContact(e,t){return this.setPrimaryContact(`/internal/clients/${e}/contacts/${t.id}/primary`,t.isPrimary??!1)}detachClientContact(e,t){return this.detachContact(`/internal/clients/${e}/contacts/${t.id}/detach`)}createContragentContact(e,t,n,r={}){return this.createContact(e,n,{contragents:[{id:t,is_primary:n.isPrimary??!1,not_disturb:n.notDisturb??!1}]},r)}setPrimaryContragentContact(e,t,n){return this.setPrimaryContact(`/internal/clients/${e}/contragents/${t}/contacts/${n.id}/primary`,n.isPrimary??!1)}detachContragentContact(e,t,n){return this.detachContact(`/internal/clients/${e}/contragents/${t}/contacts/${n.id}/detach`)}createDeliveryAddressContact(e,t,n,r={}){return this.createContact(e,n,{addresses:[{id:t,is_primary:n.isPrimary??!1,not_disturb:n.notDisturb??!1}]},r)}setPrimaryDeliveryAddressContact(e,t,n){return this.setPrimaryContact(`/internal/clients/${e}/delivery-addresses/${t}/contacts/${n.id}/primary`,n.isPrimary??!1)}detachDeliveryAddressContact(e,t,n){return this.detachContact(`/internal/clients/${e}/delivery-addresses/${t}/contacts/${n.id}/detach`)}createContact(e,t,n,r={}){let i={name:t.name,position:t.position,comment:t.comment,...n};return t.phone?.length&&(i.phone=t.phone),t.email?.length&&(i.email=t.email),this.post(`/internal/clients/${e}/contacts`,i,e=>new L(e.data),r)}setPrimaryContact(e,t){return this.patch(e,{is_primary:t})}detachContact(e){return this.patch(e)}sendClientEmailConfirmation(e){return this.get(`/internal/clients/${e.id}/verification/email?email=${e.email}`)}},$e=class extends t.HttpRequester{checkPhoneIsBusy(e){return new Promise((t,n)=>{this.request({method:`GET`,url:`/public/user/verification/phone/check`,params:{phone:e}}).then(e=>{t(!!e.isBusy)}).catch(n)})}},et=class{date;name;version;constructor(e){this.date=(0,r.isString)(e?.date)?(0,n.parseISO)(e.date):e?.date??new Date,this.name=e?.name??``,this.version=e?.version??`0.0.0`}},tt=function(e){return e.Kozyrek=`kozyrek`,e.Mosquitto=`mosquitto`,e.Strip=`strip`,e.MetalForDoors=`metal_for_doors`,e.Sandwich=`sandwich`,e.SandwichM2=`sandwich_m2`,e}({}),nt=class extends t.HttpRequester{getConfiguratorSettings(e,t){return this.get(`internal/catalog/categories/${e.id}/configurators/${e.properties?.configurator}/settings?client_id=${t}`)}searchProduct(e,t,n,r={}){return this.request({method:`GET`,url:`internal/catalog/categories/${e.id}/configurators/${e.properties?.configurator}/product`,params:{params:n,client_id:t}},e=>new x(e.data),r)}createTemplate(e,t,n,r={}){return this.post(`internal/catalog/categories/${e.id}/configurators/${e.properties?.configurator}/template?client_id=${t}`,{...n},()=>{},r)}removeTemplate(e,t,n){return this.delete(`internal/catalog/categories/${e.id}/configurators/${e.properties?.configurator}/template/${n}?client_id=${t}`)}calculate(e,t,n){return this.get(`internal/catalog/categories/${e.id}/configurators/${e.properties?.configurator}/calculate`,{client_id:t,...n})}},rt=class{page=1;pageSize=50;constructor(e){this.page=e?.page??1,this.pageSize=e?.pageSize??50}},it=class extends rt{itemCount=0;pageCount=1;pageSlot=5;pageSizes=[25,50,100];showSizePicker=!0;constructor(e){super(e),this.itemCount=e?.itemCount??0,this.pageCount=e?.pageCount??1,this.pageSlot=e?.pageSlot??5,this.pageSizes=e?.pageSizes??[25,50,100],this.showSizePicker=e?.showSizePicker??!0}},at=class{field;direction;constructor(e){this.field=e?.field??``,this.direction=e?.direction??`asc`}},V=class e{static decadeInterval(t){let[n,r]=e.shiftedDecadeBounds(t,0);return{from:n,to:r}}static shiftDecadeInterval(t,n){let[r,i]=e.shiftedDecadeBounds(t,n);return{from:r,to:i}}static startOfHalfYear(e){return new Date(e.getFullYear(),e.getMonth()<6?0:6,1)}static endOfHalfYear(e){return(0,n.endOfMonth)(new Date(e.getFullYear(),e.getMonth()<6?5:11,1))}static addHalfYears(e,t){return(0,n.addMonths)(e,t*6)}static intervalTillSameDate(e,t,r){let i=(0,n.differenceInCalendarMonths)((0,n.startOfMonth)(r),(0,n.startOfMonth)(e)),a=(0,n.startOfMonth)((0,n.addMonths)(t,i)),o=Math.min((0,n.getDate)(r),(0,n.getDaysInMonth)(a));return{from:(0,n.startOfDay)(t),to:(0,n.endOfDay)((0,n.setDate)(a,o))}}static weekTillSameWeekday(e,t){let r=(0,n.startOfWeek)((0,n.addWeeks)(e,t),{weekStartsOn:1}),i=(0,n.differenceInCalendarDays)(e,(0,n.startOfWeek)(e,{weekStartsOn:1}));return{from:r,to:(0,n.endOfDay)((0,n.addDays)(r,i))}}static decadeTillSameDayNumber(t,r){let[i]=e.shiftedDecadeBounds(t,0),a=(0,n.differenceInCalendarDays)(t,i)+1,[o,s]=e.shiftedDecadeBounds(t,r),c=(0,n.differenceInCalendarDays)(s,o)+1;return{from:o,to:(0,n.endOfDay)((0,n.addDays)(o,Math.min(a,c)-1))}}static shiftedDecadeBounds(e,t){let r=(0,n.getDate)(e),i=2;r<=10?i=0:r<=20&&(i=1);let a=i+t,o=Math.floor(a/3),s=(a%3+3)%3,c=(0,n.startOfMonth)((0,n.addMonths)(e,o)),l=(0,n.addDays)(c,s*10);return[l,s===2?(0,n.endOfMonth)(c):(0,n.endOfDay)((0,n.addDays)(l,9))]}};function ot(e){return(0,n.format)((0,n.subDays)((0,n.startOfToday)(),e),`yyyy-MM-dd`)}function st(e,t){let n=[2,0,1,1,1,2],r=Math.floor(Math.abs(e));return t[r%100>4&&r%100<20?2:n[Math.min(r%10,5)]]}function ct(e){let t=(0,n.parseISO)(e),r=(0,n.differenceInCalendarDays)((0,n.startOfToday)(),t);switch(!0){case r===0:return`Сегодня`;case r===1:return`Вчера`;case r<0:return e;default:return`${r} ${st(r,[`день`,`дня`,`дней`])} назад`}}var lt=class{static defaultDateRanges(e){let t=(0,n.addBusinessDays)(new Date,1),r=new Date,i=(0,n.startOfYear)(e===void 0?r:new Date(e,0,1)),a=(0,n.endOfYear)(i);return{nextWorkingDay:{label:`Следующий рабочий день`,from:(0,n.startOfDay)(t),to:(0,n.endOfDay)(t)},today:{label:`Сегодня`,from:(0,n.startOfToday)(),to:(0,n.endOfToday)()},yesterday:{label:`Вчера`,from:(0,n.startOfYesterday)(),to:(0,n.endOfYesterday)()},tomorrow:{label:`Завтра`,from:(0,n.startOfTomorrow)(),to:(0,n.endOfTomorrow)()},currentWeek:{label:`Неделя`,from:(0,n.startOfWeek)(r,{weekStartsOn:1}),to:(0,n.endOfWeek)(r,{weekStartsOn:1})},currentMonth:{label:`Месяц`,from:(0,n.startOfMonth)(r),to:(0,n.endOfMonth)(r)},oneMonth:{label:`1 месяц`,from:i,to:(0,n.endOfMonth)(i)},threeMonths:{label:`3 месяца`,from:i,to:(0,n.endOfMonth)((0,n.addMonths)(i,2))},nineMonths:{label:`9 месяцев`,from:i,to:(0,n.endOfMonth)((0,n.addMonths)(i,8))},firstQuarter:{label:`I квартал`,from:i,to:(0,n.endOfMonth)((0,n.addMonths)(i,2))},secondQuarter:{label:`II квартал`,from:(0,n.addMonths)(i,3),to:(0,n.endOfMonth)((0,n.addMonths)(i,5))},thirdQuarter:{label:`III квартал`,from:(0,n.addMonths)(i,6),to:(0,n.endOfMonth)((0,n.addMonths)(i,8))},fourthQuarter:{label:`IV квартал`,from:(0,n.addMonths)(i,9),to:(0,n.endOfMonth)((0,n.addMonths)(i,11))},firstHalfYear:{label:`I полугодие`,from:i,to:(0,n.endOfMonth)((0,n.addMonths)(i,5))},secondHalfYear:{label:`II полугодие`,from:(0,n.addMonths)(i,6),to:a},currentYear:{label:`12 месяцев`,from:i,to:a}}}static standardPeriods(e=new Date){let t={weekStartsOn:1},r=(0,n.startOfDay)(e),i=(0,n.endOfDay)(e),a=V.decadeInterval(e),o=(0,n.startOfMonth)(e),s=(0,n.startOfQuarter)(e),c=V.startOfHalfYear(e),l=(0,n.startOfYear)(e),u=V.addHalfYears(e,-1),d=V.addHalfYears(e,1);return{yesterday:{label:`Вчера`,group:`day`,from:(0,n.startOfDay)((0,n.subDays)(e,1)),to:(0,n.endOfDay)((0,n.subDays)(e,1))},today:{label:`Сегодня`,group:`day`,from:r,to:i},tomorrow:{label:`Завтра`,group:`day`,from:(0,n.startOfDay)((0,n.addDays)(e,1)),to:(0,n.endOfDay)((0,n.addDays)(e,1))},lastWeek:{label:`Прошлая неделя`,group:`week`,from:(0,n.startOfWeek)((0,n.subWeeks)(e,1),t),to:(0,n.endOfWeek)((0,n.subWeeks)(e,1),t)},thisWeek:{label:`Эта неделя`,group:`week`,from:(0,n.startOfWeek)(e,t),to:(0,n.endOfWeek)(e,t)},nextWeek:{label:`Следующая неделя`,group:`week`,from:(0,n.startOfWeek)((0,n.addWeeks)(e,1),t),to:(0,n.endOfWeek)((0,n.addWeeks)(e,1),t)},lastTenDays:{label:`Прошлая декада`,group:`decade`,...V.shiftDecadeInterval(e,-1)},thisTenDays:{label:`Эта декада`,group:`decade`,...a},nextTenDays:{label:`Следующая декада`,group:`decade`,...V.shiftDecadeInterval(e,1)},lastMonth:{label:`Прошлый месяц`,group:`month`,from:(0,n.startOfMonth)((0,n.subMonths)(e,1)),to:(0,n.endOfMonth)((0,n.subMonths)(e,1))},thisMonth:{label:`Этот месяц`,group:`month`,from:o,to:(0,n.endOfMonth)(e)},nextMonth:{label:`Следующий месяц`,group:`month`,from:(0,n.startOfMonth)((0,n.addMonths)(e,1)),to:(0,n.endOfMonth)((0,n.addMonths)(e,1))},lastQuarter:{label:`Прошлый квартал`,group:`quarter`,from:(0,n.startOfQuarter)((0,n.subQuarters)(e,1)),to:(0,n.endOfQuarter)((0,n.subQuarters)(e,1))},thisQuarter:{label:`Этот квартал`,group:`quarter`,from:s,to:(0,n.endOfQuarter)(e)},nextQuarter:{label:`Следующий квартал`,group:`quarter`,from:(0,n.startOfQuarter)((0,n.addQuarters)(e,1)),to:(0,n.endOfQuarter)((0,n.addQuarters)(e,1))},lastHalfYear:{label:`Прошлое полугодие`,group:`halfYear`,from:V.startOfHalfYear(u),to:V.endOfHalfYear(u)},thisHalfYear:{label:`Это полугодие`,group:`halfYear`,from:c,to:V.endOfHalfYear(e)},nextHalfYear:{label:`Следующее полугодие`,group:`halfYear`,from:V.startOfHalfYear(d),to:V.endOfHalfYear(d)},lastYear:{label:`Прошлый год`,group:`year`,from:(0,n.startOfYear)((0,n.subYears)(e,1)),to:(0,n.endOfYear)((0,n.subYears)(e,1))},thisYear:{label:`Этот год`,group:`year`,from:l,to:(0,n.endOfYear)(e)},nextYear:{label:`Следующий год`,group:`year`,from:(0,n.startOfYear)((0,n.addYears)(e,1)),to:(0,n.endOfYear)((0,n.addYears)(e,1))},fromBeginningOfThisWeek:{label:`С начала этой недели`,group:`other`,section:`fromBeginning`,from:(0,n.startOfWeek)(e,t),to:i},fromBeginningOfThisTenDays:{label:`С начала этой декады`,group:`other`,section:`fromBeginning`,from:a.from,to:i},fromBeginningOfThisMonth:{label:`С начала этого месяца`,group:`other`,section:`fromBeginning`,from:o,to:i},fromBeginningOfThisQuarter:{label:`С начала этого квартала`,group:`other`,section:`fromBeginning`,from:s,to:i},fromBeginningOfThisHalfYear:{label:`С начала этого полугодия`,group:`other`,section:`fromBeginning`,from:c,to:i},fromBeginningOfThisYear:{label:`С начала этого года`,group:`other`,section:`fromBeginning`,from:l,to:i},tillEndOfThisWeek:{label:`До конца этой недели`,group:`other`,section:`tillEnd`,from:r,to:(0,n.endOfWeek)(e,t)},tillEndOfThisTenDays:{label:`До конца этой декады`,group:`other`,section:`tillEnd`,from:r,to:a.to},tillEndOfThisMonth:{label:`До конца этого месяца`,group:`other`,section:`tillEnd`,from:r,to:(0,n.endOfMonth)(e)},tillEndOfThisQuarter:{label:`До конца этого квартала`,group:`other`,section:`tillEnd`,from:r,to:(0,n.endOfQuarter)(e)},tillEndOfThisHalfYear:{label:`До конца этого полугодия`,group:`other`,section:`tillEnd`,from:r,to:V.endOfHalfYear(e)},tillEndOfThisYear:{label:`До конца этого года`,group:`other`,section:`tillEnd`,from:r,to:(0,n.endOfYear)(e)},lastWeekTillSameWeekDay:{label:`Прошлая неделя, до такого же дня недели`,group:`other`,section:`lastTillSame`,...V.weekTillSameWeekday(e,-1)},lastTenDaysTillSameDayNumber:{label:`Прошлая декада, до такого же номера дня`,group:`other`,section:`lastTillSame`,...V.decadeTillSameDayNumber(e,-1)},lastMonthTillSameDate:{label:`Прошлый месяц, до такой же даты`,group:`other`,section:`lastTillSame`,...V.intervalTillSameDate(o,(0,n.startOfMonth)((0,n.subMonths)(e,1)),e)},lastQuarterTillSameDate:{label:`Прошлый квартал, до такой же даты`,group:`other`,section:`lastTillSame`,...V.intervalTillSameDate(s,(0,n.startOfQuarter)((0,n.subQuarters)(e,1)),e)},lastHalfYearTillSameDate:{label:`Прошлое полугодие, до такой же даты`,group:`other`,section:`lastTillSame`,...V.intervalTillSameDate(c,V.startOfHalfYear(u),e)},lastYearTillSameDate:{label:`Прошлый год, до такой же даты`,group:`other`,section:`lastTillSame`,...V.intervalTillSameDate(l,(0,n.startOfYear)((0,n.subYears)(e,1)),e)},nextWeekTillSameWeekDay:{label:`Следующая неделя, до такого же дня недели`,group:`other`,section:`nextTillSame`,...V.weekTillSameWeekday(e,1)},nextTenDaysTillSameDayNumber:{label:`Следующая декада, до такого же номера дня`,group:`other`,section:`nextTillSame`,...V.decadeTillSameDayNumber(e,1)},nextMonthTillSameDate:{label:`Следующий месяц, до такой же даты`,group:`other`,section:`nextTillSame`,...V.intervalTillSameDate(o,(0,n.startOfMonth)((0,n.addMonths)(e,1)),e)},nextQuarterTillSameDate:{label:`Следующий квартал, до такой же даты`,group:`other`,section:`nextTillSame`,...V.intervalTillSameDate(s,(0,n.startOfQuarter)((0,n.addQuarters)(e,1)),e)},nextHalfYearTillSameDate:{label:`Следующее полугодие, до такой же даты`,group:`other`,section:`nextTillSame`,...V.intervalTillSameDate(c,V.startOfHalfYear(d),e)},nextYearTillSameDate:{label:`Следующий год, до такой же даты`,group:`other`,section:`nextTillSame`,...V.intervalTillSameDate(l,(0,n.startOfYear)((0,n.addYears)(e,1)),e)},last7Days:{label:`Последние 7 дней`,group:`other`,section:`rollingDays`,from:(0,n.startOfDay)((0,n.subDays)(e,6)),to:i},next7Days:{label:`Следующие 7 дней`,group:`other`,section:`rollingDays`,from:r,to:(0,n.endOfDay)((0,n.addDays)(e,6))}}}},ut=[{key:`day`,label:`День`},{key:`week`,label:`Неделя`},{key:`decade`,label:`Декада`},{key:`month`,label:`Месяц`},{key:`quarter`,label:`Квартал`},{key:`halfYear`,label:`Полугодие`},{key:`year`,label:`Год`},{key:`other`,label:`Прочее`}],dt=[{key:`fromBeginning`,label:`С начала периода`},{key:`tillEnd`,label:`До конца периода`},{key:`lastTillSame`,label:`Прошлые, до такой же даты`},{key:`nextTillSame`,label:`Следующие, до такой же даты`},{key:`rollingDays`,label:`7 дней`}],H=class extends t.NamedIdentity{city;isActive;constructor(e){super(e),this.city=e?.city?new t.CityWithRegionAndCountry(e.city):void 0,this.isActive=e?.isActive??!1}},ft=class{salesDirections;partnerGroups;managers;additionalClients;fixedClients;regions;cities;lastLoginDate;lastOrderDate;constructor(e){this.salesDirections=(0,r.map)(e?.salesDirections??[],e=>new t.SalesDirection(e)),this.partnerGroups=(0,r.map)(e?.partnerGroups??[],e=>new t.PartnerGroup(e)),this.managers=(0,r.map)(e?.managers??[],e=>new h(e)),this.additionalClients=(0,r.map)(e?.additionalClients??[],e=>new H(e)),this.fixedClients=(0,r.map)(e?.fixedClients??[],e=>new H(e)),this.regions=(0,r.map)(e?.regions??[],e=>new t.Region(e)),this.cities=(0,r.map)(e?.cities??[],e=>new t.CityWithRegionAndCountry(e)),this.lastLoginDate=new d(e?.lastLoginDate),this.lastOrderDate=new d(e?.lastOrderDate)}hasClientConditions(){return(0,r.some)([this.salesDirections,this.partnerGroups,this.managers,this.additionalClients,this.fixedClients,this.regions,this.cities],e=>!(0,r.isEmpty)(e))||(0,r.some)([this.lastLoginDate,this.lastOrderDate],e=>!!e.from||!!e.to)}setPeriod(e,t){return this[e]=new d({from:t?.from?(0,n.startOfDay)(t.from):null,to:t?.to?(0,n.endOfDay)(t.to):null}),this}toSaveData(){return{salesDirections:(0,r.map)(this.salesDirections,`id`),partnerGroups:(0,r.map)(this.partnerGroups,`id`),managers:(0,r.map)(this.managers,`id`),additionalClients:(0,r.map)(this.additionalClients,`id`),regions:(0,r.map)(this.regions,`id`),cities:(0,r.map)(this.cities,`id`),lastLoginDate:new d(this.lastLoginDate),lastOrderDate:new d(this.lastOrderDate)}}},U=function(e){return e.Active=`active`,e.Scheduled=`scheduled`,e.Completed=`completed`,e}({}),pt=class{static resolve(e,t=new Date){return e.deletedAt&&e.deletedAt.getTime()<=t.getTime()?U.Completed:e.publishedAt&&e.publishedAt.getTime()>t.getTime()?U.Scheduled:U.Active}},W=class extends g{conditions;products;productCategories;countDiscountedPrices;expectedCountDiscountedPrices;countDiscountedProducts;countDiscountedClients;constructor(e){super(e),this.conditions=new ft(e?.conditions),this.products=(0,r.map)(e?.products??[],e=>new x(e)),this.productCategories=(0,r.map)(e?.productCategories??[],e=>new T(e)),this.countDiscountedPrices=e?.countDiscountedPrices??0,this.expectedCountDiscountedPrices=e?.expectedCountDiscountedPrices??0,this.countDiscountedProducts=e?.countDiscountedProducts??0,this.countDiscountedClients=e?.countDiscountedClients??0}getState(e=new Date){return pt.resolve(this,e)}assignCounters(e){this.countDiscountedPrices=e.countDiscountedPrices,this.expectedCountDiscountedPrices=e.expectedCountDiscountedPrices,this.countDiscountedProducts=e.countDiscountedProducts,this.countDiscountedClients=e.countDiscountedClients}isPricesUpdating(){return this.countDiscountedPrices!==this.expectedCountDiscountedPrices}toSaveData(){return{name:this.name,percent:this.percent,isLowPriceAllowed:this.isLowPriceAllowed,publishedAt:this.publishedAt??null,deletedAt:this.deletedAt??null,description:this.description??``,products:(0,r.map)(this.products,`id`),productCategories:(0,r.map)(this.productCategories,`id`),conditions:this.conditions.toSaveData()}}},mt=class{client;additionalClientsCondition;fixedClientsCondition;partnerGroupsCondition;managersCondition;citiesCondition;regionsCondition;salesDirectionsCondition;constructor(e){this.client=new H(e?.client),this.additionalClientsCondition=e?.additionalClientsCondition??!1,this.fixedClientsCondition=e?.fixedClientsCondition??!1,this.partnerGroupsCondition=e?.partnerGroupsCondition??!1,this.managersCondition=e?.managersCondition??!1,this.citiesCondition=e?.citiesCondition??!1,this.regionsCondition=e?.regionsCondition??!1,this.salesDirectionsCondition=e?.salesDirectionsCondition??!1}isEligible(){return this.additionalClientsCondition||this.fixedClientsCondition||this.partnerGroupsCondition||this.managersCondition||this.citiesCondition||this.regionsCondition||this.salesDirectionsCondition}},ht=class extends u{id;name;states;constructor(e){super(),this.id=e?.id,this.name=e?.name,this.states=e?.states}resetFilterValue(e){switch(e){case`id`:case`name`:case`states`:this[e]=void 0}return this}},gt=class e extends p{static prepareSaveData(e,n){return{...e,publishedAt:t.DateHelper.toApiFormat(e.publishedAt),deletedAt:t.DateHelper.toApiFormat(e.deletedAt),conditions:{...e.conditions,lastLoginDate:t.DateHelper.periodToApiFormat(e.conditions.lastLoginDate),lastOrderDate:t.DateHelper.periodToApiFormat(e.conditions.lastOrderDate),updateFixedClients:n}}}getDiscountsList(e,t,n,r){return this.getTypedPaginated(g,`/internal/price/discounts`,e,t,n,{},void 0,r)}getDiscount(e){return this.get(`/internal/price/discounts/${e}`,{},e=>new W(e.data))}createDiscount(t,n,r={}){return this.post(`/internal/price/discounts`,e.prepareSaveData(t,n),e=>new W(e.data),r)}updateDiscount(t,n,r,i={}){return this.patch(`/internal/price/discounts/${t}`,e.prepareSaveData(n,r),e=>new W(e.data),i)}removeDiscount(e){return this.delete(`/internal/price/discounts/${e}`)}getEligibleClients(e){return this.getTypedList(mt,`/internal/price/discounts/${e}/clients`)}checkClient(e,t){return this.get(`/internal/price/discounts/${e}/clients/${t}/check`,{},e=>new mt(e.data))}},G=class extends t.NamedIdentity{constructor(e){super(e)}},K=class extends t.Identity{question;answer;groups;constructor(e){super(e,-1),this.question=e?.question??``,this.answer=e?.answer??``,this.groups=(0,r.map)(e?.groups??[],e=>new G(e))}toSaveData(){return{question:this.question,answer:this.answer,groups:(0,r.map)(this.groups,`id`)}}},_t=class extends p{getFaqList(e,t){return this.getTypedPaginated(K,`/internal/faq`,void 0,void 0,t,(0,r.isNil)(e)?{}:{group:e})}getFaq(e){return this.get(`/internal/faq/${e}`,{},e=>new K(e.data))}createFaq(e,t={}){return this.post(`/internal/faq`,e,e=>new K(e.data),t)}updateFaq(e,t,n={}){return this.patch(`/internal/faq/${e}`,t,e=>new K(e.data),n)}removeFaq(e){return this.delete(`/internal/faq/${e}`)}getGroupsList(){return this.getTypedList(G,`/internal/faq/groups`)}createGroup(e,t={}){return this.post(`/internal/faq/groups`,e,e=>new G(e.data),t)}updateGroup(e,t,n={}){return this.patch(`/internal/faq/groups/${e}`,t,e=>new G(e.data),n)}removeGroup(e){return this.delete(`/internal/faq/groups/${e}`)}};function vt(e){let t=(0,r.round)(e*100);return`${t>=0?`+`:``}${t}%`}var yt=class e{static productIsMeasurable(e){return e.unit.isLinear||e.unit.isSquare}static getProductMultiplicity(t){return!t.properties?.ignoreMinCountCheck&&t.properties?.minCount!=null&&!e.productIsMeasurable(t)?t.properties.minCount:1}static getProductLengthMultiplicity(e){return e.properties?.lengthStep==null?!e.properties?.ignoreMinCountCheck&&e.properties?.minCount!=null?e.properties.minCount:.01:e.properties.lengthStep}},bt=class{static generateUndefinedManagerInstance(){return new t.Manager({id:0,name:`- Не назначен -`,isActive:!0,guid:`-undefined-`})}static isUndefinedManagerInstance(e){return e.id===0&&e.guid===`-undefined-`}},q=function(e){return e.Processing=`processing`,e.Completed=`completed`,e.Error=`error`,e.NeedsActualization=`needs_actualization`,e}({}),xt=class{status;actualizedAt;expiresAt;error;constructor(e){this.status=e?.status??q.Processing,this.actualizedAt=t.DateHelper.parse(e?.actualizedAt),this.expiresAt=t.DateHelper.parse(e?.expiresAt),this.error=e?.error}get isProcessing(){return this.status===q.Processing}get isOutdated(){return this.isOutdatedAt(new Date)}get isOrderAllowed(){return this.isOrderAllowedAt(new Date)}isOutdatedAt(e){return this.status!==q.Completed||(0,r.isNil)(this.actualizedAt)?!0:!(0,r.isNil)(this.expiresAt)&&this.expiresAt.getTime()<e.getTime()}isOrderAllowedAt(e){return this.status===q.Completed&&!this.isOutdatedAt(e)}},St=class extends s{name;client;sum;isProfstroy;actualization;file;constructor(e){super(e),this.name=e?.name,this.client=new O(e?.client),this.sum=e?.sum,this.isProfstroy=e?.isProfstroy,this.actualization=e?.actualization&&new xt(e.actualization),this.file=e?.file}},Ct=class extends de{groupName;supplierSku;isIgnored;lineError;constructor(e){super(e),this.groupName=e.groupName,this.supplierSku=e.supplierSku??e.product.supplierSku,this.isIgnored=e.isIgnored,this.lineError=e.lineError}get isProductStub(){return(0,r.isNil)(this.product.id)}get isOrderable(){return!this.isProductStub&&!this.isIgnored&&(0,r.isEmpty)(this.lineError)}},J=class extends St{sum;products;constructor(e){super(e),this.sum=e.sum??0,this.products=(e.products??[]).map(t=>e.isProfstroy?new Ct(t):new de(t))}},wt=class extends u{id;clientSearchTerm;name;createdAt=new d;constructor(e){super(),this.id=e?.id,this.clientSearchTerm=e?.clientSearchTerm,this.name=e?.name,this.createdAt=new d(e?.createdAt)}resetFilterValue(e){return e===`createdAt`?(this.createdAt.from=null,this.createdAt.to=null):this[e]=void 0,this}asClearRaw(){let e=super.asClearRaw();return!e?.createdAt?.from&&!e?.createdAt?.to&&delete e.createdAt,e}},Tt=class extends Ye{client;payment;delivery;attachedUser;status;statusDetail;salesDirection;attachedAt;isOnOrder;isProfstroy;isNotInStock;sum;isLargeOrder;constructor(e){super(e),this.client=new O(e?.client),this.payment={type:e?.payment?.type??-1,status:e?.payment?.status??-1,onlinePaymentLink:e?.payment?.onlinePaymentLink},this.delivery={type:e?.delivery?.type??-1,date:(0,r.isString)(e?.delivery?.date)?(0,n.parseISO)(e.delivery.date):e?.delivery?.date??new Date,address:e?.delivery?.address?new z(e.delivery.address):void 0,warehouse:e?.delivery?.warehouse?new t.Warehouse(e.delivery.warehouse):void 0},this.attachedUser=e?.attachedUser?new h(e?.attachedUser):void 0,this.status=new t.OrderStatus(e?.status),this.statusDetail=e?.statusDetail?new t.Reference(e.statusDetail):void 0,this.salesDirection=new t.SalesDirection(e?.salesDirection);let i=e?.attachedAt;this.attachedAt=(0,r.isString)(i)?(0,n.parseISO)(i):e?.attachedAt,this.isOnOrder=e?.isOnOrder??!1,this.isProfstroy=e?.isProfstroy??!1,this.isNotInStock=e?.isNotInStock??!1,this.sum=e?.sum??0,this.isLargeOrder=e?.isLargeOrder??!1}},Et=class extends ue{product;cost;costOne;costOneRub;costRub;logicGroupId;salesDirection;specificationImgUrl;sawing;currency;changedFields=[];replacement;constructor(e,n){super(e),this.product=new S(e.product),this.currency=new t.Currency(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=(0,r.isArray)(e.sawing)?e.sawing:e.sawing?[e.sawing]:void 0,n&&(this.replacement=n,this.quantity!==n.quantity&&this.changedFields.push(`quantity`),this.length!==n.length&&this.changedFields.push(`length`))}},Y=class extends Tt{products;invoices;comment;image;contragent;barcode;orderSource;isAllowProcessingWithoutPayment;nextStatuses;actions;operatorsComment;operatorsForWarehouseComment;erpOrderUrl;numberDoc;constructor(e){super(e),this.products=(e.products??[]).map(t=>new Et(t,t.replacementId?e.products?.find(e=>e.id===t.replacementId):void 0)),this.invoices=e.invoices??[],this.comment=e.comment,this.image=e.image,this.contragent=e.contragent?R.createInstance(e.contragent):void 0,this.barcode=e.barcode,this.orderSource=e.orderSource?new t.Reference(e.orderSource):void 0,this.isAllowProcessingWithoutPayment=e.isAllowProcessingWithoutPayment,this.nextStatuses=e.nextStatuses?.map(e=>new t.OrderStatus(e)),this.actions=e.actions,this.operatorsComment=e.operatorsComment,this.operatorsForWarehouseComment=e.operatorsForWarehouseComment,this.erpOrderUrl=e.erpOrderUrl,this.numberDoc=e.numberDoc}},Dt=class extends p{getOffers(e,t,n,r){return this.getTypedPaginated(St,`/internal/orders/offers`,e,t,n,{},void 0,r)}createOfferFromCart(e,t,n){return this.post(`/internal/orders/offers/${e}`,{name:t,items:n?.length?n:void 0},e=>new J(e.data))}createProfstroyOffer(e,t,n,r={}){return this.post(`/internal/orders/offers/${e}/profstroy`,{file:t,name:n},e=>new J(e.data),r)}actualizeProfstroyOffer(e){return this.post(`/internal/orders/offers/${e}/profstroy/actualize`,{},e=>new J(e.data))}reloadProfstroyOffer(e){return this.post(`/internal/orders/offers/${e}/profstroy/reload`,{},e=>new J(e.data))}getOffer(e){return this.get(`/internal/orders/offers/${e}`,{},e=>new J(e.data))}updateOffer(e,t){return this.patch(`/internal/orders/offers/${e}`,{name:t},e=>new J(e.data))}deleteOffer(e){return this.delete(`/internal/orders/offers/${e}`)}createOrderFromDraft(e,r,i,a={}){let o=(0,t.useBaseConfigStore)().config.dateFormats.api;return this.post(`/internal/orders/offers/${e}/create-order`,{...r,deliveryDate:r.deliveryDate?(0,n.format)(r.deliveryDate,o):void 0,items:i?.length?i:void 0},e=>t.TypedInstanceFactory.instanceListInitializer(Y,e.data),a)}addOfferProduct(e,t,n={}){return this.post(`/internal/orders/offers/${e}/products`,{product_id:t.product.id,product_category_id:t.configurator?t.category.id:void 0,quantity:t.quantity,height:t.height,length:t.length,width:t.width,configurator:t.configurator,marker:t.marker,is_additional_sale:t.isAdditionalSale,...t.configuratorParams},e=>new J(e.data),n)}patchOfferProduct(e,t,n,r={}){return this.patch(`/internal/orders/offers/${e}/products/${t}`,{product_id:n.product.id,product_category_id:n.configurator?n.category.id:void 0,quantity:n.quantity,height:n.height,length:n.length,width:n.width,configurator:n.configurator,marker:n.marker,is_additional_sale:n.isAdditionalSale,...n.configuratorParams},e=>new J(e.data),r)}deleteOfferProduct(e,t){return this.delete(`/internal/orders/offers/${e}/products/${t}`,e=>new J(e.data))}getOfferHtml(e,t){return this.get(`/internal/orders/offers/${e}/view`,t?{recipientText:t}:{},e=>new Blob([e.data],{type:`text/html`}))}getOfferPdf(e,t){return this.getBlob(`/internal/orders/offers/${e}/download`,t?{recipientText:t}:{},e=>new Blob([e.request.response],{type:`application/pdf`}))}sendOffer(e,t){return this.post(`/internal/orders/offers/${e}/send`,t)}},Ot=class{static isProfstroy(e){return!!e?.isProfstroy}static isProfstroyOffer(e){return!(0,r.isNil)(e)&&e.isProfstroy===!0&&!(0,r.isNil)(e.actualization)}},kt=function(e){return e.View=`view`,e.Share=`share`,e.EditTags=`edit_tags`,e.SaveOrderIgnoredProducts=`save_order_ignored_products`,e.ChangeStatus=`change_status`,e.ChangeProducts=`change_products`,e.ChangeOrderParameters=`change_order_parameters`,e.Recalculate=`recalculate`,e.AttachOrder=`attach_order`,e.DetachOrder=`detach_order`,e.ChangeAttachedOperator=`change_attached_operator`,e.SendOnlinePaymentLink=`send_online_payment_link`,e.ConfirmOnlineFullPayment=`confirm_online_full_payment`,e.MergeOrders=`merge_orders`,e.GetHistory=`get_history`,e.CloneOrder=`clone_order`,e.DeleteAttachedFile=`delete_attached_file`,e}({}),At=class{paymentType;deliveryType;contragentId;deliveryDate;addressId;warehouseId;image;comment;barcode;operatorsComment;operatorsForWarehouseComment;additionalEmails;isAllowProcessingWithoutPayment;isAdditionalSale;constructor(e){this.paymentType=e?.payment.type,this.deliveryType=e?.delivery.type,this.contragentId=e?.contragent?.id,this.deliveryDate=e?.delivery.date?new Date(e.delivery.date):void 0,this.addressId=e?.delivery.address?.id,this.warehouseId=e?.delivery.warehouse?.id,this.comment=e?.comment,this.barcode=e?.barcode,this.operatorsComment=e?.operatorsComment,this.operatorsForWarehouseComment=e?.operatorsForWarehouseComment,this.isAllowProcessingWithoutPayment=e?.isAllowProcessingWithoutPayment}},jt=class extends u{attachedUsers;clientSearchTerm;client;contragent;createdAt=new d;creator;deliveryDate=new d;deliveryAddressSearch;clientCities;id;isApproved;isNotInStock;isOnOrder;attachedAt=new d;salesDirections;status;statusDetail;deliveryType;paymentType;warehouses;isLargeOrder;isToProcess;onlyMyRegions;constructor(e){super(),this.attachedUsers=e?.attachedUsers?.map(e=>`isActive`in e?new t.Manager(e):new t.Operator(e)),this.clientSearchTerm=e?.clientSearchTerm,this.client=e?.client?new O(e.client):void 0,this.contragent=e?.contragent,this.createdAt=new d(e?.createdAt),this.creator=e?.creator?new h(e.creator):void 0,this.deliveryDate=new d(e?.deliveryDate),this.deliveryAddressSearch=e?.deliveryAddressSearch,this.clientCities=e?.clientCities?.map(e=>new t.CityWithRegionAndCountry(e)),this.id=e?.id,this.isApproved=e?.isApproved,this.isNotInStock=e?.isNotInStock,this.isOnOrder=e?.isOnOrder,this.isLargeOrder=e?.isLargeOrder,this.attachedAt=new d(e?.attachedAt),this.salesDirections=e?.salesDirections?.map(e=>new t.SalesDirection(e)),this.status=e?.status,this.statusDetail=e?.statusDetail,this.deliveryType=e?.deliveryType?new t.DeliveryType(e.deliveryType):void 0,this.paymentType=e?.paymentType?new t.PaymentType(e.paymentType):void 0,this.warehouses=e?.warehouses?.map(e=>new t.Warehouse(e)),this.isToProcess=e?.isToProcess}resetFilterValue(e){switch(e){case`createdAt`:this.createdAt.from=null,this.createdAt.to=null;break;case`creator`:this.creator=void 0;break;case`deliveryDate`:this.deliveryDate.from=null,this.deliveryDate.to=null;break;case`deliveryType`:this.deliveryType=new t.DeliveryType;break;case`clientCities`:this.clientCities=[];break;case`attachedAt`:this.attachedAt.from=null,this.attachedAt.to=null;break;case`salesDirection`:case`salesDirections`:this.salesDirections=[];break;case`status`:this.status=[];break;case`warehouse`:case`warehouses`:this.warehouses=[];break;default:this[e]=void 0}return this}asClearRaw(){let e=super.asClearRaw();return!e?.createdAt?.from&&!e?.createdAt?.to&&delete e.createdAt,!e?.deliveryDate?.from&&!e?.deliveryDate?.to&&delete e.deliveryDate,!e?.attachedAt?.from&&!e?.attachedAt?.to&&delete e.attachedAt,e}},Mt=class{user;status;statusDetail;createdAt;constructor(e){this.user=new h(e?.user),this.status=new t.OrderStatus(e?.status),this.statusDetail=e?.statusDetail?new t.Reference(e.statusDetail):void 0;let i=e?.createdAt;this.createdAt=(0,r.isString)(i)?(0,n.parseISO)(i):e?.createdAt??new Date}},Nt=class extends p{getOrders(e,t,n,r){return this.getTypedPaginated(Tt,`/internal/orders`,e,t,n,{},void 0,r)}getOrdersCount(e,t){return this.get(`/internal/orders/count`,e?{filters:JSON.stringify((e instanceof f?e:new f(e)).toPrimitive())}:{},void 0,void 0,t).then(e=>e.count)}getClientOrderStatistics(e,t){return this.get(`/internal/clients/${e}/orders/statistics`,t?{period:t}:{})}getOrder(e){return this.get(`/internal/orders/${e}`,{},e=>new Y(e.data))}createClientOrder(e,r,i,a={}){let o=(0,t.useBaseConfigStore)().config.dateFormats.api;return this.post(`/internal/clients/${e}/orders`,{...r,deliveryDate:(0,n.format)(r.deliveryDate,o),items:i?.length?i:void 0},e=>t.TypedInstanceFactory.instanceListInitializer(Y,e.data),a)}attachOrder(e){return this.patch(`/internal/orders/${e}/attach`,{},e=>new Y(e.data))}detachOrder(e){return this.patch(`/internal/orders/${e}/detach`,{},e=>new Y(e.data))}mergeOrders(e,t){return this.patch(`/internal/orders/${e}/merge`,{ids:t},e=>new Y(e.data))}recalculateOrder(e){return this.patch(`/internal/orders/${e}/recalculate`,{},e=>new Y(e.data))}cloneOrder(e){return this.get(`/internal/orders/${e}/clone`,{})}updateOrder(e,r,i={}){let a=(0,t.useBaseConfigStore)().config.dateFormats.api;return this.patch(`/internal/orders/${e}`,{...r,deliveryDate:r.deliveryDate?(0,n.format)(r.deliveryDate,a):void 0},e=>new Y(e.data),i)}addOrderProduct(e,t,n={}){return this.post(`/internal/orders/${e}/products`,{product_id:t.product.id,product_category_id:t.configurator?t.category.id:void 0,quantity:t.quantity,height:t.height,length:t.length,width:t.width,configurator:t.configurator,marker:t.marker,is_additional_sale:t.isAdditionalSale,...t.configuratorParams},e=>new Y(e.data),n)}changeOrderStatus(e,t,n,r={}){return this.patch(`/internal/orders/${e}/status`,{status:t,statusDetail:n},e=>new Y(e.data),r)}changeOrderStatusDetail(e,t){return this.patch(`/internal/orders/${e}/status`,{statusDetail:t},e=>new Y(e.data))}getOrderStatusHistory(e){return this.getTypedList(Mt,`/internal/orders/${e}/history`)}getOrderPrintHtml(e,t){return this.get(`/internal/orders/${e}/print/view`,{...t},e=>new Blob([e.data],{type:`text/html`}))}getOrderPrintPdf(e,t){return this.getBlob(`/internal/orders/${e}/print/download`,{...t},e=>new Blob([e.request.response],{type:`application/pdf`}))}sendOrderPrint(e,t){return this.post(`/internal/orders/${e}/print/send`,t)}changeAttachedOperator(e,t){return this.patch(`/internal/orders/${e}/change-attached-operator`,{operatorId:t},e=>new Y(e.data))}deleteOrderAttachedFile(e){return this.delete(`/internal/orders/${e}/file/attached`,e=>new Y(e.data))}deleteOrderProduct(e,t){return this.delete(`/internal/orders/${e}/products/${t}`,e=>new Y(e.data))}patchOrderProduct(e,t,n,r={}){return this.patch(`/internal/orders/${e}/products/${t}`,{product_id:n.product.id,product_category_id:n.configurator?n.category.id:void 0,quantity:n.quantity,height:n.height,length:n.length,width:n.width,configurator:n.configurator,marker:n.marker,is_additional_sale:n.isAdditionalSale,...n.configuratorParams},e=>new Y(e.data),r)}getDeliveryNearestDates(e,t){return this.get(`/internal/orders/delivery/${e}/nearest-dates`,{},e=>e.data,void 0,t)}getSelfDeliveryNearestDates(e,t){return this.get(`/internal/orders/self-delivery/${e}/nearest-dates`,{},e=>e.data,void 0,t)}getDeliveryCost(e,r,i,a){let o=(0,t.useBaseConfigStore)().config.dateFormats.api;return this.get(`/internal/orders/delivery/${e}/cost`,{date:(0,n.format)(r,o),warehouse_id:i},e=>e.data,void 0,a)}},Pt=Symbol(`currentOrder`),X=class{client;product;cost;costCoefficient;source;constructor(e){this.client=new O(e?.client),this.product=new x(e?.product),this.cost=e?.cost??0,this.costCoefficient=e?.costCoefficient??0,this.source=e?.source??le.Product}},Ft=e=>e?(0,r.omitBy)({cities:e.cities?.map(e=>e.id),clients:e.clients?.map(e=>e.id),managers:e.managers?.map(e=>e.id),partnerGroups:e.partnerGroups?.map(e=>e.id),salesDirections:e.salesDirections?.map(e=>e.id),hideNotActive:e.hideNotActive},e=>(0,r.isNil)(e)||((0,r.isArray)(e)||(0,r.isObject)(e))&&(0,r.isEmpty)(e)):{},It=e=>{let t={};return e.from&&(e.from.coefficient||e.from.value)&&(t.from={},e.from.coefficient&&(t.from.priceCoefficientId=e.from.coefficient.id),e.from.value&&(t.from.increasePercent=e.from.value)),e.to&&(e.to.coefficient||e.to.value)&&(t.to={},e.to.coefficient&&(t.to.priceCoefficientId=e.to.coefficient.id),e.to.value&&(t.to.increasePercent=e.to.value)),t},Lt=class extends t.HttpRequester{analyzeProductPrices(e,n,r){return this.get(`/internal/price/products/${e}/analyze`,{...It(n),filters:Ft(r)},e=>t.TypedInstanceFactory.instanceListInitializer(X,e.data))}analyzeCategoryPrices(e,n,r){return this.get(`/internal/price/categories/${e}/analyze`,{...It(n),filters:Ft(r)},e=>t.TypedInstanceFactory.instanceListInitializer(X,e.data))}analyzeCategoryPricesBySquare(e,n,r){return this.get(`/internal/price/categories/${e}/analyze/square`,{...n,filters:Ft(r)},e=>t.TypedInstanceFactory.instanceListInitializer(X,e.data))}},Rt=class{cost;isLowCost;isRetail;costDate;discountName;priceTemplateName;product;client;executor;currency;constructor(e){this.cost=e.cost??0,this.isLowCost=e.isLowCost??!1,this.isRetail=e.isRetail??!1,this.costDate=(0,r.isString)(e.costDate)?(0,n.parseISO)(e.costDate):e.costDate??new Date,this.discountName=e.discountName,this.priceTemplateName=e.priceTemplateName,this.product=e.product?new y(e.product):void 0,this.client=e.client?new h(e.client):void 0,this.executor=e.executor?new h(e.executor):void 0,this.currency=e.currency?new t.Currency(e.currency):void 0}},zt=class extends y{history;constructor(e){super(e),this.history=(0,r.map)(e.history,e=>new Rt(e))}},Bt=class extends t.HttpRequester{getProductPriceHistory(e){let i=(0,t.useBaseConfigStore)().config.dateFormats.api,a=(0,r.omitBy)((0,r.merge)(e,{costDate:{from:(0,r.isDate)(e.costDate?.from)?(0,n.format)(e.costDate.from,i):e.costDate?.from,to:(0,r.isDate)(e.costDate?.to)?(0,n.format)(e.costDate.to,i):e.costDate?.to}}),e=>(0,r.isNil)(e)||((0,r.isArray)(e)||(0,r.isObject)(e))&&(0,r.isEmpty)(e)),o=e.product?.[0]??0;return delete a.product,this.get(`/internal/price/products/${o}/history`,a).then(e=>[new zt((0,r.merge)(e[0],{history:e}))])}},Vt=class{products=[];productCategories=[];constructor(e){e?.products&&(this.products=e.products.map(e=>new y(e))),e?.productCategories&&(this.productCategories=e.productCategories.map(e=>new y(e)))}},Ht=class extends t.HttpRequester{getProductCategoryRecommendations(e){return this.get(`/internal/catalog/recommendations/categories/${e.id}`,{},e=>new Vt(e.data))}getProductRecommendations(e){return this.get(`/internal/catalog/recommendations/products/${e.id}`,{},e=>new Vt(e.data))}saveProductCategoryRecommendations(e,t){return this.post(`/internal/catalog/recommendations/categories/${e.id}`,{product_categories:t.productCategories.map(e=>e.id),products:t.products.map(e=>e.id)})}saveProductRecommendations(e,t){return this.post(`/internal/catalog/recommendations/products/${e.id}`,{product_categories:t.productCategories.map(e=>e.id),products:t.products.map(e=>e.id)})}},Ut=class{static generateUndefinedInstance(e,t=`- Не определён -`){return new e({id:0,name:t,slug:`-undefined-`})}static isUndefinedInstance(e){return e.id===0&&e.slug===`-undefined-`}},Wt=class{name;content;constructor(e){this.name=e.name,this.content=e.content}},Gt=class{resourceType;resourceId;h1;title;description;keywords;meta;tags;constructor(e){this.resourceType=new t.ResourceType(e?.resourceType),this.resourceId=e?.resourceId??``,this.h1=e?.h1,this.title=e?.title,this.description=e?.description,this.keywords=e?.keywords,this.meta=e?.meta?.map(e=>new Wt(e))??[],this.tags=e?.tags}},Kt=class extends t.HttpRequester{getResourceSeoData(e,t){return this.get(`/internal/seo/${e.slug}/${t}`,{},e=>new Gt(e.data))}saveResourceSeoData(e,t={}){return this.post(`/internal/seo/${e.resourceType.slug}/${e.resourceId}`,e,e=>new Gt(e.data),t)}deleteResourceSeoData(e,t){return this.delete(`/internal/seo/${e.slug}/${t}`)}},qt=class extends t.Identity{text;searchCount;lastSearchedAt;constructor(e){super(e),this.text=e?.text??``,this.searchCount=e?.searchCount??0,this.lastSearchedAt=t.DateHelper.parse(e?.lastSearchedAt)}},Jt=class extends t.HttpRequester{getSearchProductsStatistics(e,n){return this.getTypedList(qt,`/internal/statistics/search/products`,{date:t.DateHelper.periodToApiFormat(e)},!1,n)}removeSearchProductStatistic(e){return this.delete(`/internal/statistics/search/products/${e}`)}},Z=function(e){return e[e.Undetermined=0]=`Undetermined`,e[e.Complete=1]=`Complete`,e[e.Incomplete=2]=`Incomplete`,e}({}),Yt=class{static isBlocked(e,t){return t&&e===Z.Incomplete}static getValidationResult(e,n){switch(e){case Z.Incomplete:return n?new t.FieldValidationResultData(`Адрес неполный, выберите более точный вариант из подсказок`,`error`):new t.FieldValidationResultData(`Адрес неполный, проверьте его`,`warning`);case Z.Undetermined:return new t.FieldValidationResultData(`Не удалось определить полноту адреса, проверьте его`,`warning`);default:return}}},Xt=class extends t.HttpRequester{searchAddresses(e){return this.execSuggestionQuery(`/public/suggestions/address`,e)}searchBank(e){return this.execSuggestionQuery(`/public/suggestions/bank`,e)}searchOrganization(e){return this.execSuggestionQuery(`/public/suggestions/organization`,e)}execSuggestionQuery(e,t){return this.get(e,{query:t}).then(e=>{let t=[...e],n=1;return t.forEach(e=>{e.id=n++}),t})}},Zt=class extends t.HttpRequester{constructor(){super(),this.baseUrl=`${(0,t.useBaseConfigStore)().config.http.portalApiUrl}/api`,this.interceptorIds.request.authRequestInterceptor&&this.httpClient.interceptors.request.eject(this.interceptorIds.request.authRequestInterceptor)}getAccessToken(){return this.get(`internal/users/current-tokens`).then(e=>e.accessToken)}},Q=class{user;salesDirection;constructor(e){this.user=new h(e?.user),this.salesDirection=new t.SalesDirection(e?.salesDirection)}},$=class extends t.UserRegionShortInfo{cities;users;constructor(e){super(e),this.cities=e?.cities?.map(e=>new t.CityWithRegionAndCountry(e))??[],this.users=e?.users?.map(e=>new Q(e))??[]}},Qt=class extends u{id;name;abbr;constructor(e){super(),this.id=e?.id,this.name=e?.name,this.abbr=e?.abbr}resetFilterValue(e){switch(e){case`id`:case`name`:case`abbr`:this[e]=void 0}return this}},$t=class extends p{getRegionsList(e,n,r){return this.getTypedPaginated(t.UserRegionShortInfo,`/internal/users/regions`,e,n,r)}getRegion(e){return this.get(`/internal/users/regions/${e}`,{},e=>new $(e.data))}createRegion(e,t={}){return this.post(`/internal/users/regions`,e,e=>new $(e.data),t)}updateRegion(e,t,n={}){return this.patch(`/internal/users/regions/${e}`,t,e=>new $(e.data),n)}removeRegion(e){return this.delete(`/internal/users/regions/${e}`)}getRegionEmployees(e){return this.getTypedList(Q,`/internal/users/regions/${e}/users`)}attachRegionEmployee(e,t,n){return this.post(`/internal/users/regions/${e}/users/${t}`,{salesDirectionId:n},e=>new Q(e.data))}detachRegionEmployee(e,t,n){return this.request({method:`DELETE`,url:`/internal/users/regions/${e}/users/${t}`,params:{sales_direction_id:n}})}};e.AddressQualityEnum=Z,e.AddressQualityHelper=Yt,e.BankAccount=F,e.BasePaginationProvider=p,e.BlogPost=l,e.BlogPostMediaFile=a,e.BlogPostMediaTypeEnum=i,e.BlogPostPublicationStatusEnum=o,e.BlogPostShortInfo=c,e.BlogPostsListFilters=ee,e.BlogProvider=re,e.CalculationTypeEnum=pe,e.CalendarHelper=V,e.Cart=w,e.CartProvider=fe,e.CatalogProvider=Oe,e.CatalogableItem=oe,e.Category=T,e.CategoryFilter=De,e.CategoryFilterSetting=Te,e.CategoryFilterValue=Ee,e.CategoryPricingRule=Ce,e.Client=qe,e.ClientAdditionalData=Xe,e.ClientCategory=ge,e.ClientDataProvider=Qe,e.ClientPriceCatalogableItem=xe,e.ClientPriceCategory=Se,e.ClientPriceProduct=N,e.ClientPriceProvider=ke,e.ClientPriceTemplateProvider=Ae,e.ClientProduct=S,e.ClientProductCategoryDataProvider=Ne,e.ClientProductDataProvider=Pe,e.ClientShortInfo=O,e.ClientsAdditionalDataRequestTypeEnum=Ve,e.ClientsListFilters=Je,e.CodedIdentity=y,e.ConfiguratorProvider=nt,e.ConfiguratorsEnum=tt,e.Contact=I,e.ContactPerson=L,e.ContactPersonRelated=Ze,e.ContactRelation=B,e.ContragentBase=He,e.ContragentFactory=R,e.ContragentIc=We,e.ContragentPerson=Ue,e.ContragentUlNr=Ke,e.ContragentUlR=Ge,e.CostSourceEnum=le,e.CreatableIdentity=s,e.Curator=D,e.DataSuggestionProvider=Xt,e.DateTimeProvider=lt,e.DeletableIdentity=ye,e.DeletableNamedIdentity=m,e.DeliveryAddress=z,e.Discount=W,e.DiscountClient=H,e.DiscountClientEligibility=mt,e.DiscountConditions=ft,e.DiscountProvider=gt,e.DiscountShortInfo=g,e.DiscountStateEnum=U,e.DiscountStateHelper=pt,e.DiscountsListFilters=ht,e.Faq=K,e.FaqGroup=G,e.FaqProvider=_t,e.FilterGroup=f,e.FilterItem=ne,e.FilterOpEnum=te,e.FilterSettings=we,e.HiddenCatalogableItem=se,e.Image=ce,e.ManagerDataFactory=bt,e.MetaTagItem=Wt,e.Offer=J,e.OfferActualization=xt,e.OfferActualizationStatus=q,e.OfferHelper=Ot,e.OfferShortInfo=St,e.OffersDataProvider=Dt,e.OffersListFilters=wt,e.Order=Y,e.OrderAction=kt,e.OrderEditorData=At,e.OrderInfo=Tt,e.OrderItem=Et,e.OrderItemBase=ue,e.OrderShortInfo=Ye,e.OrderStatusHistoryInfo=Mt,e.OrdersDataProvider=Nt,e.OrdersListFilters=jt,e.PaginationFiltersBase=u,e.PriceAnalyze=X,e.PriceAnalyzeProvider=Lt,e.PriceCatalogableItem=_e,e.PriceHistoryDataProvider=Bt,e.PriceHistoryItem=Rt,e.PriceTemplate=_,e.PriceTemplateCategory=E,e.PriceTemplateClient=k,e.PriceTemplateICatalogableItem=ve,e.PriceTemplateProduct=A,e.PriceTemplateProvider=Fe,e.PricingRole=P,e.PricingRoleProvider=Ie,e.PrimaryCatalogableItem=b,e.Product=x,e.ProductCategoryDataProvider=je,e.ProductDataProvider=Me,e.ProductFilterTypeEnum=me,e.ProductPriceCoefficient=v,e.ProductPriceHistory=zt,e.ProductUnit=ae,e.ProfstroyOfferItem=Ct,e.PropertiesProvider=Le,e.Property=j,e.PropertyValue=M,e.RecommendationsDataProvider=Ht,e.RecommendationsList=Vt,e.ReferenceDataFactory=Ut,e.STANDARD_PERIOD_GROUPS=ut,e.STANDARD_PERIOD_SECTIONS=dt,e.SearchProductStatistic=qt,e.Seo=Gt,e.SeoDataProvider=Kt,e.StatisticsProvider=Jt,e.StockCount=ie,e.TableDataPagination=it,e.TableDataPaginationRequestParams=rt,e.TableDataSortRequestParams=at,e.TemplateProductCategoryDataProvider=Re,e.TemplatesListFilters=be,e.UnitsHelper=yt,e.UnknownClientDataProvider=$e,e.UserAuthDataProvider=Zt,e.UserRegion=$,e.UserRegionEmployee=Q,e.UserRegionProvider=$t,e.UserRegionsListFilters=Qt,e.UserShortInfo=h,e.VersionConfig=et,e.currentOrderInjectionKey=Pt,e.daysAgoIso=ot,e.findCatalogItemByIdRecursive=ze,e.flattenCatalogItems=Be,e.formatPercentChange=vt,e.formatRelativeDate=ct,e.pluralize=st,Object.keys(t).forEach(function(n){n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})});