@snabcentr/client-ui 5.15.0 → 5.19.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.
@@ -1,23 +1,23 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, Injectable, NgZone, RendererFactory2, EventEmitter, Output, Input, ChangeDetectionStrategy, Component, signal, ChangeDetectorRef, Directive, Pipe, ElementRef, Renderer2, HostListener, input, computed, model, output, DestroyRef, effect, ViewChild, ContentChild, viewChild, HostBinding, ContentChildren, forwardRef, contentChild, TemplateRef, RESPONSE_INIT, ViewEncapsulation, Injector, viewChildren, afterNextRender } from '@angular/core';
3
- import { ScContactsService, ScUserService, ScLocationsService, IS_BROWSER, ScSuggestionService, ScISuggestionType, SC_MIN_LENGTH_SEARCH_TERM, ScAuthService, SEARCH_TERM, ScUnitsHelper, ScImageHelper, SC_PATH_IMAGE_NOT_FOUND, ScImage, ScPhoneService, ScUserMetrikaService, ScUserMetrikaGoalsEnum, ScVCardService, IS_RUNNING_ON_TERMINAL, ScVerificationService, ScConvertersService, ScReferencesService, ScOpfList, ScNumberHelper, ScBannerService, ScMediaImageTransformerPipe, ScCartService, ScUploadedFile, loadingPlaceholder, SC_ORDER_LOADER, ScMimeTypes, ScCatalogService, ScWarehouseService, SEARCH_TERM_PROVIDERS, ScPaginationService, SC_NEXT_PAGE_PAGINATION_CLICK, SC_PRODUCT_PAGINATION_OPTIONS, ScCatalogFilterService, ScIdOrSlugPipe, SC_CATEGORY_INFO, ScConfiguratorService, ScContragentService, ScDeliveryAddressService, SC_URLS, IS_SERVER, ScIconTypesEnum, ScDocumentInfoTypesEnum, ScFilesService, ScOrdersService, ScUIService, SC_USER_INFO as SC_USER_INFO$1, ScPaymentType, ScDeliveryType, TERMINAL_PROVIDERS, ScOrderDraftsService, ScRouteKeys, ScSeoService, scOrderIsLoaded, SC_PAGE_QUERY_PARAM, ScFrequentlyAskedQuestionsService, SchemaOrgFactory, scGetPageQueryParamChanges, ScNewsService, SC_COMPANY_INFO, ScFeedbackService } from '@snabcentr/client-core';
4
- import { EMPTY, BehaviorSubject, switchMap, of, shareReplay, filter, map, Observable, debounceTime, startWith, catchError, throwError, share, Subject, tap, finalize, timer, scan, takeWhile, endWith, distinctUntilChanged, combineLatest, pairwise, Subscription, merge, skip, from, concatMap, noop as noop$1, first, retry, fromEvent, animationFrames, take, takeUntil, defer, timeout, ignoreElements } from 'rxjs';
2
+ import { InjectionToken, inject, Injectable, NgZone, untracked, signal, EventEmitter, Output, Input, ChangeDetectionStrategy, Component, ChangeDetectorRef, Directive, Pipe, ElementRef, Renderer2, HostListener, input, computed, model, output, DestroyRef, effect, ViewChild, ContentChild, viewChild, HostBinding, ContentChildren, forwardRef, contentChild, TemplateRef, RESPONSE_INIT, ViewEncapsulation, Injector, viewChildren, afterNextRender } from '@angular/core';
3
+ import { ScContactsService, ScUserService, ScLocationsService, ScSuggestionAddressQuality, ScSuggestionService, ScISuggestionType, SC_MIN_LENGTH_SEARCH_TERM, ScAuthService, SEARCH_TERM, ScUnitsHelper, ScImageHelper, SC_PATH_IMAGE_NOT_FOUND, ScImage, ScPhoneService, ScUserMetrikaService, ScUserMetrikaGoalsEnum, ScVCardService, IS_RUNNING_ON_TERMINAL, ScVerificationService, ScConvertersService, ScReferencesService, ScOpfList, ScNumberHelper, ScBannerService, ScMediaImageTransformerPipe, ScUploadedFile, ScCartService, loadingPlaceholder, SC_ORDER_LOADER, ScMimeTypes, ScCatalogService, ScWarehouseService, SEARCH_TERM_PROVIDERS, ScPaginationService, SC_NEXT_PAGE_PAGINATION_CLICK, SC_PRODUCT_PAGINATION_OPTIONS, ScCatalogFilterService, ScIdOrSlugPipe, SC_CATEGORY_INFO, ScConfiguratorService, ScContragentService, ScDeliveryAddressService, SC_URLS, IS_SERVER, ScIconTypesEnum, ScDocumentInfoTypesEnum, ScFilesService, ScOrderItemsGroup, ScOrderItem, ScOrdersService, ScUIService, SC_USER_INFO as SC_USER_INFO$1, ScPaymentType, ScDeliveryType, TERMINAL_PROVIDERS, ScOrderDraft, SC_UPDATE_INTERVAL, ScOrderDraftsService, ScOrderDraftActualizationStatus, ScRouteKeys, ScSeoService, scOrderIsLoaded, SC_PAGE_QUERY_PARAM, ScFrequentlyAskedQuestionsService, SchemaOrgFactory, scGetPageQueryParamChanges, ScNewsService, SC_COMPANY_INFO, ScFeedbackService } from '@snabcentr/client-core';
4
+ import { EMPTY, BehaviorSubject, switchMap, of, shareReplay, filter, map, debounceTime, startWith, catchError, throwError, share, Subject, tap, finalize, timer, scan, takeWhile, endWith, distinctUntilChanged, combineLatest, pairwise, Observable, Subscription, merge, skip, from, concatMap, noop as noop$1, first, retry, defaultIfEmpty, exhaustMap, fromEvent, animationFrames, take, takeUntil } from 'rxjs';
5
5
  import { WA_WINDOW, WA_NAVIGATOR } from '@ng-web-apis/common';
6
6
  import { takeUntilDestroyed, toSignal, outputFromObservable, toObservable } from '@angular/core/rxjs-interop';
7
- import { tuiIsPresent, TuiDay, TuiTime, TuiValueTransformer, tuiControlValue, tuiMarkControlAsTouchedAndValidate, TuiAutoFocus, TuiHovered, TuiDayRange, TuiMonth, tuiProvide, TuiValidationError, TUI_WINDOW_SIZE, tuiClamp, tuiZonefree, TUI_TRUE_HANDLER } from '@taiga-ui/cdk';
7
+ import { tuiIsPresent, TuiDay, TuiTime, TuiValueTransformer, TuiValidationError, tuiControlValue, tuiMarkControlAsTouchedAndValidate, TuiAutoFocus, TuiHovered, TuiDayRange, TuiMonth, tuiProvide, TUI_WINDOW_SIZE, tuiClamp, TUI_TRUE_HANDLER } from '@taiga-ui/cdk';
8
8
  import * as i1$1 from '@taiga-ui/kit';
9
- import { tuiInputDateOptionsProvider, TuiAvatar, TuiInitialsPipe, TuiButtonLoading, TuiSortCountriesPipe, TuiPush, TuiInputPhoneInternational, TuiPassword, TuiChevron, TuiSelect, TuiDataListWrapperComponent, TuiStringifyContentPipe, TuiComboBox, TuiStepper, TuiAccordionDirective, TuiAccordion, TuiFiles, TuiChip, TuiInputNumber, TuiLineClamp, TuiBadge, TuiInputNumberDirective, TuiTooltip, TuiHighlight, TuiFade, TuiRange, tuiInputNumberOptionsProvider, TuiInputSlider, TuiPushComponent, TuiTreeService, TuiTreeItemContent, TUI_TREE_START, TUI_TREE_CONTENT, TUI_TREE_LOADING, TuiTreeComponent, TuiTreeChildren, TuiTreeControllerDirective, TUI_TREE_LOADER, TuiPreviewDialogService, TuiPreview, tuiFilesAccepted, TuiInputDate, TuiTextarea, TUI_CONFIRM, TuiDataListWrapper, TUI_PAGINATION_TEXTS, TuiInputPhone } from '@taiga-ui/kit';
10
- import * as i1$2 from '@angular/common';
11
- import { DOCUMENT, AsyncPipe, NgTemplateOutlet, NgClass, CommonModule } from '@angular/common';
12
- import { HttpErrorResponse, HttpClient } from '@angular/common/http';
9
+ import { tuiInputDateOptionsProvider, TuiAvatar, TuiInitialsPipe, TuiButtonLoading, TuiSortCountriesPipe, TuiPush, TuiInputPhoneInternational, TuiPassword, TuiChevron, TuiSelect, TuiDataListWrapperComponent, TuiStringifyContentPipe, TuiComboBox, TuiStepper, TuiAccordionDirective, TuiAccordion, TUI_CONFIRM_WORDS, TuiFiles, TuiChip, TuiInputNumber, TuiLineClamp, TuiBadge, TuiInputNumberDirective, TuiTooltip, TuiHighlight, TuiFade, TuiRange, TuiBlock, tuiInputNumberOptionsProvider, TuiInputSlider, TuiPushComponent, TuiTreeService, TuiTreeItemContent, TUI_TREE_START, TUI_TREE_CONTENT, TUI_TREE_LOADING, TuiTreeComponent, TuiTreeChildren, TuiTreeControllerDirective, TUI_TREE_LOADER, TuiPreviewDialogService, TuiPreview, TUI_CONFIRM, tuiFilesAccepted, TuiInputDate, TuiTextarea, TUI_INPUT_FILES_OPTIONS, tuiCreateFileFormatValidator, tuiCreateFileSizeValidator, TUI_INPUT_FILE_TEXTS, TuiDataListWrapper, TUI_PAGINATION_TEXTS, TuiInputPhone } from '@taiga-ui/kit';
10
+ import { HttpErrorResponse, HttpClient, HttpStatusCode } from '@angular/common/http';
13
11
  import * as i1 from '@angular/forms';
14
- import { NgControl, FormControl, FormGroupDirective, ReactiveFormsModule, FormGroup, Validators, FormsModule, FormArray, NG_VALUE_ACCESSOR } from '@angular/forms';
12
+ import { NgControl, FormControl, FormGroupDirective, ReactiveFormsModule, FormGroup, Validators, DefaultValueAccessor, FormsModule, FormArray, NG_VALUE_ACCESSOR } from '@angular/forms';
15
13
  import * as i2 from '@taiga-ui/core';
16
- import { TUI_DATA_LIST_HOST, TuiLoader, TuiDataList, TuiDialogService, TuiLink, TuiButton, TuiIcon, TuiAppearance, TuiWithAppearance, TuiIcons, TuiWithIcons, TuiLabel, TuiTextfield, TuiInput, TuiError, TuiCheckbox, tuiDropdownOptionsProvider, TuiOption, TuiFilterByInputPipe, TuiCarouselComponent, TuiCarousel, TuiNumberFormat, TuiFormatNumberPipe, TuiHint, TuiHintDirective, TuiHintDriver, TuiHintHover, TuiHintPosition, TUI_MONTHS, TuiScrollbar, tuiNumberFormatProvider, tuiItemsHandlersProvider, TuiNotification, TuiTitle, tuiTextfieldOptionsProvider, tuiHintOptionsProvider, TuiNotificationService, TuiIconPipe, TUI_BUTTON_DEFAULT_OPTIONS, TUI_BUTTON_OPTIONS, TUI_COMMON_ICONS } from '@taiga-ui/core';
14
+ import { TUI_TEXTFIELD_OPTIONS, TUI_DATA_LIST_HOST, TuiLoader, TuiDataList, TuiDialogService, TuiLink, TuiButton, TuiIcon, TuiAppearance, TuiWithAppearance, TuiIcons, TuiWithIcons, TuiLabel, TuiTextfield, TuiInput, TuiError, TuiCheckbox, tuiDropdownOptionsProvider, TuiOption, TuiFilterByInputPipe, TuiCarouselComponent, TuiCarousel, TuiNumberFormat, TuiFormatNumberPipe, TuiHint, TuiHintDirective, TuiHintDriver, TuiHintHover, TuiHintPosition, TUI_MONTHS, TuiScrollbar, tuiNumberFormatProvider, tuiItemsHandlersProvider, TuiNotification, TuiTitle, tuiTextfieldOptionsProvider, tuiHintOptionsProvider, TuiNotificationService, TuiIconPipe, TUI_BUTTON_DEFAULT_OPTIONS, TUI_BUTTON_OPTIONS, TUI_COMMON_ICONS } from '@taiga-ui/core';
15
+ import * as i1$2 from '@angular/common';
16
+ import { AsyncPipe, DOCUMENT, NgTemplateOutlet, NgClass, CommonModule } from '@angular/common';
17
+ import { isNil, isString, isUndefined, isObject, noop, isBoolean, isArray } from 'lodash-es';
17
18
  import { isValidPhoneNumber } from 'libphonenumber-js/max';
18
19
  import { MaskitoDirective } from '@maskito/angular';
19
20
  import { getCountries } from 'libphonenumber-js';
20
- import { isNil, isUndefined, isObject, noop, isBoolean, isString, isArray } from 'lodash-es';
21
21
  import { POLYMORPHEUS_CONTEXT, PolymorpheusComponent, PolymorpheusTemplate, PolymorpheusOutlet, injectContext } from '@taiga-ui/polymorpheus';
22
22
  import { QRCodeComponent } from 'angularx-qrcode';
23
23
  import * as i3 from '@taiga-ui/core/portals/dropdown';
@@ -45,6 +45,8 @@ import { TuiCurrencyPipe } from '@taiga-ui/addon-commerce';
45
45
  import { isValid, parse, format } from 'date-fns';
46
46
  import * as i6$1 from '@taiga-ui/core/components/calendar';
47
47
  import { Clipboard } from '@angular/cdk/clipboard';
48
+ import * as i6$2 from 'ng-recaptcha-2';
49
+ import { RecaptchaComponent, RecaptchaFormsModule, RecaptchaModule } from 'ng-recaptcha-2';
48
50
 
49
51
  /**
50
52
  * Поток для закрытия уведомлений помощи.
@@ -173,6 +175,13 @@ const SC_ALLOW_SELECT_TERMINATED = new InjectionToken(ngDevMode ? 'SC_ALLOW_SELE
173
175
  factory: () => false,
174
176
  });
175
177
 
178
+ /**
179
+ * Токен признака, что отправка форм с неполным (по данным подсказок) адресом заблокирована. По умолчанию блокировка выключена.
180
+ */
181
+ const SC_BLOCK_INCOMPLETE_ADDRESS = new InjectionToken('SC_BLOCK_INCOMPLETE_ADDRESS', {
182
+ factory: () => false,
183
+ });
184
+
176
185
  /**
177
186
  * Токен максимального количества файлов, отправляемых в форме в байтах.
178
187
  */
@@ -332,6 +341,36 @@ const SC_HIDDEN_PRINT_ELEMENTS = new InjectionToken('SC_HIDDEN_PRINT_ELEMENTS',
332
341
  providedIn: 'root',
333
342
  });
334
343
 
344
+ /**
345
+ * Селектор iframe reCAPTCHA.
346
+ */
347
+ const RECAPTCHA_IFRAME_SELECTOR = 'iframe[src*="recaptcha"]';
348
+ /**
349
+ * Селектор хоста reCAPTCHA.
350
+ */
351
+ const RECAPTCHA_HOST_SELECTOR = 're-captcha';
352
+ /**
353
+ * Освобождает ресурсы reCAPTCHA и удаляет осиротевшие iframe после смены маршрута.
354
+ *
355
+ * @param documentReference Объект документа.
356
+ * @param windowReference Объект окна браузера.
357
+ */
358
+ function cleanupRecaptchaArtifacts(documentReference, windowReference) {
359
+ const windowWithRecaptcha = windowReference;
360
+ try {
361
+ windowWithRecaptcha.grecaptcha?.reset();
362
+ }
363
+ catch {
364
+ // Ошибки reCAPTCHA не должны блокировать навигацию.
365
+ }
366
+ documentReference.querySelectorAll(RECAPTCHA_IFRAME_SELECTOR).forEach((iframe) => {
367
+ if (iframe.closest(RECAPTCHA_HOST_SELECTOR)) {
368
+ return;
369
+ }
370
+ iframe.remove();
371
+ });
372
+ }
373
+
335
374
  /**
336
375
  * Сервис по работе с печатью страницы.
337
376
  */
@@ -378,100 +417,219 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
378
417
  }] });
379
418
 
380
419
  /**
381
- * Сервис для вставки в {@link Document} внешних и дополнительных скриптов.
420
+ * Сервис-реестр качества адресов, выбранных из подсказок.
421
+ *
422
+ * Хранит качество последнего выбранного адреса для каждого контрола. Качество полного адреса
423
+ * действует, пока значение контрола не изменилось после выбора: ручная правка возвращает адрес
424
+ * в разряд непроверяемых. Качество неполного адреса и адреса с неопределённой полнотой сохраняется
425
+ * и при ручной правке текста: его заменяет только выбор другой подсказки по этому полю.
426
+ * Полная очистка поля сбрасывает качество: адрес, введённый после неё, считается ручным.
382
427
  */
383
- class ScScriptsService {
428
+ class ScAddressQualityService {
384
429
  constructor() {
385
430
  /**
386
- * Объект {@link Document}, предоставляющий доступ к DOM страницы.
431
+ * Валидатор, запрещающий отправку формы с неполным адресом, пока блокировка включена токеном {@link SC_BLOCK_INCOMPLETE_ADDRESS}.
432
+ * Подключается к контролу адреса при его создании; директива качества адреса только показывает предупреждение.
433
+ *
434
+ * @param control Контрол адреса.
387
435
  */
388
- this.document = inject(DOCUMENT);
436
+ this.validator = (control) => this.validate(control);
389
437
  /**
390
- * Объект {@link Renderer2}, предоставляющий доступ к DOM страницы.
438
+ * Признак, что отправка форм с неполным адресом заблокирована.
391
439
  */
392
- this.renderer = inject(RendererFactory2).createRenderer(null, null);
440
+ this.blockIncompleteAddress = inject(SC_BLOCK_INCOMPLETE_ADDRESS);
393
441
  /**
394
- * Признак того, что скрипт выполняется в браузере.
442
+ * Ошибка валидации неполного адреса.
395
443
  */
396
- this.isBrowser = inject(IS_BROWSER);
444
+ this.incompleteAddressError = new TuiValidationError('Проверьте адрес и выберите более точный вариант из подсказок');
397
445
  /**
398
- * {@link NgZone} для вставки скриптов вне зоны Angular.
446
+ * Текст предупреждения о необходимости проверить адрес, общий для неполного адреса и адреса с неопределённой полнотой.
399
447
  */
400
- this.ngZone = inject(NgZone);
448
+ this.warningMessage = 'Проверьте правильность адреса';
449
+ /**
450
+ * Appearance поля адреса с предупреждением о необходимости проверить адрес (жёлтая рамка), задаётся через `tuiTextfieldAppearance`.
451
+ */
452
+ this.warningAppearance = 'sc-textfield-warning';
453
+ /**
454
+ * Appearance поля адреса без предупреждения: appearance полей ввода по умолчанию из настроек `tui-textfield`.
455
+ */
456
+ this.defaultAppearance = inject(TUI_TEXTFIELD_OPTIONS).appearance();
457
+ /**
458
+ * Реестр состояний качества по контролам адресов.
459
+ */
460
+ this.states = new WeakMap();
461
+ /**
462
+ * Реестр признаков включённого контроля качества по контролам адресов.
463
+ */
464
+ this.checkEnabledStates = new WeakMap();
401
465
  }
402
466
  /**
403
- * Вставляет в конец {@link Document.body} скрипты, заданные строками HTML, вне зоны Angular. Из каждой строки берётся первый `<script>`. На сервере ничего не делает.
404
- * Принимает только доверенные строки из конфигурации приложения: строка разбирается как HTML и может выполнить код.
467
+ * Возвращает признак, что значение поля адреса пустое без учёта пробелов.
405
468
  *
406
- * @param scriptStrings Строки HTML скриптов.
469
+ * @param value Значение поля адреса.
407
470
  */
408
- appendScripts(scriptStrings) {
409
- if (!this.isBrowser) {
410
- return;
471
+ static isEmptyAddress(value) {
472
+ return isNil(value) || (isString(value) && !value.trim());
473
+ }
474
+ /**
475
+ * Задаёт качество адреса, выбранного в контроле, и пересчитывает валидность контрола
476
+ * без рассылки событий, чтобы не нарушать подавление valueChanges при выборе подсказки.
477
+ * Контрол адреса, требующего внимания пользователя, помечается затронутым, чтобы сообщения показались сразу.
478
+ *
479
+ * @param control Контрол адреса.
480
+ * @param quality Качество (полнота) адреса или null, если качество неизвестно.
481
+ */
482
+ setQuality(control, quality) {
483
+ this.stateOf(control).set(quality === null ? null : { quality, value: control.value });
484
+ if (quality === ScSuggestionAddressQuality.incomplete || quality === ScSuggestionAddressQuality.undetermined) {
485
+ control.markAsTouched();
411
486
  }
412
- this.ngZone.runOutsideAngular(() => {
413
- scriptStrings.forEach((scriptString) => {
414
- const script = this.createScript(scriptString);
415
- if (script) {
416
- this.renderer.appendChild(this.document.body, script);
417
- }
418
- });
487
+ control.updateValueAndValidity({ emitEvent: false });
488
+ }
489
+ /**
490
+ * Возвращает качество адреса, выбранного в контроле, либо null, если адрес из подсказок
491
+ * не выбирался или поле пустое. Качество полного адреса действует, только пока значение контрола не изменилось
492
+ * после выбора; качество неполного адреса и адреса с неопределённой полнотой действует
493
+ * до выбора другой подсказки или полной очистки поля, в том числе после ручной правки текста.
494
+ *
495
+ * @param control Контрол адреса.
496
+ */
497
+ getQuality(control) {
498
+ const state = this.stateOf(control)();
499
+ if (!state || ScAddressQualityService.isEmptyAddress(control.value)) {
500
+ return null;
501
+ }
502
+ if (state.quality === ScSuggestionAddressQuality.complete) {
503
+ return state.value === control.value ? ScSuggestionAddressQuality.complete : null;
504
+ }
505
+ return state.quality;
506
+ }
507
+ /**
508
+ * Задаёт качество адресов организации контролам группы на основе выбранной подсказки.
509
+ * Качество применяется только к заполненным адресам подсказки: для пустого адреса
510
+ * оно сбрасывается, даже если сервис подсказок прислал для него значение.
511
+ *
512
+ * @param group Группа с контролами адресов организации.
513
+ * @param suggestion Объект подсказки по организации.
514
+ */
515
+ setOrganizationAddressQualities(group, suggestion) {
516
+ const qualities = [
517
+ ['legalAddress', suggestion.legalAddress, suggestion.legalAddressQuality],
518
+ ['postalAddress', suggestion.postalAddress, suggestion.postalAddressQuality],
519
+ ['actualAddress', suggestion.actualAddress, suggestion.actualAddressQuality],
520
+ ];
521
+ qualities.forEach(([controlName, address, quality]) => {
522
+ const control = group.get(controlName);
523
+ if (control) {
524
+ this.setQuality(control, address ? (quality ?? null) : null);
525
+ }
419
526
  });
420
527
  }
421
528
  /**
422
- * Загружает внешний скрипт: при подписке добавляет его в {@link Document.head}, после загрузки выдаёт элемент скрипта и завершается.
423
- * Если скрипт не загрузился или подписка отменена раньше, удаляет его со страницы; удаление не отменяет загрузку и выполнение уже вставленного скрипта. На сервере завершается без загрузки.
529
+ * Включает или отключает контроль качества адреса для контрола и пересчитывает его валидность без рассылки событий.
530
+ * Сохранённое качество при отключении не теряется и снова учитывается после включения.
531
+ * Вызывать при смене значения формы, а не из хуков проверки изменений (ngOnChanges и т.п.),
532
+ * чтобы родительские шаблоны сразу видели актуальную валидность.
424
533
  *
425
- * @param url Адрес скрипта.
534
+ * @param control Контрол адреса.
535
+ * @param enabled Признак, что контроль качества адреса включён.
426
536
  */
427
- loadScript$(url) {
428
- if (!this.isBrowser) {
429
- return EMPTY;
537
+ setQualityCheckEnabled(control, enabled) {
538
+ const checkEnabled = this.checkEnabledOf(control);
539
+ if (untracked(checkEnabled) === enabled) {
540
+ return;
430
541
  }
431
- return new Observable((subscriber) => {
432
- const script = this.renderer.createElement('script');
433
- let isLoaded = false;
434
- const unlistenLoad = this.renderer.listen(script, 'load', () => {
435
- isLoaded = true;
436
- subscriber.next(script);
437
- subscriber.complete();
438
- });
439
- const unlistenError = this.renderer.listen(script, 'error', () => {
440
- subscriber.error(new Error(`Failed to load script ${url}`));
441
- });
442
- this.renderer.setProperty(script, 'src', url);
443
- this.renderer.appendChild(this.document.head, script);
444
- return () => {
445
- unlistenLoad();
446
- unlistenError();
447
- if (!isLoaded) {
448
- this.removeScript(script);
449
- }
450
- };
542
+ // Вызов возможен во время отрисовки шаблона (первая подписка async pipe), где запись сигналов запрещена.
543
+ untracked(() => {
544
+ checkEnabled.set(enabled);
451
545
  });
546
+ control.updateValueAndValidity({ emitEvent: false });
547
+ }
548
+ /**
549
+ * Возвращает признак, что контроль качества адреса для контрола включён.
550
+ *
551
+ * @param control Контрол адреса.
552
+ */
553
+ isQualityCheckEnabled(control) {
554
+ return this.checkEnabledOf(control)();
555
+ }
556
+ /**
557
+ * Возвращает ошибку неполного адреса либо null, если контрол можно отправлять: контроль качества отключён,
558
+ * блокировка выключена токеном {@link SC_BLOCK_INCOMPLETE_ADDRESS} или адрес не неполный.
559
+ * Для очищенного поля сбрасывает сохранённое качество адреса.
560
+ *
561
+ * @param control Контрол адреса.
562
+ */
563
+ validate(control) {
564
+ this.resetQualityOfEmptyAddress(control);
565
+ return this.blockIncompleteAddress && this.isQualityCheckEnabled(control) && this.getQuality(control) === ScSuggestionAddressQuality.incomplete
566
+ ? { incompleteAddress: this.incompleteAddressError }
567
+ : null;
568
+ }
569
+ /**
570
+ * Возвращает текст предупреждения о необходимости проверить выбранный адрес либо null, когда предупреждение не требуется,
571
+ * в том числе для пустого и отключённого поля. Для неполного адреса при включённой блокировке отправки вместо предупреждения
572
+ * показывается ошибка валидатора {@link validator}, если он подключён к контролу.
573
+ *
574
+ * @param control Контрол адреса.
575
+ */
576
+ getWarningMessage(control) {
577
+ if (control.disabled || !this.isQualityCheckEnabled(control)) {
578
+ return null;
579
+ }
580
+ switch (this.getQuality(control)) {
581
+ case ScSuggestionAddressQuality.undetermined:
582
+ return this.warningMessage;
583
+ case ScSuggestionAddressQuality.incomplete:
584
+ return this.blockIncompleteAddress && control.hasValidator(this.validator) ? null : this.warningMessage;
585
+ default:
586
+ return null;
587
+ }
588
+ }
589
+ /**
590
+ * Возвращает сигнал состояния качества для контрола, создавая его при первом обращении.
591
+ *
592
+ * @param control Контрол адреса.
593
+ */
594
+ stateOf(control) {
595
+ let state = this.states.get(control);
596
+ if (!state) {
597
+ state = signal(null);
598
+ this.states.set(control, state);
599
+ }
600
+ return state;
452
601
  }
453
602
  /**
454
- * Удаляет скрипт со страницы. При подключённых анимациях Angular узел удаляется при ближайшей проверке изменений.
603
+ * Возвращает сигнал признака включённого контроля качества для контрола, создавая его при первом обращении.
455
604
  *
456
- * @param script Элемент скрипта.
605
+ * @param control Контрол адреса.
457
606
  */
458
- removeScript(script) {
459
- this.renderer.removeChild(script.parentNode, script);
607
+ checkEnabledOf(control) {
608
+ let checkEnabled = this.checkEnabledStates.get(control);
609
+ if (!checkEnabled) {
610
+ checkEnabled = signal(true);
611
+ this.checkEnabledStates.set(control, checkEnabled);
612
+ }
613
+ return checkEnabled;
460
614
  }
461
615
  /**
462
- * Создаёт {@link HTMLScriptElement} из строки HTML скрипта.
616
+ * Сбрасывает сохранённое качество адреса, если поле очищено.
463
617
  *
464
- * @param scriptString Строка HTML скрипта.
618
+ * @param control Контрол адреса.
465
619
  */
466
- createScript(scriptString) {
467
- const range = this.document.createRange();
468
- const fragment = range.createContextualFragment(scriptString);
469
- return fragment.querySelector('script');
620
+ resetQualityOfEmptyAddress(control) {
621
+ const state = this.states.get(control);
622
+ if (state && untracked(state) && ScAddressQualityService.isEmptyAddress(control.value)) {
623
+ // Проверка возможна во время отрисовки шаблона, где запись сигналов запрещена.
624
+ untracked(() => {
625
+ state.set(null);
626
+ });
627
+ }
470
628
  }
471
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScScriptsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
472
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScScriptsService, providedIn: 'root' }); }
629
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScAddressQualityService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
630
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScAddressQualityService, providedIn: 'root' }); }
473
631
  }
474
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScScriptsService, decorators: [{
632
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScAddressQualityService, decorators: [{
475
633
  type: Injectable,
476
634
  args: [{
477
635
  providedIn: 'root',
@@ -512,6 +670,10 @@ class ScSuggestionFieldComponent {
512
670
  * Признак, что разрешено выбирать записи ликвидированных организаций.
513
671
  */
514
672
  this.allowSelectTerminated = inject(SC_ALLOW_SELECT_TERMINATED);
673
+ /**
674
+ * Сервис-реестр качества адресов, выбранных из подсказок.
675
+ */
676
+ this.addressQualityService = inject(ScAddressQualityService);
515
677
  }
516
678
  /** @inheritDoc */
517
679
  ngOnInit() {
@@ -544,7 +706,7 @@ class ScSuggestionFieldComponent {
544
706
  break;
545
707
  case ScISuggestionType.address:
546
708
  if ('addressString' in suggestion) {
547
- this.control.control?.patchValue(suggestion.addressString, { emitEvent: false });
709
+ this.applyAddressSuggestion(suggestion);
548
710
  }
549
711
  break;
550
712
  case ScISuggestionType.bank:
@@ -558,17 +720,7 @@ class ScSuggestionFieldComponent {
558
720
  break;
559
721
  case ScISuggestionType.organization:
560
722
  if ('inn' in suggestion && !('bic' in suggestion)) {
561
- (this.control.control?.parent).patchValue({
562
- name: suggestion.name,
563
- inn: suggestion.inn,
564
- kpp: suggestion.kpp,
565
- okpo: suggestion.okpo,
566
- directorName: suggestion.directorName,
567
- directorPosition: suggestion.directorPosition,
568
- legalAddress: suggestion.legalAddress,
569
- postalAddress: suggestion.postalAddress,
570
- actualAddress: suggestion.actualAddress,
571
- }, { emitEvent: false });
723
+ this.applyOrganizationSuggestion(suggestion);
572
724
  }
573
725
  break;
574
726
  case ScISuggestionType.email:
@@ -607,6 +759,15 @@ class ScSuggestionFieldComponent {
607
759
  }
608
760
  return false;
609
761
  }
762
+ /**
763
+ * Возвращает текст пометки о качестве адреса для элемента выпадающего списка подсказок по адресу либо null, когда пометка не требуется.
764
+ * Неполный адрес и адрес с неопределённой полнотой помечаются одинаково.
765
+ *
766
+ * @param quality Качество (полнота) адреса.
767
+ */
768
+ getAddressQualityWarning(quality) {
769
+ return quality === ScSuggestionAddressQuality.incomplete || quality === ScSuggestionAddressQuality.undetermined ? 'Проверьте адрес' : null;
770
+ }
610
771
  /**
611
772
  * Проверяет прекращена ли деятельность указанной организации.
612
773
  *
@@ -616,12 +777,44 @@ class ScSuggestionFieldComponent {
616
777
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
617
778
  return suggestion.rawData?.['state']?.status === 'LIQUIDATED';
618
779
  }
780
+ /**
781
+ * Заполняет контрол строкой выбранного адреса и регистрирует качество адреса.
782
+ *
783
+ * @param suggestion Объект подсказки по адресу.
784
+ */
785
+ applyAddressSuggestion(suggestion) {
786
+ this.control.control?.patchValue(suggestion.addressString, { emitEvent: false });
787
+ if (this.control.control) {
788
+ this.addressQualityService.setQuality(this.control.control, suggestion.quality ?? null);
789
+ }
790
+ }
791
+ /**
792
+ * Заполняет поля родительской группы данными выбранной организации и регистрирует качество её адресов.
793
+ *
794
+ * @param suggestion Объект подсказки по организации.
795
+ */
796
+ applyOrganizationSuggestion(suggestion) {
797
+ const parentGroup = this.control.control?.parent;
798
+ parentGroup.patchValue({
799
+ name: suggestion.name,
800
+ inn: suggestion.inn,
801
+ kpp: suggestion.kpp,
802
+ ogrn: suggestion.ogrn ?? null,
803
+ okpo: suggestion.okpo,
804
+ directorName: suggestion.directorName,
805
+ directorPosition: suggestion.directorPosition,
806
+ legalAddress: suggestion.legalAddress,
807
+ postalAddress: suggestion.postalAddress,
808
+ actualAddress: suggestion.actualAddress,
809
+ }, { emitEvent: false });
810
+ this.addressQualityService.setOrganizationAddressQualities(parentGroup, suggestion);
811
+ }
619
812
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScSuggestionFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
620
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScSuggestionFieldComponent, isStandalone: true, selector: "sc-suggestion-field", inputs: { type: "type" }, outputs: { selectedClick: "selectedClick" }, ngImport: i0, template: "<tui-loader\n size=\"m\"\n [overlay]=\"true\"\n [loading]=\"!!(loading$ | async)\"\n>\n @let options = suggestions$ | async;\n <tui-data-list>\n @for (option of options; track option) {\n <button\n tuiOption\n (click)=\"onSelected(option)\"\n [disabled]=\"isDisabledSuggestion(option)\"\n class=\"flex-col !items-start\"\n >\n @let optionValue = $any(option);\n @switch (type) {\n @case (suggestionType.fio) {\n <span class=\"text-tui-link\">{{ optionValue.fio }}</span>\n }\n @case (suggestionType.organization) {\n <span class=\"text-tui-link\">\n {{ optionValue.name }}\n <span class=\"ml-1 text-tui-text-02\">\u0438\u043D\u043D: {{ optionValue.inn }}</span>\n @if (isOrgTerminated(optionValue)) {\n <span class=\"text-tui-negative\"> \u041B\u0438\u043A\u0432\u0438\u0434\u0438\u0440\u043E\u0432\u0430\u043D\u043E </span>\n }\n </span>\n <span class=\"text-tui-text-02\">{{ optionValue?.legalAddress }}</span>\n }\n @case (suggestionType.bank) {\n <span class=\"text-tui-link\">{{ optionValue.name }}</span>\n <span class=\"text-tui-text-02\">{{ optionValue.bic }}</span>\n }\n @case (suggestionType.email) {\n <span class=\"text-tui-link\">{{ optionValue.email }}</span>\n }\n @case (suggestionType.address) {\n <span class=\"text-tui-link\">{{ optionValue.addressString }}</span>\n }\n }\n </button>\n }\n </tui-data-list>\n</tui-loader>\n", dependencies: [{ kind: "component", type: TuiLoader, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "loading"] }, { kind: "component", type: i2.TuiDataListComponent, selector: "tui-data-list", inputs: ["emptyContent", "size"] }, { kind: "directive", type: i2.TuiOption, selector: "button[tuiOption], a[tuiOption], label[tuiOption]", inputs: ["disabled"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
813
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScSuggestionFieldComponent, isStandalone: true, selector: "sc-suggestion-field", inputs: { type: "type" }, outputs: { selectedClick: "selectedClick" }, ngImport: i0, template: "<tui-loader\n size=\"m\"\n [overlay]=\"true\"\n [loading]=\"!!(loading$ | async)\"\n>\n @let options = suggestions$ | async;\n <tui-data-list>\n @for (option of options; track option) {\n <button\n tuiOption\n (click)=\"onSelected(option)\"\n [disabled]=\"isDisabledSuggestion(option)\"\n class=\"flex-col !items-start\"\n >\n @let optionValue = $any(option);\n @switch (type) {\n @case (suggestionType.fio) {\n <span class=\"text-tui-link\">{{ optionValue.fio }}</span>\n }\n @case (suggestionType.organization) {\n <span class=\"text-tui-link\">\n {{ optionValue.name }}\n <span class=\"ml-1 text-tui-text-02\">\u0438\u043D\u043D: {{ optionValue.inn }}</span>\n @if (isOrgTerminated(optionValue)) {\n <span class=\"text-tui-negative\"> \u041B\u0438\u043A\u0432\u0438\u0434\u0438\u0440\u043E\u0432\u0430\u043D\u043E </span>\n }\n </span>\n <span class=\"text-tui-text-02\">{{ optionValue?.legalAddress }}</span>\n }\n @case (suggestionType.bank) {\n <span class=\"text-tui-link\">{{ optionValue.name }}</span>\n <span class=\"text-tui-text-02\">{{ optionValue.bic }}</span>\n }\n @case (suggestionType.email) {\n <span class=\"text-tui-link\">{{ optionValue.email }}</span>\n }\n @case (suggestionType.address) {\n <span class=\"text-tui-link\">{{ optionValue.addressString }}</span>\n @if (getAddressQualityWarning(optionValue.quality); as addressQualityWarning) {\n <span class=\"text-xs text-tui-status-warning\">{{ addressQualityWarning }}</span>\n }\n }\n }\n </button>\n }\n </tui-data-list>\n</tui-loader>\n", dependencies: [{ kind: "component", type: TuiLoader, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "loading"] }, { kind: "component", type: i2.TuiDataListComponent, selector: "tui-data-list", inputs: ["emptyContent", "size"] }, { kind: "directive", type: i2.TuiOption, selector: "button[tuiOption], a[tuiOption], label[tuiOption]", inputs: ["disabled"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
621
814
  }
622
815
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScSuggestionFieldComponent, decorators: [{
623
816
  type: Component,
624
- args: [{ selector: 'sc-suggestion-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [TuiLoader, ...TuiDataList, AsyncPipe], template: "<tui-loader\n size=\"m\"\n [overlay]=\"true\"\n [loading]=\"!!(loading$ | async)\"\n>\n @let options = suggestions$ | async;\n <tui-data-list>\n @for (option of options; track option) {\n <button\n tuiOption\n (click)=\"onSelected(option)\"\n [disabled]=\"isDisabledSuggestion(option)\"\n class=\"flex-col !items-start\"\n >\n @let optionValue = $any(option);\n @switch (type) {\n @case (suggestionType.fio) {\n <span class=\"text-tui-link\">{{ optionValue.fio }}</span>\n }\n @case (suggestionType.organization) {\n <span class=\"text-tui-link\">\n {{ optionValue.name }}\n <span class=\"ml-1 text-tui-text-02\">\u0438\u043D\u043D: {{ optionValue.inn }}</span>\n @if (isOrgTerminated(optionValue)) {\n <span class=\"text-tui-negative\"> \u041B\u0438\u043A\u0432\u0438\u0434\u0438\u0440\u043E\u0432\u0430\u043D\u043E </span>\n }\n </span>\n <span class=\"text-tui-text-02\">{{ optionValue?.legalAddress }}</span>\n }\n @case (suggestionType.bank) {\n <span class=\"text-tui-link\">{{ optionValue.name }}</span>\n <span class=\"text-tui-text-02\">{{ optionValue.bic }}</span>\n }\n @case (suggestionType.email) {\n <span class=\"text-tui-link\">{{ optionValue.email }}</span>\n }\n @case (suggestionType.address) {\n <span class=\"text-tui-link\">{{ optionValue.addressString }}</span>\n }\n }\n </button>\n }\n </tui-data-list>\n</tui-loader>\n" }]
817
+ args: [{ selector: 'sc-suggestion-field', changeDetection: ChangeDetectionStrategy.OnPush, imports: [TuiLoader, ...TuiDataList, AsyncPipe], template: "<tui-loader\n size=\"m\"\n [overlay]=\"true\"\n [loading]=\"!!(loading$ | async)\"\n>\n @let options = suggestions$ | async;\n <tui-data-list>\n @for (option of options; track option) {\n <button\n tuiOption\n (click)=\"onSelected(option)\"\n [disabled]=\"isDisabledSuggestion(option)\"\n class=\"flex-col !items-start\"\n >\n @let optionValue = $any(option);\n @switch (type) {\n @case (suggestionType.fio) {\n <span class=\"text-tui-link\">{{ optionValue.fio }}</span>\n }\n @case (suggestionType.organization) {\n <span class=\"text-tui-link\">\n {{ optionValue.name }}\n <span class=\"ml-1 text-tui-text-02\">\u0438\u043D\u043D: {{ optionValue.inn }}</span>\n @if (isOrgTerminated(optionValue)) {\n <span class=\"text-tui-negative\"> \u041B\u0438\u043A\u0432\u0438\u0434\u0438\u0440\u043E\u0432\u0430\u043D\u043E </span>\n }\n </span>\n <span class=\"text-tui-text-02\">{{ optionValue?.legalAddress }}</span>\n }\n @case (suggestionType.bank) {\n <span class=\"text-tui-link\">{{ optionValue.name }}</span>\n <span class=\"text-tui-text-02\">{{ optionValue.bic }}</span>\n }\n @case (suggestionType.email) {\n <span class=\"text-tui-link\">{{ optionValue.email }}</span>\n }\n @case (suggestionType.address) {\n <span class=\"text-tui-link\">{{ optionValue.addressString }}</span>\n @if (getAddressQualityWarning(optionValue.quality); as addressQualityWarning) {\n <span class=\"text-xs text-tui-status-warning\">{{ addressQualityWarning }}</span>\n }\n }\n }\n </button>\n }\n </tui-data-list>\n</tui-loader>\n" }]
625
818
  }], propDecorators: { type: [{
626
819
  type: Input
627
820
  }], selectedClick: [{
@@ -807,6 +1000,49 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
807
1000
  type: Output
808
1001
  }] } });
809
1002
 
1003
+ /**
1004
+ * Директива предупреждения о качестве (полноте) адреса, выбранного из подсказок, для поля с контролом формы.
1005
+ * Пока предупреждение показывается, {@link getAppearance} задаёт полю appearance предупреждения (жёлтая рамка) для `tuiTextfieldAppearance` у `tui-textfield`.
1006
+ *
1007
+ * Блокировку отправки формы с неполным адресом обеспечивает валидатор {@link ScAddressQualityService.validator},
1008
+ * подключённый к контролу адреса при его создании.
1009
+ */
1010
+ class ScAddressQualityDirective {
1011
+ constructor() {
1012
+ /**
1013
+ * Контрол поля адреса.
1014
+ */
1015
+ this.ngControl = inject(NgControl, { self: true });
1016
+ /**
1017
+ * Сервис-реестр качества адресов, выбранных из подсказок.
1018
+ */
1019
+ this.addressQualityService = inject(ScAddressQualityService);
1020
+ }
1021
+ /**
1022
+ * Возвращает текст предупреждения о необходимости проверить выбранный адрес либо null, когда предупреждение не требуется.
1023
+ */
1024
+ getWarningMessage() {
1025
+ const { control } = this.ngControl;
1026
+ return control ? this.addressQualityService.getWarningMessage(control) : null;
1027
+ }
1028
+ /**
1029
+ * Возвращает appearance поля адреса: appearance предупреждения, пока оно показывается, иначе appearance поля по умолчанию.
1030
+ */
1031
+ getAppearance() {
1032
+ return this.getWarningMessage() ? this.addressQualityService.warningAppearance : this.addressQualityService.defaultAppearance;
1033
+ }
1034
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScAddressQualityDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1035
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: ScAddressQualityDirective, isStandalone: true, selector: "[scAddressQuality]", exportAs: ["scAddressQuality"], ngImport: i0 }); }
1036
+ }
1037
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScAddressQualityDirective, decorators: [{
1038
+ type: Directive,
1039
+ args: [{
1040
+ standalone: true,
1041
+ selector: '[scAddressQuality]',
1042
+ exportAs: 'scAddressQuality',
1043
+ }]
1044
+ }] });
1045
+
810
1046
  /**
811
1047
  * Пайп для форматирования даты и времени.
812
1048
  */
@@ -1431,6 +1667,19 @@ const scKppMask = {
1431
1667
  mask: /^\d{0,9}$/,
1432
1668
  };
1433
1669
 
1670
+ /**
1671
+ * Маска поля ввода ОГРНИП индивидуального предпринимателя.
1672
+ */
1673
+ const scEntrepreneurOgrnMask = {
1674
+ mask: /^\d{0,15}$/,
1675
+ };
1676
+ /**
1677
+ * Маска поля ввода ОГРН юридического лица.
1678
+ */
1679
+ const scLegalOgrnMask = {
1680
+ mask: /^\d{0,13}$/,
1681
+ };
1682
+
1434
1683
  /**
1435
1684
  * Маска поля ввода ОКПО индивидуального предпринимателя.
1436
1685
  */
@@ -2162,6 +2411,66 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
2162
2411
  type: Output
2163
2412
  }] } });
2164
2413
 
2414
+ /* eslint-disable class-methods-use-this */
2415
+ /**
2416
+ * Преобразователь значения текстового поля, в котором очищенное поле даёт в форме null, как нетронутое.
2417
+ */
2418
+ class NullOnEmptyValueTransformer extends TuiValueTransformer {
2419
+ /**
2420
+ * Преобразует значение из формы в значение поля ввода: null становится пустой строкой.
2421
+ *
2422
+ * @param controlValue Значение из формы поля ввода.
2423
+ */
2424
+ fromControlValue(controlValue) {
2425
+ return controlValue ?? '';
2426
+ }
2427
+ /**
2428
+ * Преобразует значение поля ввода в значение формы: пустая строка становится null.
2429
+ *
2430
+ * @param componentValue Значение из компонента поля ввода.
2431
+ */
2432
+ toControlValue(componentValue) {
2433
+ return componentValue === '' ? null : componentValue;
2434
+ }
2435
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: NullOnEmptyValueTransformer, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
2436
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: NullOnEmptyValueTransformer }); }
2437
+ }
2438
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: NullOnEmptyValueTransformer, decorators: [{
2439
+ type: Injectable
2440
+ }] });
2441
+
2442
+ /**
2443
+ * Директива для замены пустой строки в значении текстового поля на null: очищенное необязательное поле не уходит в запрос.
2444
+ */
2445
+ class NullOnEmptyTransformerDirective {
2446
+ /**
2447
+ * Инициализирует экземпляр класса {@link NullOnEmptyTransformerDirective}.
2448
+ * Подменяет регистрацию обработчика изменений до подключения контрола формы, чтобы введённое значение попадало в форму через преобразователь.
2449
+ */
2450
+ constructor() {
2451
+ /**
2452
+ * Стандартный обработчик значения текстового поля, через который поле связано с контролом формы.
2453
+ */
2454
+ this.valueAccessor = inject(DefaultValueAccessor, { self: true });
2455
+ /**
2456
+ * Преобразователь значения поля ввода в значение формы.
2457
+ */
2458
+ this.transformer = new NullOnEmptyValueTransformer();
2459
+ const registerOnChange = this.valueAccessor.registerOnChange.bind(this.valueAccessor);
2460
+ this.valueAccessor.registerOnChange = (onChange) => {
2461
+ registerOnChange((value) => onChange(this.transformer.toControlValue(value)));
2462
+ };
2463
+ }
2464
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: NullOnEmptyTransformerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
2465
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.16", type: NullOnEmptyTransformerDirective, isStandalone: true, selector: "input[tuiInput][nullOnEmpty]", ngImport: i0 }); }
2466
+ }
2467
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: NullOnEmptyTransformerDirective, decorators: [{
2468
+ type: Directive,
2469
+ args: [{
2470
+ selector: 'input[tuiInput][nullOnEmpty]',
2471
+ }]
2472
+ }], ctorParameters: () => [] });
2473
+
2165
2474
  /**
2166
2475
  * Компонент формы контактного лица.
2167
2476
  */
@@ -2177,7 +2486,7 @@ class ScNewContactFormComponent {
2177
2486
  this.countries = getCountries();
2178
2487
  }
2179
2488
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScNewContactFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2180
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.16", type: ScNewContactFormComponent, isStandalone: true, selector: "sc-new-contact-form", inputs: { form: "form" }, ngImport: i0, template: "<div\n [formGroup]=\"form\"\n class=\"flex flex-col gap-3\"\n>\n <label tuiLabel>\n \u0424.\u0418.\u041E.\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n placeholder=\"\u0424.\u0418.\u041E.\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.fio\"\n />\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n\n <label tuiLabel>\n \u0422\u0435\u043B\u0435\u0444\u043E\u043D\n <tui-textfield>\n <input\n formControlName=\"phone\"\n tuiInputPhoneInternational\n [countrySearch]=\"true\"\n [countries]=\"(countries | tuiSortCountries) || []\"\n autocomplete=\"phone\"\n placeholder=\"\u0422\u0435\u043B\u0435\u0444\u043E\u043D\"\n />\n </tui-textfield>\n <tui-error formControlName=\"phone\" />\n </label>\n\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"email\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.email\"\n />\n </tui-textfield>\n <tui-error formControlName=\"email\" />\n </label>\n\n <label tuiLabel>\n \u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u043A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0433\u043E \u043B\u0438\u0446\u0430\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"position\"\n placeholder=\"\u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u043A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0433\u043E \u043B\u0438\u0446\u0430\"\n />\n </tui-textfield>\n <tui-error formControlName=\"position\" />\n </label>\n</div>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i2.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "directive", type: i2.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "invalid", "focused", "state"] }, { kind: "component", type: ScSuggestionFieldComponent, selector: "sc-suggestion-field", inputs: ["type"], outputs: ["selectedClick"] }, { kind: "component", type: i2.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i2.TuiErrorDirective, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName], tui-error[formArray]", inputs: ["order"] }, { kind: "component", type: i1$1.TuiInputPhoneInternationalComponent, selector: "input[tuiInputPhoneInternational]", inputs: ["countrySearch", "countryIsoCode", "countries"], outputs: ["countryIsoCodeChange"] }, { kind: "pipe", type: TuiSortCountriesPipe, name: "tuiSortCountries" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2489
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.16", type: ScNewContactFormComponent, isStandalone: true, selector: "sc-new-contact-form", inputs: { form: "form" }, ngImport: i0, template: "<div\n [formGroup]=\"form\"\n class=\"flex flex-col gap-3\"\n>\n <label tuiLabel>\n \u0424.\u0418.\u041E.\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n placeholder=\"\u0424.\u0418.\u041E.\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.fio\"\n />\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n\n <label tuiLabel>\n \u0422\u0435\u043B\u0435\u0444\u043E\u043D\n <tui-textfield>\n <input\n formControlName=\"phone\"\n tuiInputPhoneInternational\n [countrySearch]=\"true\"\n [countries]=\"(countries | tuiSortCountries) || []\"\n autocomplete=\"phone\"\n placeholder=\"\u0422\u0435\u043B\u0435\u0444\u043E\u043D\"\n />\n </tui-textfield>\n <tui-error formControlName=\"phone\" />\n </label>\n\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <tui-textfield>\n <input\n tuiInput\n nullOnEmpty\n formControlName=\"email\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.email\"\n />\n </tui-textfield>\n <tui-error formControlName=\"email\" />\n </label>\n\n <label tuiLabel>\n \u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u043A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0433\u043E \u043B\u0438\u0446\u0430\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"position\"\n placeholder=\"\u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u043A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0433\u043E \u043B\u0438\u0446\u0430\"\n />\n </tui-textfield>\n <tui-error formControlName=\"position\" />\n </label>\n</div>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i2.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "directive", type: i2.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "invalid", "focused", "state"] }, { kind: "directive", type: NullOnEmptyTransformerDirective, selector: "input[tuiInput][nullOnEmpty]" }, { kind: "component", type: ScSuggestionFieldComponent, selector: "sc-suggestion-field", inputs: ["type"], outputs: ["selectedClick"] }, { kind: "component", type: i2.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i2.TuiErrorDirective, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName], tui-error[formArray]", inputs: ["order"] }, { kind: "component", type: i1$1.TuiInputPhoneInternationalComponent, selector: "input[tuiInputPhoneInternational]", inputs: ["countrySearch", "countryIsoCode", "countries"], outputs: ["countryIsoCodeChange"] }, { kind: "pipe", type: TuiSortCountriesPipe, name: "tuiSortCountries" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2181
2490
  }
2182
2491
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScNewContactFormComponent, decorators: [{
2183
2492
  type: Component,
@@ -2187,6 +2496,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
2187
2496
  TuiLabel,
2188
2497
  TuiTextfield,
2189
2498
  TuiInput,
2499
+ NullOnEmptyTransformerDirective,
2190
2500
  ScSuggestionFieldComponent,
2191
2501
  TuiError,
2192
2502
  TuiObscured,
@@ -2202,7 +2512,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
2202
2512
  TuiInputPhoneInternational,
2203
2513
  AsyncPipe,
2204
2514
  TuiSortCountriesPipe,
2205
- ], template: "<div\n [formGroup]=\"form\"\n class=\"flex flex-col gap-3\"\n>\n <label tuiLabel>\n \u0424.\u0418.\u041E.\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n placeholder=\"\u0424.\u0418.\u041E.\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.fio\"\n />\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n\n <label tuiLabel>\n \u0422\u0435\u043B\u0435\u0444\u043E\u043D\n <tui-textfield>\n <input\n formControlName=\"phone\"\n tuiInputPhoneInternational\n [countrySearch]=\"true\"\n [countries]=\"(countries | tuiSortCountries) || []\"\n autocomplete=\"phone\"\n placeholder=\"\u0422\u0435\u043B\u0435\u0444\u043E\u043D\"\n />\n </tui-textfield>\n <tui-error formControlName=\"phone\" />\n </label>\n\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"email\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.email\"\n />\n </tui-textfield>\n <tui-error formControlName=\"email\" />\n </label>\n\n <label tuiLabel>\n \u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u043A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0433\u043E \u043B\u0438\u0446\u0430\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"position\"\n placeholder=\"\u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u043A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0433\u043E \u043B\u0438\u0446\u0430\"\n />\n </tui-textfield>\n <tui-error formControlName=\"position\" />\n </label>\n</div>\n" }]
2515
+ ], template: "<div\n [formGroup]=\"form\"\n class=\"flex flex-col gap-3\"\n>\n <label tuiLabel>\n \u0424.\u0418.\u041E.\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n placeholder=\"\u0424.\u0418.\u041E.\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.fio\"\n />\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n\n <label tuiLabel>\n \u0422\u0435\u043B\u0435\u0444\u043E\u043D\n <tui-textfield>\n <input\n formControlName=\"phone\"\n tuiInputPhoneInternational\n [countrySearch]=\"true\"\n [countries]=\"(countries | tuiSortCountries) || []\"\n autocomplete=\"phone\"\n placeholder=\"\u0422\u0435\u043B\u0435\u0444\u043E\u043D\"\n />\n </tui-textfield>\n <tui-error formControlName=\"phone\" />\n </label>\n\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <tui-textfield>\n <input\n tuiInput\n nullOnEmpty\n formControlName=\"email\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.email\"\n />\n </tui-textfield>\n <tui-error formControlName=\"email\" />\n </label>\n\n <label tuiLabel>\n \u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u043A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0433\u043E \u043B\u0438\u0446\u0430\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"position\"\n placeholder=\"\u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u043A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0433\u043E \u043B\u0438\u0446\u0430\"\n />\n </tui-textfield>\n <tui-error formControlName=\"position\" />\n </label>\n</div>\n" }]
2206
2516
  }], propDecorators: { form: [{
2207
2517
  type: Input
2208
2518
  }] } });
@@ -2357,7 +2667,7 @@ function scAtLeastOneRequiredValidator(fields, blockName) {
2357
2667
  };
2358
2668
  }
2359
2669
 
2360
- /* eslint-disable class-methods-use-this,@typescript-eslint/unbound-method */
2670
+ /* eslint-disable class-methods-use-this,@typescript-eslint/unbound-method,security/detect-object-injection */
2361
2671
  /**
2362
2672
  * Форма создания нового контрагента.
2363
2673
  */
@@ -2371,6 +2681,10 @@ class ScNewContragentFormComponent {
2371
2681
  * Сервис для получения списков стран, регионов, городов.
2372
2682
  */
2373
2683
  this.locationsService = inject(ScLocationsService);
2684
+ /**
2685
+ * Сервис-реестр качества адресов, выбранных из подсказок.
2686
+ */
2687
+ this.addressQualityService = inject(ScAddressQualityService);
2374
2688
  /**
2375
2689
  * Директива c `FormGroup` из DOM.
2376
2690
  */
@@ -2380,13 +2694,14 @@ class ScNewContragentFormComponent {
2380
2694
  */
2381
2695
  this.entrepreneurGroup = new FormGroup({
2382
2696
  inn: new FormControl(null, Validators.required),
2697
+ ogrn: new FormControl(null),
2383
2698
  okpo: new FormControl(null, Validators.required),
2384
2699
  directorName: new FormControl(null, Validators.required),
2385
2700
  directorPosition: new FormControl(null, Validators.required),
2386
2701
  directorActsOn: new FormControl(null, Validators.required),
2387
- legalAddress: new FormControl(null, Validators.required),
2388
- postalAddress: new FormControl(null, Validators.required),
2389
- actualAddress: new FormControl(null, Validators.required),
2702
+ legalAddress: new FormControl(null, [Validators.required, this.addressQualityService.validator]),
2703
+ postalAddress: new FormControl(null, [Validators.required, this.addressQualityService.validator]),
2704
+ actualAddress: new FormControl(null, [Validators.required, this.addressQualityService.validator]),
2390
2705
  bankAccounts: new FormArray([
2391
2706
  new FormGroup({
2392
2707
  bankName: new FormControl(null, Validators.required),
@@ -2434,6 +2749,17 @@ class ScNewContragentFormComponent {
2434
2749
  * {@link Observable} выбора ОПФ.
2435
2750
  */
2436
2751
  this.selectOpf$ = tuiControlValue(this.form.controls.opf).pipe(distinctUntilChanged(), tap((opf) => {
2752
+ const opfOrder = ScOpfList[opf];
2753
+ const innLength = opfOrder > ScOpfList.entrepreneur ? 10 : 12;
2754
+ const ogrnLength = opfOrder > ScOpfList.entrepreneur ? 13 : 15;
2755
+ const okpoLength = opfOrder > ScOpfList.entrepreneur ? 8 : 10;
2756
+ // Правила задаются до включения контролов: enable и setControl проверяют сразу.
2757
+ this.entrepreneurGroup.controls.inn.setValidators([Validators.required, Validators.minLength(innLength), Validators.maxLength(innLength)]);
2758
+ this.entrepreneurGroup.controls.ogrn.setValidators([Validators.minLength(ogrnLength), Validators.maxLength(ogrnLength)]);
2759
+ this.entrepreneurGroup.controls.okpo.setValidators([Validators.required, Validators.minLength(okpoLength), Validators.maxLength(okpoLength)]);
2760
+ [this.entrepreneurGroup.controls.legalAddress, this.entrepreneurGroup.controls.postalAddress, this.entrepreneurGroup.controls.actualAddress].forEach((addressControl) => {
2761
+ this.addressQualityService.setQualityCheckEnabled(addressControl, opfOrder !== ScOpfList.non_resident_legal);
2762
+ });
2437
2763
  Object.keys({ ...this.entrepreneurGroup.controls, ...this.legalGroup.controls, ...this.nonResidentLegalGroup.controls }).forEach((key) => {
2438
2764
  this.form.get(key)?.disable();
2439
2765
  });
@@ -2443,23 +2769,17 @@ class ScNewContragentFormComponent {
2443
2769
  this.form.setControl(key, formGroup.get(key));
2444
2770
  });
2445
2771
  };
2446
- // eslint-disable-next-line security/detect-object-injection
2447
- if (ScOpfList[opf] > ScOpfList.individual) {
2772
+ if (opfOrder > ScOpfList.individual) {
2448
2773
  addControls(this.entrepreneurGroup);
2449
- this.entrepreneurGroup.controls.inn.setValidators([Validators.required, Validators.minLength(12)]);
2450
- this.entrepreneurGroup.controls.okpo.setValidators([Validators.required, Validators.minLength(10)]);
2451
2774
  }
2452
- // eslint-disable-next-line security/detect-object-injection
2453
- if (ScOpfList[opf] > ScOpfList.entrepreneur) {
2775
+ if (opfOrder > ScOpfList.entrepreneur) {
2454
2776
  addControls(this.legalGroup);
2455
- this.entrepreneurGroup.controls.inn.setValidators([Validators.required, Validators.minLength(10)]);
2456
- this.entrepreneurGroup.controls.okpo.setValidators([Validators.required, Validators.minLength(8)]);
2457
2777
  }
2458
- // eslint-disable-next-line security/detect-object-injection
2459
- if (ScOpfList[opf] > ScOpfList.legal) {
2778
+ if (opfOrder > ScOpfList.legal) {
2460
2779
  addControls(this.nonResidentLegalGroup);
2461
2780
  this.legalGroup.controls.kpp.disable();
2462
2781
  this.entrepreneurGroup.controls.inn.disable();
2782
+ this.entrepreneurGroup.controls.ogrn.disable();
2463
2783
  this.entrepreneurGroup.controls.okpo.disable();
2464
2784
  }
2465
2785
  }));
@@ -2488,14 +2808,18 @@ class ScNewContragentFormComponent {
2488
2808
  *
2489
2809
  * @param opf Организационно-правовая форма.
2490
2810
  */
2491
- // eslint-disable-next-line security/detect-object-injection
2492
2811
  this.innMask = (opf) => (ScOpfList[opf] > ScOpfList.entrepreneur ? scLegalInnMask : scEntrepreneurInnMask);
2812
+ /**
2813
+ * Маска поля ввода ОГРН.
2814
+ *
2815
+ * @param opf Организационно-правовая форма.
2816
+ */
2817
+ this.ogrnMask = (opf) => (ScOpfList[opf] > ScOpfList.entrepreneur ? scLegalOgrnMask : scEntrepreneurOgrnMask);
2493
2818
  /**
2494
2819
  * Маска поля ввода ОКПО.
2495
2820
  *
2496
2821
  * @param opf Организационно-правовая форма.
2497
2822
  */
2498
- // eslint-disable-next-line security/detect-object-injection
2499
2823
  this.okpoMask = (opf) => (ScOpfList[opf] > ScOpfList.entrepreneur ? scLegalOkpoMask : scEntrepreneurOkpoMask);
2500
2824
  /**
2501
2825
  * Функция преобразования объекта сортировки в значение, отображаемое в поле ввода.
@@ -2553,7 +2877,7 @@ class ScNewContragentFormComponent {
2553
2877
  return this.locationsService.getCountries$().pipe(map((countries) => countries?.find((country) => country.id === countryId)?.name ?? ''));
2554
2878
  }
2555
2879
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScNewContragentFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2556
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScNewContragentFormComponent, isStandalone: true, selector: "sc-new-contragent-form", inputs: { opfControl: "opfControl" }, ngImport: i0, template: "@if (selectOpf$ | async; as selectOpf) {\n <div\n [formGroup]=\"form\"\n class=\"flex flex-col gap-3 pb-1\"\n >\n <p class=\"text-lg font-bold\">\u041E\u0431\u0449\u0438\u0435 \u0434\u0430\u043D\u043D\u044B\u0435 \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u0430</p>\n <label tuiLabel>\n \u0422\u0438\u043F \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u0430 (\u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u043E\u043D\u043D\u043E-\u043F\u0440\u0430\u0432\u043E\u0432\u0430\u044F \u0444\u043E\u0440\u043C\u0430)\n <tui-textfield\n tuiChevron\n [content]=\"opfContent\"\n >\n <input\n tuiSelect\n formControlName=\"opf\"\n [readOnly]=\"!!opfControl\"\n placeholder=\"\u0422\u0438\u043F \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u0430 (\u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u043E\u043D\u043D\u043E-\u043F\u0440\u0430\u0432\u043E\u0432\u0430\u044F \u0444\u043E\u0440\u043C\u0430)\"\n />\n <tui-data-list *tuiDropdown>\n @for (item of getOpf$() | async; track item; let index = $index) {\n <button\n tuiOption\n [value]=\"item.slug\"\n >\n {{ item.name }}\n </button>\n }\n </tui-data-list>\n </tui-textfield>\n <ng-template\n #opfContent\n let-data\n >\n <div>{{ (getOpfBySlug$(data) | async)?.name }}</div>\n </ng-template>\n <tui-error formControlName=\"opf\" />\n </label>\n @let nameLabel = opfListEnum[selectOpf] === opfListEnum.individual ? '\u0424.\u0418.\u041E.' : '\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438';\n <label tuiLabel>\n {{ nameLabel }}\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n [placeholder]=\"nameLabel\"\n />\n @if (opfListEnum[selectOpf] === opfListEnum.individual) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.fio\"\n />\n } @else if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.organization\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n @if (opfListEnum[selectOpf] > opfListEnum.individual) {\n <label tuiLabel>\n \u0418\u041D\u041D \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043B\u0438 \u0418\u041F\n <tui-textfield>\n <input\n tuiInput\n [maskito]=\"innMask(selectOpf)\"\n autocomplete=\"inn\"\n formControlName=\"inn\"\n placeholder=\"\u0418\u041D\u041D \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043B\u0438 \u0418\u041F\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.organization\"\n />\n </tui-textfield>\n <tui-error formControlName=\"inn\" />\n </label>\n @if (opfListEnum[selectOpf] === opfListEnum.legal) {\n <label tuiLabel>\n \u041A\u043E\u0434 \u041E\u041A\u041F\u041E\n <tui-textfield>\n <input\n tuiInput\n [maskito]=\"okpoMask(selectOpf)\"\n autocomplete=\"okpo\"\n formControlName=\"okpo\"\n placeholder=\"\u041A\u043E\u0434 \u041E\u041A\u041F\u041E\"\n />\n </tui-textfield>\n <tui-error formControlName=\"okpo\" />\n </label>\n }\n <label tuiLabel>\n \u0424.\u0418.\u041E. \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"directorName\"\n placeholder=\"\u0424.\u0418.\u041E. \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.fio\"\n />\n </tui-textfield>\n <tui-error formControlName=\"directorName\" />\n </label>\n <label tuiLabel>\n \u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"directorPosition\"\n placeholder=\"\u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\"\n />\n </tui-textfield>\n <tui-error formControlName=\"directorPosition\" />\n </label>\n <label tuiLabel>\n \u041E\u0441\u043D\u043E\u0432\u0430\u043D\u0438\u044F \u043F\u043E\u043B\u043D\u043E\u043C\u043E\u0447\u0438\u0439 \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"directorActsOn\"\n placeholder=\"\u041E\u0441\u043D\u043E\u0432\u0430\u043D\u0438\u044F \u043F\u043E\u043B\u043D\u043E\u043C\u043E\u0447\u0438\u0439 \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\"\n />\n </tui-textfield>\n <tui-error formControlName=\"directorActsOn\" />\n </label>\n <label tuiLabel>\n \u042E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"legalAddress\"\n placeholder=\"\u042E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\"\n />\n @if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.address\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"legalAddress\" />\n </label>\n <label tuiLabel>\n \u041F\u043E\u0447\u0442\u043E\u0432\u044B\u0439 \u0430\u0434\u0440\u0435\u0441\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"postalAddress\"\n placeholder=\"\u041F\u043E\u0447\u0442\u043E\u0432\u044B\u0439 \u0430\u0434\u0440\u0435\u0441\"\n />\n @if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.address\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"postalAddress\" />\n </label>\n <label tuiLabel>\n \u0424\u0430\u043A\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"actualAddress\"\n placeholder=\"\u0424\u0430\u043A\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\"\n />\n @if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.address\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"actualAddress\" />\n </label>\n @if (opfListEnum[selectOpf] === opfListEnum.legal) {\n <label tuiLabel>\n \u041A\u041F\u041F \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438\n <tui-textfield>\n <input\n tuiInput\n [maskito]=\"kppMask\"\n autocomplete=\"kpp\"\n formControlName=\"kpp\"\n placeholder=\"\u041A\u041F\u041F \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438\"\n />\n </tui-textfield>\n <tui-error formControlName=\"kpp\" />\n </label>\n }\n }\n @if (opfListEnum[selectOpf] === opfListEnum.non_resident_legal) {\n @let countries = countries$ | async;\n @let countriesId = countriesId$ | async;\n @if (countries) {\n <label tuiLabel>\n \u0421\u0442\u0440\u0430\u043D\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\n <tui-textfield [stringify]=\"stringify(countries ?? [])\">\n <input\n tuiComboBox\n formControlName=\"registrationCountryId\"\n autocapitalize=\"off\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n placeholder=\"\u0421\u0442\u0440\u0430\u043D\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\"\n />\n <tui-data-list-wrapper\n *tuiDropdown\n [itemContent]=\"stringify(countries ?? []) | tuiStringifyContent\"\n [items]=\"countriesId | tuiFilterByInput\"\n />\n </tui-textfield>\n <ng-template\n #CountryContent\n let-data\n >\n <div>{{ (getCountryNameById$(data) | async) ?? '' }}</div>\n </ng-template>\n <tui-error formControlName=\"registrationCountryId\" />\n </label>\n }\n <ng-template #selectLoading> <tui-loader /> </ng-template>\n <label tuiLabel>\n \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u043E\u043D\u043D\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"registrationNumber\"\n placeholder=\"\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u043E\u043D\u043D\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\"\n />\n </tui-textfield>\n <tui-error formControlName=\"registrationNumber\" />\n </label>\n <label tuiLabel>\n \u041D\u0430\u043B\u043E\u0433\u043E\u0432\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"taxNumber\"\n placeholder=\"\u041D\u0430\u043B\u043E\u0433\u043E\u0432\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\"\n />\n </tui-textfield>\n <tui-error formControlName=\"taxNumber\" />\n </label>\n }\n </div>\n}\n", styles: ["tui-carousel{--tui-carousel-padding: .5rem}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i2.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "directive", type: i1$1.TuiSelectDirective, selector: "input[tuiSelect]" }, { kind: "directive", type: TuiChevron, selector: "[tuiChevron]", inputs: ["tuiChevron"] }, { kind: "component", type: i2.TuiDataListComponent, selector: "tui-data-list", inputs: ["emptyContent", "size"] }, { kind: "directive", type: i2.TuiOption, selector: "button[tuiOption], a[tuiOption], label[tuiOption]", inputs: ["disabled"] }, { kind: "directive", type: i2.TuiOptionWithValue, selector: "button[tuiOption][value], a[tuiOption][value], label[tuiOption][value]", inputs: ["disabled", "value"] }, { kind: "component", type: i2.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i2.TuiErrorDirective, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName], tui-error[formArray]", inputs: ["order"] }, { kind: "directive", type: i2.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "invalid", "focused", "state"] }, { kind: "component", type: ScSuggestionFieldComponent, selector: "sc-suggestion-field", inputs: ["type"], outputs: ["selectedClick"] }, { kind: "directive", type: MaskitoDirective, selector: "[maskito]", inputs: ["maskito", "maskitoElement"], outputs: ["maskitoChange", "maskitoElementChange"] }, { kind: "directive", type: i1$1.TuiComboBoxDirective, selector: "input[tuiComboBox]", inputs: ["strict", "matcher"] }, { kind: "component", type: TuiDataListWrapperComponent, selector: "tui-data-list-wrapper:not([labels])", inputs: ["items", "emptyContent", "size", "itemContent"], outputs: ["itemClick"] }, { kind: "component", type: TuiLoader, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "loading"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: TuiStringifyContentPipe, name: "tuiStringifyContent" }, { kind: "pipe", type: TuiFilterByInputPipe, name: "tuiFilterByInput" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2880
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScNewContragentFormComponent, isStandalone: true, selector: "sc-new-contragent-form", inputs: { opfControl: "opfControl" }, ngImport: i0, template: "@if (selectOpf$ | async; as selectOpf) {\n <div\n [formGroup]=\"form\"\n class=\"flex flex-col gap-3 pb-1\"\n >\n <p class=\"text-lg font-bold\">\u041E\u0431\u0449\u0438\u0435 \u0434\u0430\u043D\u043D\u044B\u0435 \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u0430</p>\n <label tuiLabel>\n \u0422\u0438\u043F \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u0430 (\u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u043E\u043D\u043D\u043E-\u043F\u0440\u0430\u0432\u043E\u0432\u0430\u044F \u0444\u043E\u0440\u043C\u0430)\n <tui-textfield\n tuiChevron\n [content]=\"opfContent\"\n >\n <input\n tuiSelect\n formControlName=\"opf\"\n [readOnly]=\"!!opfControl\"\n placeholder=\"\u0422\u0438\u043F \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u0430 (\u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u043E\u043D\u043D\u043E-\u043F\u0440\u0430\u0432\u043E\u0432\u0430\u044F \u0444\u043E\u0440\u043C\u0430)\"\n />\n <tui-data-list *tuiDropdown>\n @for (item of getOpf$() | async; track item; let index = $index) {\n <button\n tuiOption\n [value]=\"item.slug\"\n >\n {{ item.name }}\n </button>\n }\n </tui-data-list>\n </tui-textfield>\n <ng-template\n #opfContent\n let-data\n >\n <div>{{ (getOpfBySlug$(data) | async)?.name }}</div>\n </ng-template>\n <tui-error formControlName=\"opf\" />\n </label>\n @let nameLabel = opfListEnum[selectOpf] === opfListEnum.individual ? '\u0424.\u0418.\u041E.' : '\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438';\n <label tuiLabel>\n {{ nameLabel }}\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n [placeholder]=\"nameLabel\"\n />\n @if (opfListEnum[selectOpf] === opfListEnum.individual) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.fio\"\n />\n } @else if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.organization\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n @if (opfListEnum[selectOpf] > opfListEnum.individual) {\n <label tuiLabel>\n \u0418\u041D\u041D \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043B\u0438 \u0418\u041F\n <tui-textfield>\n <input\n tuiInput\n [maskito]=\"innMask(selectOpf)\"\n autocomplete=\"inn\"\n formControlName=\"inn\"\n placeholder=\"\u0418\u041D\u041D \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043B\u0438 \u0418\u041F\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.organization\"\n />\n </tui-textfield>\n <tui-error formControlName=\"inn\" />\n </label>\n @if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n @let ogrnLabel = opfListEnum[selectOpf] === opfListEnum.entrepreneur ? '\u041E\u0413\u0420\u041D\u0418\u041F' : '\u041E\u0413\u0420\u041D \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438';\n <label tuiLabel>\n {{ ogrnLabel }}\n <tui-textfield>\n <input\n tuiInput\n nullOnEmpty\n [maskito]=\"ogrnMask(selectOpf)\"\n autocomplete=\"ogrn\"\n formControlName=\"ogrn\"\n [placeholder]=\"ogrnLabel\"\n />\n </tui-textfield>\n <tui-error formControlName=\"ogrn\" />\n </label>\n <label tuiLabel>\n \u041A\u043E\u0434 \u041E\u041A\u041F\u041E\n <tui-textfield>\n <input\n tuiInput\n [maskito]=\"okpoMask(selectOpf)\"\n autocomplete=\"okpo\"\n formControlName=\"okpo\"\n placeholder=\"\u041A\u043E\u0434 \u041E\u041A\u041F\u041E\"\n />\n </tui-textfield>\n <tui-error formControlName=\"okpo\" />\n </label>\n }\n <label tuiLabel>\n \u0424.\u0418.\u041E. \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"directorName\"\n placeholder=\"\u0424.\u0418.\u041E. \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.fio\"\n />\n </tui-textfield>\n <tui-error formControlName=\"directorName\" />\n </label>\n <label tuiLabel>\n \u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"directorPosition\"\n placeholder=\"\u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\"\n />\n </tui-textfield>\n <tui-error formControlName=\"directorPosition\" />\n </label>\n <label tuiLabel>\n \u041E\u0441\u043D\u043E\u0432\u0430\u043D\u0438\u044F \u043F\u043E\u043B\u043D\u043E\u043C\u043E\u0447\u0438\u0439 \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"directorActsOn\"\n placeholder=\"\u041E\u0441\u043D\u043E\u0432\u0430\u043D\u0438\u044F \u043F\u043E\u043B\u043D\u043E\u043C\u043E\u0447\u0438\u0439 \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\"\n />\n </tui-textfield>\n <tui-error formControlName=\"directorActsOn\" />\n </label>\n <label tuiLabel>\n \u042E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\n <tui-textfield [tuiTextfieldAppearance]=\"legalAddressQuality.getAppearance()\">\n <input\n tuiInput\n scAddressQuality\n #legalAddressQuality=\"scAddressQuality\"\n formControlName=\"legalAddress\"\n placeholder=\"\u042E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\"\n />\n @if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.address\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"legalAddress\" />\n @if (legalAddressQuality.getWarningMessage(); as addressQualityWarning) {\n <p class=\"text-xs text-tui-status-warning\">{{ addressQualityWarning }}</p>\n }\n </label>\n <label tuiLabel>\n \u041F\u043E\u0447\u0442\u043E\u0432\u044B\u0439 \u0430\u0434\u0440\u0435\u0441\n <tui-textfield [tuiTextfieldAppearance]=\"postalAddressQuality.getAppearance()\">\n <input\n tuiInput\n scAddressQuality\n #postalAddressQuality=\"scAddressQuality\"\n formControlName=\"postalAddress\"\n placeholder=\"\u041F\u043E\u0447\u0442\u043E\u0432\u044B\u0439 \u0430\u0434\u0440\u0435\u0441\"\n />\n @if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.address\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"postalAddress\" />\n @if (postalAddressQuality.getWarningMessage(); as addressQualityWarning) {\n <p class=\"text-xs text-tui-status-warning\">{{ addressQualityWarning }}</p>\n }\n </label>\n <label tuiLabel>\n \u0424\u0430\u043A\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\n <tui-textfield [tuiTextfieldAppearance]=\"actualAddressQuality.getAppearance()\">\n <input\n tuiInput\n scAddressQuality\n #actualAddressQuality=\"scAddressQuality\"\n formControlName=\"actualAddress\"\n placeholder=\"\u0424\u0430\u043A\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\"\n />\n @if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.address\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"actualAddress\" />\n @if (actualAddressQuality.getWarningMessage(); as addressQualityWarning) {\n <p class=\"text-xs text-tui-status-warning\">{{ addressQualityWarning }}</p>\n }\n </label>\n @if (opfListEnum[selectOpf] === opfListEnum.legal) {\n <label tuiLabel>\n \u041A\u041F\u041F \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438\n <tui-textfield>\n <input\n tuiInput\n [maskito]=\"kppMask\"\n autocomplete=\"kpp\"\n formControlName=\"kpp\"\n placeholder=\"\u041A\u041F\u041F \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438\"\n />\n </tui-textfield>\n <tui-error formControlName=\"kpp\" />\n </label>\n }\n }\n @if (opfListEnum[selectOpf] === opfListEnum.non_resident_legal) {\n @let countries = countries$ | async;\n @let countriesId = countriesId$ | async;\n @if (countries) {\n <label tuiLabel>\n \u0421\u0442\u0440\u0430\u043D\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\n <tui-textfield [stringify]=\"stringify(countries ?? [])\">\n <input\n tuiComboBox\n formControlName=\"registrationCountryId\"\n autocapitalize=\"off\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n placeholder=\"\u0421\u0442\u0440\u0430\u043D\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\"\n />\n <tui-data-list-wrapper\n *tuiDropdown\n [itemContent]=\"stringify(countries ?? []) | tuiStringifyContent\"\n [items]=\"countriesId | tuiFilterByInput\"\n />\n </tui-textfield>\n <ng-template\n #CountryContent\n let-data\n >\n <div>{{ (getCountryNameById$(data) | async) ?? '' }}</div>\n </ng-template>\n <tui-error formControlName=\"registrationCountryId\" />\n </label>\n }\n <ng-template #selectLoading> <tui-loader /> </ng-template>\n <label tuiLabel>\n \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u043E\u043D\u043D\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"registrationNumber\"\n placeholder=\"\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u043E\u043D\u043D\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\"\n />\n </tui-textfield>\n <tui-error formControlName=\"registrationNumber\" />\n </label>\n <label tuiLabel>\n \u041D\u0430\u043B\u043E\u0433\u043E\u0432\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\n <tui-textfield>\n <input\n tuiInput\n nullOnEmpty\n formControlName=\"taxNumber\"\n placeholder=\"\u041D\u0430\u043B\u043E\u0433\u043E\u0432\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\"\n />\n </tui-textfield>\n <tui-error formControlName=\"taxNumber\" />\n </label>\n }\n </div>\n}\n", styles: ["tui-carousel{--tui-carousel-padding: .5rem}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i2.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i2.TuiTextfieldOptionsDirective, selector: "[tuiTextfieldAppearance],[tuiTextfieldSize],[tuiTextfieldCleaner]", inputs: ["tuiTextfieldAppearance", "tuiTextfieldSize", "tuiTextfieldCleaner"] }, { kind: "directive", type: i3.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "directive", type: i1$1.TuiSelectDirective, selector: "input[tuiSelect]" }, { kind: "directive", type: TuiChevron, selector: "[tuiChevron]", inputs: ["tuiChevron"] }, { kind: "component", type: i2.TuiDataListComponent, selector: "tui-data-list", inputs: ["emptyContent", "size"] }, { kind: "directive", type: i2.TuiOption, selector: "button[tuiOption], a[tuiOption], label[tuiOption]", inputs: ["disabled"] }, { kind: "directive", type: i2.TuiOptionWithValue, selector: "button[tuiOption][value], a[tuiOption][value], label[tuiOption][value]", inputs: ["disabled", "value"] }, { kind: "component", type: i2.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i2.TuiErrorDirective, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName], tui-error[formArray]", inputs: ["order"] }, { kind: "directive", type: i2.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "invalid", "focused", "state"] }, { kind: "component", type: ScSuggestionFieldComponent, selector: "sc-suggestion-field", inputs: ["type"], outputs: ["selectedClick"] }, { kind: "directive", type: ScAddressQualityDirective, selector: "[scAddressQuality]", exportAs: ["scAddressQuality"] }, { kind: "directive", type: NullOnEmptyTransformerDirective, selector: "input[tuiInput][nullOnEmpty]" }, { kind: "directive", type: MaskitoDirective, selector: "[maskito]", inputs: ["maskito", "maskitoElement"], outputs: ["maskitoChange", "maskitoElementChange"] }, { kind: "directive", type: i1$1.TuiComboBoxDirective, selector: "input[tuiComboBox]", inputs: ["strict", "matcher"] }, { kind: "component", type: TuiDataListWrapperComponent, selector: "tui-data-list-wrapper:not([labels])", inputs: ["items", "emptyContent", "size", "itemContent"], outputs: ["itemClick"] }, { kind: "component", type: TuiLoader, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "loading"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: TuiStringifyContentPipe, name: "tuiStringifyContent" }, { kind: "pipe", type: TuiFilterByInputPipe, name: "tuiFilterByInput" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2557
2881
  }
2558
2882
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScNewContragentFormComponent, decorators: [{
2559
2883
  type: Component,
@@ -2569,6 +2893,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
2569
2893
  TuiError,
2570
2894
  TuiInput,
2571
2895
  ScSuggestionFieldComponent,
2896
+ ScAddressQualityDirective,
2897
+ NullOnEmptyTransformerDirective,
2572
2898
  MaskitoDirective,
2573
2899
  TuiComboBox,
2574
2900
  TuiDataListWrapperComponent,
@@ -2576,7 +2902,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
2576
2902
  AsyncPipe,
2577
2903
  TuiStringifyContentPipe,
2578
2904
  TuiFilterByInputPipe,
2579
- ], template: "@if (selectOpf$ | async; as selectOpf) {\n <div\n [formGroup]=\"form\"\n class=\"flex flex-col gap-3 pb-1\"\n >\n <p class=\"text-lg font-bold\">\u041E\u0431\u0449\u0438\u0435 \u0434\u0430\u043D\u043D\u044B\u0435 \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u0430</p>\n <label tuiLabel>\n \u0422\u0438\u043F \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u0430 (\u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u043E\u043D\u043D\u043E-\u043F\u0440\u0430\u0432\u043E\u0432\u0430\u044F \u0444\u043E\u0440\u043C\u0430)\n <tui-textfield\n tuiChevron\n [content]=\"opfContent\"\n >\n <input\n tuiSelect\n formControlName=\"opf\"\n [readOnly]=\"!!opfControl\"\n placeholder=\"\u0422\u0438\u043F \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u0430 (\u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u043E\u043D\u043D\u043E-\u043F\u0440\u0430\u0432\u043E\u0432\u0430\u044F \u0444\u043E\u0440\u043C\u0430)\"\n />\n <tui-data-list *tuiDropdown>\n @for (item of getOpf$() | async; track item; let index = $index) {\n <button\n tuiOption\n [value]=\"item.slug\"\n >\n {{ item.name }}\n </button>\n }\n </tui-data-list>\n </tui-textfield>\n <ng-template\n #opfContent\n let-data\n >\n <div>{{ (getOpfBySlug$(data) | async)?.name }}</div>\n </ng-template>\n <tui-error formControlName=\"opf\" />\n </label>\n @let nameLabel = opfListEnum[selectOpf] === opfListEnum.individual ? '\u0424.\u0418.\u041E.' : '\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438';\n <label tuiLabel>\n {{ nameLabel }}\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n [placeholder]=\"nameLabel\"\n />\n @if (opfListEnum[selectOpf] === opfListEnum.individual) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.fio\"\n />\n } @else if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.organization\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n @if (opfListEnum[selectOpf] > opfListEnum.individual) {\n <label tuiLabel>\n \u0418\u041D\u041D \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043B\u0438 \u0418\u041F\n <tui-textfield>\n <input\n tuiInput\n [maskito]=\"innMask(selectOpf)\"\n autocomplete=\"inn\"\n formControlName=\"inn\"\n placeholder=\"\u0418\u041D\u041D \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043B\u0438 \u0418\u041F\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.organization\"\n />\n </tui-textfield>\n <tui-error formControlName=\"inn\" />\n </label>\n @if (opfListEnum[selectOpf] === opfListEnum.legal) {\n <label tuiLabel>\n \u041A\u043E\u0434 \u041E\u041A\u041F\u041E\n <tui-textfield>\n <input\n tuiInput\n [maskito]=\"okpoMask(selectOpf)\"\n autocomplete=\"okpo\"\n formControlName=\"okpo\"\n placeholder=\"\u041A\u043E\u0434 \u041E\u041A\u041F\u041E\"\n />\n </tui-textfield>\n <tui-error formControlName=\"okpo\" />\n </label>\n }\n <label tuiLabel>\n \u0424.\u0418.\u041E. \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"directorName\"\n placeholder=\"\u0424.\u0418.\u041E. \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.fio\"\n />\n </tui-textfield>\n <tui-error formControlName=\"directorName\" />\n </label>\n <label tuiLabel>\n \u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"directorPosition\"\n placeholder=\"\u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\"\n />\n </tui-textfield>\n <tui-error formControlName=\"directorPosition\" />\n </label>\n <label tuiLabel>\n \u041E\u0441\u043D\u043E\u0432\u0430\u043D\u0438\u044F \u043F\u043E\u043B\u043D\u043E\u043C\u043E\u0447\u0438\u0439 \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"directorActsOn\"\n placeholder=\"\u041E\u0441\u043D\u043E\u0432\u0430\u043D\u0438\u044F \u043F\u043E\u043B\u043D\u043E\u043C\u043E\u0447\u0438\u0439 \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\"\n />\n </tui-textfield>\n <tui-error formControlName=\"directorActsOn\" />\n </label>\n <label tuiLabel>\n \u042E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"legalAddress\"\n placeholder=\"\u042E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\"\n />\n @if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.address\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"legalAddress\" />\n </label>\n <label tuiLabel>\n \u041F\u043E\u0447\u0442\u043E\u0432\u044B\u0439 \u0430\u0434\u0440\u0435\u0441\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"postalAddress\"\n placeholder=\"\u041F\u043E\u0447\u0442\u043E\u0432\u044B\u0439 \u0430\u0434\u0440\u0435\u0441\"\n />\n @if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.address\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"postalAddress\" />\n </label>\n <label tuiLabel>\n \u0424\u0430\u043A\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"actualAddress\"\n placeholder=\"\u0424\u0430\u043A\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\"\n />\n @if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.address\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"actualAddress\" />\n </label>\n @if (opfListEnum[selectOpf] === opfListEnum.legal) {\n <label tuiLabel>\n \u041A\u041F\u041F \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438\n <tui-textfield>\n <input\n tuiInput\n [maskito]=\"kppMask\"\n autocomplete=\"kpp\"\n formControlName=\"kpp\"\n placeholder=\"\u041A\u041F\u041F \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438\"\n />\n </tui-textfield>\n <tui-error formControlName=\"kpp\" />\n </label>\n }\n }\n @if (opfListEnum[selectOpf] === opfListEnum.non_resident_legal) {\n @let countries = countries$ | async;\n @let countriesId = countriesId$ | async;\n @if (countries) {\n <label tuiLabel>\n \u0421\u0442\u0440\u0430\u043D\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\n <tui-textfield [stringify]=\"stringify(countries ?? [])\">\n <input\n tuiComboBox\n formControlName=\"registrationCountryId\"\n autocapitalize=\"off\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n placeholder=\"\u0421\u0442\u0440\u0430\u043D\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\"\n />\n <tui-data-list-wrapper\n *tuiDropdown\n [itemContent]=\"stringify(countries ?? []) | tuiStringifyContent\"\n [items]=\"countriesId | tuiFilterByInput\"\n />\n </tui-textfield>\n <ng-template\n #CountryContent\n let-data\n >\n <div>{{ (getCountryNameById$(data) | async) ?? '' }}</div>\n </ng-template>\n <tui-error formControlName=\"registrationCountryId\" />\n </label>\n }\n <ng-template #selectLoading> <tui-loader /> </ng-template>\n <label tuiLabel>\n \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u043E\u043D\u043D\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"registrationNumber\"\n placeholder=\"\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u043E\u043D\u043D\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\"\n />\n </tui-textfield>\n <tui-error formControlName=\"registrationNumber\" />\n </label>\n <label tuiLabel>\n \u041D\u0430\u043B\u043E\u0433\u043E\u0432\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"taxNumber\"\n placeholder=\"\u041D\u0430\u043B\u043E\u0433\u043E\u0432\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\"\n />\n </tui-textfield>\n <tui-error formControlName=\"taxNumber\" />\n </label>\n }\n </div>\n}\n", styles: ["tui-carousel{--tui-carousel-padding: .5rem}\n"] }]
2905
+ ], template: "@if (selectOpf$ | async; as selectOpf) {\n <div\n [formGroup]=\"form\"\n class=\"flex flex-col gap-3 pb-1\"\n >\n <p class=\"text-lg font-bold\">\u041E\u0431\u0449\u0438\u0435 \u0434\u0430\u043D\u043D\u044B\u0435 \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u0430</p>\n <label tuiLabel>\n \u0422\u0438\u043F \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u0430 (\u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u043E\u043D\u043D\u043E-\u043F\u0440\u0430\u0432\u043E\u0432\u0430\u044F \u0444\u043E\u0440\u043C\u0430)\n <tui-textfield\n tuiChevron\n [content]=\"opfContent\"\n >\n <input\n tuiSelect\n formControlName=\"opf\"\n [readOnly]=\"!!opfControl\"\n placeholder=\"\u0422\u0438\u043F \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u0430 (\u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u043E\u043D\u043D\u043E-\u043F\u0440\u0430\u0432\u043E\u0432\u0430\u044F \u0444\u043E\u0440\u043C\u0430)\"\n />\n <tui-data-list *tuiDropdown>\n @for (item of getOpf$() | async; track item; let index = $index) {\n <button\n tuiOption\n [value]=\"item.slug\"\n >\n {{ item.name }}\n </button>\n }\n </tui-data-list>\n </tui-textfield>\n <ng-template\n #opfContent\n let-data\n >\n <div>{{ (getOpfBySlug$(data) | async)?.name }}</div>\n </ng-template>\n <tui-error formControlName=\"opf\" />\n </label>\n @let nameLabel = opfListEnum[selectOpf] === opfListEnum.individual ? '\u0424.\u0418.\u041E.' : '\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438';\n <label tuiLabel>\n {{ nameLabel }}\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n [placeholder]=\"nameLabel\"\n />\n @if (opfListEnum[selectOpf] === opfListEnum.individual) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.fio\"\n />\n } @else if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.organization\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n @if (opfListEnum[selectOpf] > opfListEnum.individual) {\n <label tuiLabel>\n \u0418\u041D\u041D \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043B\u0438 \u0418\u041F\n <tui-textfield>\n <input\n tuiInput\n [maskito]=\"innMask(selectOpf)\"\n autocomplete=\"inn\"\n formControlName=\"inn\"\n placeholder=\"\u0418\u041D\u041D \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043B\u0438 \u0418\u041F\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.organization\"\n />\n </tui-textfield>\n <tui-error formControlName=\"inn\" />\n </label>\n @if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n @let ogrnLabel = opfListEnum[selectOpf] === opfListEnum.entrepreneur ? '\u041E\u0413\u0420\u041D\u0418\u041F' : '\u041E\u0413\u0420\u041D \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438';\n <label tuiLabel>\n {{ ogrnLabel }}\n <tui-textfield>\n <input\n tuiInput\n nullOnEmpty\n [maskito]=\"ogrnMask(selectOpf)\"\n autocomplete=\"ogrn\"\n formControlName=\"ogrn\"\n [placeholder]=\"ogrnLabel\"\n />\n </tui-textfield>\n <tui-error formControlName=\"ogrn\" />\n </label>\n <label tuiLabel>\n \u041A\u043E\u0434 \u041E\u041A\u041F\u041E\n <tui-textfield>\n <input\n tuiInput\n [maskito]=\"okpoMask(selectOpf)\"\n autocomplete=\"okpo\"\n formControlName=\"okpo\"\n placeholder=\"\u041A\u043E\u0434 \u041E\u041A\u041F\u041E\"\n />\n </tui-textfield>\n <tui-error formControlName=\"okpo\" />\n </label>\n }\n <label tuiLabel>\n \u0424.\u0418.\u041E. \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"directorName\"\n placeholder=\"\u0424.\u0418.\u041E. \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.fio\"\n />\n </tui-textfield>\n <tui-error formControlName=\"directorName\" />\n </label>\n <label tuiLabel>\n \u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"directorPosition\"\n placeholder=\"\u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\"\n />\n </tui-textfield>\n <tui-error formControlName=\"directorPosition\" />\n </label>\n <label tuiLabel>\n \u041E\u0441\u043D\u043E\u0432\u0430\u043D\u0438\u044F \u043F\u043E\u043B\u043D\u043E\u043C\u043E\u0447\u0438\u0439 \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"directorActsOn\"\n placeholder=\"\u041E\u0441\u043D\u043E\u0432\u0430\u043D\u0438\u044F \u043F\u043E\u043B\u043D\u043E\u043C\u043E\u0447\u0438\u0439 \u0440\u0443\u043A\u043E\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F\"\n />\n </tui-textfield>\n <tui-error formControlName=\"directorActsOn\" />\n </label>\n <label tuiLabel>\n \u042E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\n <tui-textfield [tuiTextfieldAppearance]=\"legalAddressQuality.getAppearance()\">\n <input\n tuiInput\n scAddressQuality\n #legalAddressQuality=\"scAddressQuality\"\n formControlName=\"legalAddress\"\n placeholder=\"\u042E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\"\n />\n @if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.address\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"legalAddress\" />\n @if (legalAddressQuality.getWarningMessage(); as addressQualityWarning) {\n <p class=\"text-xs text-tui-status-warning\">{{ addressQualityWarning }}</p>\n }\n </label>\n <label tuiLabel>\n \u041F\u043E\u0447\u0442\u043E\u0432\u044B\u0439 \u0430\u0434\u0440\u0435\u0441\n <tui-textfield [tuiTextfieldAppearance]=\"postalAddressQuality.getAppearance()\">\n <input\n tuiInput\n scAddressQuality\n #postalAddressQuality=\"scAddressQuality\"\n formControlName=\"postalAddress\"\n placeholder=\"\u041F\u043E\u0447\u0442\u043E\u0432\u044B\u0439 \u0430\u0434\u0440\u0435\u0441\"\n />\n @if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.address\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"postalAddress\" />\n @if (postalAddressQuality.getWarningMessage(); as addressQualityWarning) {\n <p class=\"text-xs text-tui-status-warning\">{{ addressQualityWarning }}</p>\n }\n </label>\n <label tuiLabel>\n \u0424\u0430\u043A\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\n <tui-textfield [tuiTextfieldAppearance]=\"actualAddressQuality.getAppearance()\">\n <input\n tuiInput\n scAddressQuality\n #actualAddressQuality=\"scAddressQuality\"\n formControlName=\"actualAddress\"\n placeholder=\"\u0424\u0430\u043A\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0430\u0434\u0440\u0435\u0441\"\n />\n @if (opfListEnum[selectOpf] !== opfListEnum.non_resident_legal) {\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.address\"\n />\n }\n </tui-textfield>\n <tui-error formControlName=\"actualAddress\" />\n @if (actualAddressQuality.getWarningMessage(); as addressQualityWarning) {\n <p class=\"text-xs text-tui-status-warning\">{{ addressQualityWarning }}</p>\n }\n </label>\n @if (opfListEnum[selectOpf] === opfListEnum.legal) {\n <label tuiLabel>\n \u041A\u041F\u041F \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438\n <tui-textfield>\n <input\n tuiInput\n [maskito]=\"kppMask\"\n autocomplete=\"kpp\"\n formControlName=\"kpp\"\n placeholder=\"\u041A\u041F\u041F \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438\"\n />\n </tui-textfield>\n <tui-error formControlName=\"kpp\" />\n </label>\n }\n }\n @if (opfListEnum[selectOpf] === opfListEnum.non_resident_legal) {\n @let countries = countries$ | async;\n @let countriesId = countriesId$ | async;\n @if (countries) {\n <label tuiLabel>\n \u0421\u0442\u0440\u0430\u043D\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\n <tui-textfield [stringify]=\"stringify(countries ?? [])\">\n <input\n tuiComboBox\n formControlName=\"registrationCountryId\"\n autocapitalize=\"off\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n placeholder=\"\u0421\u0442\u0440\u0430\u043D\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\"\n />\n <tui-data-list-wrapper\n *tuiDropdown\n [itemContent]=\"stringify(countries ?? []) | tuiStringifyContent\"\n [items]=\"countriesId | tuiFilterByInput\"\n />\n </tui-textfield>\n <ng-template\n #CountryContent\n let-data\n >\n <div>{{ (getCountryNameById$(data) | async) ?? '' }}</div>\n </ng-template>\n <tui-error formControlName=\"registrationCountryId\" />\n </label>\n }\n <ng-template #selectLoading> <tui-loader /> </ng-template>\n <label tuiLabel>\n \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u043E\u043D\u043D\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"registrationNumber\"\n placeholder=\"\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u043E\u043D\u043D\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\"\n />\n </tui-textfield>\n <tui-error formControlName=\"registrationNumber\" />\n </label>\n <label tuiLabel>\n \u041D\u0430\u043B\u043E\u0433\u043E\u0432\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\n <tui-textfield>\n <input\n tuiInput\n nullOnEmpty\n formControlName=\"taxNumber\"\n placeholder=\"\u041D\u0430\u043B\u043E\u0433\u043E\u0432\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u043B\u0438\u0446\u0430\"\n />\n </tui-textfield>\n <tui-error formControlName=\"taxNumber\" />\n </label>\n }\n </div>\n}\n", styles: ["tui-carousel{--tui-carousel-padding: .5rem}\n"] }]
2580
2906
  }], propDecorators: { opfControl: [{
2581
2907
  type: Input
2582
2908
  }] } });
@@ -2588,6 +2914,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
2588
2914
  class ScAddressesSelectionFieldComponent {
2589
2915
  /**
2590
2916
  * Инициализирует экземпляр класса {@link ScAddressesSelectionFieldComponent}.
2917
+ * Включение выбора страны сохраняет выбранные страну, регион и город. При выключении выбора страна
2918
+ * фиксируется на текущей стране системы, поэтому регион и город сбрасываются, только если была выбрана другая страна.
2591
2919
  */
2592
2920
  constructor() {
2593
2921
  /**
@@ -2645,10 +2973,7 @@ class ScAddressesSelectionFieldComponent {
2645
2973
  */
2646
2974
  this.stringify = (item) => item.name;
2647
2975
  effect(() => {
2648
- if (this.canSelectCountry()) {
2649
- this.countryControl.setValue(null);
2650
- }
2651
- else {
2976
+ if (!this.canSelectCountry() && this.countryControl.value?.id !== this.russiaCountryId) {
2652
2977
  this.countryControl.setValue({
2653
2978
  id: this.russiaCountryId,
2654
2979
  name: 'Россия',
@@ -2749,6 +3074,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
2749
3074
  class ScSignUpFormComponent {
2750
3075
  /**
2751
3076
  * Инициализирует экземпляр класса {@link ScSignUpFormComponent}.
3077
+ * Название сбрасывается только при переходе между физическим лицом и организацией: у физического лица в поле Ф.И.О.,
3078
+ * у остальных форм название организации, поэтому прежнее значение по смыслу не подходит.
2752
3079
  */
2753
3080
  constructor() {
2754
3081
  /**
@@ -2767,6 +3094,10 @@ class ScSignUpFormComponent {
2767
3094
  * Сервис для сбора метрик о действиях пользователей.
2768
3095
  */
2769
3096
  this.userMetrikaService = inject(ScUserMetrikaService);
3097
+ /**
3098
+ * Сервис-реестр качества адресов, выбранных из подсказок.
3099
+ */
3100
+ this.addressQualityService = inject(ScAddressQualityService);
2770
3101
  /**
2771
3102
  * Поле ввода организационно-правовых форм.
2772
3103
  */
@@ -2841,7 +3172,9 @@ class ScSignUpFormComponent {
2841
3172
  * Список этапов регистрации.
2842
3173
  */
2843
3174
  this.steps = ['Данные о клиенте', 'Общие данные контрагента', 'Контакты пользователя', 'Банковские реквизиты пользователя'];
2844
- this.opfControl.valueChanges.pipe(distinctUntilChanged(), takeUntilDestroyed()).subscribe(() => {
3175
+ this.opfControl.valueChanges
3176
+ .pipe(startWith(this.opfControl.value), pairwise(), filter(([previousOpf, opf]) => (previousOpf === 'individual') !== (opf === 'individual')), takeUntilDestroyed())
3177
+ .subscribe(() => {
2845
3178
  this.form.patchValue({ name: null });
2846
3179
  });
2847
3180
  }
@@ -3011,6 +3344,7 @@ class ScSignUpFormComponent {
3011
3344
  name: suggestion.name,
3012
3345
  inn: suggestion.inn,
3013
3346
  kpp: suggestion.kpp ?? null,
3347
+ ogrn: suggestion.ogrn ?? null,
3014
3348
  okpo: suggestion.okpo ?? null,
3015
3349
  directorName: suggestion.directorName ?? null,
3016
3350
  directorPosition: suggestion.directorPosition ?? null,
@@ -3021,6 +3355,7 @@ class ScSignUpFormComponent {
3021
3355
  this.form.controls.contragent.markAllAsTouched();
3022
3356
  this.form.get(['contragent', 'contacts'])?.markAsUntouched();
3023
3357
  this.form.get(['contragent', 'bankAccounts'])?.markAsUntouched();
3358
+ this.addressQualityService.setOrganizationAddressQualities(this.form.controls.contragent, suggestion);
3024
3359
  }
3025
3360
  }
3026
3361
  /**
@@ -3167,6 +3502,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
3167
3502
  type: Output
3168
3503
  }] } });
3169
3504
 
3505
+ /**
3506
+ * Компонент немодального уведомления с выбором «Да» или «Нет» для событий без действия пользователя, например изменения списка в фоне.
3507
+ * Уведомление завершается выбором пользователя. Действие пользователя подтверждается диалогом TUI_CONFIRM.
3508
+ */
3509
+ class ScConfirmAlertComponent {
3510
+ constructor() {
3511
+ /**
3512
+ * Контекст уведомления: вопрос, подписи и вид кнопки согласия, выбор пользователя.
3513
+ */
3514
+ this.context = injectContext();
3515
+ /**
3516
+ * Подписи кнопок по умолчанию.
3517
+ */
3518
+ this.words = inject(TUI_CONFIRM_WORDS);
3519
+ }
3520
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScConfirmAlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3521
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.16", type: ScConfirmAlertComponent, isStandalone: true, selector: "sc-confirm-alert", ngImport: i0, template: "<div class=\"flex flex-col items-start gap-2\">\n <span *polymorpheusOutlet=\"context.data.content as text; context: context\">{{ text }}</span>\n <div class=\"flex gap-2\">\n <button\n tuiButton\n type=\"button\"\n size=\"s\"\n [appearance]=\"context.data.appearance || 'primary'\"\n (click)=\"context.completeWith(true)\"\n >\n {{ context.data.yes || words().yes }}\n </button>\n <button\n tuiButton\n type=\"button\"\n size=\"s\"\n appearance=\"secondary\"\n (click)=\"context.completeWith(false)\"\n >\n {{ context.data.no || words().no }}\n </button>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3522
+ }
3523
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScConfirmAlertComponent, decorators: [{
3524
+ type: Component,
3525
+ args: [{ selector: 'sc-confirm-alert', imports: [PolymorpheusOutlet, TuiButton], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-col items-start gap-2\">\n <span *polymorpheusOutlet=\"context.data.content as text; context: context\">{{ text }}</span>\n <div class=\"flex gap-2\">\n <button\n tuiButton\n type=\"button\"\n size=\"s\"\n [appearance]=\"context.data.appearance || 'primary'\"\n (click)=\"context.completeWith(true)\"\n >\n {{ context.data.yes || words().yes }}\n </button>\n <button\n tuiButton\n type=\"button\"\n size=\"s\"\n appearance=\"secondary\"\n (click)=\"context.completeWith(false)\"\n >\n {{ context.data.no || words().no }}\n </button>\n </div>\n</div>\n" }]
3526
+ }] });
3527
+
3170
3528
  /**
3171
3529
  * Баннер с прокруткой переданных {@link TemplateRef} элементов, и баннеров локации.
3172
3530
  */
@@ -3282,6 +3640,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
3282
3640
  args: ['style.aspect-ratio']
3283
3641
  }] } });
3284
3642
 
3643
+ /**
3644
+ * Класс-помощник для работы с файлами, выбранными пользователем.
3645
+ */
3646
+ class ScFileHelper {
3647
+ /**
3648
+ * Читает файл и возвращает его для отправки в API: название и содержимое в виде data-URI. При отписке чтение прерывается.
3649
+ *
3650
+ * @param file Выбранный файл.
3651
+ */
3652
+ static readAsUploadedFile$(file) {
3653
+ return new Observable((observer) => {
3654
+ const reader = new FileReader();
3655
+ reader.addEventListener('load', () => {
3656
+ observer.next(new ScUploadedFile(file.name, reader.result));
3657
+ observer.complete();
3658
+ });
3659
+ reader.addEventListener('error', () => {
3660
+ observer.error(reader.error);
3661
+ });
3662
+ reader.readAsDataURL(file);
3663
+ return () => {
3664
+ reader.abort();
3665
+ };
3666
+ });
3667
+ }
3668
+ }
3669
+
3285
3670
  /**
3286
3671
  * Компонент диалога для добавления товаров в корзину из CSV файла.
3287
3672
  */
@@ -3324,19 +3709,7 @@ class ScCartAddProductsFromCsvDialogComponent {
3324
3709
  /**
3325
3710
  * {@link Observable} запроса на добавление товаров из CSV файла.
3326
3711
  */
3327
- this.submitRequest$ = this.onSubmit$.pipe(map(() => this.control.value), filter(tuiIsPresent), switchMap((file) => new Observable((observer) => {
3328
- const reader = new FileReader();
3329
- reader.addEventListener('load', () => {
3330
- observer.next(new ScUploadedFile(file.name, reader.result));
3331
- });
3332
- reader.addEventListener('error', (e) => {
3333
- observer.error(e);
3334
- });
3335
- reader.readAsDataURL(file);
3336
- return () => {
3337
- reader.abort();
3338
- };
3339
- })), switchMap((file) => this.cartService.addProductsFromCsv$(file).pipe(tap(() => {
3712
+ this.submitRequest$ = this.onSubmit$.pipe(map(() => this.control.value), filter(tuiIsPresent), switchMap((file) => ScFileHelper.readAsUploadedFile$(file)), switchMap((file) => this.cartService.addProductsFromCsv$(file).pipe(tap(() => {
3340
3713
  this.context.$implicit.complete();
3341
3714
  }), startWith(null))));
3342
3715
  /**
@@ -3608,7 +3981,7 @@ class ScAddOrEditingCartItemDialogComponent {
3608
3981
  this.context.$implicit.complete();
3609
3982
  }), catchError((error) => {
3610
3983
  if (error instanceof HttpErrorResponse) {
3611
- const { errors, message } = error.error;
3984
+ const { errors, message } = (error.error ?? {});
3612
3985
  if (errors && isObject(errors)) {
3613
3986
  Object.entries(errors).forEach(([k, v]) => {
3614
3987
  this.formComponent().form.get(k)?.setErrors({ serverResponse: v });
@@ -3620,7 +3993,8 @@ class ScAddOrEditingCartItemDialogComponent {
3620
3993
  this.formComponent().form.updateValueAndValidity();
3621
3994
  this.formComponent().form.markAsDirty();
3622
3995
  }
3623
- return of();
3996
+ // Значение вместо пустого потока снимает загрузку, чтобы форму можно было отправить снова.
3997
+ return of(null);
3624
3998
  }), startWith(loadingPlaceholder))), share());
3625
3999
  /**
3626
4000
  * {@link Observable} изменения состояния загрузки данных.
@@ -3945,6 +4319,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
3945
4319
  */
3946
4320
  class ScInputQuantityComponent {
3947
4321
  constructor() {
4322
+ /**
4323
+ * Минимальное количество знаков после запятой.
4324
+ */
4325
+ this.minPrecision = 2;
3948
4326
  /**
3949
4327
  * Внутренний FormControl.
3950
4328
  */
@@ -3981,8 +4359,14 @@ class ScInputQuantityComponent {
3981
4359
  * Объект для работы с обнаружением изменений.
3982
4360
  */
3983
4361
  this.cdr = inject(ChangeDetectorRef);
4362
+ /**
4363
+ * Обратный вызов для пометки контрола как "touched".
4364
+ */
3984
4365
  // eslint-disable-next-line @typescript-eslint/no-empty-function, class-methods-use-this
3985
4366
  this.onTouched = noop;
4367
+ /**
4368
+ * Обратный вызов изменения значения.
4369
+ */
3986
4370
  // eslint-disable-next-line @typescript-eslint/no-empty-function, class-methods-use-this
3987
4371
  this.onChange = noop;
3988
4372
  /**
@@ -3998,11 +4382,20 @@ class ScInputQuantityComponent {
3998
4382
  this.formControl.setValidators(stepValidator(value ? 1 : this.step));
3999
4383
  }
4000
4384
  /**
4001
- * Обратный вызов для пометки контрола как "touched".
4385
+ * Количество знаков после запятой: по шагу, но не меньше двух.
4002
4386
  */
4387
+ get precision() {
4388
+ return Math.max(this.minPrecision, ScNumberHelper.getDecimalsCount(this.step));
4389
+ }
4003
4390
  /**
4004
- * Обратный вызов изменения значения.
4391
+ * Настройки формата числа поля. Точность задаётся только для шага с тремя и более знаками после запятой, иначе действует общая настройка.
4005
4392
  */
4393
+ get numberFormat() {
4394
+ if (this.numberFormatCache?.step !== this.step) {
4395
+ this.numberFormatCache = { step: this.step, format: this.precision > this.minPrecision ? { precision: this.precision, decimalMode: 'not-zero' } : {} };
4396
+ }
4397
+ return this.numberFormatCache.format;
4398
+ }
4006
4399
  /**
4007
4400
  * Возвращает элемент, который может быть сфокусирован.
4008
4401
  */
@@ -4098,7 +4491,7 @@ class ScInputQuantityComponent {
4098
4491
  useExisting: forwardRef(() => ScInputQuantityComponent),
4099
4492
  multi: true,
4100
4493
  },
4101
- ], viewQueries: [{ propertyName: "numberInput", first: true, predicate: TuiInputNumberDirective, descendants: true }], ngImport: i0, template: "@if (formControl) {\n <tui-loader\n class=\"w-full\"\n [overlay]=\"true\"\n [loading]=\"showLoader\"\n [size]=\"size\"\n >\n <div class=\"flex items-center gap-1 text-center\">\n <div class=\"field-with-button flex grow rounded-xl\">\n <button\n tuiIconButton\n [appearance]=\"appearance\"\n [size]=\"size\"\n [disabled]=\"isDisabled\"\n (click.prevent)=\"decrement(true)\"\n >\n <tui-icon icon=\"@tui.minus\"></tui-icon>\n </button>\n <tui-textfield\n tuiTextfieldAppearance=\"\"\n [tuiTextfieldSize]=\"size\"\n [tuiTextfieldCleaner]=\"false\"\n class=\"grow\"\n >\n <input\n tuiInputNumber\n [formControl]=\"formControl\"\n [min]=\"_ignoreStepValidators ? 1 : step\"\n [style.text-align]=\"'center'\"\n [style.font-weight]=\"700\"\n (focusin)=\"$any($event.target).select()\"\n (keydown.arrowDown)=\"(0)\"\n (keydown.arrowUp)=\"(0)\"\n (blur)=\"onTouched()\"\n />\n </tui-textfield>\n <button\n tuiIconButton\n [appearance]=\"appearance\"\n [size]=\"size\"\n [disabled]=\"isDisabled\"\n (click.prevent)=\"incident(true)\"\n >\n <tui-icon icon=\"@tui.plus\"></tui-icon>\n </button>\n </div>\n @if (showCross) {\n <button\n tuiIconButton\n appearance=\"secondary\"\n [size]=\"size\"\n [disabled]=\"isDisabled\"\n (click.prevent)=\"clear()\"\n >\n <tui-icon icon=\"@tui.x\"></tui-icon>\n </button>\n }\n </div>\n </tui-loader>\n}\n", styles: [":host [data-size=l]{--tui-height-l: var(--tui-height-m);--tui-typography-body-m: bold .875rem/1.25rem var(--tui-typography-family-text);--tui-padding-l: 0}:host [data-size=m]{--tui-height-m: var(--tui-height-s);--tui-typography-body-s: bold .75rem/1rem var(--tui-typography-family-text);--tui-padding-m: 0}:host [data-size=m] tui-svg{font-size:12px!important}:host [data-size=s]{--tui-height-s: var(--tui-height-xs);--tui-typography-body-s: bold .75rem/1rem var(--tui-typography-family-text);--tui-padding-s: 0}:host [data-size=s] tui-svg{font-size:12px!important}:host[data-disabled=true]{pointer-events:none;opacity:var(--tui-disabled-opacity)}:host[data-appearance=secondary] .field-with-button{background-color:var(--tui-background-base);box-shadow:inset 0 0 0 .0625rem var(--tui-background-neutral-1-hover)}:host[data-appearance=primary] .field-with-button{background-color:var(--tui-status-warning-pale)}:host .field-with-button:has(._invalid){background-color:var(--tui-status-negative-pale)}\n"], dependencies: [{ kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiIcon, selector: "tui-icon:not([tuiBadge])", inputs: ["background"] }, { kind: "directive", type: i1$1.TuiInputNumberDirective, selector: "input[tuiInputNumber]" }, { kind: "component", type: i3$1.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3$1.TuiTextfieldOptionsDirective, selector: "[tuiTextfieldAppearance],[tuiTextfieldSize],[tuiTextfieldCleaner]", inputs: ["tuiTextfieldAppearance", "tuiTextfieldSize", "tuiTextfieldCleaner"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: TuiLoader, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "loading"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4494
+ ], viewQueries: [{ propertyName: "numberInput", first: true, predicate: TuiInputNumberDirective, descendants: true }], ngImport: i0, template: "@if (formControl) {\n <tui-loader\n class=\"w-full\"\n [overlay]=\"true\"\n [loading]=\"showLoader\"\n [size]=\"size\"\n >\n <div class=\"flex items-center gap-1 text-center\">\n <div class=\"field-with-button flex grow rounded-xl\">\n <button\n tuiIconButton\n [appearance]=\"appearance\"\n [size]=\"size\"\n [disabled]=\"isDisabled\"\n (click.prevent)=\"decrement(true)\"\n >\n <tui-icon icon=\"@tui.minus\"></tui-icon>\n </button>\n <tui-textfield\n tuiTextfieldAppearance=\"\"\n [tuiTextfieldSize]=\"size\"\n [tuiTextfieldCleaner]=\"false\"\n class=\"grow\"\n >\n <input\n tuiInputNumber\n [formControl]=\"formControl\"\n [min]=\"_ignoreStepValidators ? 1 : step\"\n [tuiNumberFormat]=\"numberFormat\"\n [style.text-align]=\"'center'\"\n [style.font-weight]=\"700\"\n (focusin)=\"$any($event.target).select()\"\n (keydown.arrowDown)=\"(0)\"\n (keydown.arrowUp)=\"(0)\"\n (blur)=\"onTouched()\"\n />\n </tui-textfield>\n <button\n tuiIconButton\n [appearance]=\"appearance\"\n [size]=\"size\"\n [disabled]=\"isDisabled\"\n (click.prevent)=\"incident(true)\"\n >\n <tui-icon icon=\"@tui.plus\"></tui-icon>\n </button>\n </div>\n @if (showCross) {\n <button\n tuiIconButton\n appearance=\"secondary\"\n [size]=\"size\"\n [disabled]=\"isDisabled\"\n (click.prevent)=\"clear()\"\n >\n <tui-icon icon=\"@tui.x\"></tui-icon>\n </button>\n }\n </div>\n </tui-loader>\n}\n", styles: [":host [data-size=l]{--tui-height-l: var(--tui-height-m);--tui-typography-body-m: bold .875rem/1.25rem var(--tui-typography-family-text);--tui-padding-l: 0}:host [data-size=m]{--tui-height-m: var(--tui-height-s);--tui-typography-body-s: bold .75rem/1rem var(--tui-typography-family-text);--tui-padding-m: 0}:host [data-size=m] tui-svg{font-size:12px!important}:host [data-size=s]{--tui-height-s: var(--tui-height-xs);--tui-typography-body-s: bold .75rem/1rem var(--tui-typography-family-text);--tui-padding-s: 0}:host [data-size=s] tui-svg{font-size:12px!important}:host[data-disabled=true]{pointer-events:none;opacity:var(--tui-disabled-opacity)}:host[data-appearance=secondary] .field-with-button{background-color:var(--tui-background-base);box-shadow:inset 0 0 0 .0625rem var(--tui-background-neutral-1-hover)}:host[data-appearance=primary] .field-with-button{background-color:var(--tui-status-warning-pale)}:host .field-with-button:has(._invalid){background-color:var(--tui-status-negative-pale)}\n"], dependencies: [{ kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiIcon, selector: "tui-icon:not([tuiBadge])", inputs: ["background"] }, { kind: "directive", type: i1$1.TuiInputNumberDirective, selector: "input[tuiInputNumber]" }, { kind: "component", type: i3$1.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3$1.TuiTextfieldOptionsDirective, selector: "[tuiTextfieldAppearance],[tuiTextfieldSize],[tuiTextfieldCleaner]", inputs: ["tuiTextfieldAppearance", "tuiTextfieldSize", "tuiTextfieldCleaner"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: TuiLoader, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "loading"] }, { kind: "directive", type: TuiNumberFormat, selector: "[tuiNumberFormat]", inputs: ["tuiNumberFormat"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4102
4495
  }
4103
4496
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScInputQuantityComponent, decorators: [{
4104
4497
  type: Component,
@@ -4106,14 +4499,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
4106
4499
  '[attr.data-appearance]': 'appearance',
4107
4500
  '[attr.data-disabled]': 'isDisabled',
4108
4501
  '[attr.data-size]': 'size',
4109
- }, imports: [TuiButton, TuiIcon, ...TuiInputNumber, FormsModule, ReactiveFormsModule, ...TuiHint, TuiError, TuiLoader], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
4502
+ }, imports: [TuiButton, TuiIcon, ...TuiInputNumber, FormsModule, ReactiveFormsModule, ...TuiHint, TuiError, TuiLoader, TuiNumberFormat], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
4110
4503
  {
4111
4504
  provide: NG_VALUE_ACCESSOR,
4112
4505
  // eslint-disable-next-line no-use-before-define
4113
4506
  useExisting: forwardRef(() => ScInputQuantityComponent),
4114
4507
  multi: true,
4115
4508
  },
4116
- ], template: "@if (formControl) {\n <tui-loader\n class=\"w-full\"\n [overlay]=\"true\"\n [loading]=\"showLoader\"\n [size]=\"size\"\n >\n <div class=\"flex items-center gap-1 text-center\">\n <div class=\"field-with-button flex grow rounded-xl\">\n <button\n tuiIconButton\n [appearance]=\"appearance\"\n [size]=\"size\"\n [disabled]=\"isDisabled\"\n (click.prevent)=\"decrement(true)\"\n >\n <tui-icon icon=\"@tui.minus\"></tui-icon>\n </button>\n <tui-textfield\n tuiTextfieldAppearance=\"\"\n [tuiTextfieldSize]=\"size\"\n [tuiTextfieldCleaner]=\"false\"\n class=\"grow\"\n >\n <input\n tuiInputNumber\n [formControl]=\"formControl\"\n [min]=\"_ignoreStepValidators ? 1 : step\"\n [style.text-align]=\"'center'\"\n [style.font-weight]=\"700\"\n (focusin)=\"$any($event.target).select()\"\n (keydown.arrowDown)=\"(0)\"\n (keydown.arrowUp)=\"(0)\"\n (blur)=\"onTouched()\"\n />\n </tui-textfield>\n <button\n tuiIconButton\n [appearance]=\"appearance\"\n [size]=\"size\"\n [disabled]=\"isDisabled\"\n (click.prevent)=\"incident(true)\"\n >\n <tui-icon icon=\"@tui.plus\"></tui-icon>\n </button>\n </div>\n @if (showCross) {\n <button\n tuiIconButton\n appearance=\"secondary\"\n [size]=\"size\"\n [disabled]=\"isDisabled\"\n (click.prevent)=\"clear()\"\n >\n <tui-icon icon=\"@tui.x\"></tui-icon>\n </button>\n }\n </div>\n </tui-loader>\n}\n", styles: [":host [data-size=l]{--tui-height-l: var(--tui-height-m);--tui-typography-body-m: bold .875rem/1.25rem var(--tui-typography-family-text);--tui-padding-l: 0}:host [data-size=m]{--tui-height-m: var(--tui-height-s);--tui-typography-body-s: bold .75rem/1rem var(--tui-typography-family-text);--tui-padding-m: 0}:host [data-size=m] tui-svg{font-size:12px!important}:host [data-size=s]{--tui-height-s: var(--tui-height-xs);--tui-typography-body-s: bold .75rem/1rem var(--tui-typography-family-text);--tui-padding-s: 0}:host [data-size=s] tui-svg{font-size:12px!important}:host[data-disabled=true]{pointer-events:none;opacity:var(--tui-disabled-opacity)}:host[data-appearance=secondary] .field-with-button{background-color:var(--tui-background-base);box-shadow:inset 0 0 0 .0625rem var(--tui-background-neutral-1-hover)}:host[data-appearance=primary] .field-with-button{background-color:var(--tui-status-warning-pale)}:host .field-with-button:has(._invalid){background-color:var(--tui-status-negative-pale)}\n"] }]
4509
+ ], template: "@if (formControl) {\n <tui-loader\n class=\"w-full\"\n [overlay]=\"true\"\n [loading]=\"showLoader\"\n [size]=\"size\"\n >\n <div class=\"flex items-center gap-1 text-center\">\n <div class=\"field-with-button flex grow rounded-xl\">\n <button\n tuiIconButton\n [appearance]=\"appearance\"\n [size]=\"size\"\n [disabled]=\"isDisabled\"\n (click.prevent)=\"decrement(true)\"\n >\n <tui-icon icon=\"@tui.minus\"></tui-icon>\n </button>\n <tui-textfield\n tuiTextfieldAppearance=\"\"\n [tuiTextfieldSize]=\"size\"\n [tuiTextfieldCleaner]=\"false\"\n class=\"grow\"\n >\n <input\n tuiInputNumber\n [formControl]=\"formControl\"\n [min]=\"_ignoreStepValidators ? 1 : step\"\n [tuiNumberFormat]=\"numberFormat\"\n [style.text-align]=\"'center'\"\n [style.font-weight]=\"700\"\n (focusin)=\"$any($event.target).select()\"\n (keydown.arrowDown)=\"(0)\"\n (keydown.arrowUp)=\"(0)\"\n (blur)=\"onTouched()\"\n />\n </tui-textfield>\n <button\n tuiIconButton\n [appearance]=\"appearance\"\n [size]=\"size\"\n [disabled]=\"isDisabled\"\n (click.prevent)=\"incident(true)\"\n >\n <tui-icon icon=\"@tui.plus\"></tui-icon>\n </button>\n </div>\n @if (showCross) {\n <button\n tuiIconButton\n appearance=\"secondary\"\n [size]=\"size\"\n [disabled]=\"isDisabled\"\n (click.prevent)=\"clear()\"\n >\n <tui-icon icon=\"@tui.x\"></tui-icon>\n </button>\n }\n </div>\n </tui-loader>\n}\n", styles: [":host [data-size=l]{--tui-height-l: var(--tui-height-m);--tui-typography-body-m: bold .875rem/1.25rem var(--tui-typography-family-text);--tui-padding-l: 0}:host [data-size=m]{--tui-height-m: var(--tui-height-s);--tui-typography-body-s: bold .75rem/1rem var(--tui-typography-family-text);--tui-padding-m: 0}:host [data-size=m] tui-svg{font-size:12px!important}:host [data-size=s]{--tui-height-s: var(--tui-height-xs);--tui-typography-body-s: bold .75rem/1rem var(--tui-typography-family-text);--tui-padding-s: 0}:host [data-size=s] tui-svg{font-size:12px!important}:host[data-disabled=true]{pointer-events:none;opacity:var(--tui-disabled-opacity)}:host[data-appearance=secondary] .field-with-button{background-color:var(--tui-background-base);box-shadow:inset 0 0 0 .0625rem var(--tui-background-neutral-1-hover)}:host[data-appearance=primary] .field-with-button{background-color:var(--tui-status-warning-pale)}:host .field-with-button:has(._invalid){background-color:var(--tui-status-negative-pale)}\n"] }]
4117
4510
  }], propDecorators: { numberInput: [{
4118
4511
  type: ViewChild,
4119
4512
  args: [TuiInputNumberDirective]
@@ -4354,11 +4747,11 @@ class ScPriceWarehouseStockComponent {
4354
4747
  }))));
4355
4748
  }
4356
4749
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScPriceWarehouseStockComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4357
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScPriceWarehouseStockComponent, isStandalone: true, selector: "sc-price-warehouse-stock", inputs: { classList: "classList", product: "product", withStockHint: "withStockHint", fromMain: "fromMain" }, ngImport: i0, template: "@if (product) {\n @let isDisabled = product.isHidden || product.isNull;\n @if (selectedWarehouse$ | async; as warehouseSelect) {\n @let showStockHint = withStockHint && !!(warehousesList$ | async)?.length;\n <span>\n @if (!product.stockCount?.length && product.getNotStockMessage(warehouseSelect); as message) {\n @let showPlaningHint = !!(product.properties?.planingIncomingDate || product.properties?.planingProductionDate);\n <a\n tuiLink\n [style.text-decoration-line]=\"showPlaningHint ? 'underline' : null\"\n [tuiHint]=\"showPlaningHint && planingHint\"\n [class.disabled]=\"isDisabled\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n [style.color]=\"'var(--tui-status-negative)'\"\n [style.cursor]=\"showPlaningHint && planingHint ? 'pointer' : 'default'\"\n [ngClass]=\"classList\"\n >\n {{ message }}\n </a>\n }\n <ng-template #planingHint>\n @if (product.properties?.planingIncomingDate) {\n <span>\n \u041F\u043B\u0430\u043D\u0438\u0440\u0443\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 \u043F\u043E\u0441\u0442\u0443\u043F\u043B\u0435\u043D\u0438\u044F <br />\n \u043D\u0430 \u041E\u0441\u043D\u043E\u0432\u043D\u043E\u0439 \u0441\u043A\u043B\u0430\u0434:\n <span class=\"font-bold\">{{ product.properties?.planingIncomingDate }}</span>\n </span>\n }\n @if (product.properties?.planingProductionDate) {\n <span>\n \u041F\u043B\u0430\u043D\u0438\u0440\u0443\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 <br />\n \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0441\u0442\u0432\u0430:\n <span class=\"font-bold\">{{ product.properties?.planingProductionDate }}</span>\n </span>\n }\n </ng-template>\n @if (product.stockCount && product.stockCount.length && !product.onOrder) {\n <span>\n <span\n tuiLink\n [style.color]=\"'var(--tui-status-positive)'\"\n [tuiHint]=\"showStockHint && stockHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n [ngClass]=\"classList\"\n [class.disabled]=\"isDisabled\"\n class=\"!underline\"\n >\n \u041F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C \u043D\u0430\u043B\u0438\u0447\u0438\u0435\n </span>\n </span>\n }\n @if (product.onOrder) {\n <span\n [style.color]=\"'var(--tui-status-warning)'\"\n [ngClass]=\"classList\"\n >\n \u041F\u043E\u0434 \u0437\u0430\u043A\u0430\u0437\n </span>\n }\n </span>\n }\n <ng-template #stockHint>\n @if (selectedWarehouse$ | async; as warehouseSelect) {\n <table\n class=\"stock-table table-auto text-body-s\"\n [ngClass]=\"classList\"\n >\n <tbody>\n @for (item of warehousesList$ | async; track item) {\n <tr class=\"border-b\">\n <ng-container>\n <td class=\"px-1\">{{ item.w?.name }}:</td>\n <td class=\"px-1\">{{ item.sc.count !== undefined && item.sc.count !== null ? item.sc.count + ' ' + product.unit.name : '\u0412 \u043D\u0430\u043B\u0438\u0447\u0438\u0438' }}</td>\n </ng-container>\n </tr>\n }\n </tbody>\n </table>\n }\n </ng-template>\n}\n", styles: ["::ng-deep tui-hint:has(.stock-table){max-inline-size:22rem}[tuiIconButton]{--tui-radius-m: .75rem;--tui-height-xs: 1.25rem}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: RouterModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.TuiHintDirective, selector: "[tuiHint]:not(ng-container):not(ng-template)", inputs: ["tuiHint", "tuiHintContext", "tuiHintAppearance"], outputs: ["tuiHintVisible"] }, { kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]" }, { kind: "pipe", type: i1$2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4750
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScPriceWarehouseStockComponent, isStandalone: true, selector: "sc-price-warehouse-stock", inputs: { classList: "classList", product: "product", withStockHint: "withStockHint", fromMain: "fromMain" }, ngImport: i0, template: "@if (product) {\n @let isDisabled = product.isHidden || product.isNull;\n @if (selectedWarehouse$ | async; as warehouseSelect) {\n @let showStockHint = withStockHint && !!(warehousesList$ | async)?.length;\n <span>\n @if (!product.stockCount?.length && product.getNotStockMessage(warehouseSelect); as message) {\n @let showPlaningHint = !!(product.properties?.planingIncomingDate || product.properties?.planingProductionDate);\n <a\n tuiLink\n [style.text-decoration-line]=\"showPlaningHint ? 'underline' : null\"\n [tuiHint]=\"showPlaningHint && planingHint\"\n [class.disabled]=\"isDisabled\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n [style.color]=\"'var(--tui-status-negative)'\"\n [style.cursor]=\"showPlaningHint && planingHint ? 'pointer' : 'default'\"\n [ngClass]=\"classList\"\n >\n {{ message }}\n </a>\n }\n <ng-template #planingHint>\n @if (product.properties?.planingIncomingDate) {\n <span>\n \u041F\u043B\u0430\u043D\u0438\u0440\u0443\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 \u043F\u043E\u0441\u0442\u0443\u043F\u043B\u0435\u043D\u0438\u044F <br />\n \u043D\u0430 \u041E\u0441\u043D\u043E\u0432\u043D\u043E\u0439 \u0441\u043A\u043B\u0430\u0434:\n <span class=\"font-bold\">{{ product.properties?.planingIncomingDate }}</span>\n </span>\n }\n @if (product.properties?.planingProductionDate) {\n <span>\n \u041F\u043B\u0430\u043D\u0438\u0440\u0443\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 <br />\n \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0441\u0442\u0432\u0430:\n <span class=\"font-bold\">{{ product.properties?.planingProductionDate }}</span>\n </span>\n }\n </ng-template>\n @if (product.stockCount && product.stockCount.length && !product.onOrder) {\n <span>\n <span\n tuiLink\n [style.color]=\"'var(--tui-status-positive)'\"\n [tuiHint]=\"showStockHint && stockHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n [ngClass]=\"classList\"\n [class.disabled]=\"isDisabled\"\n class=\"!underline\"\n >\n \u041F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C \u043D\u0430\u043B\u0438\u0447\u0438\u0435\n </span>\n </span>\n }\n @if (product.onOrder) {\n <span\n [style.color]=\"'var(--tui-status-warning)'\"\n [ngClass]=\"classList\"\n >\n \u041F\u043E\u0434 \u0437\u0430\u043A\u0430\u0437\n </span>\n }\n </span>\n @if (product.properties?.planingProductionDate) {\n <p\n class=\"text-tui-text-02\"\n [class.disabled]=\"isDisabled\"\n [ngClass]=\"classList\"\n >\n \u041F\u043B\u0430\u043D\u0438\u0440\u0443\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0441\u0442\u0432\u0430: {{ product.properties?.planingProductionDate }}\n </p>\n }\n }\n <ng-template #stockHint>\n @if (selectedWarehouse$ | async; as warehouseSelect) {\n <table\n class=\"stock-table table-auto text-body-s\"\n [ngClass]=\"classList\"\n >\n <tbody>\n @for (item of warehousesList$ | async; track item) {\n <tr class=\"border-b\">\n <ng-container>\n <td class=\"px-1\">{{ item.w?.name }}:</td>\n <td class=\"px-1\">{{ item.sc.count !== undefined && item.sc.count !== null ? item.sc.count + ' ' + product.unit.name : '\u0412 \u043D\u0430\u043B\u0438\u0447\u0438\u0438' }}</td>\n </ng-container>\n </tr>\n }\n </tbody>\n </table>\n }\n </ng-template>\n}\n", styles: ["::ng-deep tui-hint:has(.stock-table){max-inline-size:22rem}[tuiIconButton]{--tui-radius-m: .75rem;--tui-height-xs: 1.25rem}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: RouterModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.TuiHintDirective, selector: "[tuiHint]:not(ng-container):not(ng-template)", inputs: ["tuiHint", "tuiHintContext", "tuiHintAppearance"], outputs: ["tuiHintVisible"] }, { kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]" }, { kind: "pipe", type: i1$2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4358
4751
  }
4359
4752
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScPriceWarehouseStockComponent, decorators: [{
4360
4753
  type: Component,
4361
- args: [{ selector: 'sc-price-warehouse-stock', imports: [CommonModule, RouterModule, FormsModule, ReactiveFormsModule, ...TuiHint, TuiLink], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (product) {\n @let isDisabled = product.isHidden || product.isNull;\n @if (selectedWarehouse$ | async; as warehouseSelect) {\n @let showStockHint = withStockHint && !!(warehousesList$ | async)?.length;\n <span>\n @if (!product.stockCount?.length && product.getNotStockMessage(warehouseSelect); as message) {\n @let showPlaningHint = !!(product.properties?.planingIncomingDate || product.properties?.planingProductionDate);\n <a\n tuiLink\n [style.text-decoration-line]=\"showPlaningHint ? 'underline' : null\"\n [tuiHint]=\"showPlaningHint && planingHint\"\n [class.disabled]=\"isDisabled\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n [style.color]=\"'var(--tui-status-negative)'\"\n [style.cursor]=\"showPlaningHint && planingHint ? 'pointer' : 'default'\"\n [ngClass]=\"classList\"\n >\n {{ message }}\n </a>\n }\n <ng-template #planingHint>\n @if (product.properties?.planingIncomingDate) {\n <span>\n \u041F\u043B\u0430\u043D\u0438\u0440\u0443\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 \u043F\u043E\u0441\u0442\u0443\u043F\u043B\u0435\u043D\u0438\u044F <br />\n \u043D\u0430 \u041E\u0441\u043D\u043E\u0432\u043D\u043E\u0439 \u0441\u043A\u043B\u0430\u0434:\n <span class=\"font-bold\">{{ product.properties?.planingIncomingDate }}</span>\n </span>\n }\n @if (product.properties?.planingProductionDate) {\n <span>\n \u041F\u043B\u0430\u043D\u0438\u0440\u0443\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 <br />\n \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0441\u0442\u0432\u0430:\n <span class=\"font-bold\">{{ product.properties?.planingProductionDate }}</span>\n </span>\n }\n </ng-template>\n @if (product.stockCount && product.stockCount.length && !product.onOrder) {\n <span>\n <span\n tuiLink\n [style.color]=\"'var(--tui-status-positive)'\"\n [tuiHint]=\"showStockHint && stockHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n [ngClass]=\"classList\"\n [class.disabled]=\"isDisabled\"\n class=\"!underline\"\n >\n \u041F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C \u043D\u0430\u043B\u0438\u0447\u0438\u0435\n </span>\n </span>\n }\n @if (product.onOrder) {\n <span\n [style.color]=\"'var(--tui-status-warning)'\"\n [ngClass]=\"classList\"\n >\n \u041F\u043E\u0434 \u0437\u0430\u043A\u0430\u0437\n </span>\n }\n </span>\n }\n <ng-template #stockHint>\n @if (selectedWarehouse$ | async; as warehouseSelect) {\n <table\n class=\"stock-table table-auto text-body-s\"\n [ngClass]=\"classList\"\n >\n <tbody>\n @for (item of warehousesList$ | async; track item) {\n <tr class=\"border-b\">\n <ng-container>\n <td class=\"px-1\">{{ item.w?.name }}:</td>\n <td class=\"px-1\">{{ item.sc.count !== undefined && item.sc.count !== null ? item.sc.count + ' ' + product.unit.name : '\u0412 \u043D\u0430\u043B\u0438\u0447\u0438\u0438' }}</td>\n </ng-container>\n </tr>\n }\n </tbody>\n </table>\n }\n </ng-template>\n}\n", styles: ["::ng-deep tui-hint:has(.stock-table){max-inline-size:22rem}[tuiIconButton]{--tui-radius-m: .75rem;--tui-height-xs: 1.25rem}\n"] }]
4754
+ args: [{ selector: 'sc-price-warehouse-stock', imports: [CommonModule, RouterModule, FormsModule, ReactiveFormsModule, ...TuiHint, TuiLink], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (product) {\n @let isDisabled = product.isHidden || product.isNull;\n @if (selectedWarehouse$ | async; as warehouseSelect) {\n @let showStockHint = withStockHint && !!(warehousesList$ | async)?.length;\n <span>\n @if (!product.stockCount?.length && product.getNotStockMessage(warehouseSelect); as message) {\n @let showPlaningHint = !!(product.properties?.planingIncomingDate || product.properties?.planingProductionDate);\n <a\n tuiLink\n [style.text-decoration-line]=\"showPlaningHint ? 'underline' : null\"\n [tuiHint]=\"showPlaningHint && planingHint\"\n [class.disabled]=\"isDisabled\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n [style.color]=\"'var(--tui-status-negative)'\"\n [style.cursor]=\"showPlaningHint && planingHint ? 'pointer' : 'default'\"\n [ngClass]=\"classList\"\n >\n {{ message }}\n </a>\n }\n <ng-template #planingHint>\n @if (product.properties?.planingIncomingDate) {\n <span>\n \u041F\u043B\u0430\u043D\u0438\u0440\u0443\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 \u043F\u043E\u0441\u0442\u0443\u043F\u043B\u0435\u043D\u0438\u044F <br />\n \u043D\u0430 \u041E\u0441\u043D\u043E\u0432\u043D\u043E\u0439 \u0441\u043A\u043B\u0430\u0434:\n <span class=\"font-bold\">{{ product.properties?.planingIncomingDate }}</span>\n </span>\n }\n @if (product.properties?.planingProductionDate) {\n <span>\n \u041F\u043B\u0430\u043D\u0438\u0440\u0443\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 <br />\n \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0441\u0442\u0432\u0430:\n <span class=\"font-bold\">{{ product.properties?.planingProductionDate }}</span>\n </span>\n }\n </ng-template>\n @if (product.stockCount && product.stockCount.length && !product.onOrder) {\n <span>\n <span\n tuiLink\n [style.color]=\"'var(--tui-status-positive)'\"\n [tuiHint]=\"showStockHint && stockHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n [ngClass]=\"classList\"\n [class.disabled]=\"isDisabled\"\n class=\"!underline\"\n >\n \u041F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C \u043D\u0430\u043B\u0438\u0447\u0438\u0435\n </span>\n </span>\n }\n @if (product.onOrder) {\n <span\n [style.color]=\"'var(--tui-status-warning)'\"\n [ngClass]=\"classList\"\n >\n \u041F\u043E\u0434 \u0437\u0430\u043A\u0430\u0437\n </span>\n }\n </span>\n @if (product.properties?.planingProductionDate) {\n <p\n class=\"text-tui-text-02\"\n [class.disabled]=\"isDisabled\"\n [ngClass]=\"classList\"\n >\n \u041F\u043B\u0430\u043D\u0438\u0440\u0443\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0441\u0442\u0432\u0430: {{ product.properties?.planingProductionDate }}\n </p>\n }\n }\n <ng-template #stockHint>\n @if (selectedWarehouse$ | async; as warehouseSelect) {\n <table\n class=\"stock-table table-auto text-body-s\"\n [ngClass]=\"classList\"\n >\n <tbody>\n @for (item of warehousesList$ | async; track item) {\n <tr class=\"border-b\">\n <ng-container>\n <td class=\"px-1\">{{ item.w?.name }}:</td>\n <td class=\"px-1\">{{ item.sc.count !== undefined && item.sc.count !== null ? item.sc.count + ' ' + product.unit.name : '\u0412 \u043D\u0430\u043B\u0438\u0447\u0438\u0438' }}</td>\n </ng-container>\n </tr>\n }\n </tbody>\n </table>\n }\n </ng-template>\n}\n", styles: ["::ng-deep tui-hint:has(.stock-table){max-inline-size:22rem}[tuiIconButton]{--tui-radius-m: .75rem;--tui-height-xs: 1.25rem}\n"] }]
4362
4755
  }], propDecorators: { classList: [{
4363
4756
  type: Input
4364
4757
  }], product: [{
@@ -4673,6 +5066,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
4673
5066
  args: [{ selector: 'sc-price-list-pagination', changeDetection: ChangeDetectionStrategy.OnPush, imports: [TuiTransitioned, TuiAppearance$1, TuiWithAppearance$1, TuiIcons$1, TuiWithIcons$1, TuiButton, AsyncPipe], template: "@let meta = meta$ | async;\n@let disabled = disabled$ | async;\n\n@if (meta) {\n @let isLastPage = meta.currentPage === meta.lastPage;\n\n @if (!isLastPage) {\n <button\n tuiButton\n (click)=\"showMore()\"\n [disabled]=\"disabled\"\n appearance=\"secondary\"\n class=\"!font-bold\"\n >\n \u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0435\u0449\u0451\n </button>\n }\n}\n" }]
4674
5067
  }] });
4675
5068
 
5069
+ /**
5070
+ * Токен настроек представлений групп фильтров каталога.
5071
+ * Группа, которой нет в настройках, выводится заголовком и фильтрами в стандартном виде.
5072
+ */
5073
+ const SC_CATALOG_FILTER_PREVIEWS = new InjectionToken('SC_CATALOG_FILTER_PREVIEWS', {
5074
+ factory: () => ({}),
5075
+ });
5076
+
4676
5077
  /**
4677
5078
  * Токен для инъекции {@link BehaviorSubject} для хранения фильтров продуктов.
4678
5079
  */
@@ -4750,7 +5151,7 @@ class ScCatalogFiltersComponent {
4750
5151
  */
4751
5152
  constructor() {
4752
5153
  /**
4753
- * Подписки синхронизации контролов формы (range slider, single-select checkbox).
5154
+ * Подписки синхронизации контролов формы (range slider, single-select checkbox, выбор одного фильтра в группе).
4754
5155
  */
4755
5156
  this.formSyncs = new Subscription();
4756
5157
  /**
@@ -4769,6 +5170,10 @@ class ScCatalogFiltersComponent {
4769
5170
  * Признак необходимости отображать фильтры для вложенных категорий.
4770
5171
  */
4771
5172
  this.isRecursively = inject(SC_CATALOG_SHOW_PRODUCTS_RECURSIVELY);
5173
+ /**
5174
+ * Настройки представлений групп фильтров по идентификатору группы.
5175
+ */
5176
+ this.previews = inject(SC_CATALOG_FILTER_PREVIEWS);
4772
5177
  /**
4773
5178
  * Показывать ли кнопку «Показать результаты».
4774
5179
  */
@@ -4788,11 +5193,13 @@ class ScCatalogFiltersComponent {
4788
5193
  /**
4789
5194
  * {@link Observable} фильтров категории.
4790
5195
  */
4791
- this.filters = toSignal(inject(SC_CATEGORY_INFO).pipe(catchError(() => EMPTY), filter(tuiIsPresent), switchMap((category) => this.catalogFilterService.getFilters$(this.idOrSlugPipe.transform(category), this.isRecursively)), filter(tuiIsPresent), map((filters) => filters
4792
- .filter((item) => this.isRenderableFilter(item))
4793
- .map((item) => (item.type === 'checkbox' ? { ...item, values: [...item.values].sort((a, b) => a.label.localeCompare(b.label)) } : item))), tap((filters) => {
4794
- this.updateFormControls(filters);
5196
+ this.filters = toSignal(inject(SC_CATEGORY_INFO).pipe(catchError(() => EMPTY), filter(tuiIsPresent), switchMap((category) => this.catalogFilterService.getFilters$(this.idOrSlugPipe.transform(category), this.isRecursively)), filter(tuiIsPresent), map((items) => items.flatMap((item) => this.prepareFilterItem(item))), tap((items) => {
5197
+ this.updateFormControls(items);
4795
5198
  }), share()));
5199
+ /**
5200
+ * Фильтры категории без групп: вложенные фильтры групп идут на месте своей группы.
5201
+ */
5202
+ this.flatFilters = computed(() => this.flattenFilters(this.filters() ?? []), ...(ngDevMode ? [{ debugName: "flatFilters" }] : /* istanbul ignore next */ []));
4796
5203
  inject(DestroyRef).onDestroy(() => {
4797
5204
  this.formSyncs.unsubscribe();
4798
5205
  });
@@ -4823,24 +5230,58 @@ class ScCatalogFiltersComponent {
4823
5230
  }
4824
5231
  }
4825
5232
  /**
4826
- * Обновляет состав контролов формы на основе переданных фильтров.
5233
+ * Возвращает пригодный для вывода фильтр со значениями checkbox, отсортированными по названию, или пустой массив,
5234
+ * если фильтр выводить нельзя.
4827
5235
  *
4828
- * @param filters Массив фильтров для создания контролов.
5236
+ * @param item Фильтр каталога.
4829
5237
  */
4830
- updateFormControls(filters) {
4831
- this.formSyncs.unsubscribe();
4832
- this.formSyncs = new Subscription();
4833
- const appliedFilters = this.getAppliedFilters();
4834
- Object.keys(this.form.controls).forEach((key) => {
4835
- this.form.removeControl(key, { emitEvent: false });
4836
- });
4837
- filters.forEach((item) => {
4838
- // eslint-disable-next-line security/detect-object-injection
4839
- const appliedValue = appliedFilters[item.id];
4840
- switch (item.type) {
4841
- case 'checkbox': {
4842
- const checkboxControl = this.createCheckboxFormControl(item, appliedValue);
4843
- this.form.addControl(item.id, checkboxControl, { emitEvent: false });
5238
+ prepareFilter(item) {
5239
+ if (!this.isRenderableFilter(item)) {
5240
+ return [];
5241
+ }
5242
+ return [item.type === 'checkbox' ? { ...item, values: [...item.values].sort((a, b) => a.label.localeCompare(b.label)) } : item];
5243
+ }
5244
+ /**
5245
+ * Возвращает подготовленный к выводу элемент списка фильтров. У группы остаются только пригодные для вывода фильтры,
5246
+ * группа без них пропускается.
5247
+ *
5248
+ * @param item Элемент списка фильтров категории.
5249
+ */
5250
+ prepareFilterItem(item) {
5251
+ if (item.type !== 'group') {
5252
+ return this.prepareFilter(item);
5253
+ }
5254
+ const filters = item.filters.flatMap((filterItem) => this.prepareFilter(filterItem));
5255
+ return filters.length > 0 ? [{ ...item, filters }] : [];
5256
+ }
5257
+ /**
5258
+ * Возвращает фильтры без групп: вместо группы идут её фильтры.
5259
+ *
5260
+ * @param items Элементы списка фильтров категории.
5261
+ */
5262
+ flattenFilters(items) {
5263
+ return items.flatMap((item) => (item.type === 'group' ? item.filters : [item]));
5264
+ }
5265
+ /**
5266
+ * Обновляет состав контролов формы на основе переданных фильтров. Контролы фильтров группы лежат в корне формы,
5267
+ * как и остальные фильтры, потому что в запрос они уходят отдельными свойствами.
5268
+ *
5269
+ * @param items Элементы списка фильтров категории.
5270
+ */
5271
+ updateFormControls(items) {
5272
+ this.formSyncs.unsubscribe();
5273
+ this.formSyncs = new Subscription();
5274
+ const appliedFilters = this.getAppliedFilters();
5275
+ Object.keys(this.form.controls).forEach((key) => {
5276
+ this.form.removeControl(key, { emitEvent: false });
5277
+ });
5278
+ this.flattenFilters(items).forEach((item) => {
5279
+ // eslint-disable-next-line security/detect-object-injection
5280
+ const appliedValue = appliedFilters[item.id];
5281
+ switch (item.type) {
5282
+ case 'checkbox': {
5283
+ const checkboxControl = this.createCheckboxFormControl(item, appliedValue);
5284
+ this.form.addControl(item.id, checkboxControl, { emitEvent: false });
4844
5285
  // Single-select для !isMultiple: при выборе одного остальные снимаются.
4845
5286
  if (!item.isMultiple && item.values.length > 1) {
4846
5287
  this.formSyncs.add(this.syncSingleSelectCheckbox(checkboxControl));
@@ -4860,6 +5301,11 @@ class ScCatalogFiltersComponent {
4860
5301
  break;
4861
5302
  }
4862
5303
  });
5304
+ items.forEach((item) => {
5305
+ if (item.type === 'group') {
5306
+ this.formSyncs.add(this.syncSingleSelectGroup(item));
5307
+ }
5308
+ });
4863
5309
  }
4864
5310
  /**
4865
5311
  * Возвращает текущие применённые фильтры из хранилища фильтров.
@@ -4877,7 +5323,7 @@ class ScCatalogFiltersComponent {
4877
5323
  */
4878
5324
  buildPropertyFilters(value) {
4879
5325
  const result = {};
4880
- this.filters()?.forEach((filterItem) => {
5326
+ this.flatFilters().forEach((filterItem) => {
4881
5327
  const controlValue = value[filterItem.id];
4882
5328
  if (isNil(controlValue)) {
4883
5329
  return;
@@ -4962,6 +5408,25 @@ class ScCatalogFiltersComponent {
4962
5408
  group.setValue(next);
4963
5409
  });
4964
5410
  }
5411
+ /**
5412
+ * Реализует выбор одного фильтра в группе: при включении переключателя остальные переключатели группы выключаются.
5413
+ * Повторное нажатие на включённый переключатель снимает выбор.
5414
+ *
5415
+ * @param groupFilter Группа фильтров.
5416
+ */
5417
+ syncSingleSelectGroup(groupFilter) {
5418
+ const controls = groupFilter.filters
5419
+ .filter((filterItem) => filterItem.type === 'toggle')
5420
+ .map((filterItem) => this.form.get(filterItem.id))
5421
+ .filter((control) => tuiIsPresent(control));
5422
+ return merge(...controls.map((control) => control.valueChanges.pipe(filter(Boolean), map(() => control)))).subscribe((selectedControl) => {
5423
+ controls
5424
+ .filter((control) => control !== selectedControl && control.value)
5425
+ .forEach((control) => {
5426
+ control.setValue(false);
5427
+ });
5428
+ });
5429
+ }
4965
5430
  /**
4966
5431
  * Связывает поля «от»/«до» с контролом слайдера.
4967
5432
  *
@@ -5089,21 +5554,22 @@ class ScCatalogFiltersComponent {
5089
5554
  this.form.get(filterId)?.get('to')?.reset(+max);
5090
5555
  }
5091
5556
  /**
5092
- * Сбрасывает все чекбоксы группы в `false`.
5557
+ * Проверяет, что пользователь менял фильтры группы.
5093
5558
  *
5094
- * @param filterId Идентификатор фильтра (ключ FormGroup в форме).
5559
+ * @param groupFilter Группа фильтров.
5095
5560
  */
5096
- resetCheckboxGroup(filterId) {
5097
- const group = this.form.get(filterId);
5098
- if (!group) {
5099
- return;
5100
- }
5101
- const resetValue = {};
5102
- Object.keys(group.controls).forEach((id) => {
5103
- // eslint-disable-next-line security/detect-object-injection
5104
- resetValue[id] = false;
5561
+ isGroupDirty(groupFilter) {
5562
+ return groupFilter.filters.some((filterItem) => this.form.get(filterItem.id)?.dirty);
5563
+ }
5564
+ /**
5565
+ * Сбрасывает фильтры группы к исходным значениям.
5566
+ *
5567
+ * @param groupFilter Группа фильтров.
5568
+ */
5569
+ resetGroupFilters(groupFilter) {
5570
+ groupFilter.filters.forEach((filterItem) => {
5571
+ this.resetFilter(filterItem);
5105
5572
  });
5106
- group.reset(resetValue);
5107
5573
  }
5108
5574
  /**
5109
5575
  * Сбрасывает все фильтры и оповещает родителя о нажатии кнопки сброса.
@@ -5124,42 +5590,52 @@ class ScCatalogFiltersComponent {
5124
5590
  * @param emitEvent Признак необходимости эмитить события изменения контролов (false — тихий сброс без отправки значений в хранилище фильтров).
5125
5591
  */
5126
5592
  resetAllFilters(emitEvent = true) {
5127
- this.filters()?.forEach((filterItem) => {
5128
- const control = this.form.get(filterItem.id);
5129
- if (!control) {
5130
- return;
5593
+ this.flatFilters().forEach((filterItem) => {
5594
+ this.resetFilter(filterItem, emitEvent);
5595
+ });
5596
+ }
5597
+ /**
5598
+ * Сбрасывает фильтр к исходному значению.
5599
+ *
5600
+ * @param filterItem Фильтр каталога.
5601
+ * @param emitEvent Признак необходимости эмитить события изменения контролов. При false сброс проходит тихо, без отправки значений в хранилище фильтров.
5602
+ */
5603
+ resetFilter(filterItem, emitEvent = true) {
5604
+ const control = this.form.get(filterItem.id);
5605
+ if (!control) {
5606
+ return;
5607
+ }
5608
+ switch (filterItem.type) {
5609
+ case 'checkbox': {
5610
+ const group = control;
5611
+ const resetValue = {};
5612
+ Object.keys(group.controls).forEach((id) => {
5613
+ // eslint-disable-next-line security/detect-object-injection
5614
+ resetValue[id] = false;
5615
+ });
5616
+ group.reset(resetValue, { emitEvent });
5617
+ break;
5131
5618
  }
5132
- switch (filterItem.type) {
5133
- case 'checkbox': {
5134
- const group = control;
5135
- const resetValue = {};
5136
- Object.keys(group.controls).forEach((id) => {
5137
- // eslint-disable-next-line security/detect-object-injection
5138
- resetValue[id] = false;
5139
- });
5140
- group.reset(resetValue, { emitEvent });
5141
- break;
5142
- }
5143
- case 'toggle':
5144
- control.reset(false, { emitEvent });
5145
- break;
5146
- case 'range': {
5147
- const group = control;
5148
- const { min, max } = filterItem;
5149
- group.reset({ from: min, to: max, slider: [min, max] }, { emitEvent });
5150
- break;
5151
- }
5152
- default:
5153
- break;
5619
+ case 'toggle':
5620
+ control.reset(false, { emitEvent });
5621
+ break;
5622
+ case 'range': {
5623
+ const group = control;
5624
+ const { min, max } = filterItem;
5625
+ group.reset({ from: min, to: max, slider: [min, max] }, { emitEvent });
5626
+ break;
5154
5627
  }
5155
- });
5628
+ default:
5629
+ break;
5630
+ }
5156
5631
  }
5157
5632
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScCatalogFiltersComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
5158
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScCatalogFiltersComponent, isStandalone: true, selector: "sc-catalog-filters", inputs: { showResultsButton: { classPropertyName: "showResultsButton", publicName: "showResultsButton", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { resetFilters: "resetFilters", showResults: "showResults" }, ngImport: i0, template: "@if (filters()?.length) {\n <form\n [formGroup]=\"form\"\n class=\"flex flex-col pb-1\"\n >\n @for (filter of filters(); track filter.id; let isFirst = $first) {\n @if (!isFirst) {\n <hr class=\"my-3 w-full h-px\" />\n }\n\n <div class=\"flex flex-col gap-2\">\n <!-- \u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A \u0433\u0440\u0443\u043F\u043F\u044B. \u0414\u043B\u044F toggle \u043F\u043E\u0434\u043F\u0438\u0441\u0438 \u043D\u0435\u0442: \u043C\u0435\u0442\u043A\u0430 \u0438\u0434\u0451\u0442 \u043F\u0440\u044F\u043C\u043E \u0440\u044F\u0434\u043E\u043C \u0441 \u0441\u0430\u043C\u0438\u043C checkbox. -->\n @if (filter.type !== 'toggle') {\n <label class=\"text-body-s-bold\">{{ filter.label }}</label>\n }\n\n <!-- Checkbox: FormGroup(value.id \u2192 boolean) \u0434\u043B\u044F \u043B\u044E\u0431\u043E\u0433\u043E \u0447\u0438\u0441\u043B\u0430 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439.\n \u0420\u0430\u0437\u0432\u0438\u043B\u043A\u0430 \u043E\u0434\u043D\u043E/\u043C\u043D\u043E\u0433\u043E \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439 \u0432\u044B\u043D\u0435\u0441\u0435\u043D\u0430 \u0432 TS (\u0441\u043C. processCheckboxFilter).\n ng-template \u0432\u043D\u0443\u0442\u0440\u0438 formGroupName: \u0438\u043D\u0430\u0447\u0435 reactive forms \u043D\u0435 \u043D\u0430\u0439\u0434\u0451\u0442 ControlContainer \u043F\u0440\u0438 \u043F\u0440\u043E\u0435\u043A\u0446\u0438\u0438 \u0432 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0439 \u043A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442. -->\n @if (filter.type === 'checkbox') {\n <div\n class=\"flex flex-col gap-2\"\n [formGroupName]=\"filter.id\"\n >\n <sc-catalog-filter-collapsible\n [itemsCount]=\"filter.values.length\"\n [showReset]=\"form.get(filter.id)?.dirty ?? false\"\n (resetGroup)=\"resetCheckboxGroup(filter.id)\"\n >\n <ng-template>\n <div class=\"flex flex-col gap-2\">\n @for (value of filter.values; track value.id) {\n <label class=\"flex items-center gap-2\">\n <input\n [formControlName]=\"value.id\"\n tuiCheckbox\n type=\"checkbox\"\n />\n <span class=\"text-body-s\">{{ value.label }}</span>\n </label>\n }\n </div>\n </ng-template>\n </sc-catalog-filter-collapsible>\n </div>\n\n <!-- Toggle: \u043E\u0434\u0438\u043D boolean \u043D\u0430 \u043A\u043E\u0440\u043D\u0435 \u0444\u043E\u0440\u043C\u044B, \u043F\u043E\u0434\u043F\u0438\u0441\u044C = filter.label -->\n } @else if (filter.type === 'toggle') {\n <label class=\"flex items-center gap-2\">\n <input\n [formControlName]=\"filter.id\"\n tuiCheckbox\n type=\"checkbox\"\n />\n <span class=\"text-body-s-bold\">{{ filter.label }}</span>\n </label>\n\n <!-- Range: FormGroup(from, to, slider) \u0441 \u0434\u0432\u0443\u0441\u0442\u043E\u0440\u043E\u043D\u043D\u0435\u0439 \u0441\u0438\u043D\u0445\u0440\u043E\u043D\u0438\u0437\u0430\u0446\u0438\u0435\u0439 -->\n } @else if (filter.type === 'range') {\n <div\n [formGroupName]=\"filter.id\"\n class=\"flex flex-col gap-3\"\n >\n <div class=\"flex gap-3 px-1\">\n <label\n tuiLabel\n class=\"min-w-0 flex-1\"\n >\n \u041E\u0442\n <tui-textfield [tuiTextfieldCleaner]=\"false\">\n <input\n scSelectOnFocusin\n tuiInputNumber\n formControlName=\"from\"\n [min]=\"+filter.min\"\n [max]=\"+filter.max\"\n autocomplete=\"off\"\n placeholder=\"\u041E\u0442\"\n />\n @if (form.get(filter.id)?.get('from')?.dirty) {\n <button\n tuiIconButton\n type=\"button\"\n size=\"xs\"\n appearance=\"icon\"\n (click)=\"resetRangeFrom(filter.id, filter.min)\"\n >\n <tui-icon icon=\"@tui.x\" />\n </button>\n }\n </tui-textfield>\n </label>\n <label\n tuiLabel\n class=\"min-w-0 flex-1\"\n >\n \u0414\u043E\n <tui-textfield [tuiTextfieldCleaner]=\"false\">\n <input\n scSelectOnFocusin\n tuiInputNumber\n formControlName=\"to\"\n [min]=\"+filter.min\"\n [max]=\"+filter.max\"\n autocomplete=\"off\"\n placeholder=\"\u0414\u043E\"\n />\n @if (form.get(filter.id)?.get('to')?.dirty) {\n <button\n tuiIconButton\n type=\"button\"\n size=\"xs\"\n appearance=\"icon\"\n (click)=\"resetRangeTo(filter.id, filter.max)\"\n >\n <tui-icon icon=\"@tui.x\" />\n </button>\n }\n </tui-textfield>\n </label>\n </div>\n\n <tui-range\n size=\"m\"\n formControlName=\"slider\"\n [min]=\"+filter.min\"\n [max]=\"+filter.max\"\n [style.--tui-thickness.rem]=\"0.25\"\n />\n </div>\n }\n </div>\n }\n <button\n tuiButton\n appearance=\"secondary\"\n type=\"button\"\n class=\"mt-2\"\n (click)=\"onResetFiltersClick()\"\n >\n \u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440\u044B\n </button>\n @if (showResultsButton()) {\n <button\n tuiButton\n appearance=\"primary\"\n type=\"button\"\n class=\"mt-2\"\n (click)=\"onShowResultsClick()\"\n >\n \u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B\n </button>\n }\n </form>\n}\n", styles: [".accordion [tuiAccordion]{border:none;-webkit-mask:none;mask:none}.accordion tui-expand{box-shadow:none}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i2$3.TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i2.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i2.TuiTextfieldOptionsDirective, selector: "[tuiTextfieldAppearance],[tuiTextfieldSize],[tuiTextfieldCleaner]", inputs: ["tuiTextfieldAppearance", "tuiTextfieldSize", "tuiTextfieldCleaner"] }, { kind: "directive", type: ScSelectOnFocusinDirective, selector: "tui-input-number, tui-input, tui-input-phone, tui-input-date, tui-input-password, input[tuiInput], input[tuiInputNumber], input[tuiTextfield], input[tuiInputSlider]" }, { kind: "component", type: ScCatalogFilterCollapsibleComponent, selector: "sc-catalog-filter-collapsible", inputs: ["itemsCount", "showReset"], outputs: ["resetGroup"] }, { kind: "component", type: TuiCheckbox, selector: "input[type=\"checkbox\"][tuiCheckbox]" }, { kind: "directive", type: i1$1.TuiInputNumberDirective, selector: "input[tuiInputNumber]" }, { kind: "component", type: TuiRange, selector: "tui-range", inputs: ["min", "max", "step", "segments", "keySteps", "focusable", "margin", "limit"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiIcon, selector: "tui-icon:not([tuiBadge])", inputs: ["background"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5633
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScCatalogFiltersComponent, isStandalone: true, selector: "sc-catalog-filters", inputs: { showResultsButton: { classPropertyName: "showResultsButton", publicName: "showResultsButton", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { resetFilters: "resetFilters", showResults: "showResults" }, ngImport: i0, template: "@if (filters()?.length) {\n <form\n [formGroup]=\"form\"\n class=\"flex flex-col pb-1\"\n >\n @for (item of filters(); track item.id; let isFirst = $first) {\n @if (!isFirst) {\n <hr class=\"my-3 w-full h-px\" />\n }\n\n <!-- \u0413\u0440\u0443\u043F\u043F\u0430: \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A \u0431\u043B\u043E\u043A\u0430 \u0438 \u0444\u0438\u043B\u044C\u0442\u0440\u044B \u0433\u0440\u0443\u043F\u043F\u044B. \u0413\u0440\u0443\u043F\u043F\u0430 \u0438\u0437 \u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A SC_CATALOG_FILTER_PREVIEWS \u0432\u044B\u0432\u043E\u0434\u0438\u0442\u0441\u044F \u043F\u043B\u0438\u0442\u043A\u0430\u043C\u0438 \u0441 \u0438\u043A\u043E\u043D\u043A\u0430\u043C\u0438,\n \u043E\u0441\u0442\u0430\u043B\u044C\u043D\u044B\u0435 \u0433\u0440\u0443\u043F\u043F\u044B \u0432\u044B\u0432\u043E\u0434\u044F\u0442 \u0444\u0438\u043B\u044C\u0442\u0440\u044B \u0432 \u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u043E\u043C \u0432\u0438\u0434\u0435. \u041A\u043E\u043D\u0442\u0440\u043E\u043B\u044B \u0444\u0438\u043B\u044C\u0442\u0440\u043E\u0432 \u0433\u0440\u0443\u043F\u043F\u044B \u043B\u0435\u0436\u0430\u0442 \u0432 \u043A\u043E\u0440\u043D\u0435 \u0444\u043E\u0440\u043C\u044B. -->\n @if (item.type === 'group') {\n @let preview = previews[item.id];\n <div class=\"flex flex-col gap-2\">\n <label class=\"text-body-s-bold\">{{ item.label }}</label>\n @if (preview) {\n <!-- \u041E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u0435 \u043F\u043B\u0438\u0442\u043A\u0438 \u0437\u0430\u0434\u0430\u0451\u0442 input[tuiBlock], \u0443 label \u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u0435 \u0441\u043D\u044F\u0442\u043E (appearance=\"\"). -->\n <div class=\"grid grid-cols-2 gap-2\">\n @for (filterItem of item.filters; track filterItem.id) {\n @if (filterItem.type === 'toggle') {\n <label\n class=\"flex-col items-center text-center\"\n appearance=\"\"\n tuiBlock=\"s\"\n >\n <input\n class=\"bg-tui-background-neutral-1\"\n [formControlName]=\"filterItem.id\"\n tuiBlock\n type=\"checkbox\"\n />\n <tui-icon [icon]=\"preview.icons[filterItem.id] ?? preview.defaultIcon\" />\n <span class=\"text-body-s-bold\">{{ filterItem.label }}</span>\n </label>\n } @else {\n <div class=\"col-span-2\">\n <ng-container *ngTemplateOutlet=\"filterTemplate; context: { $implicit: filterItem }\" />\n </div>\n }\n }\n </div>\n @if (isGroupDirty(item)) {\n <button\n tuiLink\n type=\"button\"\n class=\"text-start !text-body-s\"\n (click)=\"resetGroupFilters(item)\"\n >\n \u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C\n </button>\n }\n } @else {\n <div class=\"flex flex-col gap-3\">\n @for (filterItem of item.filters; track filterItem.id) {\n <ng-container *ngTemplateOutlet=\"filterTemplate; context: { $implicit: filterItem }\" />\n }\n </div>\n }\n </div>\n } @else {\n <ng-container *ngTemplateOutlet=\"filterTemplate; context: { $implicit: item }\" />\n }\n }\n\n <!-- \u0412\u044B\u0432\u043E\u0434 \u043E\u0434\u043D\u043E\u0433\u043E \u0444\u0438\u043B\u044C\u0442\u0440\u0430. \u0428\u0430\u0431\u043B\u043E\u043D \u043E\u0431\u044A\u044F\u0432\u043B\u0435\u043D \u0432\u043D\u0443\u0442\u0440\u0438 \u0444\u043E\u0440\u043C\u044B, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 formControlName \u0438 formGroupName \u0431\u0435\u0440\u0443\u0442 \u0435\u0451 \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044B. -->\n <ng-template\n #filterTemplate\n let-filter\n >\n <div class=\"flex flex-col gap-2\">\n <!-- \u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A \u0444\u0438\u043B\u044C\u0442\u0440\u0430. \u0414\u043B\u044F toggle \u043F\u043E\u0434\u043F\u0438\u0441\u0438 \u043D\u0435\u0442: \u043C\u0435\u0442\u043A\u0430 \u0438\u0434\u0451\u0442 \u043F\u0440\u044F\u043C\u043E \u0440\u044F\u0434\u043E\u043C \u0441 \u0441\u0430\u043C\u0438\u043C checkbox. -->\n @if (filter.type !== 'toggle') {\n <label class=\"text-body-s-bold\">{{ filter.label }}</label>\n }\n\n <!-- Checkbox: FormGroup(value.id \u2192 boolean) \u0434\u043B\u044F \u043B\u044E\u0431\u043E\u0433\u043E \u0447\u0438\u0441\u043B\u0430 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439.\n \u0420\u0430\u0437\u0432\u0438\u043B\u043A\u0430 \u043E\u0434\u043D\u043E/\u043C\u043D\u043E\u0433\u043E \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439 \u0432\u044B\u043D\u0435\u0441\u0435\u043D\u0430 \u0432 TS (\u0441\u043C. processCheckboxFilter).\n ng-template \u0432\u043D\u0443\u0442\u0440\u0438 formGroupName: \u0438\u043D\u0430\u0447\u0435 reactive forms \u043D\u0435 \u043D\u0430\u0439\u0434\u0451\u0442 ControlContainer \u043F\u0440\u0438 \u043F\u0440\u043E\u0435\u043A\u0446\u0438\u0438 \u0432 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0439 \u043A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442. -->\n @if (filter.type === 'checkbox') {\n <div\n class=\"flex flex-col gap-2\"\n [formGroupName]=\"filter.id\"\n >\n <sc-catalog-filter-collapsible\n [itemsCount]=\"filter.values.length\"\n [showReset]=\"form.get(filter.id)?.dirty ?? false\"\n (resetGroup)=\"resetFilter(filter)\"\n >\n <ng-template>\n <div class=\"flex flex-col gap-2\">\n @for (value of filter.values; track value.id) {\n <label class=\"flex items-center gap-2\">\n <input\n [formControlName]=\"value.id\"\n tuiCheckbox\n type=\"checkbox\"\n />\n <span class=\"text-body-s\">{{ value.label }}</span>\n </label>\n }\n </div>\n </ng-template>\n </sc-catalog-filter-collapsible>\n </div>\n\n <!-- Toggle: \u043E\u0434\u0438\u043D boolean \u043D\u0430 \u043A\u043E\u0440\u043D\u0435 \u0444\u043E\u0440\u043C\u044B, \u043F\u043E\u0434\u043F\u0438\u0441\u044C = filter.label -->\n } @else if (filter.type === 'toggle') {\n <label class=\"flex items-center gap-2\">\n <input\n [formControlName]=\"filter.id\"\n tuiCheckbox\n type=\"checkbox\"\n />\n <span class=\"text-body-s-bold\">{{ filter.label }}</span>\n </label>\n\n <!-- Range: FormGroup(from, to, slider) \u0441 \u0434\u0432\u0443\u0441\u0442\u043E\u0440\u043E\u043D\u043D\u0435\u0439 \u0441\u0438\u043D\u0445\u0440\u043E\u043D\u0438\u0437\u0430\u0446\u0438\u0435\u0439 -->\n } @else if (filter.type === 'range') {\n <div\n [formGroupName]=\"filter.id\"\n class=\"flex flex-col gap-3\"\n >\n <div class=\"flex gap-3 px-1\">\n <label\n tuiLabel\n class=\"min-w-0 flex-1\"\n >\n \u041E\u0442\n <tui-textfield [tuiTextfieldCleaner]=\"false\">\n <input\n scSelectOnFocusin\n tuiInputNumber\n formControlName=\"from\"\n [min]=\"+filter.min\"\n [max]=\"+filter.max\"\n autocomplete=\"off\"\n placeholder=\"\u041E\u0442\"\n />\n @if (form.get(filter.id)?.get('from')?.dirty) {\n <button\n tuiIconButton\n type=\"button\"\n size=\"xs\"\n appearance=\"icon\"\n (click)=\"resetRangeFrom(filter.id, filter.min)\"\n >\n <tui-icon icon=\"@tui.x\" />\n </button>\n }\n </tui-textfield>\n </label>\n <label\n tuiLabel\n class=\"min-w-0 flex-1\"\n >\n \u0414\u043E\n <tui-textfield [tuiTextfieldCleaner]=\"false\">\n <input\n scSelectOnFocusin\n tuiInputNumber\n formControlName=\"to\"\n [min]=\"+filter.min\"\n [max]=\"+filter.max\"\n autocomplete=\"off\"\n placeholder=\"\u0414\u043E\"\n />\n @if (form.get(filter.id)?.get('to')?.dirty) {\n <button\n tuiIconButton\n type=\"button\"\n size=\"xs\"\n appearance=\"icon\"\n (click)=\"resetRangeTo(filter.id, filter.max)\"\n >\n <tui-icon icon=\"@tui.x\" />\n </button>\n }\n </tui-textfield>\n </label>\n </div>\n\n <tui-range\n size=\"m\"\n formControlName=\"slider\"\n [min]=\"+filter.min\"\n [max]=\"+filter.max\"\n [style.--tui-thickness.rem]=\"0.25\"\n />\n </div>\n }\n </div>\n </ng-template>\n\n <button\n tuiButton\n appearance=\"secondary\"\n type=\"button\"\n class=\"mt-2\"\n (click)=\"onResetFiltersClick()\"\n >\n \u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440\u044B\n </button>\n @if (showResultsButton()) {\n <button\n tuiButton\n appearance=\"primary\"\n type=\"button\"\n class=\"mt-2\"\n (click)=\"onShowResultsClick()\"\n >\n \u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B\n </button>\n }\n </form>\n}\n", styles: [".accordion [tuiAccordion]{border:none;-webkit-mask:none;mask:none}.accordion tui-expand{box-shadow:none}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i2$3.TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i2.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i2.TuiTextfieldOptionsDirective, selector: "[tuiTextfieldAppearance],[tuiTextfieldSize],[tuiTextfieldCleaner]", inputs: ["tuiTextfieldAppearance", "tuiTextfieldSize", "tuiTextfieldCleaner"] }, { kind: "directive", type: ScSelectOnFocusinDirective, selector: "tui-input-number, tui-input, tui-input-phone, tui-input-date, tui-input-password, input[tuiInput], input[tuiInputNumber], input[tuiTextfield], input[tuiInputSlider]" }, { kind: "component", type: ScCatalogFilterCollapsibleComponent, selector: "sc-catalog-filter-collapsible", inputs: ["itemsCount", "showReset"], outputs: ["resetGroup"] }, { kind: "component", type: TuiCheckbox, selector: "input[type=\"checkbox\"][tuiCheckbox]" }, { kind: "directive", type: i1$1.TuiInputNumberDirective, selector: "input[tuiInputNumber]" }, { kind: "component", type: TuiRange, selector: "tui-range", inputs: ["min", "max", "step", "segments", "keySteps", "focusable", "margin", "limit"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiIcon, selector: "tui-icon:not([tuiBadge])", inputs: ["background"] }, { kind: "directive", type: TuiBlock, selector: "label[tuiBlock],input[tuiBlock]", inputs: ["tuiBlock"] }, { kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5159
5634
  }
5160
5635
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScCatalogFiltersComponent, decorators: [{
5161
5636
  type: Component,
5162
5637
  args: [{ standalone: true, selector: 'sc-catalog-filters', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
5638
+ NgTemplateOutlet,
5163
5639
  ReactiveFormsModule,
5164
5640
  TuiTextfield,
5165
5641
  ScSelectOnFocusinDirective,
@@ -5171,7 +5647,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
5171
5647
  TuiRange,
5172
5648
  TuiButton,
5173
5649
  TuiIcon,
5174
- ], template: "@if (filters()?.length) {\n <form\n [formGroup]=\"form\"\n class=\"flex flex-col pb-1\"\n >\n @for (filter of filters(); track filter.id; let isFirst = $first) {\n @if (!isFirst) {\n <hr class=\"my-3 w-full h-px\" />\n }\n\n <div class=\"flex flex-col gap-2\">\n <!-- \u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A \u0433\u0440\u0443\u043F\u043F\u044B. \u0414\u043B\u044F toggle \u043F\u043E\u0434\u043F\u0438\u0441\u0438 \u043D\u0435\u0442: \u043C\u0435\u0442\u043A\u0430 \u0438\u0434\u0451\u0442 \u043F\u0440\u044F\u043C\u043E \u0440\u044F\u0434\u043E\u043C \u0441 \u0441\u0430\u043C\u0438\u043C checkbox. -->\n @if (filter.type !== 'toggle') {\n <label class=\"text-body-s-bold\">{{ filter.label }}</label>\n }\n\n <!-- Checkbox: FormGroup(value.id \u2192 boolean) \u0434\u043B\u044F \u043B\u044E\u0431\u043E\u0433\u043E \u0447\u0438\u0441\u043B\u0430 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439.\n \u0420\u0430\u0437\u0432\u0438\u043B\u043A\u0430 \u043E\u0434\u043D\u043E/\u043C\u043D\u043E\u0433\u043E \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439 \u0432\u044B\u043D\u0435\u0441\u0435\u043D\u0430 \u0432 TS (\u0441\u043C. processCheckboxFilter).\n ng-template \u0432\u043D\u0443\u0442\u0440\u0438 formGroupName: \u0438\u043D\u0430\u0447\u0435 reactive forms \u043D\u0435 \u043D\u0430\u0439\u0434\u0451\u0442 ControlContainer \u043F\u0440\u0438 \u043F\u0440\u043E\u0435\u043A\u0446\u0438\u0438 \u0432 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0439 \u043A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442. -->\n @if (filter.type === 'checkbox') {\n <div\n class=\"flex flex-col gap-2\"\n [formGroupName]=\"filter.id\"\n >\n <sc-catalog-filter-collapsible\n [itemsCount]=\"filter.values.length\"\n [showReset]=\"form.get(filter.id)?.dirty ?? false\"\n (resetGroup)=\"resetCheckboxGroup(filter.id)\"\n >\n <ng-template>\n <div class=\"flex flex-col gap-2\">\n @for (value of filter.values; track value.id) {\n <label class=\"flex items-center gap-2\">\n <input\n [formControlName]=\"value.id\"\n tuiCheckbox\n type=\"checkbox\"\n />\n <span class=\"text-body-s\">{{ value.label }}</span>\n </label>\n }\n </div>\n </ng-template>\n </sc-catalog-filter-collapsible>\n </div>\n\n <!-- Toggle: \u043E\u0434\u0438\u043D boolean \u043D\u0430 \u043A\u043E\u0440\u043D\u0435 \u0444\u043E\u0440\u043C\u044B, \u043F\u043E\u0434\u043F\u0438\u0441\u044C = filter.label -->\n } @else if (filter.type === 'toggle') {\n <label class=\"flex items-center gap-2\">\n <input\n [formControlName]=\"filter.id\"\n tuiCheckbox\n type=\"checkbox\"\n />\n <span class=\"text-body-s-bold\">{{ filter.label }}</span>\n </label>\n\n <!-- Range: FormGroup(from, to, slider) \u0441 \u0434\u0432\u0443\u0441\u0442\u043E\u0440\u043E\u043D\u043D\u0435\u0439 \u0441\u0438\u043D\u0445\u0440\u043E\u043D\u0438\u0437\u0430\u0446\u0438\u0435\u0439 -->\n } @else if (filter.type === 'range') {\n <div\n [formGroupName]=\"filter.id\"\n class=\"flex flex-col gap-3\"\n >\n <div class=\"flex gap-3 px-1\">\n <label\n tuiLabel\n class=\"min-w-0 flex-1\"\n >\n \u041E\u0442\n <tui-textfield [tuiTextfieldCleaner]=\"false\">\n <input\n scSelectOnFocusin\n tuiInputNumber\n formControlName=\"from\"\n [min]=\"+filter.min\"\n [max]=\"+filter.max\"\n autocomplete=\"off\"\n placeholder=\"\u041E\u0442\"\n />\n @if (form.get(filter.id)?.get('from')?.dirty) {\n <button\n tuiIconButton\n type=\"button\"\n size=\"xs\"\n appearance=\"icon\"\n (click)=\"resetRangeFrom(filter.id, filter.min)\"\n >\n <tui-icon icon=\"@tui.x\" />\n </button>\n }\n </tui-textfield>\n </label>\n <label\n tuiLabel\n class=\"min-w-0 flex-1\"\n >\n \u0414\u043E\n <tui-textfield [tuiTextfieldCleaner]=\"false\">\n <input\n scSelectOnFocusin\n tuiInputNumber\n formControlName=\"to\"\n [min]=\"+filter.min\"\n [max]=\"+filter.max\"\n autocomplete=\"off\"\n placeholder=\"\u0414\u043E\"\n />\n @if (form.get(filter.id)?.get('to')?.dirty) {\n <button\n tuiIconButton\n type=\"button\"\n size=\"xs\"\n appearance=\"icon\"\n (click)=\"resetRangeTo(filter.id, filter.max)\"\n >\n <tui-icon icon=\"@tui.x\" />\n </button>\n }\n </tui-textfield>\n </label>\n </div>\n\n <tui-range\n size=\"m\"\n formControlName=\"slider\"\n [min]=\"+filter.min\"\n [max]=\"+filter.max\"\n [style.--tui-thickness.rem]=\"0.25\"\n />\n </div>\n }\n </div>\n }\n <button\n tuiButton\n appearance=\"secondary\"\n type=\"button\"\n class=\"mt-2\"\n (click)=\"onResetFiltersClick()\"\n >\n \u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440\u044B\n </button>\n @if (showResultsButton()) {\n <button\n tuiButton\n appearance=\"primary\"\n type=\"button\"\n class=\"mt-2\"\n (click)=\"onShowResultsClick()\"\n >\n \u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B\n </button>\n }\n </form>\n}\n", styles: [".accordion [tuiAccordion]{border:none;-webkit-mask:none;mask:none}.accordion tui-expand{box-shadow:none}\n"] }]
5650
+ TuiBlock,
5651
+ TuiLink,
5652
+ ], template: "@if (filters()?.length) {\n <form\n [formGroup]=\"form\"\n class=\"flex flex-col pb-1\"\n >\n @for (item of filters(); track item.id; let isFirst = $first) {\n @if (!isFirst) {\n <hr class=\"my-3 w-full h-px\" />\n }\n\n <!-- \u0413\u0440\u0443\u043F\u043F\u0430: \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A \u0431\u043B\u043E\u043A\u0430 \u0438 \u0444\u0438\u043B\u044C\u0442\u0440\u044B \u0433\u0440\u0443\u043F\u043F\u044B. \u0413\u0440\u0443\u043F\u043F\u0430 \u0438\u0437 \u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A SC_CATALOG_FILTER_PREVIEWS \u0432\u044B\u0432\u043E\u0434\u0438\u0442\u0441\u044F \u043F\u043B\u0438\u0442\u043A\u0430\u043C\u0438 \u0441 \u0438\u043A\u043E\u043D\u043A\u0430\u043C\u0438,\n \u043E\u0441\u0442\u0430\u043B\u044C\u043D\u044B\u0435 \u0433\u0440\u0443\u043F\u043F\u044B \u0432\u044B\u0432\u043E\u0434\u044F\u0442 \u0444\u0438\u043B\u044C\u0442\u0440\u044B \u0432 \u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u043E\u043C \u0432\u0438\u0434\u0435. \u041A\u043E\u043D\u0442\u0440\u043E\u043B\u044B \u0444\u0438\u043B\u044C\u0442\u0440\u043E\u0432 \u0433\u0440\u0443\u043F\u043F\u044B \u043B\u0435\u0436\u0430\u0442 \u0432 \u043A\u043E\u0440\u043D\u0435 \u0444\u043E\u0440\u043C\u044B. -->\n @if (item.type === 'group') {\n @let preview = previews[item.id];\n <div class=\"flex flex-col gap-2\">\n <label class=\"text-body-s-bold\">{{ item.label }}</label>\n @if (preview) {\n <!-- \u041E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u0435 \u043F\u043B\u0438\u0442\u043A\u0438 \u0437\u0430\u0434\u0430\u0451\u0442 input[tuiBlock], \u0443 label \u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u0435 \u0441\u043D\u044F\u0442\u043E (appearance=\"\"). -->\n <div class=\"grid grid-cols-2 gap-2\">\n @for (filterItem of item.filters; track filterItem.id) {\n @if (filterItem.type === 'toggle') {\n <label\n class=\"flex-col items-center text-center\"\n appearance=\"\"\n tuiBlock=\"s\"\n >\n <input\n class=\"bg-tui-background-neutral-1\"\n [formControlName]=\"filterItem.id\"\n tuiBlock\n type=\"checkbox\"\n />\n <tui-icon [icon]=\"preview.icons[filterItem.id] ?? preview.defaultIcon\" />\n <span class=\"text-body-s-bold\">{{ filterItem.label }}</span>\n </label>\n } @else {\n <div class=\"col-span-2\">\n <ng-container *ngTemplateOutlet=\"filterTemplate; context: { $implicit: filterItem }\" />\n </div>\n }\n }\n </div>\n @if (isGroupDirty(item)) {\n <button\n tuiLink\n type=\"button\"\n class=\"text-start !text-body-s\"\n (click)=\"resetGroupFilters(item)\"\n >\n \u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C\n </button>\n }\n } @else {\n <div class=\"flex flex-col gap-3\">\n @for (filterItem of item.filters; track filterItem.id) {\n <ng-container *ngTemplateOutlet=\"filterTemplate; context: { $implicit: filterItem }\" />\n }\n </div>\n }\n </div>\n } @else {\n <ng-container *ngTemplateOutlet=\"filterTemplate; context: { $implicit: item }\" />\n }\n }\n\n <!-- \u0412\u044B\u0432\u043E\u0434 \u043E\u0434\u043D\u043E\u0433\u043E \u0444\u0438\u043B\u044C\u0442\u0440\u0430. \u0428\u0430\u0431\u043B\u043E\u043D \u043E\u0431\u044A\u044F\u0432\u043B\u0435\u043D \u0432\u043D\u0443\u0442\u0440\u0438 \u0444\u043E\u0440\u043C\u044B, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 formControlName \u0438 formGroupName \u0431\u0435\u0440\u0443\u0442 \u0435\u0451 \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044B. -->\n <ng-template\n #filterTemplate\n let-filter\n >\n <div class=\"flex flex-col gap-2\">\n <!-- \u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A \u0444\u0438\u043B\u044C\u0442\u0440\u0430. \u0414\u043B\u044F toggle \u043F\u043E\u0434\u043F\u0438\u0441\u0438 \u043D\u0435\u0442: \u043C\u0435\u0442\u043A\u0430 \u0438\u0434\u0451\u0442 \u043F\u0440\u044F\u043C\u043E \u0440\u044F\u0434\u043E\u043C \u0441 \u0441\u0430\u043C\u0438\u043C checkbox. -->\n @if (filter.type !== 'toggle') {\n <label class=\"text-body-s-bold\">{{ filter.label }}</label>\n }\n\n <!-- Checkbox: FormGroup(value.id \u2192 boolean) \u0434\u043B\u044F \u043B\u044E\u0431\u043E\u0433\u043E \u0447\u0438\u0441\u043B\u0430 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439.\n \u0420\u0430\u0437\u0432\u0438\u043B\u043A\u0430 \u043E\u0434\u043D\u043E/\u043C\u043D\u043E\u0433\u043E \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0439 \u0432\u044B\u043D\u0435\u0441\u0435\u043D\u0430 \u0432 TS (\u0441\u043C. processCheckboxFilter).\n ng-template \u0432\u043D\u0443\u0442\u0440\u0438 formGroupName: \u0438\u043D\u0430\u0447\u0435 reactive forms \u043D\u0435 \u043D\u0430\u0439\u0434\u0451\u0442 ControlContainer \u043F\u0440\u0438 \u043F\u0440\u043E\u0435\u043A\u0446\u0438\u0438 \u0432 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0439 \u043A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442. -->\n @if (filter.type === 'checkbox') {\n <div\n class=\"flex flex-col gap-2\"\n [formGroupName]=\"filter.id\"\n >\n <sc-catalog-filter-collapsible\n [itemsCount]=\"filter.values.length\"\n [showReset]=\"form.get(filter.id)?.dirty ?? false\"\n (resetGroup)=\"resetFilter(filter)\"\n >\n <ng-template>\n <div class=\"flex flex-col gap-2\">\n @for (value of filter.values; track value.id) {\n <label class=\"flex items-center gap-2\">\n <input\n [formControlName]=\"value.id\"\n tuiCheckbox\n type=\"checkbox\"\n />\n <span class=\"text-body-s\">{{ value.label }}</span>\n </label>\n }\n </div>\n </ng-template>\n </sc-catalog-filter-collapsible>\n </div>\n\n <!-- Toggle: \u043E\u0434\u0438\u043D boolean \u043D\u0430 \u043A\u043E\u0440\u043D\u0435 \u0444\u043E\u0440\u043C\u044B, \u043F\u043E\u0434\u043F\u0438\u0441\u044C = filter.label -->\n } @else if (filter.type === 'toggle') {\n <label class=\"flex items-center gap-2\">\n <input\n [formControlName]=\"filter.id\"\n tuiCheckbox\n type=\"checkbox\"\n />\n <span class=\"text-body-s-bold\">{{ filter.label }}</span>\n </label>\n\n <!-- Range: FormGroup(from, to, slider) \u0441 \u0434\u0432\u0443\u0441\u0442\u043E\u0440\u043E\u043D\u043D\u0435\u0439 \u0441\u0438\u043D\u0445\u0440\u043E\u043D\u0438\u0437\u0430\u0446\u0438\u0435\u0439 -->\n } @else if (filter.type === 'range') {\n <div\n [formGroupName]=\"filter.id\"\n class=\"flex flex-col gap-3\"\n >\n <div class=\"flex gap-3 px-1\">\n <label\n tuiLabel\n class=\"min-w-0 flex-1\"\n >\n \u041E\u0442\n <tui-textfield [tuiTextfieldCleaner]=\"false\">\n <input\n scSelectOnFocusin\n tuiInputNumber\n formControlName=\"from\"\n [min]=\"+filter.min\"\n [max]=\"+filter.max\"\n autocomplete=\"off\"\n placeholder=\"\u041E\u0442\"\n />\n @if (form.get(filter.id)?.get('from')?.dirty) {\n <button\n tuiIconButton\n type=\"button\"\n size=\"xs\"\n appearance=\"icon\"\n (click)=\"resetRangeFrom(filter.id, filter.min)\"\n >\n <tui-icon icon=\"@tui.x\" />\n </button>\n }\n </tui-textfield>\n </label>\n <label\n tuiLabel\n class=\"min-w-0 flex-1\"\n >\n \u0414\u043E\n <tui-textfield [tuiTextfieldCleaner]=\"false\">\n <input\n scSelectOnFocusin\n tuiInputNumber\n formControlName=\"to\"\n [min]=\"+filter.min\"\n [max]=\"+filter.max\"\n autocomplete=\"off\"\n placeholder=\"\u0414\u043E\"\n />\n @if (form.get(filter.id)?.get('to')?.dirty) {\n <button\n tuiIconButton\n type=\"button\"\n size=\"xs\"\n appearance=\"icon\"\n (click)=\"resetRangeTo(filter.id, filter.max)\"\n >\n <tui-icon icon=\"@tui.x\" />\n </button>\n }\n </tui-textfield>\n </label>\n </div>\n\n <tui-range\n size=\"m\"\n formControlName=\"slider\"\n [min]=\"+filter.min\"\n [max]=\"+filter.max\"\n [style.--tui-thickness.rem]=\"0.25\"\n />\n </div>\n }\n </div>\n </ng-template>\n\n <button\n tuiButton\n appearance=\"secondary\"\n type=\"button\"\n class=\"mt-2\"\n (click)=\"onResetFiltersClick()\"\n >\n \u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440\u044B\n </button>\n @if (showResultsButton()) {\n <button\n tuiButton\n appearance=\"primary\"\n type=\"button\"\n class=\"mt-2\"\n (click)=\"onShowResultsClick()\"\n >\n \u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B\n </button>\n }\n </form>\n}\n", styles: [".accordion [tuiAccordion]{border:none;-webkit-mask:none;mask:none}.accordion tui-expand{box-shadow:none}\n"] }]
5175
5653
  }], ctorParameters: () => [], propDecorators: { showResultsButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showResultsButton", required: false }] }], resetFilters: [{ type: i0.Output, args: ["resetFilters"] }], showResults: [{ type: i0.Output, args: ["showResults"] }] } });
5176
5654
 
5177
5655
  /* eslint-disable @typescript-eslint/unbound-method */
@@ -6506,6 +6984,10 @@ class ScContragentsAccordionItemComponent {
6506
6984
  * Событие нажатия на кнопку удаления контактного лица у контрагента.
6507
6985
  */
6508
6986
  this.deleteContragentContactClick = new EventEmitter();
6987
+ /**
6988
+ * Перечисление организационно-правовых форм.
6989
+ */
6990
+ this.opfListEnum = ScOpfList;
6509
6991
  /**
6510
6992
  * Сервис работы с контрагентами.
6511
6993
  */
@@ -6526,7 +7008,7 @@ class ScContragentsAccordionItemComponent {
6526
7008
  this.deleteContragentContactClick.emit({ contact: contact, contragent: contragent });
6527
7009
  }
6528
7010
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScContragentsAccordionItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
6529
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScContragentsAccordionItemComponent, isStandalone: true, selector: "sc-contragents-accordion-item", inputs: { contragent: "contragent" }, outputs: { deleteContragentClick: "deleteContragentClick", addContragentBankAccountClick: "addContragentBankAccountClick", deleteContragentBankAccountClick: "deleteContragentBankAccountClick", addContragentContactClick: "addContragentContactClick", deleteContragentContactClick: "deleteContragentContactClick" }, ngImport: i0, template: "<sc-accordion [showAddButton]=\"false\">\n {{ contragent.name }}\n @if ($any(contragent).inn; as inn) {\n <span>\u0418\u041D\u041D: {{ inn }}</span>\n }\n\n <ng-template scAccordionContent>\n <div class=\"flex flex-col gap-2\">\n <div class=\"flex gap-2\">\n <div class=\"flex grow flex-col gap-2\">\n {{ contragent.name }}\n @if ($any(contragent).inn; as inn) {\n <span>\u0418\u041D\u041D: {{ inn }}</span>\n }\n @if ($any(contragent).kpp; as kpp) {\n <span>\u041A\u041F\u041F: {{ kpp }}</span>\n }\n </div>\n </div>\n\n <sc-accordion (addButtonClick)=\"addContragentBankAccountClick.emit(contragent)\">\n \u0411\u0430\u043D\u043A\u043E\u0432\u0441\u043A\u0438\u0435 \u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u044B\n <ng-template scAccordionContent>\n @let bankAccounts = bankAccounts$ | async;\n <tui-loader\n [overlay]=\"true\"\n [loading]=\"bankAccounts === null\"\n >\n <div class=\"flex flex-col gap-2\">\n @if (!bankAccounts || bankAccounts.length) {\n @for (bankAccount of bankAccounts; track bankAccount) {\n <div class=\"flex gap-2 border-b border-tui-base-03\">\n <div class=\"flex grow flex-col gap-2\">\n <span>\u0411\u0430\u043D\u043A: {{ bankAccount.bankName }}</span>\n <span>\u0411\u0418\u041A: {{ bankAccount.bic }}</span>\n <span>\u0420/\u0441\u0447\u0451\u0442: {{ bankAccount.accountNumber }}</span>\n <span>\u041A\u043E\u0440/\u0441\u0447\u0451\u0442: {{ bankAccount.correspondentAccount }}</span>\n <span>\u0412\u0430\u043B\u044E\u0442\u0430: {{ bankAccount.currency.name }}</span>\n </div>\n </div>\n }\n } @else {\n <div\n tuiNotification\n size=\"l\"\n >\n <div class=\"flex flex-wrap gap-2 font-medium\">\n \u0423 \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u0430 <span class=\"font-bold\">{{ contragent.name }}</span> \u043D\u0435 \u0443\u043A\u0430\u0437\u0430\u043D\u044B \u0431\u0430\u043D\u043A\u043E\u0432\u0441\u043A\u0438\u0435 \u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u044B.\n </div>\n </div>\n }\n </div>\n </tui-loader>\n </ng-template>\n </sc-accordion>\n @if (contacts$) {\n <sc-contacts-accordion\n [contacts$]=\"contacts$\"\n (addContactClick)=\"addContragentContactClick.emit(contragent)\"\n (deleteButtonClick)=\"onDeleteContragentContactClick($event, contragent)\"\n />\n }\n </div>\n </ng-template>\n</sc-accordion>\n", dependencies: [{ kind: "component", type: ScAccordionComponent, selector: "sc-accordion", inputs: ["showAddButton", "showDeleteButton", "showArrow", "open", "size", "disabledButtons"], outputs: ["addButtonClick", "deleteButtonClick"] }, { kind: "directive", type: ScAccordionContentDirective, selector: "ng-template[scAccordionContent]" }, { kind: "component", type: TuiLoader, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "loading"] }, { kind: "directive", type: i2.TuiNotificationDirective, selector: "[tuiNotification]:not(ng-template)", inputs: ["appearance", "size", "icon"] }, { kind: "component", type: ScContactsAccordionComponent, selector: "sc-contacts-accordion", inputs: ["contacts$"], outputs: ["addContactClick", "deleteButtonClick"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
7011
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScContragentsAccordionItemComponent, isStandalone: true, selector: "sc-contragents-accordion-item", inputs: { contragent: "contragent" }, outputs: { deleteContragentClick: "deleteContragentClick", addContragentBankAccountClick: "addContragentBankAccountClick", deleteContragentBankAccountClick: "deleteContragentBankAccountClick", addContragentContactClick: "addContragentContactClick", deleteContragentContactClick: "deleteContragentContactClick" }, ngImport: i0, template: "<sc-accordion [showAddButton]=\"false\">\n {{ contragent.name }}\n @if ($any(contragent).inn; as inn) {\n <span>\u0418\u041D\u041D: {{ inn }}</span>\n }\n\n <ng-template scAccordionContent>\n <div class=\"flex flex-col gap-2\">\n <div class=\"flex gap-2\">\n <div class=\"flex grow flex-col gap-2\">\n {{ contragent.name }}\n @if ($any(contragent).inn; as inn) {\n <span>\u0418\u041D\u041D: {{ inn }}</span>\n }\n @let ogrnLabel = contragent.opf.id === opfListEnum.entrepreneur ? '\u041E\u0413\u0420\u041D\u0418\u041F' : '\u041E\u0413\u0420\u041D';\n @if ($any(contragent).ogrn; as ogrn) {\n <span>{{ ogrnLabel }}: {{ ogrn }}</span>\n }\n @if ($any(contragent).kpp; as kpp) {\n <span>\u041A\u041F\u041F: {{ kpp }}</span>\n }\n </div>\n </div>\n\n <sc-accordion (addButtonClick)=\"addContragentBankAccountClick.emit(contragent)\">\n \u0411\u0430\u043D\u043A\u043E\u0432\u0441\u043A\u0438\u0435 \u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u044B\n <ng-template scAccordionContent>\n @let bankAccounts = bankAccounts$ | async;\n <tui-loader\n [overlay]=\"true\"\n [loading]=\"bankAccounts === null\"\n >\n <div class=\"flex flex-col gap-2\">\n @if (!bankAccounts || bankAccounts.length) {\n @for (bankAccount of bankAccounts; track bankAccount) {\n <div class=\"flex gap-2 border-b border-tui-base-03\">\n <div class=\"flex grow flex-col gap-2\">\n <span>\u0411\u0430\u043D\u043A: {{ bankAccount.bankName }}</span>\n <span>\u0411\u0418\u041A: {{ bankAccount.bic }}</span>\n <span>\u0420/\u0441\u0447\u0451\u0442: {{ bankAccount.accountNumber }}</span>\n <span>\u041A\u043E\u0440/\u0441\u0447\u0451\u0442: {{ bankAccount.correspondentAccount }}</span>\n <span>\u0412\u0430\u043B\u044E\u0442\u0430: {{ bankAccount.currency.name }}</span>\n </div>\n </div>\n }\n } @else {\n <div\n tuiNotification\n size=\"l\"\n >\n <div class=\"flex flex-wrap gap-2 font-medium\">\n \u0423 \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u0430 <span class=\"font-bold\">{{ contragent.name }}</span> \u043D\u0435 \u0443\u043A\u0430\u0437\u0430\u043D\u044B \u0431\u0430\u043D\u043A\u043E\u0432\u0441\u043A\u0438\u0435 \u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u044B.\n </div>\n </div>\n }\n </div>\n </tui-loader>\n </ng-template>\n </sc-accordion>\n @if (contacts$) {\n <sc-contacts-accordion\n [contacts$]=\"contacts$\"\n (addContactClick)=\"addContragentContactClick.emit(contragent)\"\n (deleteButtonClick)=\"onDeleteContragentContactClick($event, contragent)\"\n />\n }\n </div>\n </ng-template>\n</sc-accordion>\n", dependencies: [{ kind: "component", type: ScAccordionComponent, selector: "sc-accordion", inputs: ["showAddButton", "showDeleteButton", "showArrow", "open", "size", "disabledButtons"], outputs: ["addButtonClick", "deleteButtonClick"] }, { kind: "directive", type: ScAccordionContentDirective, selector: "ng-template[scAccordionContent]" }, { kind: "component", type: TuiLoader, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "loading"] }, { kind: "directive", type: i2.TuiNotificationDirective, selector: "[tuiNotification]:not(ng-template)", inputs: ["appearance", "size", "icon"] }, { kind: "component", type: ScContactsAccordionComponent, selector: "sc-contacts-accordion", inputs: ["contacts$"], outputs: ["addContactClick", "deleteButtonClick"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
6530
7012
  }
6531
7013
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScContragentsAccordionItemComponent, decorators: [{
6532
7014
  type: Component,
@@ -6542,7 +7024,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
6542
7024
  TuiNotification,
6543
7025
  ScContactsAccordionComponent,
6544
7026
  AsyncPipe,
6545
- ], template: "<sc-accordion [showAddButton]=\"false\">\n {{ contragent.name }}\n @if ($any(contragent).inn; as inn) {\n <span>\u0418\u041D\u041D: {{ inn }}</span>\n }\n\n <ng-template scAccordionContent>\n <div class=\"flex flex-col gap-2\">\n <div class=\"flex gap-2\">\n <div class=\"flex grow flex-col gap-2\">\n {{ contragent.name }}\n @if ($any(contragent).inn; as inn) {\n <span>\u0418\u041D\u041D: {{ inn }}</span>\n }\n @if ($any(contragent).kpp; as kpp) {\n <span>\u041A\u041F\u041F: {{ kpp }}</span>\n }\n </div>\n </div>\n\n <sc-accordion (addButtonClick)=\"addContragentBankAccountClick.emit(contragent)\">\n \u0411\u0430\u043D\u043A\u043E\u0432\u0441\u043A\u0438\u0435 \u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u044B\n <ng-template scAccordionContent>\n @let bankAccounts = bankAccounts$ | async;\n <tui-loader\n [overlay]=\"true\"\n [loading]=\"bankAccounts === null\"\n >\n <div class=\"flex flex-col gap-2\">\n @if (!bankAccounts || bankAccounts.length) {\n @for (bankAccount of bankAccounts; track bankAccount) {\n <div class=\"flex gap-2 border-b border-tui-base-03\">\n <div class=\"flex grow flex-col gap-2\">\n <span>\u0411\u0430\u043D\u043A: {{ bankAccount.bankName }}</span>\n <span>\u0411\u0418\u041A: {{ bankAccount.bic }}</span>\n <span>\u0420/\u0441\u0447\u0451\u0442: {{ bankAccount.accountNumber }}</span>\n <span>\u041A\u043E\u0440/\u0441\u0447\u0451\u0442: {{ bankAccount.correspondentAccount }}</span>\n <span>\u0412\u0430\u043B\u044E\u0442\u0430: {{ bankAccount.currency.name }}</span>\n </div>\n </div>\n }\n } @else {\n <div\n tuiNotification\n size=\"l\"\n >\n <div class=\"flex flex-wrap gap-2 font-medium\">\n \u0423 \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u0430 <span class=\"font-bold\">{{ contragent.name }}</span> \u043D\u0435 \u0443\u043A\u0430\u0437\u0430\u043D\u044B \u0431\u0430\u043D\u043A\u043E\u0432\u0441\u043A\u0438\u0435 \u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u044B.\n </div>\n </div>\n }\n </div>\n </tui-loader>\n </ng-template>\n </sc-accordion>\n @if (contacts$) {\n <sc-contacts-accordion\n [contacts$]=\"contacts$\"\n (addContactClick)=\"addContragentContactClick.emit(contragent)\"\n (deleteButtonClick)=\"onDeleteContragentContactClick($event, contragent)\"\n />\n }\n </div>\n </ng-template>\n</sc-accordion>\n" }]
7027
+ ], template: "<sc-accordion [showAddButton]=\"false\">\n {{ contragent.name }}\n @if ($any(contragent).inn; as inn) {\n <span>\u0418\u041D\u041D: {{ inn }}</span>\n }\n\n <ng-template scAccordionContent>\n <div class=\"flex flex-col gap-2\">\n <div class=\"flex gap-2\">\n <div class=\"flex grow flex-col gap-2\">\n {{ contragent.name }}\n @if ($any(contragent).inn; as inn) {\n <span>\u0418\u041D\u041D: {{ inn }}</span>\n }\n @let ogrnLabel = contragent.opf.id === opfListEnum.entrepreneur ? '\u041E\u0413\u0420\u041D\u0418\u041F' : '\u041E\u0413\u0420\u041D';\n @if ($any(contragent).ogrn; as ogrn) {\n <span>{{ ogrnLabel }}: {{ ogrn }}</span>\n }\n @if ($any(contragent).kpp; as kpp) {\n <span>\u041A\u041F\u041F: {{ kpp }}</span>\n }\n </div>\n </div>\n\n <sc-accordion (addButtonClick)=\"addContragentBankAccountClick.emit(contragent)\">\n \u0411\u0430\u043D\u043A\u043E\u0432\u0441\u043A\u0438\u0435 \u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u044B\n <ng-template scAccordionContent>\n @let bankAccounts = bankAccounts$ | async;\n <tui-loader\n [overlay]=\"true\"\n [loading]=\"bankAccounts === null\"\n >\n <div class=\"flex flex-col gap-2\">\n @if (!bankAccounts || bankAccounts.length) {\n @for (bankAccount of bankAccounts; track bankAccount) {\n <div class=\"flex gap-2 border-b border-tui-base-03\">\n <div class=\"flex grow flex-col gap-2\">\n <span>\u0411\u0430\u043D\u043A: {{ bankAccount.bankName }}</span>\n <span>\u0411\u0418\u041A: {{ bankAccount.bic }}</span>\n <span>\u0420/\u0441\u0447\u0451\u0442: {{ bankAccount.accountNumber }}</span>\n <span>\u041A\u043E\u0440/\u0441\u0447\u0451\u0442: {{ bankAccount.correspondentAccount }}</span>\n <span>\u0412\u0430\u043B\u044E\u0442\u0430: {{ bankAccount.currency.name }}</span>\n </div>\n </div>\n }\n } @else {\n <div\n tuiNotification\n size=\"l\"\n >\n <div class=\"flex flex-wrap gap-2 font-medium\">\n \u0423 \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u0430 <span class=\"font-bold\">{{ contragent.name }}</span> \u043D\u0435 \u0443\u043A\u0430\u0437\u0430\u043D\u044B \u0431\u0430\u043D\u043A\u043E\u0432\u0441\u043A\u0438\u0435 \u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u044B.\n </div>\n </div>\n }\n </div>\n </tui-loader>\n </ng-template>\n </sc-accordion>\n @if (contacts$) {\n <sc-contacts-accordion\n [contacts$]=\"contacts$\"\n (addContactClick)=\"addContragentContactClick.emit(contragent)\"\n (deleteButtonClick)=\"onDeleteContragentContactClick($event, contragent)\"\n />\n }\n </div>\n </ng-template>\n</sc-accordion>\n" }]
6546
7028
  }], propDecorators: { contragent: [{
6547
7029
  type: Input
6548
7030
  }], deleteContragentClick: [{
@@ -6794,6 +7276,10 @@ class ScAddDeliveryAddressDialogComponent {
6794
7276
  * Список стран.
6795
7277
  */
6796
7278
  this.countries = getCountries();
7279
+ /**
7280
+ * Сервис-реестр качества адресов, выбранных из подсказок.
7281
+ */
7282
+ this.addressQualityService = inject(ScAddressQualityService);
6797
7283
  /**
6798
7284
  * {@link Observable} запроса данных добавления адрес доставки.
6799
7285
  */
@@ -6821,7 +7307,10 @@ class ScAddDeliveryAddressDialogComponent {
6821
7307
  /**
6822
7308
  * Группа с полями адресов.
6823
7309
  */
6824
- this.addressControl = new FormControl(null, Validators.required);
7310
+ this.addressControl = new FormControl(null, [
7311
+ Validators.required,
7312
+ this.addressQualityService.validator,
7313
+ ]);
6825
7314
  /**
6826
7315
  * Настройки карты.
6827
7316
  */
@@ -6892,6 +7381,26 @@ class ScAddDeliveryAddressDialogComponent {
6892
7381
  }
6893
7382
  }
6894
7383
  }
7384
+ /**
7385
+ * Возвращает признак, что адрес введён, но вариант с координатами не выбран: под полем показывается ошибка «Выберите вариант из списка».
7386
+ */
7387
+ isAddressWithoutCoordinates() {
7388
+ return this.addressControl.valid && this.form.controls.coordinates.invalid;
7389
+ }
7390
+ /**
7391
+ * Возвращает текст предупреждения о полноте выбранного адреса доставки либо null, когда предупреждение не требуется
7392
+ * или вместо него показана ошибка «Выберите вариант из списка».
7393
+ */
7394
+ getAddressQualityWarning() {
7395
+ return this.isAddressWithoutCoordinates() ? null : this.addressQualityService.getWarningMessage(this.addressControl);
7396
+ }
7397
+ /**
7398
+ * Возвращает appearance поля адреса доставки: appearance предупреждения, пока показано предупреждение о полноте адреса,
7399
+ * иначе appearance поля по умолчанию.
7400
+ */
7401
+ getAddressAppearance() {
7402
+ return this.getAddressQualityWarning() ? this.addressQualityService.warningAppearance : this.addressQualityService.defaultAppearance;
7403
+ }
6895
7404
  /**
6896
7405
  * Устанавливает {@link addressPlacemark} точку на определённые координаты.
6897
7406
  *
@@ -6945,7 +7454,7 @@ class ScAddDeliveryAddressDialogComponent {
6945
7454
  return placemark;
6946
7455
  }
6947
7456
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScAddDeliveryAddressDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
6948
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScAddDeliveryAddressDialogComponent, isStandalone: true, selector: "sc-add-delivery-address-dialog", ngImport: i0, template: "@let isEnabledAddDeliveryAddress = isDefaultCountry | async;\n\n@if (isEnabledAddDeliveryAddress) {\n <div class=\"relative flex flex-col gap-3 md:flex-row\">\n <form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit$.next()\"\n class=\"flex w-full flex-col gap-3\"\n >\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"address\"\n [invalid]=\"(addressControl.valid && form.controls.coordinates.invalid) || null\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.address\"\n (selectedClick)=\"onSelectedAddress($event)\"\n />\n </tui-textfield>\n <tui-error formControlName=\"address\" />\n @if (addressControl.valid && form.controls.coordinates.invalid) {\n <tui-error [error]=\"'\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0432\u0430\u0440\u0438\u0430\u043D\u0442 \u0438\u0437 \u0441\u043F\u0438\u0441\u043A\u0430'\" />\n }\n </label>\n <div\n formGroupName=\"contact\"\n class=\"flex grow flex-col gap-2\"\n >\n <p class=\"w-full font-bold\">\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0435 \u043B\u0438\u0446\u043E:</p>\n <label tuiLabel>\n \u0424.\u0418.\u041E.\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n placeholder=\"\u0424.\u0418.\u041E.\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.fio\"\n />\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n <label tuiLabel>\n \u0422\u0435\u043B\u0435\u0444\u043E\u043D\n <tui-textfield>\n <input\n formControlName=\"phone\"\n tuiInputPhoneInternational\n [countrySearch]=\"true\"\n [countries]=\"(countries | tuiSortCountries) || []\"\n autocomplete=\"phone\"\n placeholder=\"\u0422\u0435\u043B\u0435\u0444\u043E\u043D\"\n />\n </tui-textfield>\n <tui-error formControlName=\"phone\" />\n </label>\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <tui-textfield>\n <input\n tuiInput\n type=\"email\"\n formControlName=\"email\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.email\"\n />\n </tui-textfield>\n <tui-error formControlName=\"email\" />\n </label>\n <label tuiLabel>\n \u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"position\"\n placeholder=\"\u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C\"\n />\n </tui-textfield>\n <tui-error formControlName=\"position\" />\n </label>\n </div>\n <div class=\"flex justify-center gap-8\">\n <button\n tuiButton\n (click)=\"context.$implicit.complete()\"\n type=\"button\"\n iconStart=\"@tui.x\"\n appearance=\"secondary\"\n >\n \u041E\u0442\u043C\u0435\u043D\u0430\n </button>\n <button\n tuiButton\n iconStart=\"@tui.save\"\n [disabled]=\"form.invalid\"\n [loading]=\"!!(loading$ | async)\"\n type=\"submit\"\n >\n \u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C\n </button>\n </div>\n </form>\n\n <div\n class=\"absolute -z-10 flex size-full md:w-1/2\"\n [ngClass]=\"{ 'z-0 relative': addressPlacemark }\"\n >\n <div\n class=\"flex-auto\"\n [ngClass]=\"{ 'pointer-events-none opacity-50': form.controls.coordinates.invalid }\"\n >\n <ya-map\n [zoom]=\"11\"\n [state]=\"{ controls: [] }\"\n (ready)=\"onMapReadyHandle($event)\"\n [options]=\"options\"\n />\n </div>\n </div>\n </div>\n} @else {\n @let helpContacts = userHelpContacts$ | async;\n\n @if (helpContacts && helpContacts.length) {\n <tui-push\n type=\"\u0427\u0442\u043E\u0431\u044B \u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0430\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438, \u0441\u0432\u044F\u0436\u0438\u0442\u0435\u0441\u044C \u0441 \u043D\u0430\u043C\u0438\"\n class=\"!w-auto\"\n >\n <tui-icon icon=\"@tui.message-square\" />\n <sc-manager-card [manager]=\"helpContacts[0]\" />\n </tui-push>\n }\n}\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i2.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "directive", type: i2.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "invalid", "focused", "state"] }, { kind: "component", type: i2.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i2.TuiErrorDirective, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName], tui-error[formArray]", inputs: ["order"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }, { kind: "component", type: TuiIcon, selector: "tui-icon:not([tuiBadge])", inputs: ["background"] }, { kind: "component", type: i1$1.TuiPushComponent, selector: "tui-push", inputs: ["heading", "type", "lines", "timestamp"], outputs: ["close"] }, { kind: "component", type: i1$1.TuiInputPhoneInternationalComponent, selector: "input[tuiInputPhoneInternational]", inputs: ["countrySearch", "countryIsoCode", "countries"], outputs: ["countryIsoCodeChange"] }, { kind: "component", type: ScSuggestionFieldComponent, selector: "sc-suggestion-field", inputs: ["type"], outputs: ["selectedClick"] }, { kind: "component", type: ScManagerCardComponent, selector: "sc-manager-card", inputs: ["manager"] }, { kind: "component", type: YaMapComponent, selector: "ya-map", inputs: ["center", "zoom", "state", "options"], outputs: ["ready", "actionbegin", "actionbreak", "actionend", "actiontick", "actiontickcomplete", "balloonclose", "balloonopen", "boundschange", "yaclick", "yacontextmenu", "yadblclick", "destroy", "hintclose", "hintopen", "marginchange", "yamousedown", "yamouseenter", "yamouseleave", "yamousemove", "yamouseup", "multitouchend", "multitouchmove", "multitouchstart", "optionschange", "sizechange", "typechange", "yawheel"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: TuiSortCountriesPipe, name: "tuiSortCountries" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
7457
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScAddDeliveryAddressDialogComponent, isStandalone: true, selector: "sc-add-delivery-address-dialog", ngImport: i0, template: "@let isEnabledAddDeliveryAddress = isDefaultCountry | async;\n\n@if (isEnabledAddDeliveryAddress) {\n <div class=\"relative flex flex-col gap-3 md:flex-row\">\n <form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit$.next()\"\n class=\"flex w-full flex-col gap-3\"\n >\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\n <tui-textfield [tuiTextfieldAppearance]=\"getAddressAppearance()\">\n <input\n tuiInput\n formControlName=\"address\"\n [invalid]=\"isAddressWithoutCoordinates() || null\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.address\"\n (selectedClick)=\"onSelectedAddress($event)\"\n />\n </tui-textfield>\n <tui-error formControlName=\"address\" />\n @if (isAddressWithoutCoordinates()) {\n <tui-error [error]=\"'\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0432\u0430\u0440\u0438\u0430\u043D\u0442 \u0438\u0437 \u0441\u043F\u0438\u0441\u043A\u0430'\" />\n }\n @if (getAddressQualityWarning(); as addressQualityWarning) {\n <p class=\"text-xs text-tui-status-warning\">{{ addressQualityWarning }}</p>\n }\n </label>\n <div\n formGroupName=\"contact\"\n class=\"flex grow flex-col gap-2\"\n >\n <p class=\"w-full font-bold\">\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0435 \u043B\u0438\u0446\u043E:</p>\n <label tuiLabel>\n \u0424.\u0418.\u041E.\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n placeholder=\"\u0424.\u0418.\u041E.\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.fio\"\n />\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n <label tuiLabel>\n \u0422\u0435\u043B\u0435\u0444\u043E\u043D\n <tui-textfield>\n <input\n formControlName=\"phone\"\n tuiInputPhoneInternational\n [countrySearch]=\"true\"\n [countries]=\"(countries | tuiSortCountries) || []\"\n autocomplete=\"phone\"\n placeholder=\"\u0422\u0435\u043B\u0435\u0444\u043E\u043D\"\n />\n </tui-textfield>\n <tui-error formControlName=\"phone\" />\n </label>\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <tui-textfield>\n <input\n tuiInput\n type=\"email\"\n formControlName=\"email\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.email\"\n />\n </tui-textfield>\n <tui-error formControlName=\"email\" />\n </label>\n <label tuiLabel>\n \u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"position\"\n placeholder=\"\u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C\"\n />\n </tui-textfield>\n <tui-error formControlName=\"position\" />\n </label>\n </div>\n <div class=\"flex justify-center gap-8\">\n <button\n tuiButton\n (click)=\"context.$implicit.complete()\"\n type=\"button\"\n iconStart=\"@tui.x\"\n appearance=\"secondary\"\n >\n \u041E\u0442\u043C\u0435\u043D\u0430\n </button>\n <button\n tuiButton\n iconStart=\"@tui.save\"\n [disabled]=\"form.invalid\"\n [loading]=\"!!(loading$ | async)\"\n type=\"submit\"\n >\n \u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C\n </button>\n </div>\n </form>\n\n <div\n class=\"absolute -z-10 flex size-full md:w-1/2\"\n [ngClass]=\"{ 'z-0 relative': addressPlacemark }\"\n >\n <div\n class=\"flex-auto\"\n [ngClass]=\"{ 'pointer-events-none opacity-50': form.controls.coordinates.invalid }\"\n >\n <ya-map\n [zoom]=\"11\"\n [state]=\"{ controls: [] }\"\n (ready)=\"onMapReadyHandle($event)\"\n [options]=\"options\"\n />\n </div>\n </div>\n </div>\n} @else {\n @let helpContacts = userHelpContacts$ | async;\n\n @if (helpContacts && helpContacts.length) {\n <tui-push\n type=\"\u0427\u0442\u043E\u0431\u044B \u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0430\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438, \u0441\u0432\u044F\u0436\u0438\u0442\u0435\u0441\u044C \u0441 \u043D\u0430\u043C\u0438\"\n class=\"!w-auto\"\n >\n <tui-icon icon=\"@tui.message-square\" />\n <sc-manager-card [manager]=\"helpContacts[0]\" />\n </tui-push>\n }\n}\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i2.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i2.TuiTextfieldOptionsDirective, selector: "[tuiTextfieldAppearance],[tuiTextfieldSize],[tuiTextfieldCleaner]", inputs: ["tuiTextfieldAppearance", "tuiTextfieldSize", "tuiTextfieldCleaner"] }, { kind: "directive", type: i3.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "directive", type: i2.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "invalid", "focused", "state"] }, { kind: "component", type: i2.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i2.TuiErrorDirective, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName], tui-error[formArray]", inputs: ["order"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }, { kind: "component", type: TuiIcon, selector: "tui-icon:not([tuiBadge])", inputs: ["background"] }, { kind: "component", type: i1$1.TuiPushComponent, selector: "tui-push", inputs: ["heading", "type", "lines", "timestamp"], outputs: ["close"] }, { kind: "component", type: i1$1.TuiInputPhoneInternationalComponent, selector: "input[tuiInputPhoneInternational]", inputs: ["countrySearch", "countryIsoCode", "countries"], outputs: ["countryIsoCodeChange"] }, { kind: "component", type: ScSuggestionFieldComponent, selector: "sc-suggestion-field", inputs: ["type"], outputs: ["selectedClick"] }, { kind: "component", type: ScManagerCardComponent, selector: "sc-manager-card", inputs: ["manager"] }, { kind: "component", type: YaMapComponent, selector: "ya-map", inputs: ["center", "zoom", "state", "options"], outputs: ["ready", "actionbegin", "actionbreak", "actionend", "actiontick", "actiontickcomplete", "balloonclose", "balloonopen", "boundschange", "yaclick", "yacontextmenu", "yadblclick", "destroy", "hintclose", "hintopen", "marginchange", "yamousedown", "yamouseenter", "yamouseleave", "yamousemove", "yamouseup", "multitouchend", "multitouchmove", "multitouchstart", "optionschange", "sizechange", "typechange", "yawheel"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: TuiSortCountriesPipe, name: "tuiSortCountries" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
6949
7458
  }
6950
7459
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScAddDeliveryAddressDialogComponent, decorators: [{
6951
7460
  type: Component,
@@ -6966,7 +7475,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
6966
7475
  ScSuggestionFieldComponent,
6967
7476
  ScManagerCardComponent,
6968
7477
  YaMapComponent,
6969
- ], template: "@let isEnabledAddDeliveryAddress = isDefaultCountry | async;\n\n@if (isEnabledAddDeliveryAddress) {\n <div class=\"relative flex flex-col gap-3 md:flex-row\">\n <form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit$.next()\"\n class=\"flex w-full flex-col gap-3\"\n >\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"address\"\n [invalid]=\"(addressControl.valid && form.controls.coordinates.invalid) || null\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.address\"\n (selectedClick)=\"onSelectedAddress($event)\"\n />\n </tui-textfield>\n <tui-error formControlName=\"address\" />\n @if (addressControl.valid && form.controls.coordinates.invalid) {\n <tui-error [error]=\"'\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0432\u0430\u0440\u0438\u0430\u043D\u0442 \u0438\u0437 \u0441\u043F\u0438\u0441\u043A\u0430'\" />\n }\n </label>\n <div\n formGroupName=\"contact\"\n class=\"flex grow flex-col gap-2\"\n >\n <p class=\"w-full font-bold\">\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0435 \u043B\u0438\u0446\u043E:</p>\n <label tuiLabel>\n \u0424.\u0418.\u041E.\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n placeholder=\"\u0424.\u0418.\u041E.\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.fio\"\n />\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n <label tuiLabel>\n \u0422\u0435\u043B\u0435\u0444\u043E\u043D\n <tui-textfield>\n <input\n formControlName=\"phone\"\n tuiInputPhoneInternational\n [countrySearch]=\"true\"\n [countries]=\"(countries | tuiSortCountries) || []\"\n autocomplete=\"phone\"\n placeholder=\"\u0422\u0435\u043B\u0435\u0444\u043E\u043D\"\n />\n </tui-textfield>\n <tui-error formControlName=\"phone\" />\n </label>\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <tui-textfield>\n <input\n tuiInput\n type=\"email\"\n formControlName=\"email\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.email\"\n />\n </tui-textfield>\n <tui-error formControlName=\"email\" />\n </label>\n <label tuiLabel>\n \u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"position\"\n placeholder=\"\u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C\"\n />\n </tui-textfield>\n <tui-error formControlName=\"position\" />\n </label>\n </div>\n <div class=\"flex justify-center gap-8\">\n <button\n tuiButton\n (click)=\"context.$implicit.complete()\"\n type=\"button\"\n iconStart=\"@tui.x\"\n appearance=\"secondary\"\n >\n \u041E\u0442\u043C\u0435\u043D\u0430\n </button>\n <button\n tuiButton\n iconStart=\"@tui.save\"\n [disabled]=\"form.invalid\"\n [loading]=\"!!(loading$ | async)\"\n type=\"submit\"\n >\n \u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C\n </button>\n </div>\n </form>\n\n <div\n class=\"absolute -z-10 flex size-full md:w-1/2\"\n [ngClass]=\"{ 'z-0 relative': addressPlacemark }\"\n >\n <div\n class=\"flex-auto\"\n [ngClass]=\"{ 'pointer-events-none opacity-50': form.controls.coordinates.invalid }\"\n >\n <ya-map\n [zoom]=\"11\"\n [state]=\"{ controls: [] }\"\n (ready)=\"onMapReadyHandle($event)\"\n [options]=\"options\"\n />\n </div>\n </div>\n </div>\n} @else {\n @let helpContacts = userHelpContacts$ | async;\n\n @if (helpContacts && helpContacts.length) {\n <tui-push\n type=\"\u0427\u0442\u043E\u0431\u044B \u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0430\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438, \u0441\u0432\u044F\u0436\u0438\u0442\u0435\u0441\u044C \u0441 \u043D\u0430\u043C\u0438\"\n class=\"!w-auto\"\n >\n <tui-icon icon=\"@tui.message-square\" />\n <sc-manager-card [manager]=\"helpContacts[0]\" />\n </tui-push>\n }\n}\n" }]
7478
+ ], template: "@let isEnabledAddDeliveryAddress = isDefaultCountry | async;\n\n@if (isEnabledAddDeliveryAddress) {\n <div class=\"relative flex flex-col gap-3 md:flex-row\">\n <form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit$.next()\"\n class=\"flex w-full flex-col gap-3\"\n >\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\n <tui-textfield [tuiTextfieldAppearance]=\"getAddressAppearance()\">\n <input\n tuiInput\n formControlName=\"address\"\n [invalid]=\"isAddressWithoutCoordinates() || null\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.address\"\n (selectedClick)=\"onSelectedAddress($event)\"\n />\n </tui-textfield>\n <tui-error formControlName=\"address\" />\n @if (isAddressWithoutCoordinates()) {\n <tui-error [error]=\"'\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0432\u0430\u0440\u0438\u0430\u043D\u0442 \u0438\u0437 \u0441\u043F\u0438\u0441\u043A\u0430'\" />\n }\n @if (getAddressQualityWarning(); as addressQualityWarning) {\n <p class=\"text-xs text-tui-status-warning\">{{ addressQualityWarning }}</p>\n }\n </label>\n <div\n formGroupName=\"contact\"\n class=\"flex grow flex-col gap-2\"\n >\n <p class=\"w-full font-bold\">\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0435 \u043B\u0438\u0446\u043E:</p>\n <label tuiLabel>\n \u0424.\u0418.\u041E.\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n placeholder=\"\u0424.\u0418.\u041E.\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.fio\"\n />\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n <label tuiLabel>\n \u0422\u0435\u043B\u0435\u0444\u043E\u043D\n <tui-textfield>\n <input\n formControlName=\"phone\"\n tuiInputPhoneInternational\n [countrySearch]=\"true\"\n [countries]=\"(countries | tuiSortCountries) || []\"\n autocomplete=\"phone\"\n placeholder=\"\u0422\u0435\u043B\u0435\u0444\u043E\u043D\"\n />\n </tui-textfield>\n <tui-error formControlName=\"phone\" />\n </label>\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <tui-textfield>\n <input\n tuiInput\n type=\"email\"\n formControlName=\"email\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.email\"\n />\n </tui-textfield>\n <tui-error formControlName=\"email\" />\n </label>\n <label tuiLabel>\n \u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"position\"\n placeholder=\"\u0414\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C\"\n />\n </tui-textfield>\n <tui-error formControlName=\"position\" />\n </label>\n </div>\n <div class=\"flex justify-center gap-8\">\n <button\n tuiButton\n (click)=\"context.$implicit.complete()\"\n type=\"button\"\n iconStart=\"@tui.x\"\n appearance=\"secondary\"\n >\n \u041E\u0442\u043C\u0435\u043D\u0430\n </button>\n <button\n tuiButton\n iconStart=\"@tui.save\"\n [disabled]=\"form.invalid\"\n [loading]=\"!!(loading$ | async)\"\n type=\"submit\"\n >\n \u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C\n </button>\n </div>\n </form>\n\n <div\n class=\"absolute -z-10 flex size-full md:w-1/2\"\n [ngClass]=\"{ 'z-0 relative': addressPlacemark }\"\n >\n <div\n class=\"flex-auto\"\n [ngClass]=\"{ 'pointer-events-none opacity-50': form.controls.coordinates.invalid }\"\n >\n <ya-map\n [zoom]=\"11\"\n [state]=\"{ controls: [] }\"\n (ready)=\"onMapReadyHandle($event)\"\n [options]=\"options\"\n />\n </div>\n </div>\n </div>\n} @else {\n @let helpContacts = userHelpContacts$ | async;\n\n @if (helpContacts && helpContacts.length) {\n <tui-push\n type=\"\u0427\u0442\u043E\u0431\u044B \u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0430\u0434\u0440\u0435\u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438, \u0441\u0432\u044F\u0436\u0438\u0442\u0435\u0441\u044C \u0441 \u043D\u0430\u043C\u0438\"\n class=\"!w-auto\"\n >\n <tui-icon icon=\"@tui.message-square\" />\n <sc-manager-card [manager]=\"helpContacts[0]\" />\n </tui-push>\n }\n}\n" }]
6970
7479
  }] });
6971
7480
 
6972
7481
  /**
@@ -7645,6 +8154,14 @@ const scClientUiIconsName = [
7645
8154
  'catalog.stiz',
7646
8155
  'catalog.thermometer',
7647
8156
  'catalog.windowsill',
8157
+ 'catalog-filters.additional-profiles',
8158
+ 'catalog-filters.balcony-railing',
8159
+ 'catalog-filters.default',
8160
+ 'catalog-filters.door-entrance',
8161
+ 'catalog-filters.glazing-sliding',
8162
+ 'catalog-filters.stained-glass',
8163
+ 'catalog-filters.ventilation-grille',
8164
+ 'catalog-filters.window-hinged',
7648
8165
  'img.email',
7649
8166
  'img.facebook',
7650
8167
  'img.instagram',
@@ -7891,6 +8408,37 @@ class ScOrderItemComponent extends AbstractScPriceCard {
7891
8408
  * Признак, что необходимо отобразить элементы редактирования.
7892
8409
  */
7893
8410
  this.isShowEditControls = input(true, ...(ngDevMode ? [{ debugName: "isShowEditControls" }] : /* istanbul ignore next */ []));
8411
+ /**
8412
+ * Признак, что цена за единицу берётся из позиции, а не из текущей цены товара (например, цена, зафиксированная в заявке).
8413
+ */
8414
+ this.useLinePrice = input(false, ...(ngDevMode ? [{ debugName: "useLinePrice" }] : /* istanbul ignore next */ []));
8415
+ /**
8416
+ * Признак, что позиция, которая не попадёт в заказ, помечается примечанием, а неактивная позиция зачёркивается.
8417
+ */
8418
+ this.markUnavailable = input(false, ...(ngDevMode ? [{ debugName: "markUnavailable" }] : /* istanbul ignore next */ []));
8419
+ /**
8420
+ * Признак, что изменение позиции ждёт очереди или выполняется.
8421
+ */
8422
+ this.isPending = input(false, ...(ngDevMode ? [{ debugName: "isPending" }] : /* istanbul ignore next */ []));
8423
+ /**
8424
+ * Признак, что параметры позиции можно изменить в диалоге, даже если они ещё не заданы.
8425
+ */
8426
+ this.settingsAvailable = input(false, ...(ngDevMode ? [{ debugName: "settingsAvailable" }] : /* istanbul ignore next */ []));
8427
+ }
8428
+ /**
8429
+ * Оформление примечания к позиции: группа, которая не участвует в заказе, серым, остальные причины жёлтым.
8430
+ */
8431
+ get unavailableReasonAppearance() {
8432
+ return this.orderItem?.isUnavailableReasonNeutral ? 'neutral' : 'warning';
8433
+ }
8434
+ /**
8435
+ * Подсказка к количеству, когда поля количества нет: где его изменить. У неактивной позиции с примечанием количество не меняется, и подсказки нет.
8436
+ */
8437
+ get quantityHint() {
8438
+ if (this.settingsAvailable()) {
8439
+ return 'Количество и метраж меняются в окне изменения позиции';
8440
+ }
8441
+ return this.markUnavailable() && this.orderItem?.isInactive ? '' : 'Для изменения количества воспользуйтесь конфигуратором';
7894
8442
  }
7895
8443
  /**
7896
8444
  * Отображает спецификацию.
@@ -7910,23 +8458,14 @@ class ScOrderItemComponent extends AbstractScPriceCard {
7910
8458
  this.isConfiguratorHintVisible.set(visible);
7911
8459
  }
7912
8460
  }
7913
- /**
7914
- * Возвращает кратность количества для указанного товара.
7915
- *
7916
- * @param product Данные о товаре.
7917
- */
7918
- // eslint-disable-next-line class-methods-use-this
7919
- getProductMultiplicity(product) {
7920
- return ScUnitsHelper.getProductMultiplicity(product);
7921
- }
7922
8461
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScOrderItemComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
7923
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScOrderItemComponent, isStandalone: true, selector: "sc-order-item", inputs: { isShowEditControls: { classPropertyName: "isShowEditControls", publicName: "isShowEditControls", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clickSettings: "clickSettings" }, providers: [
8462
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScOrderItemComponent, isStandalone: true, selector: "sc-order-item", inputs: { isShowEditControls: { classPropertyName: "isShowEditControls", publicName: "isShowEditControls", isSignal: true, isRequired: false, transformFunction: null }, useLinePrice: { classPropertyName: "useLinePrice", publicName: "useLinePrice", isSignal: true, isRequired: false, transformFunction: null }, markUnavailable: { classPropertyName: "markUnavailable", publicName: "markUnavailable", isSignal: true, isRequired: false, transformFunction: null }, isPending: { classPropertyName: "isPending", publicName: "isPending", isSignal: true, isRequired: false, transformFunction: null }, settingsAvailable: { classPropertyName: "settingsAvailable", publicName: "settingsAvailable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clickSettings: "clickSettings" }, providers: [
7924
8463
  SEARCH_TERM_PROVIDERS,
7925
8464
  tuiTextfieldOptionsProvider({
7926
8465
  appearance: signal('textfield'),
7927
8466
  }),
7928
8467
  tuiHintOptionsProvider({ direction: 'top', showDelay: 100, hideDelay: 100 }),
7929
- ], usesInheritance: true, ngImport: i0, template: "@if (product && orderItem) {\n <div class=\"@container relative flex w-full gap-4 rounded-xl p-1 text-body-s hover:bg-tui-background-neutral-1\">\n <sc-noindex-wrapper>\n @let isDisabled = product.isHidden || product.isNull;\n <sc-hover-image-carousel\n (click)=\"isDisabled ? null : clickCardEvent.emit()\"\n [images]=\"!isMobile ? getCardImagePreviewList(product) : [getCardImagePreview()]\"\n [isShowActions]=\"false\"\n class=\"aspect-square w-24 shrink-0 cursor-pointer self-start\"\n />\n <div class=\"flex w-full flex-col gap-y-1 gap-x-4 @5xl:flex-row @5xl:items-center @5xl:gap-5\">\n <div class=\"flex min-w-0 flex-1 flex-col gap-1\">\n <div\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n class=\"text-tui-text-02\"\n >\n \u0410\u0440\u0442\u0438\u043A\u0443\u043B: {{ product.code }}\n </div>\n <div class=\"flex flex-col gap-1\">\n <a\n tuiLink\n [attr.href]=\"href ?? null\"\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n (click)=\"$event.preventDefault(); clickCardEvent.emit()\"\n [class.disabled]=\"isDisabled\"\n class=\"!text-body-m-bold\"\n >\n {{ product.name }}\n </a>\n @if (product.supplierSku) {\n <span class=\"text-tui-text-02\"> \u0410\u0440\u0442\u0438\u043A\u0443\u043B \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F: {{ product.supplierSku }} </span>\n }\n @if (product.pack) {\n <div class=\"flex items-center gap-1 text-tui-text-02\">\n \u041D\u043E\u0440\u043C\u0430 \u0443\u043F\u0430\u043A\u043E\u0432\u043A\u0438: {{ product.pack }}\n @if (product.ignoreMinCountCheck) {\n <tui-icon\n icon=\"@tui.package\"\n [tuiHint]=\"minCountHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n class=\"text-body-xl text-tui-text-01 opacity-90\"\n />\n <ng-template #minCountHint>\n \u0414\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0437\u0430\u043A\u0430\u0437 <br />\n \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u043B\u044C\u043D\u043E\u0433\u043E <br />\n \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430\n </ng-template>\n }\n </div>\n }\n\n <sc-cost-with-discount\n scPrint=\"cost\"\n [product]=\"product\"\n />\n </div>\n @if (orderItem.specificationImgUrl) {\n <a\n tuiLink\n (click)=\"showSpecification(specificationPreview)\"\n [class.disabled]=\"isDisabled\"\n >\n \u0421\u043F\u0435\u0446\u0438\u0444\u0438\u043A\u0430\u0446\u0438\u044F\n </a>\n }\n <ng-template\n #specificationPreview\n let-preview\n >\n <tui-preview\n [rotatable]=\"false\"\n [zoomable]=\"false\"\n >\n <img\n *polymorpheusOutlet=\"orderItem.specificationImgUrl as src\"\n alt=\"preview\"\n [src]=\"orderItem.specificationImgUrl\"\n />\n <button\n iconStart=\"@tui.x\"\n title=\"Close\"\n tuiIconButton\n tuiPreviewAction\n type=\"button\"\n (click)=\"preview.complete()\"\n ></button>\n </tui-preview>\n </ng-template>\n </div>\n <div class=\"grid grid-cols-1 @lg:grid-cols-3 gap-2 @2xl:gap-4 @2xl:grid-rows-1\">\n <div class=\"grid grid-cols-1 items-center @lg:gap-2 @2xl:grid-cols-2 @lg:col-span-2\">\n <!-- \u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (isShowEditControls() && showQuantityControl) {\n <!-- \u041F\u043E\u043B\u0435 \u0432\u0432\u043E\u0434\u0430 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u043E\u0432\u0430\u0440\u0430. -->\n <sc-input-quantity\n #inputQuantity\n [tuiAutoFocus]=\"autoFocuseQuantityInput()\"\n [formControl]=\"quantityControl\"\n size=\"m\"\n [showCross]=\"false\"\n [isDisabled]=\"isDisabled\"\n [step]=\"getProductMultiplicity(product)\"\n [ignoreStepValidators]=\"product.ignoreMinCountCheck\"\n [showLoader]=\"showLoader()\"\n (clickClearEvent)=\"clickClearEvent.emit(orderItem)\"\n (keydown.enter)=\"inputQuantity.nativeFocusableElement?.blur()\"\n class=\"w-32 shrink-0\"\n />\n } @else {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n >\n <div class=\"!text-body-m text-start\">\n \u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E:\n <strong> {{ orderItem.quantity }} \u0448\u0442.</strong>\n </div>\n </button>\n }\n\n @let showAdditionalInfo = orderItem.configurator || orderItem.height || orderItem.length || orderItem.width || orderItem.marker;\n @if (showAdditionalInfo) {\n <div class=\"flex items-center gap-2 @lg:gap-3 max-w-min\">\n <!-- \u041A\u043D\u043E\u043F\u043A\u0430 \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (isShowEditControls()) {\n <button\n tuiIconButton\n [disabled]=\"isDisabled\"\n [loading]=\"showLoader()\"\n (click)=\"clickSettings.emit()\"\n size=\"s\"\n [appearance]=\"isConfiguratorHintVisible() ? 'primary' : 'secondary'\"\n class=\"shrink-0\"\n >\n <tui-icon icon=\"@tui.settings\" />\n </button>\n }\n\n <!-- \u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u0430\u044F \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u043E \u0442\u043E\u0432\u0430\u0440\u0435. -->\n <div\n class=\"flex flex-col gap-x-1 text-tui-base-07\"\n [class.text-body-m]=\"!isShowEditControls()\"\n >\n @if (orderItem.marker) {\n <p>\u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430: {{ orderItem.marker }}</p>\n }\n @if (orderItem.width) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0448\u0438\u0440\u0438\u043D\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0428\u0438\u0440\u0438\u043D\u0430: <span class=\"text-body-s-bold\">{{ orderItem.width }} \u043C.</span>\n </button>\n }\n @if (orderItem.height) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0432\u044B\u0441\u043E\u0442\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0412\u044B\u0441\u043E\u0442\u0430: <span class=\"text-body-s-bold\">{{ orderItem.height }} \u043C.</span>\n </button>\n } @else if (orderItem.length) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0434\u043B\u0438\u043D\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0414\u043B\u0438\u043D\u0430: <span class=\"text-body-s-bold\">{{ orderItem.length }} \u043C.</span>\n </button>\n }\n </div>\n </div>\n }\n </div>\n\n <!-- \u0421\u0443\u043C\u043C\u0430 \u0442\u043E\u0432\u0430\u0440\u0430 \u0438 \u0441\u043A\u043B\u0430\u0434\u0441\u043A\u043E\u0435 \u043D\u0430\u043B\u0438\u0447\u0438\u0435. -->\n <div\n scPrint=\"cost\"\n class=\"flex min-w-[11rem] flex-col @lg:justify-end @2xl:!justify-center text-body-m\"\n >\n <p class=\"whitespace-nowrap\">\n \u0421\u0443\u043C\u043C\u0430:\n <strong> {{ orderItem.costRub | tuiFormatNumber: moneyFormat }} {{ 'RUB' | tuiCurrency }}</strong>\n </p>\n <sc-price-warehouse-stock\n scPrint=\"defaultNoPrint\"\n [product]=\"product\"\n />\n </div>\n </div>\n </div>\n </sc-noindex-wrapper>\n </div>\n} @else {\n <div class=\"tui-skeleton flex h-[8.25rem] w-full overflow-hidden rounded-xl\"></div>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiIcon, selector: "tui-icon:not([tuiBadge])", inputs: ["background"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.TuiHintDirective, selector: "[tuiHint]:not(ng-container):not(ng-template)", inputs: ["tuiHint", "tuiHintContext", "tuiHintAppearance"], outputs: ["tuiHintVisible"] }, { kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]" }, { kind: "directive", type: TuiHighlight, selector: "[tuiHighlight]", inputs: ["tuiHighlight", "tuiHighlightColor"] }, { kind: "directive", type: TuiAutoFocus, selector: "[tuiAutoFocus]", inputs: ["tuiAutoFocus"] }, { kind: "component", type: ScHoverImageCarouselComponent, selector: "sc-hover-image-carousel", inputs: ["images", "isShowActions", "productName"] }, { kind: "component", type: CostWithDiscountComponent, selector: "sc-cost-with-discount", inputs: ["product", "size"] }, { kind: "component", type: ScPriceWarehouseStockComponent, selector: "sc-price-warehouse-stock", inputs: ["classList", "product", "withStockHint", "fromMain"] }, { kind: "component", type: ScInputQuantityComponent, selector: "sc-input-quantity", inputs: ["step", "showLoader", "showCross", "appearance", "isDisabled", "size", "ignoreStepValidators"], outputs: ["clickClearEvent"] }, { kind: "component", type: i1$1.TuiPreviewComponent, selector: "tui-preview", inputs: ["zoomable", "rotatable", "initialScale"] }, { kind: "directive", type: i1$1.TuiPreviewAction, selector: "[tuiPreviewAction]" }, { kind: "component", type: ScNoindexWrapperComponent, selector: "sc-noindex-wrapper" }, { kind: "component", type: TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }, { kind: "directive", type: ScPrintDirective, selector: "[scPrint]", inputs: ["scPrint"] }, { kind: "pipe", type: i1$2.AsyncPipe, name: "async" }, { kind: "pipe", type: TuiCurrencyPipe, name: "tuiCurrency" }, { kind: "pipe", type: TuiFormatNumberPipe, name: "tuiFormatNumber" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
8468
+ ], usesInheritance: true, ngImport: i0, template: "@if (product && orderItem) {\n <div class=\"@container relative flex w-full gap-4 rounded-xl p-1 text-body-s hover:bg-tui-background-neutral-1\">\n <sc-noindex-wrapper>\n @let isDisabled = orderItem.isInactive;\n @let unavailableReason = markUnavailable() ? orderItem.getUnavailableReason() : '';\n <sc-hover-image-carousel\n (click)=\"isDisabled ? null : clickCardEvent.emit()\"\n [images]=\"!isMobile ? getCardImagePreviewList(product) : [getCardImagePreview()]\"\n [isShowActions]=\"false\"\n class=\"aspect-square w-24 shrink-0 cursor-pointer self-start\"\n />\n <div class=\"flex w-full flex-col gap-y-1 gap-x-4 @5xl:flex-row @5xl:items-center @5xl:gap-5\">\n <div class=\"flex min-w-0 flex-1 flex-col gap-1\">\n @if (product.code) {\n <div\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n class=\"text-tui-text-02\"\n >\n \u0410\u0440\u0442\u0438\u043A\u0443\u043B: {{ product.code }}\n </div>\n }\n <div class=\"flex flex-col gap-1\">\n <a\n tuiLink\n [attr.href]=\"href ?? null\"\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n (click)=\"$event.preventDefault(); clickCardEvent.emit()\"\n [class.disabled]=\"isDisabled\"\n [class.!line-through]=\"markUnavailable() && isDisabled\"\n class=\"!text-body-m-bold\"\n >\n {{ product.name }}\n </a>\n @if (unavailableReason) {\n <div class=\"flex flex-wrap items-baseline gap-1\">\n <span class=\"text-tui-text-02\">\u041F\u0440\u0438\u043C\u0435\u0447\u0430\u043D\u0438\u0435:</span>\n <span\n tuiBadge\n [appearance]=\"unavailableReasonAppearance\"\n size=\"m\"\n class=\"!h-auto max-w-full !whitespace-normal py-0.5 text-start\"\n >\n {{ unavailableReason }}\n </span>\n </div>\n }\n @if (product.supplierSku) {\n <span class=\"text-tui-text-02\"> \u0410\u0440\u0442\u0438\u043A\u0443\u043B \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F: {{ product.supplierSku }} </span>\n }\n @if (product.pack) {\n <div class=\"flex items-center gap-1 text-tui-text-02\">\n \u041D\u043E\u0440\u043C\u0430 \u0443\u043F\u0430\u043A\u043E\u0432\u043A\u0438: {{ product.pack }}\n @if (product.ignoreMinCountCheck) {\n <tui-icon\n icon=\"@tui.package\"\n [tuiHint]=\"minCountHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n class=\"text-body-xl text-tui-text-01 opacity-90\"\n />\n <ng-template #minCountHint>\n \u0414\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0437\u0430\u043A\u0430\u0437 <br />\n \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u043B\u044C\u043D\u043E\u0433\u043E <br />\n \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430\n </ng-template>\n }\n </div>\n }\n\n @if (useLinePrice()) {\n @if (orderItem.costOneRub > 0 || orderItem.isOrderable) {\n <span\n scPrint=\"cost\"\n class=\"text-body-m\"\n >\n {{ orderItem.costOneRub > 0 ? orderItem.getCostInRubDescPerItem() : orderItem.getCostMessage() }}\n </span>\n }\n } @else {\n <sc-cost-with-discount\n scPrint=\"cost\"\n [product]=\"product\"\n />\n }\n </div>\n @if (orderItem.specificationImgUrl) {\n <a\n tuiLink\n (click)=\"showSpecification(specificationPreview)\"\n [class.disabled]=\"isDisabled\"\n >\n \u0421\u043F\u0435\u0446\u0438\u0444\u0438\u043A\u0430\u0446\u0438\u044F\n </a>\n }\n <ng-template\n #specificationPreview\n let-preview\n >\n <tui-preview\n [rotatable]=\"false\"\n [zoomable]=\"false\"\n >\n <img\n *polymorpheusOutlet=\"orderItem.specificationImgUrl as src\"\n alt=\"preview\"\n [src]=\"orderItem.specificationImgUrl\"\n />\n <button\n iconStart=\"@tui.x\"\n title=\"Close\"\n tuiIconButton\n tuiPreviewAction\n type=\"button\"\n (click)=\"preview.complete()\"\n ></button>\n </tui-preview>\n </ng-template>\n </div>\n <div class=\"grid grid-cols-1 @lg:grid-cols-3 gap-2 @2xl:gap-4 @2xl:grid-rows-1\">\n <div class=\"grid grid-cols-1 items-center @lg:gap-2 @2xl:grid-cols-2 @lg:col-span-2\">\n <!-- \u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (isShowEditControls() && showQuantityControl) {\n <!-- \u041F\u043E\u043B\u0435 \u0432\u0432\u043E\u0434\u0430 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u043E\u0432\u0430\u0440\u0430. -->\n <sc-input-quantity\n #inputQuantity\n [tuiAutoFocus]=\"autoFocuseQuantityInput()\"\n [formControl]=\"quantityControl\"\n size=\"m\"\n [showCross]=\"false\"\n [isDisabled]=\"isDisabled\"\n [attr.inert]=\"isDisabled || null\"\n [step]=\"orderItem.quantityStep\"\n [ignoreStepValidators]=\"product.ignoreMinCountCheck\"\n [showLoader]=\"isPending()\"\n (clickClearEvent)=\"clickClearEvent.emit(orderItem)\"\n (keydown.enter)=\"inputQuantity.nativeFocusableElement?.blur()\"\n class=\"w-32 shrink-0\"\n />\n } @else {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n [tuiHint]=\"quantityHint\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n >\n <div class=\"!text-body-m text-start\">\n \u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E:\n <strong> {{ orderItem.quantity }} \u0448\u0442.</strong>\n </div>\n </button>\n }\n\n @let showAdditionalInfo = orderItem.configurator || orderItem.height || orderItem.length || orderItem.width || orderItem.marker || settingsAvailable();\n @if (showAdditionalInfo) {\n <div class=\"flex items-center gap-2 @lg:gap-3 max-w-min\">\n <!-- \u041A\u043D\u043E\u043F\u043A\u0430 \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (isShowEditControls()) {\n <button\n tuiIconButton\n [disabled]=\"isDisabled\"\n [loading]=\"isPending()\"\n (click)=\"clickSettings.emit()\"\n size=\"s\"\n [appearance]=\"isConfiguratorHintVisible() ? 'primary' : 'secondary'\"\n class=\"shrink-0\"\n >\n <tui-icon icon=\"@tui.settings\" />\n </button>\n }\n\n <!-- \u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u0430\u044F \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u043E \u0442\u043E\u0432\u0430\u0440\u0435. -->\n <div\n class=\"flex flex-col gap-x-1 text-tui-base-07\"\n [class.text-body-m]=\"!isShowEditControls()\"\n >\n @if (orderItem.marker) {\n <p>\u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430: {{ orderItem.marker }}</p>\n }\n @if (orderItem.width) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0448\u0438\u0440\u0438\u043D\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0428\u0438\u0440\u0438\u043D\u0430: <span class=\"text-body-s-bold\">{{ orderItem.width }} \u043C.</span>\n </button>\n }\n @if (orderItem.height) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0432\u044B\u0441\u043E\u0442\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0412\u044B\u0441\u043E\u0442\u0430: <span class=\"text-body-s-bold\">{{ orderItem.height }} \u043C.</span>\n </button>\n } @else if (orderItem.length) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0434\u043B\u0438\u043D\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0414\u043B\u0438\u043D\u0430: <span class=\"text-body-s-bold\">{{ orderItem.length }} \u043C.</span>\n </button>\n }\n </div>\n </div>\n }\n </div>\n\n <!-- \u0421\u0443\u043C\u043C\u0430 \u0442\u043E\u0432\u0430\u0440\u0430 \u0438 \u0441\u043A\u043B\u0430\u0434\u0441\u043A\u043E\u0435 \u043D\u0430\u043B\u0438\u0447\u0438\u0435. -->\n <div\n scPrint=\"cost\"\n class=\"flex min-w-[11rem] flex-col @lg:justify-end @2xl:!justify-center text-body-m\"\n >\n <p class=\"whitespace-nowrap\">\n \u0421\u0443\u043C\u043C\u0430:\n <strong> {{ orderItem.costRub | tuiFormatNumber: moneyFormat }} {{ 'RUB' | tuiCurrency }}</strong>\n </p>\n @if (!(markUnavailable() && product.isNull)) {\n <sc-price-warehouse-stock\n scPrint=\"defaultNoPrint\"\n [product]=\"product\"\n />\n }\n </div>\n </div>\n </div>\n </sc-noindex-wrapper>\n </div>\n} @else {\n <div class=\"tui-skeleton flex h-[8.25rem] w-full overflow-hidden rounded-xl\"></div>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiIcon, selector: "tui-icon:not([tuiBadge])", inputs: ["background"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.TuiHintDirective, selector: "[tuiHint]:not(ng-container):not(ng-template)", inputs: ["tuiHint", "tuiHintContext", "tuiHintAppearance"], outputs: ["tuiHintVisible"] }, { kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]" }, { kind: "directive", type: TuiHighlight, selector: "[tuiHighlight]", inputs: ["tuiHighlight", "tuiHighlightColor"] }, { kind: "directive", type: TuiAutoFocus, selector: "[tuiAutoFocus]", inputs: ["tuiAutoFocus"] }, { kind: "component", type: ScHoverImageCarouselComponent, selector: "sc-hover-image-carousel", inputs: ["images", "isShowActions", "productName"] }, { kind: "component", type: CostWithDiscountComponent, selector: "sc-cost-with-discount", inputs: ["product", "size"] }, { kind: "component", type: ScPriceWarehouseStockComponent, selector: "sc-price-warehouse-stock", inputs: ["classList", "product", "withStockHint", "fromMain"] }, { kind: "component", type: ScInputQuantityComponent, selector: "sc-input-quantity", inputs: ["step", "showLoader", "showCross", "appearance", "isDisabled", "size", "ignoreStepValidators"], outputs: ["clickClearEvent"] }, { kind: "component", type: i1$1.TuiPreviewComponent, selector: "tui-preview", inputs: ["zoomable", "rotatable", "initialScale"] }, { kind: "directive", type: i1$1.TuiPreviewAction, selector: "[tuiPreviewAction]" }, { kind: "directive", type: TuiBadge, selector: "[tuiBadge],tui-icon[tuiBadge]", inputs: ["size"] }, { kind: "component", type: ScNoindexWrapperComponent, selector: "sc-noindex-wrapper" }, { kind: "component", type: TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }, { kind: "directive", type: ScPrintDirective, selector: "[scPrint]", inputs: ["scPrint"] }, { kind: "pipe", type: i1$2.AsyncPipe, name: "async" }, { kind: "pipe", type: TuiCurrencyPipe, name: "tuiCurrency" }, { kind: "pipe", type: TuiFormatNumberPipe, name: "tuiFormatNumber" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
7930
8469
  }
7931
8470
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScOrderItemComponent, decorators: [{
7932
8471
  type: Component,
@@ -7952,6 +8491,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
7952
8491
  TuiCurrencyPipe,
7953
8492
  TuiFormatNumberPipe,
7954
8493
  TuiPreview,
8494
+ TuiBadge,
7955
8495
  ScNoindexWrapperComponent,
7956
8496
  TuiAppearance,
7957
8497
  TuiButtonLoading,
@@ -7962,14 +8502,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
7962
8502
  appearance: signal('textfield'),
7963
8503
  }),
7964
8504
  tuiHintOptionsProvider({ direction: 'top', showDelay: 100, hideDelay: 100 }),
7965
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (product && orderItem) {\n <div class=\"@container relative flex w-full gap-4 rounded-xl p-1 text-body-s hover:bg-tui-background-neutral-1\">\n <sc-noindex-wrapper>\n @let isDisabled = product.isHidden || product.isNull;\n <sc-hover-image-carousel\n (click)=\"isDisabled ? null : clickCardEvent.emit()\"\n [images]=\"!isMobile ? getCardImagePreviewList(product) : [getCardImagePreview()]\"\n [isShowActions]=\"false\"\n class=\"aspect-square w-24 shrink-0 cursor-pointer self-start\"\n />\n <div class=\"flex w-full flex-col gap-y-1 gap-x-4 @5xl:flex-row @5xl:items-center @5xl:gap-5\">\n <div class=\"flex min-w-0 flex-1 flex-col gap-1\">\n <div\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n class=\"text-tui-text-02\"\n >\n \u0410\u0440\u0442\u0438\u043A\u0443\u043B: {{ product.code }}\n </div>\n <div class=\"flex flex-col gap-1\">\n <a\n tuiLink\n [attr.href]=\"href ?? null\"\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n (click)=\"$event.preventDefault(); clickCardEvent.emit()\"\n [class.disabled]=\"isDisabled\"\n class=\"!text-body-m-bold\"\n >\n {{ product.name }}\n </a>\n @if (product.supplierSku) {\n <span class=\"text-tui-text-02\"> \u0410\u0440\u0442\u0438\u043A\u0443\u043B \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F: {{ product.supplierSku }} </span>\n }\n @if (product.pack) {\n <div class=\"flex items-center gap-1 text-tui-text-02\">\n \u041D\u043E\u0440\u043C\u0430 \u0443\u043F\u0430\u043A\u043E\u0432\u043A\u0438: {{ product.pack }}\n @if (product.ignoreMinCountCheck) {\n <tui-icon\n icon=\"@tui.package\"\n [tuiHint]=\"minCountHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n class=\"text-body-xl text-tui-text-01 opacity-90\"\n />\n <ng-template #minCountHint>\n \u0414\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0437\u0430\u043A\u0430\u0437 <br />\n \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u043B\u044C\u043D\u043E\u0433\u043E <br />\n \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430\n </ng-template>\n }\n </div>\n }\n\n <sc-cost-with-discount\n scPrint=\"cost\"\n [product]=\"product\"\n />\n </div>\n @if (orderItem.specificationImgUrl) {\n <a\n tuiLink\n (click)=\"showSpecification(specificationPreview)\"\n [class.disabled]=\"isDisabled\"\n >\n \u0421\u043F\u0435\u0446\u0438\u0444\u0438\u043A\u0430\u0446\u0438\u044F\n </a>\n }\n <ng-template\n #specificationPreview\n let-preview\n >\n <tui-preview\n [rotatable]=\"false\"\n [zoomable]=\"false\"\n >\n <img\n *polymorpheusOutlet=\"orderItem.specificationImgUrl as src\"\n alt=\"preview\"\n [src]=\"orderItem.specificationImgUrl\"\n />\n <button\n iconStart=\"@tui.x\"\n title=\"Close\"\n tuiIconButton\n tuiPreviewAction\n type=\"button\"\n (click)=\"preview.complete()\"\n ></button>\n </tui-preview>\n </ng-template>\n </div>\n <div class=\"grid grid-cols-1 @lg:grid-cols-3 gap-2 @2xl:gap-4 @2xl:grid-rows-1\">\n <div class=\"grid grid-cols-1 items-center @lg:gap-2 @2xl:grid-cols-2 @lg:col-span-2\">\n <!-- \u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (isShowEditControls() && showQuantityControl) {\n <!-- \u041F\u043E\u043B\u0435 \u0432\u0432\u043E\u0434\u0430 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u043E\u0432\u0430\u0440\u0430. -->\n <sc-input-quantity\n #inputQuantity\n [tuiAutoFocus]=\"autoFocuseQuantityInput()\"\n [formControl]=\"quantityControl\"\n size=\"m\"\n [showCross]=\"false\"\n [isDisabled]=\"isDisabled\"\n [step]=\"getProductMultiplicity(product)\"\n [ignoreStepValidators]=\"product.ignoreMinCountCheck\"\n [showLoader]=\"showLoader()\"\n (clickClearEvent)=\"clickClearEvent.emit(orderItem)\"\n (keydown.enter)=\"inputQuantity.nativeFocusableElement?.blur()\"\n class=\"w-32 shrink-0\"\n />\n } @else {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n >\n <div class=\"!text-body-m text-start\">\n \u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E:\n <strong> {{ orderItem.quantity }} \u0448\u0442.</strong>\n </div>\n </button>\n }\n\n @let showAdditionalInfo = orderItem.configurator || orderItem.height || orderItem.length || orderItem.width || orderItem.marker;\n @if (showAdditionalInfo) {\n <div class=\"flex items-center gap-2 @lg:gap-3 max-w-min\">\n <!-- \u041A\u043D\u043E\u043F\u043A\u0430 \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (isShowEditControls()) {\n <button\n tuiIconButton\n [disabled]=\"isDisabled\"\n [loading]=\"showLoader()\"\n (click)=\"clickSettings.emit()\"\n size=\"s\"\n [appearance]=\"isConfiguratorHintVisible() ? 'primary' : 'secondary'\"\n class=\"shrink-0\"\n >\n <tui-icon icon=\"@tui.settings\" />\n </button>\n }\n\n <!-- \u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u0430\u044F \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u043E \u0442\u043E\u0432\u0430\u0440\u0435. -->\n <div\n class=\"flex flex-col gap-x-1 text-tui-base-07\"\n [class.text-body-m]=\"!isShowEditControls()\"\n >\n @if (orderItem.marker) {\n <p>\u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430: {{ orderItem.marker }}</p>\n }\n @if (orderItem.width) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0448\u0438\u0440\u0438\u043D\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0428\u0438\u0440\u0438\u043D\u0430: <span class=\"text-body-s-bold\">{{ orderItem.width }} \u043C.</span>\n </button>\n }\n @if (orderItem.height) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0432\u044B\u0441\u043E\u0442\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0412\u044B\u0441\u043E\u0442\u0430: <span class=\"text-body-s-bold\">{{ orderItem.height }} \u043C.</span>\n </button>\n } @else if (orderItem.length) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0434\u043B\u0438\u043D\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0414\u043B\u0438\u043D\u0430: <span class=\"text-body-s-bold\">{{ orderItem.length }} \u043C.</span>\n </button>\n }\n </div>\n </div>\n }\n </div>\n\n <!-- \u0421\u0443\u043C\u043C\u0430 \u0442\u043E\u0432\u0430\u0440\u0430 \u0438 \u0441\u043A\u043B\u0430\u0434\u0441\u043A\u043E\u0435 \u043D\u0430\u043B\u0438\u0447\u0438\u0435. -->\n <div\n scPrint=\"cost\"\n class=\"flex min-w-[11rem] flex-col @lg:justify-end @2xl:!justify-center text-body-m\"\n >\n <p class=\"whitespace-nowrap\">\n \u0421\u0443\u043C\u043C\u0430:\n <strong> {{ orderItem.costRub | tuiFormatNumber: moneyFormat }} {{ 'RUB' | tuiCurrency }}</strong>\n </p>\n <sc-price-warehouse-stock\n scPrint=\"defaultNoPrint\"\n [product]=\"product\"\n />\n </div>\n </div>\n </div>\n </sc-noindex-wrapper>\n </div>\n} @else {\n <div class=\"tui-skeleton flex h-[8.25rem] w-full overflow-hidden rounded-xl\"></div>\n}\n" }]
7966
- }], propDecorators: { clickSettings: [{ type: i0.Output, args: ["clickSettings"] }], isShowEditControls: [{ type: i0.Input, args: [{ isSignal: true, alias: "isShowEditControls", required: false }] }] } });
8505
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (product && orderItem) {\n <div class=\"@container relative flex w-full gap-4 rounded-xl p-1 text-body-s hover:bg-tui-background-neutral-1\">\n <sc-noindex-wrapper>\n @let isDisabled = orderItem.isInactive;\n @let unavailableReason = markUnavailable() ? orderItem.getUnavailableReason() : '';\n <sc-hover-image-carousel\n (click)=\"isDisabled ? null : clickCardEvent.emit()\"\n [images]=\"!isMobile ? getCardImagePreviewList(product) : [getCardImagePreview()]\"\n [isShowActions]=\"false\"\n class=\"aspect-square w-24 shrink-0 cursor-pointer self-start\"\n />\n <div class=\"flex w-full flex-col gap-y-1 gap-x-4 @5xl:flex-row @5xl:items-center @5xl:gap-5\">\n <div class=\"flex min-w-0 flex-1 flex-col gap-1\">\n @if (product.code) {\n <div\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n class=\"text-tui-text-02\"\n >\n \u0410\u0440\u0442\u0438\u043A\u0443\u043B: {{ product.code }}\n </div>\n }\n <div class=\"flex flex-col gap-1\">\n <a\n tuiLink\n [attr.href]=\"href ?? null\"\n [tuiHighlight]=\"(search$ | async) ?? ''\"\n (click)=\"$event.preventDefault(); clickCardEvent.emit()\"\n [class.disabled]=\"isDisabled\"\n [class.!line-through]=\"markUnavailable() && isDisabled\"\n class=\"!text-body-m-bold\"\n >\n {{ product.name }}\n </a>\n @if (unavailableReason) {\n <div class=\"flex flex-wrap items-baseline gap-1\">\n <span class=\"text-tui-text-02\">\u041F\u0440\u0438\u043C\u0435\u0447\u0430\u043D\u0438\u0435:</span>\n <span\n tuiBadge\n [appearance]=\"unavailableReasonAppearance\"\n size=\"m\"\n class=\"!h-auto max-w-full !whitespace-normal py-0.5 text-start\"\n >\n {{ unavailableReason }}\n </span>\n </div>\n }\n @if (product.supplierSku) {\n <span class=\"text-tui-text-02\"> \u0410\u0440\u0442\u0438\u043A\u0443\u043B \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044F: {{ product.supplierSku }} </span>\n }\n @if (product.pack) {\n <div class=\"flex items-center gap-1 text-tui-text-02\">\n \u041D\u043E\u0440\u043C\u0430 \u0443\u043F\u0430\u043A\u043E\u0432\u043A\u0438: {{ product.pack }}\n @if (product.ignoreMinCountCheck) {\n <tui-icon\n icon=\"@tui.package\"\n [tuiHint]=\"minCountHint\"\n [tuiHintShowDelay]=\"100\"\n tuiHintDirection=\"top\"\n class=\"text-body-xl text-tui-text-01 opacity-90\"\n />\n <ng-template #minCountHint>\n \u0414\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0437\u0430\u043A\u0430\u0437 <br />\n \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u043B\u044C\u043D\u043E\u0433\u043E <br />\n \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430\n </ng-template>\n }\n </div>\n }\n\n @if (useLinePrice()) {\n @if (orderItem.costOneRub > 0 || orderItem.isOrderable) {\n <span\n scPrint=\"cost\"\n class=\"text-body-m\"\n >\n {{ orderItem.costOneRub > 0 ? orderItem.getCostInRubDescPerItem() : orderItem.getCostMessage() }}\n </span>\n }\n } @else {\n <sc-cost-with-discount\n scPrint=\"cost\"\n [product]=\"product\"\n />\n }\n </div>\n @if (orderItem.specificationImgUrl) {\n <a\n tuiLink\n (click)=\"showSpecification(specificationPreview)\"\n [class.disabled]=\"isDisabled\"\n >\n \u0421\u043F\u0435\u0446\u0438\u0444\u0438\u043A\u0430\u0446\u0438\u044F\n </a>\n }\n <ng-template\n #specificationPreview\n let-preview\n >\n <tui-preview\n [rotatable]=\"false\"\n [zoomable]=\"false\"\n >\n <img\n *polymorpheusOutlet=\"orderItem.specificationImgUrl as src\"\n alt=\"preview\"\n [src]=\"orderItem.specificationImgUrl\"\n />\n <button\n iconStart=\"@tui.x\"\n title=\"Close\"\n tuiIconButton\n tuiPreviewAction\n type=\"button\"\n (click)=\"preview.complete()\"\n ></button>\n </tui-preview>\n </ng-template>\n </div>\n <div class=\"grid grid-cols-1 @lg:grid-cols-3 gap-2 @2xl:gap-4 @2xl:grid-rows-1\">\n <div class=\"grid grid-cols-1 items-center @lg:gap-2 @2xl:grid-cols-2 @lg:col-span-2\">\n <!-- \u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (isShowEditControls() && showQuantityControl) {\n <!-- \u041F\u043E\u043B\u0435 \u0432\u0432\u043E\u0434\u0430 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u043E\u0432\u0430\u0440\u0430. -->\n <sc-input-quantity\n #inputQuantity\n [tuiAutoFocus]=\"autoFocuseQuantityInput()\"\n [formControl]=\"quantityControl\"\n size=\"m\"\n [showCross]=\"false\"\n [isDisabled]=\"isDisabled\"\n [attr.inert]=\"isDisabled || null\"\n [step]=\"orderItem.quantityStep\"\n [ignoreStepValidators]=\"product.ignoreMinCountCheck\"\n [showLoader]=\"isPending()\"\n (clickClearEvent)=\"clickClearEvent.emit(orderItem)\"\n (keydown.enter)=\"inputQuantity.nativeFocusableElement?.blur()\"\n class=\"w-32 shrink-0\"\n />\n } @else {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n [tuiHint]=\"quantityHint\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n >\n <div class=\"!text-body-m text-start\">\n \u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E:\n <strong> {{ orderItem.quantity }} \u0448\u0442.</strong>\n </div>\n </button>\n }\n\n @let showAdditionalInfo = orderItem.configurator || orderItem.height || orderItem.length || orderItem.width || orderItem.marker || settingsAvailable();\n @if (showAdditionalInfo) {\n <div class=\"flex items-center gap-2 @lg:gap-3 max-w-min\">\n <!-- \u041A\u043D\u043E\u043F\u043A\u0430 \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (isShowEditControls()) {\n <button\n tuiIconButton\n [disabled]=\"isDisabled\"\n [loading]=\"isPending()\"\n (click)=\"clickSettings.emit()\"\n size=\"s\"\n [appearance]=\"isConfiguratorHintVisible() ? 'primary' : 'secondary'\"\n class=\"shrink-0\"\n >\n <tui-icon icon=\"@tui.settings\" />\n </button>\n }\n\n <!-- \u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u0430\u044F \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u043E \u0442\u043E\u0432\u0430\u0440\u0435. -->\n <div\n class=\"flex flex-col gap-x-1 text-tui-base-07\"\n [class.text-body-m]=\"!isShowEditControls()\"\n >\n @if (orderItem.marker) {\n <p>\u041C\u0430\u0440\u043A\u0438\u0440\u043E\u0432\u043A\u0430: {{ orderItem.marker }}</p>\n }\n @if (orderItem.width) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0448\u0438\u0440\u0438\u043D\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0428\u0438\u0440\u0438\u043D\u0430: <span class=\"text-body-s-bold\">{{ orderItem.width }} \u043C.</span>\n </button>\n }\n @if (orderItem.height) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0432\u044B\u0441\u043E\u0442\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0412\u044B\u0441\u043E\u0442\u0430: <span class=\"text-body-s-bold\">{{ orderItem.height }} \u043C.</span>\n </button>\n } @else if (orderItem.length) {\n <button\n [appearance]=\"isShowEditControls() ? 'action-grayscale' : ''\"\n tuiTheme=\"light\"\n tuiHint=\"\u0414\u043B\u044F \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0434\u043B\u0438\u043D\u044B \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043E\u0440\u043E\u043C\"\n (tuiHintVisible)=\"configuratorHintVisible($event)\"\n tuiLink\n [style.text-decoration-line]=\"isShowEditControls() ? 'underline' : 'none'\"\n [class.pointer-events-none]=\"!isShowEditControls()\"\n class=\"text-body-s self-start whitespace-nowrap\"\n >\n \u0414\u043B\u0438\u043D\u0430: <span class=\"text-body-s-bold\">{{ orderItem.length }} \u043C.</span>\n </button>\n }\n </div>\n </div>\n }\n </div>\n\n <!-- \u0421\u0443\u043C\u043C\u0430 \u0442\u043E\u0432\u0430\u0440\u0430 \u0438 \u0441\u043A\u043B\u0430\u0434\u0441\u043A\u043E\u0435 \u043D\u0430\u043B\u0438\u0447\u0438\u0435. -->\n <div\n scPrint=\"cost\"\n class=\"flex min-w-[11rem] flex-col @lg:justify-end @2xl:!justify-center text-body-m\"\n >\n <p class=\"whitespace-nowrap\">\n \u0421\u0443\u043C\u043C\u0430:\n <strong> {{ orderItem.costRub | tuiFormatNumber: moneyFormat }} {{ 'RUB' | tuiCurrency }}</strong>\n </p>\n @if (!(markUnavailable() && product.isNull)) {\n <sc-price-warehouse-stock\n scPrint=\"defaultNoPrint\"\n [product]=\"product\"\n />\n }\n </div>\n </div>\n </div>\n </sc-noindex-wrapper>\n </div>\n} @else {\n <div class=\"tui-skeleton flex h-[8.25rem] w-full overflow-hidden rounded-xl\"></div>\n}\n" }]
8506
+ }], propDecorators: { clickSettings: [{ type: i0.Output, args: ["clickSettings"] }], isShowEditControls: [{ type: i0.Input, args: [{ isSignal: true, alias: "isShowEditControls", required: false }] }], useLinePrice: [{ type: i0.Input, args: [{ isSignal: true, alias: "useLinePrice", required: false }] }], markUnavailable: [{ type: i0.Input, args: [{ isSignal: true, alias: "markUnavailable", required: false }] }], isPending: [{ type: i0.Input, args: [{ isSignal: true, alias: "isPending", required: false }] }], settingsAvailable: [{ type: i0.Input, args: [{ isSignal: true, alias: "settingsAvailable", required: false }] }] } });
7967
8507
 
7968
8508
  /* eslint-disable no-param-reassign */
7969
8509
  /**
7970
8510
  * Компонент списка товаров корзины, заказа или черновика.
7971
8511
  */
7972
8512
  class ScOrderItemsListComponent {
8513
+ /**
8514
+ * Возвращает копию набора с добавленными или убранными ключами.
8515
+ *
8516
+ * @param keys Набор.
8517
+ * @param changed Ключи.
8518
+ * @param isIncluded Признак добавления.
8519
+ */
8520
+ static withKeys(keys, changed, isIncluded) {
8521
+ const next = new Set(keys);
8522
+ changed.forEach((key) => {
8523
+ if (isIncluded) {
8524
+ next.add(key);
8525
+ }
8526
+ else {
8527
+ next.delete(key);
8528
+ }
8529
+ });
8530
+ return next;
8531
+ }
8532
+ /**
8533
+ * Инициализирует экземпляр класса {@link ScOrderItemsListComponent}.
8534
+ * Входы выбора и пометки недоступных позиций могут прийти после списка позиций, поэтому при их изменении выбор синхронизируется заново.
8535
+ */
7973
8536
  constructor() {
7974
8537
  /**
7975
8538
  * Внутренний сигнал списка элементов корзины (товаров).
@@ -7983,6 +8546,56 @@ class ScOrderItemsListComponent {
7983
8546
  * Включить редактирование позиций.
7984
8547
  */
7985
8548
  this.editable = input(false, ...(ngDevMode ? [{ debugName: "editable" }] : /* istanbul ignore next */ []));
8549
+ /**
8550
+ * Признак вывода позиций по группам (группа позиции или «Без группы») с заголовками и итогами. Без признака позиции выводятся одним списком без заголовков.
8551
+ */
8552
+ this.grouped = input(false, ...(ngDevMode ? [{ debugName: "grouped" }] : /* istanbul ignore next */ []));
8553
+ /**
8554
+ * Признак, что позиции, которые не попадут в заказ, помечаются примечанием и не выбираются. Неактивные позиции приглушаются и зачёркиваются.
8555
+ */
8556
+ this.markUnavailable = input(false, ...(ngDevMode ? [{ debugName: "markUnavailable" }] : /* istanbul ignore next */ []));
8557
+ /**
8558
+ * Признак, что цена за единицу берётся из позиции, а не из текущей цены товара.
8559
+ */
8560
+ this.useLinePrice = input(false, ...(ngDevMode ? [{ debugName: "useLinePrice" }] : /* istanbul ignore next */ []));
8561
+ /**
8562
+ * Признак, что параметры позиции меняются в диалоге товара: диалог доступен у любой активной позиции, а количество и метраж измеряемых товаров
8563
+ * меняются только в нём, даже если метраж ещё не задан.
8564
+ */
8565
+ this.measuredInDialog = input(false, ...(ngDevMode ? [{ debugName: "measuredInDialog" }] : /* istanbul ignore next */ []));
8566
+ /**
8567
+ * Откуда удаляется позиция для текста подтверждения, например «из черновика». Если не задано, позиция удаляется без подтверждения.
8568
+ * Тот же текст используется в предупреждении о нулевом количестве.
8569
+ */
8570
+ this.deleteConfirmationTarget = input(null, ...(ngDevMode ? [{ debugName: "deleteConfirmationTarget" }] : /* istanbul ignore next */ []));
8571
+ /**
8572
+ * Подпись итоговой суммы.
8573
+ */
8574
+ this.totalLabel = input('Итого', ...(ngDevMode ? [{ debugName: "totalLabel" }] : /* istanbul ignore next */ []));
8575
+ /**
8576
+ * Позиции, разбитые на группы. Без группировки все позиции идут одной группой без заголовка.
8577
+ */
8578
+ this.groups = computed(() => {
8579
+ const items = this.itemsSignal();
8580
+ return this.grouped() ? ScOrderItemsGroup.fromItems(items) : [new ScOrderItemsGroup('', items)];
8581
+ }, ...(ngDevMode ? [{ debugName: "groups" }] : /* istanbul ignore next */ []));
8582
+ /**
8583
+ * Идентификаторы позиций, изменение или удаление которых ждёт очереди или выполняется.
8584
+ */
8585
+ this.pendingItemsIds = signal(new Set(), ...(ngDevMode ? [{ debugName: "pendingItemsIds" }] : /* istanbul ignore next */ []));
8586
+ /**
8587
+ * Названия удаляемых групп.
8588
+ */
8589
+ this.deletingGroupsNames = signal(new Set(), ...(ngDevMode ? [{ debugName: "deletingGroupsNames" }] : /* istanbul ignore next */ []));
8590
+ /**
8591
+ * Названия групп с позициями, ждущими ответа: такие группы удалить нельзя.
8592
+ */
8593
+ this.pendingGroupsNames = computed(() => {
8594
+ const pendingIds = this.pendingItemsIds();
8595
+ return new Set(this.groups()
8596
+ .filter((group) => group.items.some((item) => pendingIds.has(item.id)))
8597
+ .map((group) => group.name));
8598
+ }, ...(ngDevMode ? [{ debugName: "pendingGroupsNames" }] : /* istanbul ignore next */ []));
7986
8599
  /**
7987
8600
  * Внутренняя группа формы для выбора позиций.
7988
8601
  */
@@ -7997,6 +8610,17 @@ class ScOrderItemsListComponent {
7997
8610
  this.itemsIds = toSignal(this.selectionFormGroup.valueChanges.pipe(map((value) => Object.entries(value))), {
7998
8611
  initialValue: [],
7999
8612
  });
8613
+ /**
8614
+ * Состояние флага «Выбрать все»: `true`, если выбраны все доступные для выбора позиции, `false`, если ни одной или выбирать нечего,
8615
+ * и `null`, если только часть.
8616
+ */
8617
+ this.allItemsSelected = computed(() => {
8618
+ const checkedList = this.itemsIds().map(([, checked]) => checked);
8619
+ if (checkedList.length > 0 && checkedList.every(Boolean)) {
8620
+ return true;
8621
+ }
8622
+ return checkedList.some(Boolean) ? null : false;
8623
+ }, ...(ngDevMode ? [{ debugName: "allItemsSelected" }] : /* istanbul ignore next */ []));
8000
8624
  /**
8001
8625
  * Сигнал идентификаторов выбранных позиций.
8002
8626
  */
@@ -8017,7 +8641,7 @@ class ScOrderItemsListComponent {
8017
8641
  const items = this.itemsSignal();
8018
8642
  const selectedItemsIds = this.selectedItemsIds();
8019
8643
  const selectable = this.selectable();
8020
- return ScNumberHelper.roundMoney(items.filter((item) => !selectable || selectedItemsIds.includes(item.id)).reduce((sum, item) => sum + item.costRub, 0));
8644
+ return ScOrderItem.getCostSum(items.filter((item) => !selectable || selectedItemsIds.includes(item.id)));
8021
8645
  }, ...(ngDevMode ? [{ debugName: "sumSelectedItems" }] : /* istanbul ignore next */ []));
8022
8646
  /**
8023
8647
  * Сервис получения и редактирования списка товаров заказа (корзина / заказ / черновик = заказ).
@@ -8028,6 +8652,10 @@ class ScOrderItemsListComponent {
8028
8652
  * Признак, что можно редактировать позиции.
8029
8653
  */
8030
8654
  this.canEdit = computed(() => this.editable() && 'updateProduct$' in this.orderItemsListLoader, ...(ngDevMode ? [{ debugName: "canEdit" }] : /* istanbul ignore next */ []));
8655
+ /**
8656
+ * Признак, что группу можно удалить целиком.
8657
+ */
8658
+ this.canDeleteGroups = computed(() => this.canEdit() && 'deleteProducts$' in this.orderItemsListLoader, ...(ngDevMode ? [{ debugName: "canDeleteGroups" }] : /* istanbul ignore next */ []));
8031
8659
  /**
8032
8660
  * Настройки вывода сумм в рублях.
8033
8661
  */
@@ -8041,6 +8669,21 @@ class ScOrderItemsListComponent {
8041
8669
  * Предоставляется родителем через токен {@link SC_DIALOG_SERVICE_TOKEN}.
8042
8670
  */
8043
8671
  this.scDialogService = inject(SC_DIALOG_SERVICE_TOKEN);
8672
+ /**
8673
+ * Сервис диалоговых окон Taiga для подтверждений.
8674
+ */
8675
+ this.dialogService = inject(TuiDialogService);
8676
+ /**
8677
+ * Сервис уведомлений.
8678
+ */
8679
+ this.alerts = inject(TuiNotificationService);
8680
+ effect(() => {
8681
+ this.markUnavailable();
8682
+ this.selectable();
8683
+ untracked(() => {
8684
+ this.syncSelectionControls();
8685
+ });
8686
+ });
8044
8687
  }
8045
8688
  /**
8046
8689
  * Список элементов корзины (товаров). При установке синхронно обновляет контролы выбора в форме.
@@ -8051,6 +8694,7 @@ class ScOrderItemsListComponent {
8051
8694
  }
8052
8695
  /**
8053
8696
  * Синхронизирует контролы формы выбора с текущим списком товаров: удаляет контролы для отсутствующих id, добавляет для новых.
8697
+ * Контролы меняются без событий, а значение группы пересчитывается один раз в конце: на заявках в сотни позиций это заметно.
8054
8698
  */
8055
8699
  syncSelectionControls() {
8056
8700
  if (!this.selectable()) {
@@ -8060,61 +8704,125 @@ class ScOrderItemsListComponent {
8060
8704
  const currentIds = new Set(currentItems.map((item) => item.id));
8061
8705
  Object.keys(this.selectionFormGroup.controls).forEach((name) => {
8062
8706
  if (!currentIds.has(name)) {
8063
- this.selectionFormGroup.removeControl(name);
8707
+ this.selectionFormGroup.removeControl(name, { emitEvent: false });
8064
8708
  }
8065
8709
  });
8066
8710
  currentItems.forEach((item) => {
8067
- if (!this.selectionFormGroup.contains(item.id)) {
8068
- this.selectionFormGroup.addControl(item.id, new FormControl(true, { nonNullable: true }));
8711
+ const control = this.selectionFormGroup.get(item.id);
8712
+ const isSelectable = !this.markUnavailable() || item.isOrderable;
8713
+ if (!control) {
8714
+ this.selectionFormGroup.addControl(item.id, new FormControl({ value: isSelectable, disabled: !isSelectable }, { nonNullable: true }), { emitEvent: false });
8715
+ }
8716
+ else if (!isSelectable && control.enabled) {
8717
+ control.setValue(false, { emitEvent: false });
8718
+ control.disable({ emitEvent: false });
8719
+ }
8720
+ else if (isSelectable && control.disabled) {
8721
+ control.enable({ emitEvent: false });
8722
+ control.setValue(true, { emitEvent: false });
8069
8723
  }
8070
8724
  });
8725
+ this.selectionFormGroup.updateValueAndValidity();
8726
+ }
8727
+ /**
8728
+ * Выбирает все доступные для выбора позиции или снимает выбор со всех.
8729
+ *
8730
+ * @param event Событие изменения флага выбора всех позиций.
8731
+ */
8732
+ selectAllChangeHandler(event) {
8733
+ const { checked } = event.target;
8734
+ const enabledIds = Object.entries(this.selectionFormGroup.controls)
8735
+ .filter(([, control]) => control.enabled)
8736
+ .map(([id]) => id);
8737
+ this.selectionFormGroup.patchValue(Object.fromEntries(enabledIds.map((id) => [id, checked])));
8738
+ }
8739
+ /**
8740
+ * Возвращает признак, что позиция приглушена: она неактивна или не выбрана для заказа.
8741
+ *
8742
+ * @param item Позиция.
8743
+ */
8744
+ isItemDimmed(item) {
8745
+ const isUnselected = this.selectable() && !this.selectionFormGroup.get(item.id)?.value;
8746
+ return this.markUnavailable() ? item.isInactive || (item.isOrderable && isUnselected) : isUnselected;
8747
+ }
8748
+ /**
8749
+ * Возвращает признак, что количество и метраж товара позиции меняются в диалоге товара.
8750
+ *
8751
+ * @param item Позиция.
8752
+ */
8753
+ isEditedInDialog(item) {
8754
+ return this.measuredInDialog() && ScUnitsHelper.productIsMeasurable(item.product);
8071
8755
  }
8072
8756
  /**
8073
- * Удаляет позицию.
8757
+ * Удаляет позицию, при необходимости после подтверждения. Сообщение об ошибке показывает перехватчик приложения.
8074
8758
  *
8075
8759
  * @param item Позиция товара для удаления.
8076
- * @param priceCard Компонент карточки товара.
8077
8760
  */
8078
- deleteItem(item, priceCard) {
8079
- if (!this.canEdit()) {
8761
+ deleteItem(item) {
8762
+ if (!this.canEdit() || this.pendingItemsIds().has(item.id)) {
8080
8763
  return;
8081
8764
  }
8082
- priceCard.showLoader.set(true);
8083
- this.orderItemsListLoader
8084
- .deleteProduct$(item, this.orderOptions?.orderId())
8085
- .pipe(catchError(() => {
8086
- priceCard.quantityControl.patchValue(item.quantity, {
8087
- emitEvent: false,
8088
- });
8089
- return of();
8090
- }), finalize(() => {
8091
- priceCard.showLoader.set(false);
8765
+ this.confirmDelete$(item)
8766
+ .pipe(switchMap(() => {
8767
+ this.setItemPending(item.id, true);
8768
+ return this.orderItemsListLoader.deleteProduct$(item, this.orderOptions?.orderId()).pipe(finalize(() => {
8769
+ this.setItemPending(item.id, false);
8770
+ }));
8092
8771
  }), takeUntilDestroyed(this.destroyRef))
8093
- .subscribe();
8772
+ .subscribe({ error: noop$1 });
8773
+ }
8774
+ /**
8775
+ * Удаляет все позиции группы после подтверждения. Состав берётся на момент подтверждения.
8776
+ *
8777
+ * @param group Группа позиций.
8778
+ */
8779
+ deleteGroup(group) {
8780
+ if (!this.canDeleteGroups() || this.pendingGroupsNames().has(group.name)) {
8781
+ return;
8782
+ }
8783
+ this.confirmGroupDelete$(group)
8784
+ .pipe(switchMap(() => {
8785
+ const items = this.groups().find(({ name }) => name === group.name)?.items ?? [];
8786
+ const ids = items.map((item) => item.id);
8787
+ if (ids.length === 0) {
8788
+ return EMPTY;
8789
+ }
8790
+ this.setItemsPending(ids, true);
8791
+ this.deletingGroupsNames.update((names) => ScOrderItemsListComponent.withKeys(names, [group.name], true));
8792
+ return this.orderItemsListLoader.deleteProducts$(items, this.orderOptions?.orderId()).pipe(finalize(() => {
8793
+ this.setItemsPending(ids, false);
8794
+ this.deletingGroupsNames.update((names) => ScOrderItemsListComponent.withKeys(names, [group.name], false));
8795
+ }));
8796
+ }), takeUntilDestroyed(this.destroyRef))
8797
+ .subscribe({ error: noop$1 });
8094
8798
  }
8095
8799
  /**
8096
- * Обновляет количество товара.
8800
+ * Обновляет количество товара. Количество неактивной позиции не меняется. Пустое или нулевое значение возвращается к сохранённому количеству.
8097
8801
  *
8098
8802
  * @param newQuantity Новое значение количества товара.
8099
8803
  * @param priceCard Компонент карточки товара.
8100
8804
  */
8101
8805
  patchItem(newQuantity, priceCard) {
8102
- if (!this.canEdit() || !priceCard.orderItem || !priceCard.product || !newQuantity) {
8806
+ const { orderItem } = priceCard;
8807
+ if (!this.canEdit() || !orderItem || !priceCard.product || orderItem.isInactive) {
8808
+ return;
8809
+ }
8810
+ if (!newQuantity) {
8811
+ priceCard.quantityControl.patchValue(orderItem.quantity, { emitEvent: false });
8812
+ this.warnEmptyQuantity();
8103
8813
  return;
8104
8814
  }
8105
- priceCard.showLoader.set(true);
8815
+ this.setItemPending(orderItem.id, true);
8106
8816
  this.orderItemsListLoader
8107
- .updateProduct$(priceCard.orderItem.id, { quantity: newQuantity }, this.orderOptions?.orderId())
8108
- .pipe(catchError(() => {
8109
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
8110
- priceCard.quantityControl.patchValue(priceCard.orderItem.quantity, {
8111
- emitEvent: false,
8112
- });
8113
- return of();
8114
- }), finalize(() => {
8115
- priceCard.showLoader.set(false);
8817
+ .updateProduct$(orderItem.id, { quantity: newQuantity }, this.orderOptions?.orderId())
8818
+ .pipe(finalize(() => {
8819
+ this.setItemPending(orderItem.id, false);
8116
8820
  }), takeUntilDestroyed(this.destroyRef))
8117
- .subscribe();
8821
+ .subscribe({
8822
+ error: () => {
8823
+ priceCard.quantityControl.patchValue((priceCard.orderItem ?? orderItem).quantity, { emitEvent: false });
8824
+ },
8825
+ });
8118
8826
  }
8119
8827
  /**
8120
8828
  * Открывает модальное окно описания товара.
@@ -8129,7 +8837,7 @@ class ScOrderItemsListComponent {
8129
8837
  }
8130
8838
  }
8131
8839
  /**
8132
- * Открывает модальное окно изменения товара или его конфигуратора.
8840
+ * Открывает модальное окно изменения товара или его конфигуратора. Если параметры позиции меняются в диалоге, окно товара открывается и у штучного товара.
8133
8841
  *
8134
8842
  * @param item Позиция товара.
8135
8843
  */
@@ -8138,7 +8846,7 @@ class ScOrderItemsListComponent {
8138
8846
  if (isConfigurator) {
8139
8847
  this.scDialogService.openConfiguratorDialog(item.product, item, this.orderOptions?.orderId());
8140
8848
  }
8141
- else if (ScUnitsHelper.productIsMeasurable(item.product)) {
8849
+ else if (this.measuredInDialog() || ScUnitsHelper.productIsMeasurable(item.product)) {
8142
8850
  this.scDialogService.openAddOrEditingCartItemDialog(item.product, item, this.orderOptions?.orderId(), true);
8143
8851
  }
8144
8852
  }
@@ -8150,13 +8858,83 @@ class ScOrderItemsListComponent {
8150
8858
  openPriceHistoryChartDialog(product) {
8151
8859
  this.scDialogService.openPriceHistoryChartDialog(product);
8152
8860
  }
8861
+ /**
8862
+ * Возвращает {@link Observable}, который выдаёт значение, когда удаление позиции подтверждено или подтверждение не требуется.
8863
+ *
8864
+ * @param item Удаляемая позиция.
8865
+ */
8866
+ confirmDelete$(item) {
8867
+ const target = this.deleteConfirmationTarget();
8868
+ if (!target) {
8869
+ return of(true);
8870
+ }
8871
+ return this.confirmRemoval$(`Удалить позицию «${item.product.name}» ${target}?`);
8872
+ }
8873
+ /**
8874
+ * Возвращает {@link Observable}, который выдаёт значение, когда удаление группы подтверждено.
8875
+ *
8876
+ * @param group Группа позиций.
8877
+ */
8878
+ confirmGroupDelete$(group) {
8879
+ const target = this.deleteConfirmationTarget();
8880
+ const source = target ? ` ${target}` : '';
8881
+ return this.confirmRemoval$(`Удалить все позиции группы «${group.name}»${source}?`);
8882
+ }
8883
+ /**
8884
+ * Возвращает {@link Observable}, который выдаёт значение, когда удаление подтверждено.
8885
+ *
8886
+ * @param label Вопрос.
8887
+ */
8888
+ confirmRemoval$(label) {
8889
+ return this.dialogService.open(TUI_CONFIRM, { label, data: { yes: 'Да, удалить', no: 'Нет, оставить' } }).pipe(filter(Boolean));
8890
+ }
8891
+ /**
8892
+ * Отмечает позицию как ожидающую ответа или снимает отметку.
8893
+ *
8894
+ * @param id Идентификатор позиции.
8895
+ * @param isPending Признак ожидания.
8896
+ */
8897
+ setItemPending(id, isPending) {
8898
+ this.setItemsPending([id], isPending);
8899
+ }
8900
+ /**
8901
+ * Ставит или снимает отметку ожидания у позиций.
8902
+ *
8903
+ * @param itemsIds Идентификаторы позиций.
8904
+ * @param isPending Признак ожидания.
8905
+ */
8906
+ setItemsPending(itemsIds, isPending) {
8907
+ this.pendingItemsIds.update((ids) => ScOrderItemsListComponent.withKeys(ids, itemsIds, isPending));
8908
+ }
8909
+ /**
8910
+ * Предупреждает, что количество не может быть пустым или нулевым, а убрать позицию можно удалением. Поле возвращается к сохранённому количеству
8911
+ * в любом списке, предупреждение показывается только в списках с подтверждением удаления.
8912
+ */
8913
+ warnEmptyQuantity() {
8914
+ const target = this.deleteConfirmationTarget();
8915
+ if (target) {
8916
+ this.alerts.open(`Количество должно быть больше нуля. Чтобы убрать позицию ${target}, удалите её.`, { appearance: 'warning' }).subscribe();
8917
+ }
8918
+ }
8153
8919
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScOrderItemsListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
8154
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScOrderItemsListComponent, isStandalone: true, selector: "sc-order-items-list", inputs: { selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: false, isRequired: true, transformFunction: null } }, outputs: { selectedItemsIdsChange: "selectedItemsIdsChange" }, ngImport: i0, template: "<div\n [formGroup]=\"selectionFormGroup\"\n class=\"flex flex-col gap-5\"\n>\n @for (item of itemsSignal(); track item.id) {\n @if ($index !== 0) {\n <hr class=\"mt-auto h-px w-full bg-tui-clear\" />\n }\n\n <div class=\"flex items-center gap-4 relative\">\n @let isActive = !selectable() || selectionFormGroup.get(item.id)?.value;\n\n <!-- \u0427\u0435\u043A\u0431\u043E\u043A\u0441 \u0432\u044B\u0431\u043E\u0440\u0430 \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (selectable()) {\n <input\n tuiCheckbox\n [disabled]=\"itemComponent.showLoader()\"\n type=\"checkbox\"\n size=\"m\"\n [formControlName]=\"item.id\"\n />\n }\n\n <!-- \u041A\u0430\u0440\u0442\u043E\u0447\u043A\u0430 \u0442\u043E\u0432\u0430\u0440\u0430. -->\n <sc-order-item\n #itemComponent\n [product]=\"item.product\"\n [orderItem]=\"item\"\n [showQuantityControl]=\"canEdit() && !item.configurator\"\n [isShowEditControls]=\"canEdit()\"\n class=\"w-full duration-200\"\n [class.opacity-60]=\"selectable() && !selectionFormGroup.get(item.id)?.value\"\n (clickCardEvent)=\"openProductInfoDialog(item.product, item, orderOptions?.orderId())\"\n (quantityValueChanges)=\"patchItem($event, itemComponent)\"\n (clickPriceHistoryEvent)=\"openPriceHistoryChartDialog(item.product)\"\n (clickSettings)=\"openSettingsDialog(item)\"\n [class.pointer-events-none]=\"!isActive\"\n />\n\n <!-- \u041A\u043D\u043E\u043F\u043A\u0430 \u0443\u0434\u0430\u043B\u0435\u043D\u0438\u044F \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (canEdit()) {\n <button\n tuiIconButton\n (click)=\"deleteItem(item, itemComponent)\"\n [loading]=\"itemComponent.showLoader()\"\n size=\"s\"\n appearance=\"secondary\"\n class=\"!absolute left-1 top-1 lg:!relative lg:left-0 lg:top-0 lg:!self-center\"\n >\n <tui-icon icon=\"@tui.trash\" />\n </button>\n }\n </div>\n }\n\n <!-- \u0424\u0443\u0442\u0435\u0440 \u0441\u043F\u0438\u0441\u043A\u0430. -->\n <div\n scPrint=\"cost\"\n class=\"flex flex-col items-end gap-2.5\"\n >\n @let totalSum = sumSelectedItems();\n <!-- \u0418\u0442\u043E\u0433\u043E\u0432\u0430\u044F \u0441\u0443\u043C\u043C\u0430. -->\n <div class=\"text-base font-bold\">\u0418\u0442\u043E\u0433\u043E: {{ totalSum | tuiFormatNumber: moneyFormat }} {{ 'RUB' | tuiCurrency }}</div>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: ScOrderItemComponent, selector: "sc-order-item", inputs: ["isShowEditControls"], outputs: ["clickSettings"] }, { kind: "directive", type: ScPrintDirective, selector: "[scPrint]", inputs: ["scPrint"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: TuiCheckbox, selector: "input[type=\"checkbox\"][tuiCheckbox]" }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiIcon, selector: "tui-icon:not([tuiBadge])", inputs: ["background"] }, { kind: "component", type: TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }, { kind: "pipe", type: TuiCurrencyPipe, name: "tuiCurrency" }, { kind: "pipe", type: TuiFormatNumberPipe, name: "tuiFormatNumber" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
8920
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScOrderItemsListComponent, isStandalone: true, selector: "sc-order-items-list", inputs: { selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, grouped: { classPropertyName: "grouped", publicName: "grouped", isSignal: true, isRequired: false, transformFunction: null }, markUnavailable: { classPropertyName: "markUnavailable", publicName: "markUnavailable", isSignal: true, isRequired: false, transformFunction: null }, useLinePrice: { classPropertyName: "useLinePrice", publicName: "useLinePrice", isSignal: true, isRequired: false, transformFunction: null }, measuredInDialog: { classPropertyName: "measuredInDialog", publicName: "measuredInDialog", isSignal: true, isRequired: false, transformFunction: null }, deleteConfirmationTarget: { classPropertyName: "deleteConfirmationTarget", publicName: "deleteConfirmationTarget", isSignal: true, isRequired: false, transformFunction: null }, totalLabel: { classPropertyName: "totalLabel", publicName: "totalLabel", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: false, isRequired: true, transformFunction: null } }, outputs: { selectedItemsIdsChange: "selectedItemsIdsChange" }, ngImport: i0, template: "<div\n [formGroup]=\"selectionFormGroup\"\n class=\"flex flex-col gap-5\"\n>\n <!-- \u0424\u043B\u0430\u0433 \u0432\u044B\u0431\u043E\u0440\u0430 \u0432\u0441\u0435\u0445 \u043F\u043E\u0437\u0438\u0446\u0438\u0439. -->\n @if (selectable() && itemsSignal().length) {\n <label\n tuiLabel\n scPrint=\"defaultNoPrint\"\n class=\"self-start\"\n >\n <input\n tuiCheckbox\n type=\"checkbox\"\n size=\"m\"\n [ngModel]=\"allItemsSelected()\"\n [ngModelOptions]=\"{ standalone: true }\"\n [disabled]=\"selectionFormGroup.disabled\"\n (change)=\"selectAllChangeHandler($event)\"\n />\n \u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435\n </label>\n }\n\n @for (group of groups(); track group.name) {\n <!-- \u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A \u0433\u0440\u0443\u043F\u043F\u044B \u043F\u043E\u0437\u0438\u0446\u0438\u0439. -->\n @if (group.name) {\n <div class=\"flex flex-wrap items-end justify-between gap-x-4 gap-y-1 border-b border-tui-base-03 pb-2\">\n <div class=\"flex min-w-0 flex-col\">\n <span class=\"break-words text-body-l-bold\">{{ group.name }}</span>\n <span class=\"text-body-s text-tui-text-02\">\u043F\u043E\u0437\u0438\u0446\u0438\u0439: {{ group.items.length }}, \u0432 \u0437\u0430\u043A\u0430\u0437: {{ group.orderableCount }}</span>\n </div>\n <div class=\"flex flex-col items-end gap-1\">\n <!-- \u041A\u043D\u043E\u043F\u043A\u0430 \u0443\u0434\u0430\u043B\u0435\u043D\u0438\u044F \u0433\u0440\u0443\u043F\u043F\u044B. -->\n @if (canDeleteGroups()) {\n <button\n tuiButton\n type=\"button\"\n appearance=\"flat\"\n size=\"xs\"\n scPrint=\"defaultNoPrint\"\n [loading]=\"deletingGroupsNames().has(group.name)\"\n [disabled]=\"pendingGroupsNames().has(group.name)\"\n (click)=\"deleteGroup(group)\"\n >\n \u0423\u0434\u0430\u043B\u0438\u0442\u044C\n </button>\n }\n <span class=\"whitespace-nowrap text-body-m-bold\">{{ group.orderableSum | tuiFormatNumber: moneyFormat }} {{ 'RUB' | tuiCurrency }}</span>\n </div>\n </div>\n }\n\n @for (item of group.items; track item.id) {\n @if ($index !== 0) {\n <hr class=\"mt-auto h-px w-full bg-tui-clear\" />\n }\n\n <div class=\"flex items-center gap-4 relative\">\n @let isActive = !selectable() || selectionFormGroup.get(item.id)?.value || (markUnavailable() && !item.isOrderable);\n @let isPending = pendingItemsIds().has(item.id);\n @let editedInDialog = isEditedInDialog(item);\n\n <!-- \u0427\u0435\u043A\u0431\u043E\u043A\u0441 \u0432\u044B\u0431\u043E\u0440\u0430 \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (selectable()) {\n <input\n tuiCheckbox\n type=\"checkbox\"\n size=\"m\"\n [formControlName]=\"item.id\"\n />\n }\n\n <!-- \u041A\u0430\u0440\u0442\u043E\u0447\u043A\u0430 \u0442\u043E\u0432\u0430\u0440\u0430. -->\n <sc-order-item\n #itemComponent\n [product]=\"item.product\"\n [orderItem]=\"item\"\n [showQuantityControl]=\"canEdit() && !item.configurator && !editedInDialog\"\n [isShowEditControls]=\"canEdit()\"\n [useLinePrice]=\"useLinePrice()\"\n [markUnavailable]=\"markUnavailable()\"\n [isPending]=\"isPending\"\n [settingsAvailable]=\"canEdit() && measuredInDialog() && !item.configurator && !item.isInactive\"\n class=\"w-full duration-200\"\n [class.opacity-60]=\"isItemDimmed(item)\"\n (clickCardEvent)=\"openProductInfoDialog(item.product, item, orderOptions?.orderId())\"\n (quantityValueChanges)=\"patchItem($event, itemComponent)\"\n (clickPriceHistoryEvent)=\"openPriceHistoryChartDialog(item.product)\"\n (clickSettings)=\"openSettingsDialog(item)\"\n [class.pointer-events-none]=\"!isActive\"\n />\n\n <!-- \u041A\u043D\u043E\u043F\u043A\u0430 \u0443\u0434\u0430\u043B\u0435\u043D\u0438\u044F \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (canEdit()) {\n <button\n tuiIconButton\n (click)=\"deleteItem(item)\"\n [loading]=\"isPending\"\n size=\"s\"\n appearance=\"secondary\"\n class=\"!absolute left-1 top-1 lg:!relative lg:left-0 lg:top-0 lg:!self-center\"\n >\n <tui-icon icon=\"@tui.trash\" />\n </button>\n }\n </div>\n }\n }\n\n <!-- \u0424\u0443\u0442\u0435\u0440 \u0441\u043F\u0438\u0441\u043A\u0430. -->\n <div\n scPrint=\"cost\"\n class=\"flex flex-col items-end gap-2.5\"\n >\n @let totalSum = sumSelectedItems();\n <!-- \u0418\u0442\u043E\u0433\u043E\u0432\u0430\u044F \u0441\u0443\u043C\u043C\u0430. -->\n <div class=\"text-base font-bold\">{{ totalLabel() }}: {{ totalSum | tuiFormatNumber: moneyFormat }} {{ 'RUB' | tuiCurrency }}</div>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: ScOrderItemComponent, selector: "sc-order-item", inputs: ["isShowEditControls", "useLinePrice", "markUnavailable", "isPending", "settingsAvailable"], outputs: ["clickSettings"] }, { kind: "directive", type: ScPrintDirective, selector: "[scPrint]", inputs: ["scPrint"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: TuiCheckbox, selector: "input[type=\"checkbox\"][tuiCheckbox]" }, { kind: "directive", type: TuiLabel, selector: "label[tuiLabel]" }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiIcon, selector: "tui-icon:not([tuiBadge])", inputs: ["background"] }, { kind: "component", type: TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }, { kind: "pipe", type: TuiCurrencyPipe, name: "tuiCurrency" }, { kind: "pipe", type: TuiFormatNumberPipe, name: "tuiFormatNumber" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
8155
8921
  }
8156
8922
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScOrderItemsListComponent, decorators: [{
8157
8923
  type: Component,
8158
- args: [{ standalone: true, selector: 'sc-order-items-list', imports: [ScOrderItemComponent, ScPrintDirective, ReactiveFormsModule, TuiCheckbox, TuiButton, TuiIcon, TuiButtonLoading, TuiCurrencyPipe, AsyncPipe, TuiFormatNumberPipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n [formGroup]=\"selectionFormGroup\"\n class=\"flex flex-col gap-5\"\n>\n @for (item of itemsSignal(); track item.id) {\n @if ($index !== 0) {\n <hr class=\"mt-auto h-px w-full bg-tui-clear\" />\n }\n\n <div class=\"flex items-center gap-4 relative\">\n @let isActive = !selectable() || selectionFormGroup.get(item.id)?.value;\n\n <!-- \u0427\u0435\u043A\u0431\u043E\u043A\u0441 \u0432\u044B\u0431\u043E\u0440\u0430 \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (selectable()) {\n <input\n tuiCheckbox\n [disabled]=\"itemComponent.showLoader()\"\n type=\"checkbox\"\n size=\"m\"\n [formControlName]=\"item.id\"\n />\n }\n\n <!-- \u041A\u0430\u0440\u0442\u043E\u0447\u043A\u0430 \u0442\u043E\u0432\u0430\u0440\u0430. -->\n <sc-order-item\n #itemComponent\n [product]=\"item.product\"\n [orderItem]=\"item\"\n [showQuantityControl]=\"canEdit() && !item.configurator\"\n [isShowEditControls]=\"canEdit()\"\n class=\"w-full duration-200\"\n [class.opacity-60]=\"selectable() && !selectionFormGroup.get(item.id)?.value\"\n (clickCardEvent)=\"openProductInfoDialog(item.product, item, orderOptions?.orderId())\"\n (quantityValueChanges)=\"patchItem($event, itemComponent)\"\n (clickPriceHistoryEvent)=\"openPriceHistoryChartDialog(item.product)\"\n (clickSettings)=\"openSettingsDialog(item)\"\n [class.pointer-events-none]=\"!isActive\"\n />\n\n <!-- \u041A\u043D\u043E\u043F\u043A\u0430 \u0443\u0434\u0430\u043B\u0435\u043D\u0438\u044F \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (canEdit()) {\n <button\n tuiIconButton\n (click)=\"deleteItem(item, itemComponent)\"\n [loading]=\"itemComponent.showLoader()\"\n size=\"s\"\n appearance=\"secondary\"\n class=\"!absolute left-1 top-1 lg:!relative lg:left-0 lg:top-0 lg:!self-center\"\n >\n <tui-icon icon=\"@tui.trash\" />\n </button>\n }\n </div>\n }\n\n <!-- \u0424\u0443\u0442\u0435\u0440 \u0441\u043F\u0438\u0441\u043A\u0430. -->\n <div\n scPrint=\"cost\"\n class=\"flex flex-col items-end gap-2.5\"\n >\n @let totalSum = sumSelectedItems();\n <!-- \u0418\u0442\u043E\u0433\u043E\u0432\u0430\u044F \u0441\u0443\u043C\u043C\u0430. -->\n <div class=\"text-base font-bold\">\u0418\u0442\u043E\u0433\u043E: {{ totalSum | tuiFormatNumber: moneyFormat }} {{ 'RUB' | tuiCurrency }}</div>\n </div>\n</div>\n" }]
8159
- }], propDecorators: { selectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectable", required: false }] }], editable: [{ type: i0.Input, args: [{ isSignal: true, alias: "editable", required: false }] }], selectedItemsIdsChange: [{ type: i0.Output, args: ["selectedItemsIdsChange"] }], items: [{
8924
+ args: [{ standalone: true, selector: 'sc-order-items-list', imports: [
8925
+ ScOrderItemComponent,
8926
+ ScPrintDirective,
8927
+ FormsModule,
8928
+ ReactiveFormsModule,
8929
+ TuiCheckbox,
8930
+ TuiLabel,
8931
+ TuiButton,
8932
+ TuiIcon,
8933
+ TuiButtonLoading,
8934
+ TuiCurrencyPipe,
8935
+ TuiFormatNumberPipe,
8936
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n [formGroup]=\"selectionFormGroup\"\n class=\"flex flex-col gap-5\"\n>\n <!-- \u0424\u043B\u0430\u0433 \u0432\u044B\u0431\u043E\u0440\u0430 \u0432\u0441\u0435\u0445 \u043F\u043E\u0437\u0438\u0446\u0438\u0439. -->\n @if (selectable() && itemsSignal().length) {\n <label\n tuiLabel\n scPrint=\"defaultNoPrint\"\n class=\"self-start\"\n >\n <input\n tuiCheckbox\n type=\"checkbox\"\n size=\"m\"\n [ngModel]=\"allItemsSelected()\"\n [ngModelOptions]=\"{ standalone: true }\"\n [disabled]=\"selectionFormGroup.disabled\"\n (change)=\"selectAllChangeHandler($event)\"\n />\n \u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435\n </label>\n }\n\n @for (group of groups(); track group.name) {\n <!-- \u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A \u0433\u0440\u0443\u043F\u043F\u044B \u043F\u043E\u0437\u0438\u0446\u0438\u0439. -->\n @if (group.name) {\n <div class=\"flex flex-wrap items-end justify-between gap-x-4 gap-y-1 border-b border-tui-base-03 pb-2\">\n <div class=\"flex min-w-0 flex-col\">\n <span class=\"break-words text-body-l-bold\">{{ group.name }}</span>\n <span class=\"text-body-s text-tui-text-02\">\u043F\u043E\u0437\u0438\u0446\u0438\u0439: {{ group.items.length }}, \u0432 \u0437\u0430\u043A\u0430\u0437: {{ group.orderableCount }}</span>\n </div>\n <div class=\"flex flex-col items-end gap-1\">\n <!-- \u041A\u043D\u043E\u043F\u043A\u0430 \u0443\u0434\u0430\u043B\u0435\u043D\u0438\u044F \u0433\u0440\u0443\u043F\u043F\u044B. -->\n @if (canDeleteGroups()) {\n <button\n tuiButton\n type=\"button\"\n appearance=\"flat\"\n size=\"xs\"\n scPrint=\"defaultNoPrint\"\n [loading]=\"deletingGroupsNames().has(group.name)\"\n [disabled]=\"pendingGroupsNames().has(group.name)\"\n (click)=\"deleteGroup(group)\"\n >\n \u0423\u0434\u0430\u043B\u0438\u0442\u044C\n </button>\n }\n <span class=\"whitespace-nowrap text-body-m-bold\">{{ group.orderableSum | tuiFormatNumber: moneyFormat }} {{ 'RUB' | tuiCurrency }}</span>\n </div>\n </div>\n }\n\n @for (item of group.items; track item.id) {\n @if ($index !== 0) {\n <hr class=\"mt-auto h-px w-full bg-tui-clear\" />\n }\n\n <div class=\"flex items-center gap-4 relative\">\n @let isActive = !selectable() || selectionFormGroup.get(item.id)?.value || (markUnavailable() && !item.isOrderable);\n @let isPending = pendingItemsIds().has(item.id);\n @let editedInDialog = isEditedInDialog(item);\n\n <!-- \u0427\u0435\u043A\u0431\u043E\u043A\u0441 \u0432\u044B\u0431\u043E\u0440\u0430 \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (selectable()) {\n <input\n tuiCheckbox\n type=\"checkbox\"\n size=\"m\"\n [formControlName]=\"item.id\"\n />\n }\n\n <!-- \u041A\u0430\u0440\u0442\u043E\u0447\u043A\u0430 \u0442\u043E\u0432\u0430\u0440\u0430. -->\n <sc-order-item\n #itemComponent\n [product]=\"item.product\"\n [orderItem]=\"item\"\n [showQuantityControl]=\"canEdit() && !item.configurator && !editedInDialog\"\n [isShowEditControls]=\"canEdit()\"\n [useLinePrice]=\"useLinePrice()\"\n [markUnavailable]=\"markUnavailable()\"\n [isPending]=\"isPending\"\n [settingsAvailable]=\"canEdit() && measuredInDialog() && !item.configurator && !item.isInactive\"\n class=\"w-full duration-200\"\n [class.opacity-60]=\"isItemDimmed(item)\"\n (clickCardEvent)=\"openProductInfoDialog(item.product, item, orderOptions?.orderId())\"\n (quantityValueChanges)=\"patchItem($event, itemComponent)\"\n (clickPriceHistoryEvent)=\"openPriceHistoryChartDialog(item.product)\"\n (clickSettings)=\"openSettingsDialog(item)\"\n [class.pointer-events-none]=\"!isActive\"\n />\n\n <!-- \u041A\u043D\u043E\u043F\u043A\u0430 \u0443\u0434\u0430\u043B\u0435\u043D\u0438\u044F \u0442\u043E\u0432\u0430\u0440\u0430. -->\n @if (canEdit()) {\n <button\n tuiIconButton\n (click)=\"deleteItem(item)\"\n [loading]=\"isPending\"\n size=\"s\"\n appearance=\"secondary\"\n class=\"!absolute left-1 top-1 lg:!relative lg:left-0 lg:top-0 lg:!self-center\"\n >\n <tui-icon icon=\"@tui.trash\" />\n </button>\n }\n </div>\n }\n }\n\n <!-- \u0424\u0443\u0442\u0435\u0440 \u0441\u043F\u0438\u0441\u043A\u0430. -->\n <div\n scPrint=\"cost\"\n class=\"flex flex-col items-end gap-2.5\"\n >\n @let totalSum = sumSelectedItems();\n <!-- \u0418\u0442\u043E\u0433\u043E\u0432\u0430\u044F \u0441\u0443\u043C\u043C\u0430. -->\n <div class=\"text-base font-bold\">{{ totalLabel() }}: {{ totalSum | tuiFormatNumber: moneyFormat }} {{ 'RUB' | tuiCurrency }}</div>\n </div>\n</div>\n" }]
8937
+ }], ctorParameters: () => [], propDecorators: { selectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectable", required: false }] }], editable: [{ type: i0.Input, args: [{ isSignal: true, alias: "editable", required: false }] }], grouped: [{ type: i0.Input, args: [{ isSignal: true, alias: "grouped", required: false }] }], markUnavailable: [{ type: i0.Input, args: [{ isSignal: true, alias: "markUnavailable", required: false }] }], useLinePrice: [{ type: i0.Input, args: [{ isSignal: true, alias: "useLinePrice", required: false }] }], measuredInDialog: [{ type: i0.Input, args: [{ isSignal: true, alias: "measuredInDialog", required: false }] }], deleteConfirmationTarget: [{ type: i0.Input, args: [{ isSignal: true, alias: "deleteConfirmationTarget", required: false }] }], totalLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalLabel", required: false }] }], selectedItemsIdsChange: [{ type: i0.Output, args: ["selectedItemsIdsChange"] }], items: [{
8160
8938
  type: Input,
8161
8939
  args: [{ required: true }]
8162
8940
  }] } });
@@ -8181,6 +8959,18 @@ class ScOrderItemsListWithActionsComponent {
8181
8959
  * Включить редактирование позиций.
8182
8960
  */
8183
8961
  this.editable = input(false, ...(ngDevMode ? [{ debugName: "editable" }] : /* istanbul ignore next */ []));
8962
+ /**
8963
+ * Признак, что цена за единицу берётся из позиции, а не из текущей цены товара.
8964
+ */
8965
+ this.useLinePrice = input(false, ...(ngDevMode ? [{ debugName: "useLinePrice" }] : /* istanbul ignore next */ []));
8966
+ /**
8967
+ * Откуда удаляется позиция для текста подтверждения, например «из черновика». Если не задано, позиция удаляется без подтверждения.
8968
+ */
8969
+ this.deleteConfirmationTarget = input(null, ...(ngDevMode ? [{ debugName: "deleteConfirmationTarget" }] : /* istanbul ignore next */ []));
8970
+ /**
8971
+ * Подпись итоговой суммы.
8972
+ */
8973
+ this.totalLabel = input('Итого', ...(ngDevMode ? [{ debugName: "totalLabel" }] : /* istanbul ignore next */ []));
8184
8974
  /**
8185
8975
  * Позиции, доступные для заказа.
8186
8976
  */
@@ -8204,12 +8994,12 @@ class ScOrderItemsListWithActionsComponent {
8204
8994
  });
8205
8995
  }
8206
8996
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScOrderItemsListWithActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
8207
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScOrderItemsListWithActionsComponent, isStandalone: true, selector: "sc-order-items-list-with-actions", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, selectedItemsIds: { classPropertyName: "selectedItemsIds", publicName: "selectedItemsIds", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedItemsIds: "selectedItemsIdsChange" }, ngImport: i0, template: "<div class=\"flex flex-col gap-5\">\n <div class=\"flex flex-col gap-2.5\">\n @if (availableItems().length) {\n <sc-order-items-list\n [items]=\"availableItems()\"\n [selectable]=\"selectable()\"\n [editable]=\"editable()\"\n (selectedItemsIdsChange)=\"selectedItemsIds.set($event)\"\n />\n }\n\n <!-- \u0424\u0443\u0442\u0435\u0440 \u0441\u043F\u0438\u0441\u043A\u0430 \u0442\u043E\u0432\u0430\u0440\u043E\u0432. -->\n <div class=\"flex flex-col items-center sm:flex-row sm:items-start sm:flex-wrap-reverse grow gap-x-2.5 gap-y-4\">\n <ng-content select=\"[footerActions]\" />\n </div>\n </div>\n\n @if (nullItems().length) {\n <div class=\"flex flex-col gap-2.5\">\n <div class=\"text-base font-bold\">\u0422\u043E\u0432\u0430\u0440\u044B \u0438 \u0443\u0441\u043B\u0443\u0433\u0438, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u043F\u0440\u0435\u0434\u043E\u0441\u0442\u0430\u0432\u043B\u044F\u044E\u0442\u0441\u044F.</div>\n\n <sc-order-items-list\n [items]=\"nullItems()\"\n [selectable]=\"false\"\n [editable]=\"editable()\"\n />\n </div>\n }\n</div>\n", dependencies: [{ kind: "component", type: ScOrderItemsListComponent, selector: "sc-order-items-list", inputs: ["selectable", "editable", "items"], outputs: ["selectedItemsIdsChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
8997
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScOrderItemsListWithActionsComponent, isStandalone: true, selector: "sc-order-items-list-with-actions", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, useLinePrice: { classPropertyName: "useLinePrice", publicName: "useLinePrice", isSignal: true, isRequired: false, transformFunction: null }, deleteConfirmationTarget: { classPropertyName: "deleteConfirmationTarget", publicName: "deleteConfirmationTarget", isSignal: true, isRequired: false, transformFunction: null }, totalLabel: { classPropertyName: "totalLabel", publicName: "totalLabel", isSignal: true, isRequired: false, transformFunction: null }, selectedItemsIds: { classPropertyName: "selectedItemsIds", publicName: "selectedItemsIds", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedItemsIds: "selectedItemsIdsChange" }, ngImport: i0, template: "<div class=\"flex flex-col gap-5\">\n <div class=\"flex flex-col gap-2.5\">\n @if (availableItems().length) {\n <sc-order-items-list\n [items]=\"availableItems()\"\n [selectable]=\"selectable()\"\n [editable]=\"editable()\"\n [useLinePrice]=\"useLinePrice()\"\n [deleteConfirmationTarget]=\"deleteConfirmationTarget()\"\n [totalLabel]=\"totalLabel()\"\n (selectedItemsIdsChange)=\"selectedItemsIds.set($event)\"\n />\n }\n\n <!-- \u0424\u0443\u0442\u0435\u0440 \u0441\u043F\u0438\u0441\u043A\u0430 \u0442\u043E\u0432\u0430\u0440\u043E\u0432. -->\n <div class=\"flex flex-col items-center sm:flex-row sm:items-start sm:flex-wrap-reverse grow gap-x-2.5 gap-y-4\">\n <ng-content select=\"[footerActions]\" />\n </div>\n </div>\n\n @if (nullItems().length) {\n <div class=\"flex flex-col gap-2.5\">\n <div class=\"text-base font-bold\">\u0422\u043E\u0432\u0430\u0440\u044B \u0438 \u0443\u0441\u043B\u0443\u0433\u0438, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u043F\u0440\u0435\u0434\u043E\u0441\u0442\u0430\u0432\u043B\u044F\u044E\u0442\u0441\u044F.</div>\n\n <sc-order-items-list\n [items]=\"nullItems()\"\n [selectable]=\"false\"\n [editable]=\"editable()\"\n [useLinePrice]=\"useLinePrice()\"\n [deleteConfirmationTarget]=\"deleteConfirmationTarget()\"\n />\n </div>\n }\n</div>\n", dependencies: [{ kind: "component", type: ScOrderItemsListComponent, selector: "sc-order-items-list", inputs: ["selectable", "editable", "grouped", "markUnavailable", "useLinePrice", "measuredInDialog", "deleteConfirmationTarget", "totalLabel", "items"], outputs: ["selectedItemsIdsChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
8208
8998
  }
8209
8999
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScOrderItemsListWithActionsComponent, decorators: [{
8210
9000
  type: Component,
8211
- args: [{ selector: 'sc-order-items-list-with-actions', imports: [ScOrderItemsListComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-col gap-5\">\n <div class=\"flex flex-col gap-2.5\">\n @if (availableItems().length) {\n <sc-order-items-list\n [items]=\"availableItems()\"\n [selectable]=\"selectable()\"\n [editable]=\"editable()\"\n (selectedItemsIdsChange)=\"selectedItemsIds.set($event)\"\n />\n }\n\n <!-- \u0424\u0443\u0442\u0435\u0440 \u0441\u043F\u0438\u0441\u043A\u0430 \u0442\u043E\u0432\u0430\u0440\u043E\u0432. -->\n <div class=\"flex flex-col items-center sm:flex-row sm:items-start sm:flex-wrap-reverse grow gap-x-2.5 gap-y-4\">\n <ng-content select=\"[footerActions]\" />\n </div>\n </div>\n\n @if (nullItems().length) {\n <div class=\"flex flex-col gap-2.5\">\n <div class=\"text-base font-bold\">\u0422\u043E\u0432\u0430\u0440\u044B \u0438 \u0443\u0441\u043B\u0443\u0433\u0438, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u043F\u0440\u0435\u0434\u043E\u0441\u0442\u0430\u0432\u043B\u044F\u044E\u0442\u0441\u044F.</div>\n\n <sc-order-items-list\n [items]=\"nullItems()\"\n [selectable]=\"false\"\n [editable]=\"editable()\"\n />\n </div>\n }\n</div>\n" }]
8212
- }], ctorParameters: () => [], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }], selectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectable", required: false }] }], editable: [{ type: i0.Input, args: [{ isSignal: true, alias: "editable", required: false }] }], selectedItemsIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedItemsIds", required: false }] }, { type: i0.Output, args: ["selectedItemsIdsChange"] }] } });
9001
+ args: [{ selector: 'sc-order-items-list-with-actions', imports: [ScOrderItemsListComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-col gap-5\">\n <div class=\"flex flex-col gap-2.5\">\n @if (availableItems().length) {\n <sc-order-items-list\n [items]=\"availableItems()\"\n [selectable]=\"selectable()\"\n [editable]=\"editable()\"\n [useLinePrice]=\"useLinePrice()\"\n [deleteConfirmationTarget]=\"deleteConfirmationTarget()\"\n [totalLabel]=\"totalLabel()\"\n (selectedItemsIdsChange)=\"selectedItemsIds.set($event)\"\n />\n }\n\n <!-- \u0424\u0443\u0442\u0435\u0440 \u0441\u043F\u0438\u0441\u043A\u0430 \u0442\u043E\u0432\u0430\u0440\u043E\u0432. -->\n <div class=\"flex flex-col items-center sm:flex-row sm:items-start sm:flex-wrap-reverse grow gap-x-2.5 gap-y-4\">\n <ng-content select=\"[footerActions]\" />\n </div>\n </div>\n\n @if (nullItems().length) {\n <div class=\"flex flex-col gap-2.5\">\n <div class=\"text-base font-bold\">\u0422\u043E\u0432\u0430\u0440\u044B \u0438 \u0443\u0441\u043B\u0443\u0433\u0438, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u043F\u0440\u0435\u0434\u043E\u0441\u0442\u0430\u0432\u043B\u044F\u044E\u0442\u0441\u044F.</div>\n\n <sc-order-items-list\n [items]=\"nullItems()\"\n [selectable]=\"false\"\n [editable]=\"editable()\"\n [useLinePrice]=\"useLinePrice()\"\n [deleteConfirmationTarget]=\"deleteConfirmationTarget()\"\n />\n </div>\n }\n</div>\n" }]
9002
+ }], ctorParameters: () => [], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }], selectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectable", required: false }] }], editable: [{ type: i0.Input, args: [{ isSignal: true, alias: "editable", required: false }] }], useLinePrice: [{ type: i0.Input, args: [{ isSignal: true, alias: "useLinePrice", required: false }] }], deleteConfirmationTarget: [{ type: i0.Input, args: [{ isSignal: true, alias: "deleteConfirmationTarget", required: false }] }], totalLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalLabel", required: false }] }], selectedItemsIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedItemsIds", required: false }] }, { type: i0.Output, args: ["selectedItemsIdsChange"] }] } });
8213
9003
 
8214
9004
  /**
8215
9005
  * Список товаров оформляемого заказа с выбором позиций.
@@ -8228,6 +9018,14 @@ class ScNewOrderItemsComponent {
8228
9018
  * Включить выбор позиций чекбоксами.
8229
9019
  */
8230
9020
  this.selectable = input(true, ...(ngDevMode ? [{ debugName: "selectable" }] : /* istanbul ignore next */ []));
9021
+ /**
9022
+ * Признак, что цена за единицу берётся из позиции, а не из текущей цены товара.
9023
+ */
9024
+ this.useLinePrice = input(false, ...(ngDevMode ? [{ debugName: "useLinePrice" }] : /* istanbul ignore next */ []));
9025
+ /**
9026
+ * Подпись итоговой суммы.
9027
+ */
9028
+ this.totalLabel = input('Итого', ...(ngDevMode ? [{ debugName: "totalLabel" }] : /* istanbul ignore next */ []));
8231
9029
  /**
8232
9030
  * Время обработки и принятия заказов (из настроек окружения приложения).
8233
9031
  */
@@ -8238,12 +9036,12 @@ class ScNewOrderItemsComponent {
8238
9036
  this.selectedItemsIdsChange = output();
8239
9037
  }
8240
9038
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScNewOrderItemsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
8241
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.16", type: ScNewOrderItemsComponent, isStandalone: true, selector: "sc-new-order-items", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, orderProcessingAcceptanceTime: { classPropertyName: "orderProcessingAcceptanceTime", publicName: "orderProcessingAcceptanceTime", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedItemsIdsChange: "selectedItemsIdsChange" }, ngImport: i0, template: "<div class=\"flex flex-col gap-5\">\n <ul class=\"ml-4 list-disc text-tui-success-fill\">\n <li>\u0417\u0430\u044F\u0432\u043A\u0438 \u043F\u0440\u0438\u043D\u0438\u043C\u0430\u044E\u0442\u0441\u044F \u043D\u0435 \u043F\u043E\u0437\u0434\u043D\u0435\u0435 {{ orderProcessingAcceptanceTime() }} \u043F\u043B\u0430\u043D\u0438\u0440\u0443\u0435\u043C\u043E\u0433\u043E \u0434\u043D\u044F \u043F\u043E\u0441\u0442\u0430\u0432\u043A\u0438.</li>\n <li>\u0417\u0430\u043A\u0430\u0437\u044B \u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u043E\u0439 \u043D\u0430 \u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A \u043F\u0440\u0438\u043D\u0438\u043C\u0430\u044E\u0442\u0441\u044F \u0434\u043E {{ orderProcessingAcceptanceTime() }} \u043F\u044F\u0442\u043D\u0438\u0446\u044B.</li>\n <li>\u0417\u0430\u043A\u0430\u0437\u044B, \u0441\u043E\u0437\u0434\u0430\u043D\u043D\u044B\u0435 \u043F\u043E\u0437\u0434\u043D\u0435\u0435 {{ orderProcessingAcceptanceTime() }} \u043F\u044F\u0442\u043D\u0438\u0446\u044B \u0438\u043B\u0438 \u0432 \u0441\u0443\u0431\u0431\u043E\u0442\u0443/\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u0435 \u0431\u0443\u0434\u0443\u0442 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u0430\u043D\u044B \u0432 \u0431\u0443\u0434\u043D\u0438\u0435 \u0434\u043D\u0438.</li>\n <li>\n \u0423\u043F\u0440\u0430\u0432\u043B\u044F\u0442\u044C \u0441\u043F\u0438\u0441\u043A\u043E\u043C \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u043E\u0432 \u0432\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u0432\n <a\n tuiLink\n routerLink=\"/profile\"\n >\n \u043B\u0438\u0447\u043D\u043E\u043C \u043A\u0430\u0431\u0438\u043D\u0435\u0442\u0435\n </a>\n .\n </li>\n </ul>\n\n <div class=\"sub-title\">\u0421\u043E\u0441\u0442\u0430\u0432 \u0437\u0430\u043A\u0430\u0437\u0430</div>\n\n <sc-order-items-list-with-actions\n [items]=\"items()\"\n [editable]=\"editable()\"\n [selectable]=\"selectable()\"\n (selectedItemsIdsChange)=\"selectedItemsIdsChange.emit($event)\"\n >\n <ng-content\n select=\"[footerActions]\"\n ngProjectAs=\"[footerActions]\"\n />\n </sc-order-items-list-with-actions>\n</div>\n", dependencies: [{ kind: "component", type: ScOrderItemsListWithActionsComponent, selector: "sc-order-items-list-with-actions", inputs: ["items", "selectable", "editable", "selectedItemsIds"], outputs: ["selectedItemsIdsChange"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
9039
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.16", type: ScNewOrderItemsComponent, isStandalone: true, selector: "sc-new-order-items", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, useLinePrice: { classPropertyName: "useLinePrice", publicName: "useLinePrice", isSignal: true, isRequired: false, transformFunction: null }, totalLabel: { classPropertyName: "totalLabel", publicName: "totalLabel", isSignal: true, isRequired: false, transformFunction: null }, orderProcessingAcceptanceTime: { classPropertyName: "orderProcessingAcceptanceTime", publicName: "orderProcessingAcceptanceTime", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedItemsIdsChange: "selectedItemsIdsChange" }, ngImport: i0, template: "<div class=\"flex flex-col gap-5\">\n <ul class=\"ml-4 list-disc text-tui-success-fill\">\n <li>\u0417\u0430\u044F\u0432\u043A\u0438 \u043F\u0440\u0438\u043D\u0438\u043C\u0430\u044E\u0442\u0441\u044F \u043D\u0435 \u043F\u043E\u0437\u0434\u043D\u0435\u0435 {{ orderProcessingAcceptanceTime() }} \u043F\u043B\u0430\u043D\u0438\u0440\u0443\u0435\u043C\u043E\u0433\u043E \u0434\u043D\u044F \u043F\u043E\u0441\u0442\u0430\u0432\u043A\u0438.</li>\n <li>\u0417\u0430\u043A\u0430\u0437\u044B \u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u043E\u0439 \u043D\u0430 \u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A \u043F\u0440\u0438\u043D\u0438\u043C\u0430\u044E\u0442\u0441\u044F \u0434\u043E {{ orderProcessingAcceptanceTime() }} \u043F\u044F\u0442\u043D\u0438\u0446\u044B.</li>\n <li>\u0417\u0430\u043A\u0430\u0437\u044B, \u0441\u043E\u0437\u0434\u0430\u043D\u043D\u044B\u0435 \u043F\u043E\u0437\u0434\u043D\u0435\u0435 {{ orderProcessingAcceptanceTime() }} \u043F\u044F\u0442\u043D\u0438\u0446\u044B \u0438\u043B\u0438 \u0432 \u0441\u0443\u0431\u0431\u043E\u0442\u0443/\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u0435 \u0431\u0443\u0434\u0443\u0442 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u0430\u043D\u044B \u0432 \u0431\u0443\u0434\u043D\u0438\u0435 \u0434\u043D\u0438.</li>\n <li>\n \u0423\u043F\u0440\u0430\u0432\u043B\u044F\u0442\u044C \u0441\u043F\u0438\u0441\u043A\u043E\u043C \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u043E\u0432 \u0432\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u0432\n <a\n tuiLink\n routerLink=\"/profile\"\n >\n \u043B\u0438\u0447\u043D\u043E\u043C \u043A\u0430\u0431\u0438\u043D\u0435\u0442\u0435\n </a>\n .\n </li>\n </ul>\n\n <div class=\"sub-title\">\u0421\u043E\u0441\u0442\u0430\u0432 \u0437\u0430\u043A\u0430\u0437\u0430</div>\n\n <sc-order-items-list-with-actions\n [items]=\"items()\"\n [editable]=\"editable()\"\n [selectable]=\"selectable()\"\n [useLinePrice]=\"useLinePrice()\"\n [totalLabel]=\"totalLabel()\"\n (selectedItemsIdsChange)=\"selectedItemsIdsChange.emit($event)\"\n >\n <ng-content\n select=\"[footerActions]\"\n ngProjectAs=\"[footerActions]\"\n />\n </sc-order-items-list-with-actions>\n</div>\n", dependencies: [{ kind: "component", type: ScOrderItemsListWithActionsComponent, selector: "sc-order-items-list-with-actions", inputs: ["items", "selectable", "editable", "useLinePrice", "deleteConfirmationTarget", "totalLabel", "selectedItemsIds"], outputs: ["selectedItemsIdsChange"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
8242
9040
  }
8243
9041
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScNewOrderItemsComponent, decorators: [{
8244
9042
  type: Component,
8245
- args: [{ selector: 'sc-new-order-items', imports: [ScOrderItemsListWithActionsComponent, RouterLink, TuiLink], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-col gap-5\">\n <ul class=\"ml-4 list-disc text-tui-success-fill\">\n <li>\u0417\u0430\u044F\u0432\u043A\u0438 \u043F\u0440\u0438\u043D\u0438\u043C\u0430\u044E\u0442\u0441\u044F \u043D\u0435 \u043F\u043E\u0437\u0434\u043D\u0435\u0435 {{ orderProcessingAcceptanceTime() }} \u043F\u043B\u0430\u043D\u0438\u0440\u0443\u0435\u043C\u043E\u0433\u043E \u0434\u043D\u044F \u043F\u043E\u0441\u0442\u0430\u0432\u043A\u0438.</li>\n <li>\u0417\u0430\u043A\u0430\u0437\u044B \u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u043E\u0439 \u043D\u0430 \u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A \u043F\u0440\u0438\u043D\u0438\u043C\u0430\u044E\u0442\u0441\u044F \u0434\u043E {{ orderProcessingAcceptanceTime() }} \u043F\u044F\u0442\u043D\u0438\u0446\u044B.</li>\n <li>\u0417\u0430\u043A\u0430\u0437\u044B, \u0441\u043E\u0437\u0434\u0430\u043D\u043D\u044B\u0435 \u043F\u043E\u0437\u0434\u043D\u0435\u0435 {{ orderProcessingAcceptanceTime() }} \u043F\u044F\u0442\u043D\u0438\u0446\u044B \u0438\u043B\u0438 \u0432 \u0441\u0443\u0431\u0431\u043E\u0442\u0443/\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u0435 \u0431\u0443\u0434\u0443\u0442 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u0430\u043D\u044B \u0432 \u0431\u0443\u0434\u043D\u0438\u0435 \u0434\u043D\u0438.</li>\n <li>\n \u0423\u043F\u0440\u0430\u0432\u043B\u044F\u0442\u044C \u0441\u043F\u0438\u0441\u043A\u043E\u043C \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u043E\u0432 \u0432\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u0432\n <a\n tuiLink\n routerLink=\"/profile\"\n >\n \u043B\u0438\u0447\u043D\u043E\u043C \u043A\u0430\u0431\u0438\u043D\u0435\u0442\u0435\n </a>\n .\n </li>\n </ul>\n\n <div class=\"sub-title\">\u0421\u043E\u0441\u0442\u0430\u0432 \u0437\u0430\u043A\u0430\u0437\u0430</div>\n\n <sc-order-items-list-with-actions\n [items]=\"items()\"\n [editable]=\"editable()\"\n [selectable]=\"selectable()\"\n (selectedItemsIdsChange)=\"selectedItemsIdsChange.emit($event)\"\n >\n <ng-content\n select=\"[footerActions]\"\n ngProjectAs=\"[footerActions]\"\n />\n </sc-order-items-list-with-actions>\n</div>\n" }]
8246
- }], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }], editable: [{ type: i0.Input, args: [{ isSignal: true, alias: "editable", required: false }] }], selectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectable", required: false }] }], orderProcessingAcceptanceTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "orderProcessingAcceptanceTime", required: false }] }], selectedItemsIdsChange: [{ type: i0.Output, args: ["selectedItemsIdsChange"] }] } });
9043
+ args: [{ selector: 'sc-new-order-items', imports: [ScOrderItemsListWithActionsComponent, RouterLink, TuiLink], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-col gap-5\">\n <ul class=\"ml-4 list-disc text-tui-success-fill\">\n <li>\u0417\u0430\u044F\u0432\u043A\u0438 \u043F\u0440\u0438\u043D\u0438\u043C\u0430\u044E\u0442\u0441\u044F \u043D\u0435 \u043F\u043E\u0437\u0434\u043D\u0435\u0435 {{ orderProcessingAcceptanceTime() }} \u043F\u043B\u0430\u043D\u0438\u0440\u0443\u0435\u043C\u043E\u0433\u043E \u0434\u043D\u044F \u043F\u043E\u0441\u0442\u0430\u0432\u043A\u0438.</li>\n <li>\u0417\u0430\u043A\u0430\u0437\u044B \u0441 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u043E\u0439 \u043D\u0430 \u043F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A \u043F\u0440\u0438\u043D\u0438\u043C\u0430\u044E\u0442\u0441\u044F \u0434\u043E {{ orderProcessingAcceptanceTime() }} \u043F\u044F\u0442\u043D\u0438\u0446\u044B.</li>\n <li>\u0417\u0430\u043A\u0430\u0437\u044B, \u0441\u043E\u0437\u0434\u0430\u043D\u043D\u044B\u0435 \u043F\u043E\u0437\u0434\u043D\u0435\u0435 {{ orderProcessingAcceptanceTime() }} \u043F\u044F\u0442\u043D\u0438\u0446\u044B \u0438\u043B\u0438 \u0432 \u0441\u0443\u0431\u0431\u043E\u0442\u0443/\u0432\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u0435 \u0431\u0443\u0434\u0443\u0442 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u0430\u043D\u044B \u0432 \u0431\u0443\u0434\u043D\u0438\u0435 \u0434\u043D\u0438.</li>\n <li>\n \u0423\u043F\u0440\u0430\u0432\u043B\u044F\u0442\u044C \u0441\u043F\u0438\u0441\u043A\u043E\u043C \u043A\u043E\u043D\u0442\u0440\u0430\u0433\u0435\u043D\u0442\u043E\u0432 \u0432\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u0432\n <a\n tuiLink\n routerLink=\"/profile\"\n >\n \u043B\u0438\u0447\u043D\u043E\u043C \u043A\u0430\u0431\u0438\u043D\u0435\u0442\u0435\n </a>\n .\n </li>\n </ul>\n\n <div class=\"sub-title\">\u0421\u043E\u0441\u0442\u0430\u0432 \u0437\u0430\u043A\u0430\u0437\u0430</div>\n\n <sc-order-items-list-with-actions\n [items]=\"items()\"\n [editable]=\"editable()\"\n [selectable]=\"selectable()\"\n [useLinePrice]=\"useLinePrice()\"\n [totalLabel]=\"totalLabel()\"\n (selectedItemsIdsChange)=\"selectedItemsIdsChange.emit($event)\"\n >\n <ng-content\n select=\"[footerActions]\"\n ngProjectAs=\"[footerActions]\"\n />\n </sc-order-items-list-with-actions>\n</div>\n" }]
9044
+ }], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }], editable: [{ type: i0.Input, args: [{ isSignal: true, alias: "editable", required: false }] }], selectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectable", required: false }] }], useLinePrice: [{ type: i0.Input, args: [{ isSignal: true, alias: "useLinePrice", required: false }] }], totalLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalLabel", required: false }] }], orderProcessingAcceptanceTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "orderProcessingAcceptanceTime", required: false }] }], selectedItemsIdsChange: [{ type: i0.Output, args: ["selectedItemsIdsChange"] }] } });
8247
9045
 
8248
9046
  /**
8249
9047
  * Токен настроек {@link ScOrderFormComponent}.
@@ -8513,8 +9311,10 @@ class ScOrderFormComponent {
8513
9311
  }
8514
9312
  /**
8515
9313
  * Обрабатывает отправку формы: валидирует и эмитит данные заказа родителю.
9314
+ * Общая ошибка сервера с прошлой отправки (например, 409) не мешает отправить форму снова, ошибки полей остаются до их исправления.
8516
9315
  */
8517
9316
  submit() {
9317
+ this.form.updateValueAndValidity({ emitEvent: false });
8518
9318
  this.form.markAllAsTouched();
8519
9319
  if (!this.form.valid) {
8520
9320
  return;
@@ -8532,7 +9332,7 @@ class ScOrderFormComponent {
8532
9332
  * @param error Ответ сервера с ошибками.
8533
9333
  */
8534
9334
  applyServerErrors(error) {
8535
- const { errors, message } = error.error;
9335
+ const { errors, message } = (error.error ?? {});
8536
9336
  if (errors) {
8537
9337
  Object.keys(errors).forEach((key) => {
8538
9338
  if (key === 'deliveryDate' && isArray(errors[key])) {
@@ -8636,10 +9436,11 @@ class ScOrderFormComponent {
8636
9436
  this.initDateFieldActivationChange();
8637
9437
  }
8638
9438
  /**
8639
- * Инициализирует подписку на изменение поля прикрепления файла.
9439
+ * Инициализирует подписку на изменение поля прикрепления файла. Файл, не прошедший проверку формата или размера, к заказу не прикрепляется.
8640
9440
  */
8641
9441
  initFileChange() {
8642
- this.controlFile.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((file) => {
9442
+ this.accepted$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((files) => {
9443
+ const file = files.at(0);
8643
9444
  if (file && this.form.controls.image) {
8644
9445
  this.onUploadFile(file, this.form.controls.image);
8645
9446
  }
@@ -8844,7 +9645,7 @@ class ScOrderItemsListByStockComponent {
8844
9645
  this.selectedItemsIds.update((previous) => [...previous.filter((id) => !items.some((item) => item.id === id) && this.items().some((item) => item.id === id)), ...itemsIds]);
8845
9646
  }
8846
9647
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScOrderItemsListByStockComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
8847
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScOrderItemsListByStockComponent, isStandalone: true, selector: "sc-order-items-list-by-stock", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, warehouseId: { classPropertyName: "warehouseId", publicName: "warehouseId", isSignal: true, isRequired: true, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, sectionHeader: { classPropertyName: "sectionHeader", publicName: "sectionHeader", isSignal: true, isRequired: false, transformFunction: null }, selectedItemsIds: { classPropertyName: "selectedItemsIds", publicName: "selectedItemsIds", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedItemsIds: "selectedItemsIdsChange" }, ngImport: i0, template: "<div class=\"flex flex-col gap-5\">\n @if (itemsInWarehouseStock().length > 0) {\n <sc-order-items-list\n [items]=\"itemsInWarehouseStock()\"\n [selectable]=\"selectable()\"\n [editable]=\"editable()\"\n (selectedItemsIdsChange)=\"selectedItemsHandler($event, itemsInWarehouseStock())\"\n />\n }\n\n @if (itemsOnOrder().length > 0) {\n <div class=\"flex flex-col gap-2.5\">\n @if (sectionHeader()) {\n <div class=\"text-base font-bold text-sc-dark-grey\">{{ sectionHeader() }}</div>\n }\n <sc-order-items-list\n [items]=\"itemsOnOrder()\"\n [selectable]=\"selectable()\"\n [editable]=\"editable()\"\n (selectedItemsIdsChange)=\"selectedItemsHandler($event, itemsOnOrder())\"\n />\n </div>\n }\n\n @if (itemsNotInWarehouseStock().length > 0) {\n <div class=\"flex flex-col gap-2.5\">\n @if (sectionHeader()) {\n <div class=\"text-base font-bold text-sc-dark-grey\">{{ sectionHeader() }}</div>\n }\n <sc-order-items-list\n [items]=\"itemsNotInWarehouseStock()\"\n [selectable]=\"selectable()\"\n [editable]=\"editable()\"\n (selectedItemsIdsChange)=\"selectedItemsHandler($event, itemsNotInWarehouseStock())\"\n />\n </div>\n }\n</div>\n", dependencies: [{ kind: "component", type: ScOrderItemsListComponent, selector: "sc-order-items-list", inputs: ["selectable", "editable", "items"], outputs: ["selectedItemsIdsChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
9648
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScOrderItemsListByStockComponent, isStandalone: true, selector: "sc-order-items-list-by-stock", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, warehouseId: { classPropertyName: "warehouseId", publicName: "warehouseId", isSignal: true, isRequired: true, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, sectionHeader: { classPropertyName: "sectionHeader", publicName: "sectionHeader", isSignal: true, isRequired: false, transformFunction: null }, selectedItemsIds: { classPropertyName: "selectedItemsIds", publicName: "selectedItemsIds", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedItemsIds: "selectedItemsIdsChange" }, ngImport: i0, template: "<div class=\"flex flex-col gap-5\">\n @if (itemsInWarehouseStock().length > 0) {\n <sc-order-items-list\n [items]=\"itemsInWarehouseStock()\"\n [selectable]=\"selectable()\"\n [editable]=\"editable()\"\n (selectedItemsIdsChange)=\"selectedItemsHandler($event, itemsInWarehouseStock())\"\n />\n }\n\n @if (itemsOnOrder().length > 0) {\n <div class=\"flex flex-col gap-2.5\">\n @if (sectionHeader()) {\n <div class=\"text-base font-bold text-sc-dark-grey\">{{ sectionHeader() }}</div>\n }\n <sc-order-items-list\n [items]=\"itemsOnOrder()\"\n [selectable]=\"selectable()\"\n [editable]=\"editable()\"\n (selectedItemsIdsChange)=\"selectedItemsHandler($event, itemsOnOrder())\"\n />\n </div>\n }\n\n @if (itemsNotInWarehouseStock().length > 0) {\n <div class=\"flex flex-col gap-2.5\">\n @if (sectionHeader()) {\n <div class=\"text-base font-bold text-sc-dark-grey\">{{ sectionHeader() }}</div>\n }\n <sc-order-items-list\n [items]=\"itemsNotInWarehouseStock()\"\n [selectable]=\"selectable()\"\n [editable]=\"editable()\"\n (selectedItemsIdsChange)=\"selectedItemsHandler($event, itemsNotInWarehouseStock())\"\n />\n </div>\n }\n</div>\n", dependencies: [{ kind: "component", type: ScOrderItemsListComponent, selector: "sc-order-items-list", inputs: ["selectable", "editable", "grouped", "markUnavailable", "useLinePrice", "measuredInDialog", "deleteConfirmationTarget", "totalLabel", "items"], outputs: ["selectedItemsIdsChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
8848
9649
  }
8849
9650
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScOrderItemsListByStockComponent, decorators: [{
8850
9651
  type: Component,
@@ -8852,22 +9653,820 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
8852
9653
  }], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }], warehouseId: [{ type: i0.Input, args: [{ isSignal: true, alias: "warehouseId", required: true }] }], selectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectable", required: false }] }], editable: [{ type: i0.Input, args: [{ isSignal: true, alias: "editable", required: false }] }], sectionHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "sectionHeader", required: false }] }], selectedItemsIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedItemsIds", required: false }] }, { type: i0.Output, args: ["selectedItemsIdsChange"] }] } });
8853
9654
 
8854
9655
  /**
8855
- * Компонент страницы черновика заказа (аналог корзины для одного черновика).
9656
+ * Класс-помощник для работы со списком черновиков.
8856
9657
  */
8857
- class ScDraftComponent {
8858
- constructor() {
8859
- /**
8860
- * Сервис маршрутизации.
8861
- */
8862
- this.router = inject(Router);
8863
- /**
8864
- * Сервис предоставляющий доступ к данным о маршруте.
9658
+ class ScDraftListHelper {
9659
+ /**
9660
+ * Возвращает признак, что состав страницы не изменился: то же общее количество черновиков и те же черновики в том же порядке.
9661
+ *
9662
+ * @param items Текущие элементы списка.
9663
+ * @param total Текущее общее количество черновиков.
9664
+ * @param drafts Черновики полученной страницы.
9665
+ * @param receivedTotal Общее количество черновиков в полученных данных.
9666
+ */
9667
+ static isSamePage(items, total, drafts, receivedTotal) {
9668
+ return total === receivedTotal && items.length === drafts.length && drafts.every((draft, index) => draft.id === items.at(index)?.order.id);
9669
+ }
9670
+ /**
9671
+ * Возвращает подпись состава страницы: общее количество черновиков и номера черновиков страницы по порядку.
9672
+ *
9673
+ * @param page Страница списка.
9674
+ */
9675
+ static getSignature(page) {
9676
+ return `${page.meta.total}:${page.data.map(({ id }) => id).join(',')}`;
9677
+ }
9678
+ /**
9679
+ * Возвращает элементы новой страницы списка. Черновики, которые уже есть в списке, сохраняют раскрытие и полные данные.
9680
+ *
9681
+ * @param items Текущие элементы списка.
9682
+ * @param drafts Черновики новой страницы.
9683
+ */
9684
+ static fromPage(items, drafts) {
9685
+ return drafts.map((short) => {
9686
+ const item = items.find(({ order }) => order.id === short.id);
9687
+ return item ? ScDraftListHelper.update(item, short) : { order: short, isExpanded: false };
9688
+ });
9689
+ }
9690
+ /**
9691
+ * Возвращает список с обновлёнными краткими данными полученных черновиков, состав и порядок списка не меняются.
9692
+ * Полные данные раскрытых черновиков не меняются: их обновляет кэш черновика.
9693
+ *
9694
+ * @param items Текущие элементы списка.
9695
+ * @param drafts Полученные краткие данные черновиков.
9696
+ */
9697
+ static merge(items, drafts) {
9698
+ return items.map((item) => {
9699
+ const short = drafts.find(({ id }) => id === item.order.id);
9700
+ return short ? ScDraftListHelper.update(item, short) : item;
9701
+ });
9702
+ }
9703
+ /**
9704
+ * Возвращает номера черновиков с полными данными, у которых краткие данные отличаются: название или данные актуализации.
9705
+ *
9706
+ * @param items Текущие элементы списка.
9707
+ * @param drafts Полученные краткие данные черновиков.
9708
+ */
9709
+ static getChangedFullDraftIds(items, drafts) {
9710
+ return items
9711
+ .filter(({ order }) => order instanceof ScOrderDraft)
9712
+ .filter(({ order }) => {
9713
+ const short = drafts.find(({ id }) => id === order.id);
9714
+ if (!short) {
9715
+ return false;
9716
+ }
9717
+ const isSameActualization = short.actualization ? short.actualization.isSameAs(order.actualization) : order.actualization === undefined;
9718
+ return short.name !== order.name || !isSameActualization;
9719
+ })
9720
+ .map(({ order }) => order.id);
9721
+ }
9722
+ /**
9723
+ * Обновляет элемент списка краткими данными черновика. Полные данные черновика не заменяются.
9724
+ *
9725
+ * @param item Элемент списка.
9726
+ * @param short Краткие данные черновика.
9727
+ */
9728
+ static update(item, short) {
9729
+ if (!(item.order instanceof ScOrderDraft)) {
9730
+ // eslint-disable-next-line no-param-reassign
9731
+ item.order = short;
9732
+ }
9733
+ return item;
9734
+ }
9735
+ }
9736
+
9737
+ /**
9738
+ * Сервис текущего момента для меток и проверок срока актуализации черновиков Профстрой. Момент обновляется с интервалом проверки срока
9739
+ * актуализации одним таймером на всех подписчиков, поэтому список черновиков, страница черновика и оформление заказа видят один момент.
9740
+ * Таймер работает, только пока есть подписчики.
9741
+ */
9742
+ class ScDraftExpirationClockService {
9743
+ constructor() {
9744
+ /**
9745
+ * Интервалы обновления данных.
9746
+ */
9747
+ this.updateInterval = inject(SC_UPDATE_INTERVAL);
9748
+ /**
9749
+ * {@link Observable} текущего момента. Первый подписчик запускает таймер, после отписки всех подписчиков таймер останавливается.
9750
+ * Следующие подписчики сразу получают последний момент, а не новый: он может отставать от текущего времени не больше чем
9751
+ * на интервал проверки срока, и метки срока у нового подписчика обновятся на ближайшем тике общего таймера.
9752
+ */
9753
+ this.now$ = timer(0, this.updateInterval.orderDraftExpiration).pipe(map(() => new Date()), shareReplay({ bufferSize: 1, refCount: true }));
9754
+ }
9755
+ /**
9756
+ * Возвращает сигнал текущего момента, который обновляется общим таймером, только пока признак истинен. Вызывается в контексте
9757
+ * внедрения зависимостей, например при объявлении поля компонента: подписка живёт, пока жив компонент.
9758
+ *
9759
+ * @param active Признак, пока он истинен, момент обновляется.
9760
+ */
9761
+ nowWhile(active) {
9762
+ return toSignal(toObservable(active).pipe(switchMap((isActive) => (isActive ? this.now$ : EMPTY))), { initialValue: new Date() });
9763
+ }
9764
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScDraftExpirationClockService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
9765
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScDraftExpirationClockService, providedIn: 'root' }); }
9766
+ }
9767
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScDraftExpirationClockService, decorators: [{
9768
+ type: Injectable,
9769
+ args: [{
9770
+ providedIn: 'root',
9771
+ }]
9772
+ }] });
9773
+
9774
+ /**
9775
+ * Сервис загрузки и фонового обновления страницы списка черновиков. Предоставляется компонентом списка.
9776
+ *
9777
+ * Страница загружается по параметрам из {@link connect} с индикатором загрузки, после показа загруженной страницы сервис сообщает о её загрузке.
9778
+ *
9779
+ * Если состав страницы не изменился, черновики обновляются на месте с сохранением раскрытых строк. Если черновики появились, пропали
9780
+ * или поменялся порядок, полученная страница откладывается и показывается уведомление с предложением перезагрузить список.
9781
+ * После отказа уведомление о том же составе не повторяется. Черновики Профстрой в обработке дополнительно опрашиваются лёгким запросом,
9782
+ * текущий момент для меток срока берётся из общего источника {@link ScDraftExpirationClockService}.
9783
+ */
9784
+ class ScDraftListUpdatesService {
9785
+ /**
9786
+ * Инициализирует экземпляр класса {@link ScDraftListUpdatesService}.
9787
+ */
9788
+ constructor() {
9789
+ /**
9790
+ * Сервис для работы с черновиками заказов.
9791
+ */
9792
+ this.draftsService = inject(ScOrderDraftsService);
9793
+ /**
9794
+ * Сервис уведомлений.
9795
+ */
9796
+ this.alerts = inject(TuiNotificationService);
9797
+ /**
9798
+ * Сервис текущего момента для меток срока актуализации.
9799
+ */
9800
+ this.expirationClock = inject(ScDraftExpirationClockService);
9801
+ /**
9802
+ * Ссылка для автоматического управления уничтожением зависимостей.
9803
+ */
9804
+ this.destroyRef = inject(DestroyRef);
9805
+ /**
9806
+ * Элементы текущей страницы списка.
9807
+ */
9808
+ this.pageItems = signal(null, ...(ngDevMode ? [{ debugName: "pageItems" }] : /* istanbul ignore next */ []));
9809
+ /**
9810
+ * Данные пагинации текущей страницы.
9811
+ */
9812
+ this.pageMeta = signal(null, ...(ngDevMode ? [{ debugName: "pageMeta" }] : /* istanbul ignore next */ []));
9813
+ /**
9814
+ * Признак загрузки страницы списка по действию пользователя.
9815
+ */
9816
+ this.pageLoading = signal(false, ...(ngDevMode ? [{ debugName: "pageLoading" }] : /* istanbul ignore next */ []));
9817
+ /**
9818
+ * {@link Subject} события загрузки страницы списка по действию пользователя.
9819
+ */
9820
+ this.pageLoadedSubject = new Subject();
9821
+ /**
9822
+ * Страница с изменённым составом, которая ждёт решения пользователя.
9823
+ */
9824
+ this.pendingPage = null;
9825
+ /**
9826
+ * Подпись состава страницы, от перезагрузки которой пользователь отказался.
9827
+ */
9828
+ this.declinedSignature = null;
9829
+ /**
9830
+ * Номера черновиков в обработке, которых не оказалось в ответе опроса: черновики удалены, и опрашивать их не нужно.
9831
+ */
9832
+ this.missingIds = signal(new Set(), ...(ngDevMode ? [{ debugName: "missingIds" }] : /* istanbul ignore next */ []));
9833
+ /**
9834
+ * Номера раскрытых черновиков, перезапрос которых уже выполняется.
9835
+ */
9836
+ this.refreshingIds = new Set();
9837
+ /**
9838
+ * Подписка на показанное уведомление об изменении списка.
9839
+ */
9840
+ this.alertSubscription = null;
9841
+ /**
9842
+ * Номера черновиков Профстрой в обработке на текущей странице.
9843
+ */
9844
+ this.processingIds = computed(() => (this.pageItems() ?? [])
9845
+ .filter(({ order }) => order.isProfstroy && order.actualization?.isProcessing === true && !this.missingIds().has(order.id))
9846
+ .map(({ order }) => order.id), { ...(ngDevMode ? { debugName: "processingIds" } : /* istanbul ignore next */ {}), equal: (previous, current) => previous.join(',') === current.join(',') });
9847
+ /**
9848
+ * Элементы текущей страницы списка.
9849
+ */
9850
+ this.items = this.pageItems.asReadonly();
9851
+ /**
9852
+ * Данные пагинации текущей страницы.
9853
+ */
9854
+ this.meta = this.pageMeta.asReadonly();
9855
+ /**
9856
+ * Текущий момент для определения состояния черновиков Профстрой из общего источника.
9857
+ */
9858
+ this.now = toSignal(this.expirationClock.now$, { initialValue: new Date() });
9859
+ /**
9860
+ * Признак загрузки страницы списка по действию пользователя (фильтры, сортировка, пагинация). Фоновые проверки его не включают.
9861
+ */
9862
+ this.loading = this.pageLoading.asReadonly();
9863
+ /**
9864
+ * {@link Observable} события загрузки страницы списка по действию пользователя: страница уже показана.
9865
+ */
9866
+ this.pageLoaded$ = this.pageLoadedSubject.asObservable();
9867
+ toObservable(this.processingIds)
9868
+ .pipe(switchMap((ids) => (ids.length > 0 ? this.draftsService.watchShortList$(ids).pipe(map((drafts) => ({ ids, drafts }))) : EMPTY)), takeUntilDestroyed(this.destroyRef))
9869
+ .subscribe(({ ids, drafts }) => {
9870
+ this.markMissing(ids, drafts);
9871
+ this.applyDrafts(drafts);
9872
+ });
9873
+ this.destroyRef.onDestroy(() => {
9874
+ this.dismissAlert();
9875
+ });
9876
+ }
9877
+ /**
9878
+ * Подключает к сервису параметры запроса текущей страницы: при каждом изменении параметров загружает страницу с индикатором загрузки
9879
+ * и сообщает о её загрузке, а по текущим параметрам в фоне проверяет изменения списка. Если страница не загрузилась, остаётся текущая,
9880
+ * а смена параметров загружает список заново.
9881
+ *
9882
+ * @param params$ {@link Observable} параметров запроса текущей страницы.
9883
+ */
9884
+ connect(params$) {
9885
+ params$
9886
+ .pipe(switchMap((params) => this.draftsService.getList$(params).pipe(tap({
9887
+ subscribe: () => {
9888
+ this.pageLoading.set(true);
9889
+ },
9890
+ finalize: () => {
9891
+ this.pageLoading.set(false);
9892
+ },
9893
+ }), catchError(() => EMPTY))), takeUntilDestroyed(this.destroyRef))
9894
+ .subscribe((page) => {
9895
+ this.setPage(page);
9896
+ this.pageLoadedSubject.next();
9897
+ });
9898
+ params$
9899
+ .pipe(distinctUntilChanged((previous, current) => previous.toString() === current.toString()), switchMap((params) => this.draftsService.watchList$(params)), takeUntilDestroyed(this.destroyRef))
9900
+ .subscribe((page) => {
9901
+ this.checkPage(page);
9902
+ });
9903
+ }
9904
+ /**
9905
+ * Подставляет в строку текущей страницы полные данные черновика. Опрос черновиков в обработке сразу учитывает их состояние.
9906
+ *
9907
+ * @param draft Полные данные черновика.
9908
+ */
9909
+ setFullDraft(draft) {
9910
+ const items = this.pageItems();
9911
+ const item = items?.find(({ order }) => order.id === draft.id);
9912
+ if (!items || !item) {
9913
+ return;
9914
+ }
9915
+ item.order = draft;
9916
+ this.pageItems.set([...items]);
9917
+ }
9918
+ /**
9919
+ * Показывает страницу, загруженную по действию пользователя: строки свёрнуты, отложенные данные и уведомление сбрасываются.
9920
+ *
9921
+ * @param page Страница списка.
9922
+ */
9923
+ setPage(page) {
9924
+ this.pendingPage = null;
9925
+ this.declinedSignature = null;
9926
+ this.missingIds.set(new Set());
9927
+ this.dismissAlert();
9928
+ this.pageItems.set(page.data.map((order) => ({ order, isExpanded: false })));
9929
+ this.pageMeta.set(page.meta);
9930
+ }
9931
+ /**
9932
+ * Сравнивает полученную в фоне страницу с текущей: при том же составе обновляет черновики на месте, иначе откладывает страницу и предлагает перезагрузить список.
9933
+ *
9934
+ * @param page Страница, полученная в фоне.
9935
+ */
9936
+ checkPage(page) {
9937
+ const items = this.pageItems();
9938
+ const meta = this.pageMeta();
9939
+ if (!items || !meta) {
9940
+ return;
9941
+ }
9942
+ if (ScDraftListHelper.isSamePage(items, meta.total, page.data, page.meta.total)) {
9943
+ this.pendingPage = null;
9944
+ this.declinedSignature = null;
9945
+ this.dismissAlert();
9946
+ this.applyDrafts(page.data);
9947
+ return;
9948
+ }
9949
+ this.pendingPage = page;
9950
+ if (ScDraftListHelper.getSignature(page) !== this.declinedSignature) {
9951
+ this.showAlert();
9952
+ }
9953
+ }
9954
+ /**
9955
+ * Обновляет на месте краткие данные черновиков и перезапрашивает полные данные раскрытых черновиков, состояние которых изменилось.
9956
+ * Перезапрос раскрытого черновика не повторяется, пока выполняется предыдущий. Ошибка перезапроса не показывается:
9957
+ * это фоновое обновление, его повторит следующий опрос.
9958
+ *
9959
+ * @param drafts Краткие данные черновиков.
9960
+ */
9961
+ applyDrafts(drafts) {
9962
+ const items = this.pageItems();
9963
+ if (!items) {
9964
+ return;
9965
+ }
9966
+ ScDraftListHelper.getChangedFullDraftIds(items, drafts)
9967
+ .filter((draftId) => !this.refreshingIds.has(draftId))
9968
+ .forEach((draftId) => {
9969
+ this.refreshingIds.add(draftId);
9970
+ this.draftsService
9971
+ .fetch$(draftId)
9972
+ .pipe(catchError(() => EMPTY), finalize(() => {
9973
+ this.refreshingIds.delete(draftId);
9974
+ }), takeUntilDestroyed(this.destroyRef))
9975
+ .subscribe();
9976
+ });
9977
+ this.pageItems.set(ScDraftListHelper.merge(items, drafts));
9978
+ }
9979
+ /**
9980
+ * Запоминает черновики, которых не оказалось в ответе опроса, чтобы больше их не опрашивать.
9981
+ *
9982
+ * @param ids Номера опрошенных черновиков.
9983
+ * @param drafts Полученные краткие данные черновиков.
9984
+ */
9985
+ markMissing(ids, drafts) {
9986
+ const missing = ids.filter((id) => !drafts.some((draft) => draft.id === id));
9987
+ if (missing.length > 0) {
9988
+ this.missingIds.update((current) => new Set([...current, ...missing]));
9989
+ }
9990
+ }
9991
+ /**
9992
+ * Показывает уведомление об изменении списка, если оно ещё не показано. Ответ «Нет» и закрытие уведомления считаются отказом
9993
+ * от перезагрузки отложенного состава.
9994
+ */
9995
+ showAlert() {
9996
+ if (this.alertSubscription) {
9997
+ return;
9998
+ }
9999
+ this.alertSubscription = this.alerts
10000
+ .open(new PolymorpheusComponent(ScConfirmAlertComponent), {
10001
+ label: 'Список черновиков изменился',
10002
+ data: { content: 'Перезагрузить список?' },
10003
+ appearance: 'info',
10004
+ autoClose: 0,
10005
+ })
10006
+ .pipe(defaultIfEmpty(false), finalize(() => {
10007
+ this.alertSubscription = null;
10008
+ }))
10009
+ .subscribe((isConfirmed) => {
10010
+ if (isConfirmed) {
10011
+ this.applyPendingPage();
10012
+ }
10013
+ else {
10014
+ this.declinePendingPage();
10015
+ }
10016
+ });
10017
+ }
10018
+ /**
10019
+ * Закрывает показанное уведомление об изменении списка.
10020
+ */
10021
+ dismissAlert() {
10022
+ this.alertSubscription?.unsubscribe();
10023
+ this.alertSubscription = null;
10024
+ }
10025
+ /**
10026
+ * Показывает отложенную страницу с сохранением раскрытых строк. Уведомление закрывается всякий раз, когда отложенная страница
10027
+ * сбрасывается, поэтому при согласии пользователя она всегда есть.
10028
+ */
10029
+ applyPendingPage() {
10030
+ const page = this.pendingPage;
10031
+ if (!page) {
10032
+ return;
10033
+ }
10034
+ this.pendingPage = null;
10035
+ this.missingIds.set(new Set());
10036
+ this.pageItems.set(ScDraftListHelper.fromPage(this.pageItems() ?? [], page.data));
10037
+ this.pageMeta.set(page.meta);
10038
+ }
10039
+ /**
10040
+ * Запоминает отказ от перезагрузки отложенного состава: уведомление о нём больше не показывается, пока состав снова не изменится.
10041
+ */
10042
+ declinePendingPage() {
10043
+ this.declinedSignature = this.pendingPage ? ScDraftListHelper.getSignature(this.pendingPage) : null;
10044
+ }
10045
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScDraftListUpdatesService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
10046
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScDraftListUpdatesService }); }
10047
+ }
10048
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScDraftListUpdatesService, decorators: [{
10049
+ type: Injectable
10050
+ }], ctorParameters: () => [] });
10051
+
10052
+ /**
10053
+ * Перечисление состояний черновика Профстрой для отображения пользователю.
10054
+ */
10055
+ // eslint-disable-next-line no-shadow
10056
+ var ScProfstroyDraftState;
10057
+ (function (ScProfstroyDraftState) {
10058
+ /**
10059
+ * Выполняется обработка.
10060
+ */
10061
+ ScProfstroyDraftState["processing"] = "processing";
10062
+ /**
10063
+ * Актуализирован, срок действия не истёк.
10064
+ */
10065
+ ScProfstroyDraftState["actual"] = "actual";
10066
+ /**
10067
+ * Актуализирован, но срок действия истёк.
10068
+ */
10069
+ ScProfstroyDraftState["outdated"] = "outdated";
10070
+ /**
10071
+ * Обработка завершилась с ошибкой.
10072
+ */
10073
+ ScProfstroyDraftState["error"] = "error";
10074
+ /**
10075
+ * Требуется актуализация после изменения состава.
10076
+ */
10077
+ ScProfstroyDraftState["needsActualization"] = "needsActualization";
10078
+ /**
10079
+ * Состояние не известно.
10080
+ */
10081
+ ScProfstroyDraftState["unknown"] = "unknown";
10082
+ })(ScProfstroyDraftState || (ScProfstroyDraftState = {}));
10083
+
10084
+ /**
10085
+ * Класс-помощник для отображения черновиков Профстрой.
10086
+ */
10087
+ class ScProfstroyDraftHelper {
10088
+ /**
10089
+ * Данные об отображении состояний черновика.
10090
+ */
10091
+ static { this.stateViews = {
10092
+ [ScProfstroyDraftState.processing]: {
10093
+ label: 'Выполняется обработка',
10094
+ appearance: 'info',
10095
+ description: 'Файл обрабатывается, позиции и цены уточняются. Изменение состава и оформление заказа станут доступны после завершения.',
10096
+ },
10097
+ [ScProfstroyDraftState.actual]: {
10098
+ label: 'Актуализирован',
10099
+ appearance: 'positive',
10100
+ description: 'Цены и позиции актуальны, заказ можно оформлять.',
10101
+ },
10102
+ [ScProfstroyDraftState.outdated]: {
10103
+ label: 'Данные устарели',
10104
+ appearance: 'warning',
10105
+ description: 'С момента последней актуализации прошло много времени. Запустите её повторно, чтобы оформить заказ по актуальным ценам.',
10106
+ },
10107
+ [ScProfstroyDraftState.error]: {
10108
+ label: 'Ошибка обработки',
10109
+ appearance: 'negative',
10110
+ description: 'Обработка завершилась с ошибкой. Запустите актуализацию повторно или соберите заявку из файла заново.',
10111
+ },
10112
+ [ScProfstroyDraftState.needsActualization]: {
10113
+ label: 'Требуется актуализация',
10114
+ appearance: 'warning',
10115
+ description: 'Состав заявки изменён после последней актуализации. Запустите актуализацию, чтобы обновить цены и оформить заказ. Цены и примечания к позициям обновятся после актуализации.',
10116
+ },
10117
+ [ScProfstroyDraftState.unknown]: {
10118
+ label: 'Состояние неизвестно',
10119
+ appearance: 'neutral',
10120
+ description: '',
10121
+ },
10122
+ }; }
10123
+ /**
10124
+ * Возвращает состояние черновика на указанный момент.
10125
+ *
10126
+ * @param actualization Данные об актуализации.
10127
+ * @param now Момент проверки.
10128
+ */
10129
+ static getState(actualization, now) {
10130
+ switch (actualization?.status) {
10131
+ case ScOrderDraftActualizationStatus.processing:
10132
+ return ScProfstroyDraftState.processing;
10133
+ case ScOrderDraftActualizationStatus.completed:
10134
+ return actualization.isOutdatedAt(now) ? ScProfstroyDraftState.outdated : ScProfstroyDraftState.actual;
10135
+ case ScOrderDraftActualizationStatus.error:
10136
+ return ScProfstroyDraftState.error;
10137
+ case ScOrderDraftActualizationStatus.needsActualization:
10138
+ return ScProfstroyDraftState.needsActualization;
10139
+ default:
10140
+ return ScProfstroyDraftState.unknown;
10141
+ }
10142
+ }
10143
+ /**
10144
+ * Возвращает данные об отображении состояния черновика на указанный момент.
10145
+ *
10146
+ * @param actualization Данные об актуализации.
10147
+ * @param now Момент проверки.
10148
+ */
10149
+ static getStateView(actualization, now) {
10150
+ return ScProfstroyDraftHelper.stateViews[ScProfstroyDraftHelper.getState(actualization, now)];
10151
+ }
10152
+ /**
10153
+ * Возвращает данные об отображении панели состояния черновика: для актуальной заявки пояснение зависит от того, сколько позиций попадёт в заказ.
10154
+ *
10155
+ * @param draft Черновик Профстрой.
10156
+ * @param now Момент проверки.
10157
+ */
10158
+ static getPanelView(draft, now) {
10159
+ const view = ScProfstroyDraftHelper.getStateView(draft.actualization, now);
10160
+ if (ScProfstroyDraftHelper.getState(draft.actualization, now) !== ScProfstroyDraftState.actual) {
10161
+ return view;
10162
+ }
10163
+ const total = draft.products.length;
10164
+ const orderable = draft.products.filter((item) => item.isOrderable).length;
10165
+ if (orderable === 0) {
10166
+ return {
10167
+ ...view,
10168
+ appearance: 'warning',
10169
+ description: 'Актуализация завершена, но ни одна позиция не попадёт в заказ. Исправьте или удалите позиции с примечанием и запустите актуализацию повторно или соберите заявку заново из файла.',
10170
+ };
10171
+ }
10172
+ return orderable < total ? { ...view, description: `Цены актуальны. В заказ попадут ${orderable} из ${total} позиций, остальные отмечены в поле «Примечание».` } : view;
10173
+ }
10174
+ }
10175
+
10176
+ /**
10177
+ * Компонент панели состояния актуализации черновика Профстрой с действиями актуализации и пересборки.
10178
+ */
10179
+ class ScProfstroyActualizationPanelComponent {
10180
+ constructor() {
10181
+ /**
10182
+ * Список ссылок приложения.
10183
+ */
10184
+ this.urls = inject(SC_URLS);
10185
+ /**
10186
+ * Объект документа.
10187
+ */
10188
+ this.document = inject(DOCUMENT);
10189
+ /**
10190
+ * Черновик Профстрой.
10191
+ */
10192
+ this.draft = input.required(...(ngDevMode ? [{ debugName: "draft" }] : /* istanbul ignore next */ []));
10193
+ /**
10194
+ * Момент, на который определяется состояние. Передаётся снаружи и обновляется по таймеру проверки срока, иначе метка «Данные устарели» не сменится.
10195
+ */
10196
+ this.now = input.required(...(ngDevMode ? [{ debugName: "now" }] : /* istanbul ignore next */ []));
10197
+ /**
10198
+ * Признак, что действия над черновиком недоступны.
10199
+ */
10200
+ this.busy = input(false, ...(ngDevMode ? [{ debugName: "busy" }] : /* istanbul ignore next */ []));
10201
+ /**
10202
+ * Событие запуска актуализации.
10203
+ */
10204
+ this.actualize = output();
10205
+ /**
10206
+ * Событие запуска пересборки из файла.
10207
+ */
10208
+ this.reload = output();
10209
+ /**
10210
+ * Текущее состояние черновика.
10211
+ */
10212
+ this.state = computed(() => ScProfstroyDraftHelper.getState(this.draft().actualization, this.now()), ...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
10213
+ /**
10214
+ * Данные об отображении состояния.
10215
+ */
10216
+ this.stateView = computed(() => ScProfstroyDraftHelper.getPanelView(this.draft(), this.now()), ...(ngDevMode ? [{ debugName: "stateView" }] : /* istanbul ignore next */ []));
10217
+ /**
10218
+ * Признак, что выполняется обработка.
10219
+ */
10220
+ this.isProcessing = computed(() => this.state() === ScProfstroyDraftState.processing, ...(ngDevMode ? [{ debugName: "isProcessing" }] : /* istanbul ignore next */ []));
10221
+ /**
10222
+ * Признак, что срок действия актуализации ещё не истёк.
10223
+ */
10224
+ this.isActual = computed(() => this.state() === ScProfstroyDraftState.actual, ...(ngDevMode ? [{ debugName: "isActual" }] : /* istanbul ignore next */ []));
10225
+ /**
10226
+ * Абсолютная ссылка на исходный файл заявки. Файл лежит на хосте API, адрес API может быть указан относительно сайта.
10227
+ */
10228
+ this.fileUrl = computed(() => {
10229
+ const url = this.draft().file?.url;
10230
+ return url ? new URL(url, new URL(this.urls.apiUrl, this.document.baseURI)).href : null;
10231
+ }, ...(ngDevMode ? [{ debugName: "fileUrl" }] : /* istanbul ignore next */ []));
10232
+ }
10233
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScProfstroyActualizationPanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
10234
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScProfstroyActualizationPanelComponent, isStandalone: true, selector: "sc-profstroy-actualization-panel", inputs: { draft: { classPropertyName: "draft", publicName: "draft", isSignal: true, isRequired: true, transformFunction: null }, now: { classPropertyName: "now", publicName: "now", isSignal: true, isRequired: true, transformFunction: null }, busy: { classPropertyName: "busy", publicName: "busy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { actualize: "actualize", reload: "reload" }, ngImport: i0, template: "@let actualization = draft().actualization;\n@let view = stateView();\n\n<div\n tuiNotification\n size=\"m\"\n [appearance]=\"view.appearance\"\n>\n <div class=\"flex flex-col items-start gap-2 text-start\">\n <div class=\"flex items-center justify-start gap-2 text-start font-bold\">\n @if (isProcessing()) {\n <tui-loader size=\"s\" />\n }\n {{ view.label }}\n </div>\n\n <div class=\"flex flex-col items-start gap-1\">\n @if (actualization?.actualizedAt; as actualizedAt) {\n <span>\u0410\u043A\u0442\u0443\u0430\u043B\u0438\u0437\u0438\u0440\u043E\u0432\u0430\u043D {{ actualizedAt | scFormatDate }}</span>\n }\n @if (isActual() && actualization?.expiresAt; as expiresAt) {\n <span>\u0410\u043A\u0442\u0443\u0430\u043B\u0435\u043D \u0434\u043E {{ expiresAt | scFormatDate }}</span>\n }\n @if (view.description) {\n <span>{{ view.description }}</span>\n }\n @if (actualization?.error; as error) {\n <span class=\"font-bold\">{{ error }}</span>\n }\n @if (fileUrl(); as url) {\n <span>\n \u0424\u0430\u0439\u043B \u0437\u0430\u044F\u0432\u043A\u0438:\n <a\n tuiLink\n [href]=\"url\"\n target=\"_blank\"\n rel=\"noopener\"\n class=\"break-all\"\n >\n {{ draft().file?.originalName ?? '\u0441\u043A\u0430\u0447\u0430\u0442\u044C' }}\n </a>\n </span>\n }\n </div>\n\n <div class=\"flex flex-wrap gap-2\">\n <button\n tuiButton\n type=\"button\"\n size=\"s\"\n appearance=\"secondary\"\n iconStart=\"@tui.refresh-cw\"\n [disabled]=\"isProcessing() || busy()\"\n (click)=\"actualize.emit()\"\n >\n \u0410\u043A\u0442\u0443\u0430\u043B\u0438\u0437\u0438\u0440\u043E\u0432\u0430\u0442\u044C\n </button>\n <button\n tuiButton\n type=\"button\"\n size=\"s\"\n appearance=\"secondary\"\n iconStart=\"@tui.file-up\"\n [disabled]=\"isProcessing() || busy()\"\n (click)=\"reload.emit()\"\n >\n \u0421\u043E\u0431\u0440\u0430\u0442\u044C \u0437\u0430\u043D\u043E\u0432\u043E \u0438\u0437 \u0444\u0430\u0439\u043B\u0430\n </button>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i2.TuiNotificationDirective, selector: "[tuiNotification]:not(ng-template)", inputs: ["appearance", "size", "icon"] }, { kind: "component", type: TuiLoader, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "loading"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]" }, { kind: "pipe", type: ScFormatDatePipe, name: "scFormatDate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
10235
+ }
10236
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScProfstroyActualizationPanelComponent, decorators: [{
10237
+ type: Component,
10238
+ args: [{ selector: 'sc-profstroy-actualization-panel', imports: [TuiNotification, TuiLoader, TuiButton, TuiLink, ScFormatDatePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let actualization = draft().actualization;\n@let view = stateView();\n\n<div\n tuiNotification\n size=\"m\"\n [appearance]=\"view.appearance\"\n>\n <div class=\"flex flex-col items-start gap-2 text-start\">\n <div class=\"flex items-center justify-start gap-2 text-start font-bold\">\n @if (isProcessing()) {\n <tui-loader size=\"s\" />\n }\n {{ view.label }}\n </div>\n\n <div class=\"flex flex-col items-start gap-1\">\n @if (actualization?.actualizedAt; as actualizedAt) {\n <span>\u0410\u043A\u0442\u0443\u0430\u043B\u0438\u0437\u0438\u0440\u043E\u0432\u0430\u043D {{ actualizedAt | scFormatDate }}</span>\n }\n @if (isActual() && actualization?.expiresAt; as expiresAt) {\n <span>\u0410\u043A\u0442\u0443\u0430\u043B\u0435\u043D \u0434\u043E {{ expiresAt | scFormatDate }}</span>\n }\n @if (view.description) {\n <span>{{ view.description }}</span>\n }\n @if (actualization?.error; as error) {\n <span class=\"font-bold\">{{ error }}</span>\n }\n @if (fileUrl(); as url) {\n <span>\n \u0424\u0430\u0439\u043B \u0437\u0430\u044F\u0432\u043A\u0438:\n <a\n tuiLink\n [href]=\"url\"\n target=\"_blank\"\n rel=\"noopener\"\n class=\"break-all\"\n >\n {{ draft().file?.originalName ?? '\u0441\u043A\u0430\u0447\u0430\u0442\u044C' }}\n </a>\n </span>\n }\n </div>\n\n <div class=\"flex flex-wrap gap-2\">\n <button\n tuiButton\n type=\"button\"\n size=\"s\"\n appearance=\"secondary\"\n iconStart=\"@tui.refresh-cw\"\n [disabled]=\"isProcessing() || busy()\"\n (click)=\"actualize.emit()\"\n >\n \u0410\u043A\u0442\u0443\u0430\u043B\u0438\u0437\u0438\u0440\u043E\u0432\u0430\u0442\u044C\n </button>\n <button\n tuiButton\n type=\"button\"\n size=\"s\"\n appearance=\"secondary\"\n iconStart=\"@tui.file-up\"\n [disabled]=\"isProcessing() || busy()\"\n (click)=\"reload.emit()\"\n >\n \u0421\u043E\u0431\u0440\u0430\u0442\u044C \u0437\u0430\u043D\u043E\u0432\u043E \u0438\u0437 \u0444\u0430\u0439\u043B\u0430\n </button>\n </div>\n </div>\n</div>\n" }]
10239
+ }], propDecorators: { draft: [{ type: i0.Input, args: [{ isSignal: true, alias: "draft", required: true }] }], now: [{ type: i0.Input, args: [{ isSignal: true, alias: "now", required: true }] }], busy: [{ type: i0.Input, args: [{ isSignal: true, alias: "busy", required: false }] }], actualize: [{ type: i0.Output, args: ["actualize"] }], reload: [{ type: i0.Output, args: ["reload"] }] } });
10240
+
10241
+ /**
10242
+ * Компонент метки «Профстрой» у черновика или заказа, созданного из файла программы «Профстрой».
10243
+ */
10244
+ class ScProfstroyBadgeComponent {
10245
+ constructor() {
10246
+ /**
10247
+ * Размер метки.
10248
+ */
10249
+ this.size = input('m', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
10250
+ }
10251
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScProfstroyBadgeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
10252
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.16", type: ScProfstroyBadgeComponent, isStandalone: true, selector: "sc-profstroy-badge", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<span\n tuiBadge\n class=\"!font-medium\"\n appearance=\"primary\"\n [size]=\"size()\"\n>\n \u041F\u0440\u043E\u0444\u0441\u0442\u0440\u043E\u0439\n</span>\n", dependencies: [{ kind: "directive", type: TuiBadge, selector: "[tuiBadge],tui-icon[tuiBadge]", inputs: ["size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
10253
+ }
10254
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScProfstroyBadgeComponent, decorators: [{
10255
+ type: Component,
10256
+ args: [{ selector: 'sc-profstroy-badge', imports: [TuiBadge], changeDetection: ChangeDetectionStrategy.OnPush, template: "<span\n tuiBadge\n class=\"!font-medium\"\n appearance=\"primary\"\n [size]=\"size()\"\n>\n \u041F\u0440\u043E\u0444\u0441\u0442\u0440\u043E\u0439\n</span>\n" }]
10257
+ }], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
10258
+
10259
+ /**
10260
+ * Компонент меток черновика Профстрой: признак и текущее состояние обработки.
10261
+ */
10262
+ class ScProfstroyDraftBadgesComponent {
10263
+ constructor() {
10264
+ /**
10265
+ * Данные об актуализации черновика.
10266
+ */
10267
+ this.actualization = input(...(ngDevMode ? [undefined, { debugName: "actualization" }] : /* istanbul ignore next */ []));
10268
+ /**
10269
+ * Момент, на который определяется состояние. Передаётся снаружи и обновляется по таймеру проверки срока, иначе метка «Данные устарели» не сменится.
10270
+ */
10271
+ this.now = input.required(...(ngDevMode ? [{ debugName: "now" }] : /* istanbul ignore next */ []));
10272
+ /**
10273
+ * Данные об отображении состояния.
10274
+ */
10275
+ this.stateView = computed(() => ScProfstroyDraftHelper.getStateView(this.actualization(), this.now()), ...(ngDevMode ? [{ debugName: "stateView" }] : /* istanbul ignore next */ []));
10276
+ }
10277
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScProfstroyDraftBadgesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
10278
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.16", type: ScProfstroyDraftBadgesComponent, isStandalone: true, selector: "sc-profstroy-draft-badges", inputs: { actualization: { classPropertyName: "actualization", publicName: "actualization", isSignal: true, isRequired: false, transformFunction: null }, now: { classPropertyName: "now", publicName: "now", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<span class=\"inline-flex flex-wrap items-center gap-1\">\n <sc-profstroy-badge />\n <span\n tuiBadge\n class=\"!font-medium\"\n size=\"m\"\n [appearance]=\"stateView().appearance\"\n >\n {{ stateView().label }}\n </span>\n</span>\n", dependencies: [{ kind: "directive", type: TuiBadge, selector: "[tuiBadge],tui-icon[tuiBadge]", inputs: ["size"] }, { kind: "component", type: ScProfstroyBadgeComponent, selector: "sc-profstroy-badge", inputs: ["size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
10279
+ }
10280
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScProfstroyDraftBadgesComponent, decorators: [{
10281
+ type: Component,
10282
+ args: [{ selector: 'sc-profstroy-draft-badges', imports: [TuiBadge, ScProfstroyBadgeComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<span class=\"inline-flex flex-wrap items-center gap-1\">\n <sc-profstroy-badge />\n <span\n tuiBadge\n class=\"!font-medium\"\n size=\"m\"\n [appearance]=\"stateView().appearance\"\n >\n {{ stateView().label }}\n </span>\n</span>\n" }]
10283
+ }], propDecorators: { actualization: [{ type: i0.Input, args: [{ isSignal: true, alias: "actualization", required: false }] }], now: [{ type: i0.Input, args: [{ isSignal: true, alias: "now", required: true }] }] } });
10284
+
10285
+ /**
10286
+ * Класс-помощник для сообщений об ошибках запросов к API.
10287
+ */
10288
+ class ScApiErrorHelper {
10289
+ /**
10290
+ * Возвращает текст ошибки из ответа API или указанный текст, если ответ его не содержит.
10291
+ *
10292
+ * @param error Ошибка запроса.
10293
+ * @param fallback Текст по умолчанию.
10294
+ */
10295
+ static getMessage(error, fallback) {
10296
+ const message = error instanceof HttpErrorResponse ? error.error?.message : undefined;
10297
+ return message?.trim() ? message : fallback;
10298
+ }
10299
+ /**
10300
+ * Возвращает признак ответа 404: запись не найдена, например удалена в другой вкладке.
10301
+ *
10302
+ * @param error Ошибка запроса.
10303
+ */
10304
+ static isNotFound(error) {
10305
+ if (!(error instanceof HttpErrorResponse)) {
10306
+ return false;
10307
+ }
10308
+ const { status } = error;
10309
+ return status === HttpStatusCode.NotFound;
10310
+ }
10311
+ }
10312
+
10313
+ /* eslint-disable @typescript-eslint/unbound-method */
10314
+ /**
10315
+ * Компонент диалога создания черновика заказа из файла программы «Профстрой».
10316
+ */
10317
+ class ScProfstroyDraftCreateDialogComponent {
10318
+ constructor() {
10319
+ /**
10320
+ * Контекст диалогового окна, в котором открыт компонент.
10321
+ */
10322
+ this.context = inject(POLYMORPHEUS_CONTEXT);
10323
+ /**
10324
+ * Сервис для работы с черновиками заказов.
10325
+ */
10326
+ this.draftsService = inject(ScOrderDraftsService);
10327
+ /**
10328
+ * Ссылка для автоматического управления уничтожением зависимостей.
10329
+ */
10330
+ this.destroyRef = inject(DestroyRef);
10331
+ /**
10332
+ * Настройки поля выбора файлов, в том числе наибольший размер файла из настроек приложения.
10333
+ */
10334
+ this.inputFilesOptions = inject(TUI_INPUT_FILES_OPTIONS);
10335
+ /**
10336
+ * Допустимое расширение файла.
10337
+ */
10338
+ this.accept = '.xlsx';
10339
+ /**
10340
+ * Наибольшая длина названия заявки.
10341
+ */
10342
+ this.nameMaxLength = 255;
10343
+ /**
10344
+ * Форма создания черновика. Формат и размер файла проверяются на самом поле: после выбора файла поле выбора убирается вместе со своими проверками.
10345
+ */
10346
+ this.form = new FormGroup({
10347
+ file: new FormControl(null, [Validators.required, tuiCreateFileFormatValidator(this.accept), tuiCreateFileSizeValidator(this.inputFilesOptions.maxFileSize)]),
10348
+ name: new FormControl('', { nonNullable: true, validators: Validators.maxLength(this.nameMaxLength) }),
10349
+ });
10350
+ /**
10351
+ * Выбранный файл.
10352
+ */
10353
+ this.selectedFile = toSignal(this.form.controls.file.valueChanges, { initialValue: null });
10354
+ /**
10355
+ * Признак выполнения запроса создания.
10356
+ */
10357
+ this.submitting = signal(false, ...(ngDevMode ? [{ debugName: "submitting" }] : /* istanbul ignore next */ []));
10358
+ /**
10359
+ * Признак попытки создать заявку. До неё незаполненное поле файла ошибкой не подсвечивается: поле теряет фокус уже при открытии окна выбора файла.
10360
+ */
10361
+ this.submitAttempted = signal(false, ...(ngDevMode ? [{ debugName: "submitAttempted" }] : /* istanbul ignore next */ []));
10362
+ }
10363
+ /**
10364
+ * Удаляет выбранный файл.
10365
+ */
10366
+ removeFile() {
10367
+ this.form.controls.file.setValue(null);
10368
+ }
10369
+ /**
10370
+ * Отправляет файл и создаёт черновик. Ошибки сервера с прошлой отправки не мешают отправить форму снова.
10371
+ */
10372
+ submit() {
10373
+ this.submitAttempted.set(true);
10374
+ Object.values(this.form.controls).forEach((control) => {
10375
+ control.updateValueAndValidity();
10376
+ });
10377
+ this.form.markAllAsTouched();
10378
+ const file = this.form.controls.file.value;
10379
+ if (this.form.invalid || !file || this.submitting()) {
10380
+ return;
10381
+ }
10382
+ this.submitting.set(true);
10383
+ ScFileHelper.readAsUploadedFile$(file)
10384
+ .pipe(switchMap((uploadedFile) => this.draftsService.createProfstroy$({ file: uploadedFile, name: this.form.controls.name.value.trim() || undefined })), finalize(() => {
10385
+ this.submitting.set(false);
10386
+ }), takeUntilDestroyed(this.destroyRef))
10387
+ .subscribe({
10388
+ next: (draft) => {
10389
+ this.context.completeWith(draft);
10390
+ },
10391
+ error: (error) => {
10392
+ this.applyError(error);
10393
+ },
10394
+ });
10395
+ }
10396
+ /**
10397
+ * Показывает ошибку создания в форме: ошибки проверки данных у полей, ошибку чтения файла у поля файла, остальные ошибкой формы (401 обрабатывает авторизация).
10398
+ * Диалог остаётся открытым.
10399
+ *
10400
+ * @param error Ошибка чтения файла или запроса.
10401
+ */
10402
+ applyError(error) {
10403
+ if (!(error instanceof HttpErrorResponse)) {
10404
+ this.form.controls.file.setErrors({ serverResponse: new TuiValidationError('Не удалось прочитать файл.') });
10405
+ return;
10406
+ }
10407
+ const { status } = error;
10408
+ if (status === HttpStatusCode.Unauthorized) {
10409
+ return;
10410
+ }
10411
+ const { errors } = (error.error ?? {});
10412
+ if (status !== HttpStatusCode.UnprocessableEntity || !errors) {
10413
+ this.form.setErrors({ serverResponse: new TuiValidationError(ScApiErrorHelper.getMessage(error, 'Не удалось создать заявку.')) });
10414
+ return;
10415
+ }
10416
+ Object.entries(errors).forEach(([key, messages]) => {
10417
+ const control = key === 'name' ? this.form.controls.name : this.form.controls.file;
10418
+ control.setErrors({ serverResponse: new TuiValidationError(messages.join(' ')) });
10419
+ control.markAsTouched();
10420
+ });
10421
+ }
10422
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScProfstroyDraftCreateDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
10423
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScProfstroyDraftCreateDialogComponent, isStandalone: true, selector: "sc-profstroy-draft-create-dialog", providers: [
10424
+ {
10425
+ provide: TUI_INPUT_FILE_TEXTS,
10426
+ useFactory: () => {
10427
+ const texts = inject(TUI_INPUT_FILE_TEXTS, { skipSelf: true });
10428
+ return computed(() => ({ ...texts(), formatRejectionReason: 'Файл должен быть в формате .xlsx' }));
10429
+ },
10430
+ },
10431
+ ], ngImport: i0, template: "<form\n [formGroup]=\"form\"\n class=\"flex flex-col gap-5\"\n (ngSubmit)=\"submit()\"\n>\n <!-- \u0424\u0430\u0439\u043B. \u041F\u0440\u0438\u0447\u0438\u043D\u0443 \u043E\u0442\u043A\u043B\u043E\u043D\u0435\u043D\u0438\u044F \u0444\u0430\u0439\u043B\u0430 \u043F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0435\u0442 \u0441\u0442\u0440\u043E\u043A\u0430 \u0444\u0430\u0439\u043B\u0430, \u043F\u043E\u0434 \u043F\u043E\u043B\u0435\u043C \u043E\u043D\u0430 \u043D\u0435 \u043F\u043E\u0432\u0442\u043E\u0440\u044F\u0435\u0442\u0441\u044F. \u041D\u0435\u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u043D\u043E\u0435 \u043F\u043E\u043B\u0435 \u043F\u043E\u0434\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E \u043F\u043E\u0441\u043B\u0435 \u043F\u043E\u043F\u044B\u0442\u043A\u0438 \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u0437\u0430\u044F\u0432\u043A\u0443. -->\n <div class=\"flex flex-col gap-1\">\n @let file = selectedFile();\n @let rejected = file | tuiFileRejected: { accept } | async;\n @if (!file) {\n <label tuiInputFiles>\n <input\n tuiInputFiles\n formControlName=\"file\"\n [accept]=\"accept\"\n [invalid]=\"submitAttempted() ? null : false\"\n />\n </label>\n }\n <tui-files>\n @if (file) {\n <tui-file\n [state]=\"rejected ? 'error' : 'normal'\"\n [file]=\"rejected ?? file\"\n (remove)=\"removeFile()\"\n />\n }\n </tui-files>\n <span class=\"text-body-s text-tui-text-02\">\u0424\u0430\u0439\u043B Excel, \u0432\u044B\u0433\u0440\u0443\u0436\u0435\u043D\u043D\u044B\u0439 \u0438\u0437 \u043F\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u044B \u00AB\u041F\u0440\u043E\u0444\u0441\u0442\u0440\u043E\u0439\u00BB: {{ accept }}</span>\n @let fileErrorVisible = submitAttempted() || !form.controls.file.hasError('required');\n @if (!rejected && fileErrorVisible) {\n <tui-error\n formControlName=\"file\"\n [order]=\"['required', 'serverResponse']\"\n />\n }\n </div>\n\n <!-- \u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u0437\u0430\u044F\u0432\u043A\u0438. -->\n <label tuiLabel>\n \u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u0437\u0430\u044F\u0432\u043A\u0438\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n placeholder=\"\u041D\u0430\u043F\u0440\u0438\u043C\u0435\u0440: \u0411\u0430\u043B\u043A\u043E\u043D\u044B, \u043E\u0431\u044A\u0435\u043A\u0442 \u043D\u0430 \u041B\u0435\u043D\u0438\u043D\u0430\"\n autocomplete=\"off\"\n [maxLength]=\"nameMaxLength\"\n />\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n\n <!-- \u041E\u0448\u0438\u0431\u043A\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043D\u0435 \u043E\u0442\u043D\u043E\u0441\u044F\u0449\u0430\u044F\u0441\u044F \u043A \u043F\u043E\u043B\u044F\u043C. -->\n <tui-error [formGroup]=\"form\" />\n\n <div\n tuiNotification\n appearance=\"info\"\n size=\"m\"\n >\n \u041E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0430 \u0444\u0430\u0439\u043B\u0430 \u0432\u044B\u043F\u043E\u043B\u043D\u044F\u0435\u0442\u0441\u044F \u0432 \u0444\u043E\u043D\u0435: \u043F\u043E\u0437\u0438\u0446\u0438\u0438 \u0438 \u0446\u0435\u043D\u044B \u043F\u043E\u044F\u0432\u044F\u0442\u0441\u044F \u0432 \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\u0435 \u0447\u0435\u0440\u0435\u0437 \u043D\u0435\u043A\u043E\u0442\u043E\u0440\u043E\u0435 \u0432\u0440\u0435\u043C\u044F.\n </div>\n\n <div class=\"flex flex-wrap gap-2\">\n <button\n tuiButton\n type=\"submit\"\n iconStart=\"@tui.sc.send\"\n [loading]=\"submitting()\"\n >\n \u0421\u043E\u0437\u0434\u0430\u0442\u044C \u0437\u0430\u044F\u0432\u043A\u0443\n </button>\n <button\n tuiButton\n type=\"button\"\n appearance=\"secondary\"\n [disabled]=\"submitting()\"\n (click)=\"context.$implicit.complete()\"\n >\n \u041E\u0442\u043C\u0435\u043D\u0430\n </button>\n </div>\n</form>\n", dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i1$1.TuiFile, selector: "tui-file,a[tuiFile],button[tuiFile]", inputs: ["file", "state", "size", "showDelete", "showSize", "leftContent"], outputs: ["remove"] }, { kind: "component", type: i1$1.TuiInputFiles, selector: "label[tuiInputFiles]", inputs: ["tuiInputFiles"] }, { kind: "component", type: i1$1.TuiFilesComponent, selector: "tui-files", inputs: ["max", "expanded"], outputs: ["expandedChange"] }, { kind: "directive", type: i1$1.TuiInputFilesDirective, selector: "input[tuiInputFiles]", outputs: ["reject"] }, { kind: "directive", type: TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i2.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i2.TuiErrorDirective, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName], tui-error[formArray]", inputs: ["order"] }, { kind: "component", type: i2.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i2.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "invalid", "focused", "state"] }, { kind: "directive", type: i2.TuiNotificationDirective, selector: "[tuiNotification]:not(ng-template)", inputs: ["appearance", "size", "icon"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }, { kind: "pipe", type: i1$1.TuiFileRejectedPipe, name: "tuiFileRejected" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
10432
+ }
10433
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScProfstroyDraftCreateDialogComponent, decorators: [{
10434
+ type: Component,
10435
+ args: [{ selector: 'sc-profstroy-draft-create-dialog', imports: [ReactiveFormsModule, TuiFiles, TuiLabel, TuiError, TuiTextfield, TuiInput, TuiNotification, TuiButton, TuiButtonLoading, AsyncPipe], providers: [
10436
+ {
10437
+ provide: TUI_INPUT_FILE_TEXTS,
10438
+ useFactory: () => {
10439
+ const texts = inject(TUI_INPUT_FILE_TEXTS, { skipSelf: true });
10440
+ return computed(() => ({ ...texts(), formatRejectionReason: 'Файл должен быть в формате .xlsx' }));
10441
+ },
10442
+ },
10443
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<form\n [formGroup]=\"form\"\n class=\"flex flex-col gap-5\"\n (ngSubmit)=\"submit()\"\n>\n <!-- \u0424\u0430\u0439\u043B. \u041F\u0440\u0438\u0447\u0438\u043D\u0443 \u043E\u0442\u043A\u043B\u043E\u043D\u0435\u043D\u0438\u044F \u0444\u0430\u0439\u043B\u0430 \u043F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0435\u0442 \u0441\u0442\u0440\u043E\u043A\u0430 \u0444\u0430\u0439\u043B\u0430, \u043F\u043E\u0434 \u043F\u043E\u043B\u0435\u043C \u043E\u043D\u0430 \u043D\u0435 \u043F\u043E\u0432\u0442\u043E\u0440\u044F\u0435\u0442\u0441\u044F. \u041D\u0435\u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u043D\u043E\u0435 \u043F\u043E\u043B\u0435 \u043F\u043E\u0434\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E \u043F\u043E\u0441\u043B\u0435 \u043F\u043E\u043F\u044B\u0442\u043A\u0438 \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u0437\u0430\u044F\u0432\u043A\u0443. -->\n <div class=\"flex flex-col gap-1\">\n @let file = selectedFile();\n @let rejected = file | tuiFileRejected: { accept } | async;\n @if (!file) {\n <label tuiInputFiles>\n <input\n tuiInputFiles\n formControlName=\"file\"\n [accept]=\"accept\"\n [invalid]=\"submitAttempted() ? null : false\"\n />\n </label>\n }\n <tui-files>\n @if (file) {\n <tui-file\n [state]=\"rejected ? 'error' : 'normal'\"\n [file]=\"rejected ?? file\"\n (remove)=\"removeFile()\"\n />\n }\n </tui-files>\n <span class=\"text-body-s text-tui-text-02\">\u0424\u0430\u0439\u043B Excel, \u0432\u044B\u0433\u0440\u0443\u0436\u0435\u043D\u043D\u044B\u0439 \u0438\u0437 \u043F\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u044B \u00AB\u041F\u0440\u043E\u0444\u0441\u0442\u0440\u043E\u0439\u00BB: {{ accept }}</span>\n @let fileErrorVisible = submitAttempted() || !form.controls.file.hasError('required');\n @if (!rejected && fileErrorVisible) {\n <tui-error\n formControlName=\"file\"\n [order]=\"['required', 'serverResponse']\"\n />\n }\n </div>\n\n <!-- \u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u0437\u0430\u044F\u0432\u043A\u0438. -->\n <label tuiLabel>\n \u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u0437\u0430\u044F\u0432\u043A\u0438\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n placeholder=\"\u041D\u0430\u043F\u0440\u0438\u043C\u0435\u0440: \u0411\u0430\u043B\u043A\u043E\u043D\u044B, \u043E\u0431\u044A\u0435\u043A\u0442 \u043D\u0430 \u041B\u0435\u043D\u0438\u043D\u0430\"\n autocomplete=\"off\"\n [maxLength]=\"nameMaxLength\"\n />\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n\n <!-- \u041E\u0448\u0438\u0431\u043A\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043D\u0435 \u043E\u0442\u043D\u043E\u0441\u044F\u0449\u0430\u044F\u0441\u044F \u043A \u043F\u043E\u043B\u044F\u043C. -->\n <tui-error [formGroup]=\"form\" />\n\n <div\n tuiNotification\n appearance=\"info\"\n size=\"m\"\n >\n \u041E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0430 \u0444\u0430\u0439\u043B\u0430 \u0432\u044B\u043F\u043E\u043B\u043D\u044F\u0435\u0442\u0441\u044F \u0432 \u0444\u043E\u043D\u0435: \u043F\u043E\u0437\u0438\u0446\u0438\u0438 \u0438 \u0446\u0435\u043D\u044B \u043F\u043E\u044F\u0432\u044F\u0442\u0441\u044F \u0432 \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\u0435 \u0447\u0435\u0440\u0435\u0437 \u043D\u0435\u043A\u043E\u0442\u043E\u0440\u043E\u0435 \u0432\u0440\u0435\u043C\u044F.\n </div>\n\n <div class=\"flex flex-wrap gap-2\">\n <button\n tuiButton\n type=\"submit\"\n iconStart=\"@tui.sc.send\"\n [loading]=\"submitting()\"\n >\n \u0421\u043E\u0437\u0434\u0430\u0442\u044C \u0437\u0430\u044F\u0432\u043A\u0443\n </button>\n <button\n tuiButton\n type=\"button\"\n appearance=\"secondary\"\n [disabled]=\"submitting()\"\n (click)=\"context.$implicit.complete()\"\n >\n \u041E\u0442\u043C\u0435\u043D\u0430\n </button>\n </div>\n</form>\n" }]
10444
+ }] });
10445
+
10446
+ /**
10447
+ * Компонент страницы черновика заказа (аналог корзины для одного черновика).
10448
+ */
10449
+ class ScDraftComponent {
10450
+ /**
10451
+ * Инициализирует экземпляр класса {@link ScDraftComponent}.
10452
+ */
10453
+ constructor() {
10454
+ /**
10455
+ * Сервис маршрутизации.
10456
+ */
10457
+ this.router = inject(Router);
10458
+ /**
10459
+ * Сервис предоставляющий доступ к данным о маршруте.
8865
10460
  */
8866
10461
  this.route = inject(ActivatedRoute);
8867
10462
  /**
8868
10463
  * Сервис для работы с черновиками заказов.
8869
10464
  */
8870
10465
  this.draftsService = inject(ScOrderDraftsService);
10466
+ /**
10467
+ * Сервис уведомлений.
10468
+ */
10469
+ this.alerts = inject(TuiNotificationService);
8871
10470
  /**
8872
10471
  * Сигнал с данными текущего черновика заказа (из параметра orderId в URL).
8873
10472
  */
@@ -8888,6 +10487,45 @@ class ScDraftComponent {
8888
10487
  * Текущий ключ маршрута.
8889
10488
  */
8890
10489
  this.isDraftPage = toSignal(this.route.data.pipe(map((data) => data['routes_key'] === ScRouteKeys.draft), distinctUntilChanged()), { initialValue: false });
10490
+ /**
10491
+ * Признак черновика Профстрой.
10492
+ */
10493
+ this.isProfstroy = computed(() => this.draft()?.isProfstroy === true, ...(ngDevMode ? [{ debugName: "isProfstroy" }] : /* istanbul ignore next */ []));
10494
+ /**
10495
+ * Признак, что идёт обработка черновика Профстрой.
10496
+ */
10497
+ this.isProcessing = computed(() => this.draft()?.actualization?.isProcessing === true, ...(ngDevMode ? [{ debugName: "isProcessing" }] : /* istanbul ignore next */ []));
10498
+ /**
10499
+ * Сервис текущего момента для проверки срока актуализации.
10500
+ */
10501
+ this.expirationClock = inject(ScDraftExpirationClockService);
10502
+ /**
10503
+ * Текущий момент для проверки срока актуализации из общего источника. Обновляется, пока открыт черновик Профстрой.
10504
+ */
10505
+ this.now = this.expirationClock.nowWhile(this.isProfstroy);
10506
+ /**
10507
+ * Признак выполнения актуализации или пересборки черновика Профстрой.
10508
+ */
10509
+ this.actionRunning = signal(false, ...(ngDevMode ? [{ debugName: "actionRunning" }] : /* istanbul ignore next */ []));
10510
+ /**
10511
+ * Признак, что для черновика выполняются или ждут очереди запросы изменения или перечитывания.
10512
+ */
10513
+ this.queueBusy = toSignal(toObservable(this.draft).pipe(map((draft) => draft?.id), distinctUntilChanged(), switchMap((draftId) => (draftId === undefined ? of(false) : this.draftsService.isBusy$(draftId)))), { initialValue: false });
10514
+ /**
10515
+ * Признак, что действия над черновиком Профстрой недоступны, пока выполняется действие или запрос черновика.
10516
+ */
10517
+ this.busy = computed(() => this.actionRunning() || this.queueBusy(), ...(ngDevMode ? [{ debugName: "busy" }] : /* istanbul ignore next */ []));
10518
+ /**
10519
+ * Признак, что можно менять состав черновика Профстрой.
10520
+ */
10521
+ this.canEditProfstroy = computed(() => this.isDraftPage() && !this.actionRunning() && !this.isProcessing(), ...(ngDevMode ? [{ debugName: "canEditProfstroy" }] : /* istanbul ignore next */ []));
10522
+ /**
10523
+ * Причина, по которой нельзя оформить заказ из черновика Профстрой, или пустая строка.
10524
+ */
10525
+ this.profstroyOrderBlockReason = computed(() => {
10526
+ const reason = this.draft()?.getOrderBlockReason(this.now()) ?? '';
10527
+ return reason || (this.selectedItemsIds().length === 0 ? 'Выберите позиции для заказа.' : '');
10528
+ }, ...(ngDevMode ? [{ debugName: "profstroyOrderBlockReason" }] : /* istanbul ignore next */ []));
8891
10529
  /**
8892
10530
  * Ссылка для автоматического управления уничтожением зависимостей.
8893
10531
  */
@@ -8896,6 +10534,7 @@ class ScDraftComponent {
8896
10534
  * Сервис установки SEO-данных приложения.
8897
10535
  */
8898
10536
  this.seoService = inject(ScSeoService);
10537
+ this.watchProfstroyProcessing();
8899
10538
  }
8900
10539
  /** @inheritDoc */
8901
10540
  ngOnInit() {
@@ -8916,7 +10555,32 @@ class ScDraftComponent {
8916
10555
  this.router.navigate(['orders', 'new', this.draft()?.id, 'draft'], { queryParams: { itemsIds: this.selectedItemsIds() } }).catch(noop$1);
8917
10556
  }
8918
10557
  /**
8919
- * Удаляет черновик и перенаправляет к списку черновиков.
10558
+ * Запускает актуализацию черновика Профстрой.
10559
+ */
10560
+ actualizeProfstroy() {
10561
+ this.runProfstroyAction((draftId) => this.draftsService.actualizeProfstroy$(draftId));
10562
+ }
10563
+ /**
10564
+ * Запускает пересборку черновика Профстрой из файла после подтверждения.
10565
+ */
10566
+ reloadProfstroy() {
10567
+ this.dialogService
10568
+ .open(TUI_CONFIRM, {
10569
+ label: 'Собрать заявку заново?',
10570
+ data: {
10571
+ content: 'Заявка будет собрана заново из загруженного файла. Изменённые количество, метраж и маркировка позиций, а также удалённые позиции будут потеряны. Продолжить?',
10572
+ yes: 'Да, собрать заново',
10573
+ no: 'Отмена',
10574
+ },
10575
+ })
10576
+ .pipe(filter(Boolean), takeUntilDestroyed(this.destroyRef))
10577
+ .subscribe(() => {
10578
+ this.runProfstroyAction((draftId) => this.draftsService.reloadProfstroy$(draftId));
10579
+ });
10580
+ }
10581
+ /**
10582
+ * Удаляет черновик и перенаправляет к списку черновиков. Пока черновик удаляется, действия над ним заблокированы.
10583
+ * Если удалить не удалось, пользователь остаётся на странице, сообщение об ошибке показывает перехватчик приложения.
8920
10584
  */
8921
10585
  clearDraft() {
8922
10586
  const { id } = this.draft() ?? {};
@@ -8932,29 +10596,86 @@ class ScDraftComponent {
8932
10596
  no: 'Нет, оставить',
8933
10597
  },
8934
10598
  })
8935
- .pipe(filter(Boolean), switchMap(() => this.draftsService.delete$(id)), takeUntilDestroyed(this.destroyRef))
8936
- .subscribe(() => {
8937
- this.deleteEvent.emit();
8938
- this.router.navigate(['/drafts']).catch(noop$1);
10599
+ .pipe(filter(Boolean), switchMap(() => {
10600
+ this.actionRunning.set(true);
10601
+ return this.draftsService.delete$(id).pipe(finalize(() => {
10602
+ this.actionRunning.set(false);
10603
+ }));
10604
+ }), takeUntilDestroyed(this.destroyRef))
10605
+ .subscribe({
10606
+ next: () => {
10607
+ this.deleteEvent.emit();
10608
+ this.router.navigate(['/drafts']).catch(noop$1);
10609
+ },
10610
+ error: noop$1,
10611
+ });
10612
+ }
10613
+ /**
10614
+ * Выполняет действие над черновиком Профстрой. Пока действие выполняется, остальные заблокированы.
10615
+ * Ответ попадает в кэш черновика, после отказа 403 или 409 сервис сам перезапрашивает черновик. Сообщение об ошибке показывает перехватчик приложения.
10616
+ *
10617
+ * @param action Функция, возвращающая запрос действия по идентификатору черновика.
10618
+ */
10619
+ runProfstroyAction(action) {
10620
+ const draftId = this.draft()?.id;
10621
+ if (draftId === undefined || this.busy()) {
10622
+ return;
10623
+ }
10624
+ this.actionRunning.set(true);
10625
+ action(draftId)
10626
+ .pipe(finalize(() => {
10627
+ this.actionRunning.set(false);
10628
+ }), takeUntilDestroyed(this.destroyRef))
10629
+ .subscribe({ error: noop$1 });
10630
+ }
10631
+ /**
10632
+ * Пока черновик Профстрой на его странице в обработке, опрашивает состояние лёгким запросом списка и после окончания обработки перезапрашивает черновик.
10633
+ * Опрос идёт, пока перезапрошенный черновик остаётся в обработке: неудачный перезапрос повторяется на следующем шаге.
10634
+ * Если черновика больше нет (удалён в другой вкладке), опрос завершается, а пользователь возвращается к списку. В списке черновиков состояние опрашивает сам список.
10635
+ */
10636
+ watchProfstroyProcessing() {
10637
+ toObservable(computed(() => (this.isDraftPage() && this.isProcessing() ? this.draft()?.id : undefined)))
10638
+ .pipe(distinctUntilChanged(), switchMap((draftId) => draftId === undefined
10639
+ ? EMPTY
10640
+ : this.draftsService.watchShortList$([draftId]).pipe(filter((drafts) => !drafts.some((short) => short.id === draftId && short.actualization?.isProcessing)), exhaustMap(() => this.draftsService.fetch$(draftId).pipe(catchError((error) => (ScApiErrorHelper.isNotFound(error) ? of(null) : EMPTY)))), takeWhile((draft) => draft?.actualization?.isProcessing === true, true), filter((draft) => draft === null), map(() => draftId))), takeUntilDestroyed(this.destroyRef))
10641
+ .subscribe((draftId) => {
10642
+ this.leaveMissingDraft(draftId);
8939
10643
  });
8940
10644
  }
10645
+ /**
10646
+ * Сообщает, что черновик не найден, и возвращает к списку черновиков.
10647
+ *
10648
+ * @param draftId Идентификатор черновика.
10649
+ */
10650
+ leaveMissingDraft(draftId) {
10651
+ this.alerts.open(`Черновик №${draftId} не найден. Возможно, он удалён.`, { appearance: 'warning' }).subscribe();
10652
+ this.router.navigate(['/drafts']).catch(noop$1);
10653
+ }
8941
10654
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScDraftComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
8942
10655
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScDraftComponent, isStandalone: true, selector: "sc-draft", inputs: { draft: { classPropertyName: "draft", publicName: "draft", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { draft: "draftChange", deleteEvent: "deleteEvent" }, providers: [
8943
10656
  {
8944
10657
  provide: SC_ORDER_LOADER,
8945
10658
  useExisting: ScOrderDraftsService,
8946
10659
  },
8947
- ], ngImport: i0, template: "@let items = draft()?.products;\n\n@if (items) {\n <div class=\"flex flex-col gap-12\">\n <div class=\"flex flex-col gap-5\">\n @if (items.length) {\n <sc-order-items-list-with-actions\n scOrder\n [orderId]=\"draft()?.id\"\n [items]=\"items\"\n [editable]=\"isDraftPage()\"\n (selectedItemsIdsChange)=\"selectedItemsIds.set($event)\"\n >\n <div\n footerActions\n class=\"flex w-full flex-col items-center gap-x-2.5 gap-y-4 sm:flex-row sm:flex-wrap sm:items-start\"\n >\n <button\n tuiButton\n appearance=\"secondary\"\n (click)=\"clearDraft()\"\n iconStart=\"@tui.trash-2\"\n >\n \u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\n </button>\n\n <button\n tuiButton\n type=\"button\"\n class=\"sm:ml-auto\"\n iconStart=\"@tui.shopping-cart\"\n [disabled]=\"selectedItemsIds().length === 0\"\n (click)=\"goToNewOrder()\"\n >\n \u0417\u0430\u043A\u0430\u0437\u0430\u0442\u044C\n </button>\n </div>\n </sc-order-items-list-with-actions>\n } @else {\n <p class=\"text-base font-bold\">\u0427\u0435\u0440\u043D\u043E\u0432\u0438\u043A \u043F\u0443\u0441\u0442.</p>\n <div\n footerActions\n class=\"flex gap-2\"\n >\n <button\n tuiButton\n appearance=\"secondary\"\n (click)=\"clearDraft()\"\n iconStart=\"@tui.trash-2\"\n >\n \u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\n </button>\n </div>\n }\n </div>\n </div>\n} @else {\n <div class=\"flex flex-col gap-12\">\n <div class=\"flex flex-col gap-5\">\n @for (item of [1, 2, 3, 4]; track item) {\n <div class=\"tui-skeleton flex h-[8.25rem] w-full overflow-hidden rounded-xl\"></div>\n }\n <div class=\"flex gap-2\">\n <div class=\"tui-skeleton h-10 w-40 rounded-md\"></div>\n <div class=\"tui-skeleton h-10 w-36 rounded-md\"></div>\n </div>\n </div>\n </div>\n}\n", dependencies: [{ kind: "component", type: ScOrderItemsListWithActionsComponent, selector: "sc-order-items-list-with-actions", inputs: ["items", "selectable", "editable", "selectedItemsIds"], outputs: ["selectedItemsIdsChange"] }, { kind: "directive", type: ScOrderAccessorDirective, selector: "[scOrder]", inputs: ["orderId"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
10660
+ ], ngImport: i0, template: "@let currentDraft = draft();\n\n@if (currentDraft && currentDraft.isProfstroy) {\n <div class=\"flex flex-col gap-5\">\n <sc-profstroy-draft-badges\n [actualization]=\"currentDraft.actualization\"\n [now]=\"now()\"\n />\n\n <sc-profstroy-actualization-panel\n [draft]=\"currentDraft\"\n [now]=\"now()\"\n [busy]=\"busy() || !isDraftPage()\"\n (actualize)=\"actualizeProfstroy()\"\n (reload)=\"reloadProfstroy()\"\n />\n\n @if (currentDraft.products.length) {\n <sc-order-items-list\n scOrder\n [orderId]=\"currentDraft.id\"\n [items]=\"currentDraft.products\"\n [grouped]=\"true\"\n [markUnavailable]=\"true\"\n [useLinePrice]=\"true\"\n [measuredInDialog]=\"true\"\n [editable]=\"canEditProfstroy()\"\n [selectable]=\"true\"\n deleteConfirmationTarget=\"\u0438\u0437 \u0437\u0430\u044F\u0432\u043A\u0438\"\n totalLabel=\"\u0418\u0422\u041E\u0413\u041E \u041A \u0417\u0410\u041A\u0410\u0417\u0423\"\n (selectedItemsIdsChange)=\"selectedItemsIds.set($event)\"\n />\n } @else {\n <p class=\"text-base font-bold\">{{ isProcessing() ? '\u041F\u043E\u0437\u0438\u0446\u0438\u0438 \u043F\u043E\u044F\u0432\u044F\u0442\u0441\u044F \u043F\u043E\u0441\u043B\u0435 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0438 \u0444\u0430\u0439\u043B\u0430' : '\u0412 \u0437\u0430\u044F\u0432\u043A\u0435 \u043D\u0435\u0442 \u043F\u043E\u0437\u0438\u0446\u0438\u0439' }}</p>\n }\n\n <div class=\"flex flex-col items-center gap-x-2.5 gap-y-4 sm:flex-row sm:flex-wrap-reverse sm:items-start\">\n <button\n tuiButton\n appearance=\"secondary\"\n iconStart=\"@tui.trash-2\"\n [disabled]=\"busy()\"\n (click)=\"clearDraft()\"\n >\n \u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\n </button>\n\n <div class=\"flex flex-col items-center gap-1 sm:ml-auto sm:items-end\">\n <button\n tuiButton\n type=\"button\"\n iconStart=\"@tui.shopping-cart\"\n [disabled]=\"busy() || !!profstroyOrderBlockReason()\"\n (click)=\"goToNewOrder()\"\n >\n \u041E\u0444\u043E\u0440\u043C\u0438\u0442\u044C \u0437\u0430\u043A\u0430\u0437\n </button>\n @if (profstroyOrderBlockReason(); as reason) {\n <span class=\"text-body-s text-tui-text-02\">{{ reason }}</span>\n }\n </div>\n </div>\n </div>\n} @else {\n @let items = draft()?.products;\n\n @if (items) {\n <div class=\"flex flex-col gap-12\">\n <div class=\"flex flex-col gap-5\">\n @if (items.length) {\n <sc-order-items-list-with-actions\n scOrder\n [orderId]=\"draft()?.id\"\n [items]=\"items\"\n [editable]=\"isDraftPage()\"\n deleteConfirmationTarget=\"\u0438\u0437 \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\u0430\"\n (selectedItemsIdsChange)=\"selectedItemsIds.set($event)\"\n >\n <div\n footerActions\n class=\"flex w-full flex-col items-center gap-x-2.5 gap-y-4 sm:flex-row sm:flex-wrap sm:items-start\"\n >\n <button\n tuiButton\n appearance=\"secondary\"\n (click)=\"clearDraft()\"\n iconStart=\"@tui.trash-2\"\n >\n \u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\n </button>\n\n <button\n tuiButton\n type=\"button\"\n class=\"sm:ml-auto\"\n iconStart=\"@tui.shopping-cart\"\n [disabled]=\"selectedItemsIds().length === 0\"\n (click)=\"goToNewOrder()\"\n >\n \u0417\u0430\u043A\u0430\u0437\u0430\u0442\u044C\n </button>\n </div>\n </sc-order-items-list-with-actions>\n } @else {\n <p class=\"text-base font-bold\">\u0427\u0435\u0440\u043D\u043E\u0432\u0438\u043A \u043F\u0443\u0441\u0442.</p>\n <div\n footerActions\n class=\"flex gap-2\"\n >\n <button\n tuiButton\n appearance=\"secondary\"\n (click)=\"clearDraft()\"\n iconStart=\"@tui.trash-2\"\n >\n \u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\n </button>\n </div>\n }\n </div>\n </div>\n } @else {\n <div class=\"flex flex-col gap-12\">\n <div class=\"flex flex-col gap-5\">\n @for (item of [1, 2, 3, 4]; track item) {\n <div class=\"tui-skeleton flex h-[8.25rem] w-full overflow-hidden rounded-xl\"></div>\n }\n <div class=\"flex gap-2\">\n <div class=\"tui-skeleton h-10 w-40 rounded-md\"></div>\n <div class=\"tui-skeleton h-10 w-36 rounded-md\"></div>\n </div>\n </div>\n </div>\n }\n}\n", dependencies: [{ kind: "component", type: ScOrderItemsListWithActionsComponent, selector: "sc-order-items-list-with-actions", inputs: ["items", "selectable", "editable", "useLinePrice", "deleteConfirmationTarget", "totalLabel", "selectedItemsIds"], outputs: ["selectedItemsIdsChange"] }, { kind: "directive", type: ScOrderAccessorDirective, selector: "[scOrder]", inputs: ["orderId"] }, { kind: "component", type: ScProfstroyActualizationPanelComponent, selector: "sc-profstroy-actualization-panel", inputs: ["draft", "now", "busy"], outputs: ["actualize", "reload"] }, { kind: "component", type: ScProfstroyDraftBadgesComponent, selector: "sc-profstroy-draft-badges", inputs: ["actualization", "now"] }, { kind: "component", type: ScOrderItemsListComponent, selector: "sc-order-items-list", inputs: ["selectable", "editable", "grouped", "markUnavailable", "useLinePrice", "measuredInDialog", "deleteConfirmationTarget", "totalLabel", "items"], outputs: ["selectedItemsIdsChange"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
8948
10661
  }
8949
10662
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScDraftComponent, decorators: [{
8950
10663
  type: Component,
8951
- args: [{ standalone: true, selector: 'sc-draft', imports: [ScOrderItemsListWithActionsComponent, ScOrderAccessorDirective, TuiButton, TuiIcons], providers: [
10664
+ args: [{ selector: 'sc-draft', imports: [
10665
+ ScOrderItemsListWithActionsComponent,
10666
+ ScOrderAccessorDirective,
10667
+ ScProfstroyActualizationPanelComponent,
10668
+ ScProfstroyDraftBadgesComponent,
10669
+ ScOrderItemsListComponent,
10670
+ TuiButton,
10671
+ TuiIcons,
10672
+ ], providers: [
8952
10673
  {
8953
10674
  provide: SC_ORDER_LOADER,
8954
10675
  useExisting: ScOrderDraftsService,
8955
10676
  },
8956
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let items = draft()?.products;\n\n@if (items) {\n <div class=\"flex flex-col gap-12\">\n <div class=\"flex flex-col gap-5\">\n @if (items.length) {\n <sc-order-items-list-with-actions\n scOrder\n [orderId]=\"draft()?.id\"\n [items]=\"items\"\n [editable]=\"isDraftPage()\"\n (selectedItemsIdsChange)=\"selectedItemsIds.set($event)\"\n >\n <div\n footerActions\n class=\"flex w-full flex-col items-center gap-x-2.5 gap-y-4 sm:flex-row sm:flex-wrap sm:items-start\"\n >\n <button\n tuiButton\n appearance=\"secondary\"\n (click)=\"clearDraft()\"\n iconStart=\"@tui.trash-2\"\n >\n \u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\n </button>\n\n <button\n tuiButton\n type=\"button\"\n class=\"sm:ml-auto\"\n iconStart=\"@tui.shopping-cart\"\n [disabled]=\"selectedItemsIds().length === 0\"\n (click)=\"goToNewOrder()\"\n >\n \u0417\u0430\u043A\u0430\u0437\u0430\u0442\u044C\n </button>\n </div>\n </sc-order-items-list-with-actions>\n } @else {\n <p class=\"text-base font-bold\">\u0427\u0435\u0440\u043D\u043E\u0432\u0438\u043A \u043F\u0443\u0441\u0442.</p>\n <div\n footerActions\n class=\"flex gap-2\"\n >\n <button\n tuiButton\n appearance=\"secondary\"\n (click)=\"clearDraft()\"\n iconStart=\"@tui.trash-2\"\n >\n \u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\n </button>\n </div>\n }\n </div>\n </div>\n} @else {\n <div class=\"flex flex-col gap-12\">\n <div class=\"flex flex-col gap-5\">\n @for (item of [1, 2, 3, 4]; track item) {\n <div class=\"tui-skeleton flex h-[8.25rem] w-full overflow-hidden rounded-xl\"></div>\n }\n <div class=\"flex gap-2\">\n <div class=\"tui-skeleton h-10 w-40 rounded-md\"></div>\n <div class=\"tui-skeleton h-10 w-36 rounded-md\"></div>\n </div>\n </div>\n </div>\n}\n" }]
8957
- }], propDecorators: { draft: [{ type: i0.Input, args: [{ isSignal: true, alias: "draft", required: false }] }, { type: i0.Output, args: ["draftChange"] }], deleteEvent: [{ type: i0.Output, args: ["deleteEvent"] }] } });
10677
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let currentDraft = draft();\n\n@if (currentDraft && currentDraft.isProfstroy) {\n <div class=\"flex flex-col gap-5\">\n <sc-profstroy-draft-badges\n [actualization]=\"currentDraft.actualization\"\n [now]=\"now()\"\n />\n\n <sc-profstroy-actualization-panel\n [draft]=\"currentDraft\"\n [now]=\"now()\"\n [busy]=\"busy() || !isDraftPage()\"\n (actualize)=\"actualizeProfstroy()\"\n (reload)=\"reloadProfstroy()\"\n />\n\n @if (currentDraft.products.length) {\n <sc-order-items-list\n scOrder\n [orderId]=\"currentDraft.id\"\n [items]=\"currentDraft.products\"\n [grouped]=\"true\"\n [markUnavailable]=\"true\"\n [useLinePrice]=\"true\"\n [measuredInDialog]=\"true\"\n [editable]=\"canEditProfstroy()\"\n [selectable]=\"true\"\n deleteConfirmationTarget=\"\u0438\u0437 \u0437\u0430\u044F\u0432\u043A\u0438\"\n totalLabel=\"\u0418\u0422\u041E\u0413\u041E \u041A \u0417\u0410\u041A\u0410\u0417\u0423\"\n (selectedItemsIdsChange)=\"selectedItemsIds.set($event)\"\n />\n } @else {\n <p class=\"text-base font-bold\">{{ isProcessing() ? '\u041F\u043E\u0437\u0438\u0446\u0438\u0438 \u043F\u043E\u044F\u0432\u044F\u0442\u0441\u044F \u043F\u043E\u0441\u043B\u0435 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0438 \u0444\u0430\u0439\u043B\u0430' : '\u0412 \u0437\u0430\u044F\u0432\u043A\u0435 \u043D\u0435\u0442 \u043F\u043E\u0437\u0438\u0446\u0438\u0439' }}</p>\n }\n\n <div class=\"flex flex-col items-center gap-x-2.5 gap-y-4 sm:flex-row sm:flex-wrap-reverse sm:items-start\">\n <button\n tuiButton\n appearance=\"secondary\"\n iconStart=\"@tui.trash-2\"\n [disabled]=\"busy()\"\n (click)=\"clearDraft()\"\n >\n \u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\n </button>\n\n <div class=\"flex flex-col items-center gap-1 sm:ml-auto sm:items-end\">\n <button\n tuiButton\n type=\"button\"\n iconStart=\"@tui.shopping-cart\"\n [disabled]=\"busy() || !!profstroyOrderBlockReason()\"\n (click)=\"goToNewOrder()\"\n >\n \u041E\u0444\u043E\u0440\u043C\u0438\u0442\u044C \u0437\u0430\u043A\u0430\u0437\n </button>\n @if (profstroyOrderBlockReason(); as reason) {\n <span class=\"text-body-s text-tui-text-02\">{{ reason }}</span>\n }\n </div>\n </div>\n </div>\n} @else {\n @let items = draft()?.products;\n\n @if (items) {\n <div class=\"flex flex-col gap-12\">\n <div class=\"flex flex-col gap-5\">\n @if (items.length) {\n <sc-order-items-list-with-actions\n scOrder\n [orderId]=\"draft()?.id\"\n [items]=\"items\"\n [editable]=\"isDraftPage()\"\n deleteConfirmationTarget=\"\u0438\u0437 \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\u0430\"\n (selectedItemsIdsChange)=\"selectedItemsIds.set($event)\"\n >\n <div\n footerActions\n class=\"flex w-full flex-col items-center gap-x-2.5 gap-y-4 sm:flex-row sm:flex-wrap sm:items-start\"\n >\n <button\n tuiButton\n appearance=\"secondary\"\n (click)=\"clearDraft()\"\n iconStart=\"@tui.trash-2\"\n >\n \u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\n </button>\n\n <button\n tuiButton\n type=\"button\"\n class=\"sm:ml-auto\"\n iconStart=\"@tui.shopping-cart\"\n [disabled]=\"selectedItemsIds().length === 0\"\n (click)=\"goToNewOrder()\"\n >\n \u0417\u0430\u043A\u0430\u0437\u0430\u0442\u044C\n </button>\n </div>\n </sc-order-items-list-with-actions>\n } @else {\n <p class=\"text-base font-bold\">\u0427\u0435\u0440\u043D\u043E\u0432\u0438\u043A \u043F\u0443\u0441\u0442.</p>\n <div\n footerActions\n class=\"flex gap-2\"\n >\n <button\n tuiButton\n appearance=\"secondary\"\n (click)=\"clearDraft()\"\n iconStart=\"@tui.trash-2\"\n >\n \u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\n </button>\n </div>\n }\n </div>\n </div>\n } @else {\n <div class=\"flex flex-col gap-12\">\n <div class=\"flex flex-col gap-5\">\n @for (item of [1, 2, 3, 4]; track item) {\n <div class=\"tui-skeleton flex h-[8.25rem] w-full overflow-hidden rounded-xl\"></div>\n }\n <div class=\"flex gap-2\">\n <div class=\"tui-skeleton h-10 w-40 rounded-md\"></div>\n <div class=\"tui-skeleton h-10 w-36 rounded-md\"></div>\n </div>\n </div>\n </div>\n }\n}\n" }]
10678
+ }], ctorParameters: () => [], propDecorators: { draft: [{ type: i0.Input, args: [{ isSignal: true, alias: "draft", required: false }] }, { type: i0.Output, args: ["draftChange"] }], deleteEvent: [{ type: i0.Output, args: ["deleteEvent"] }] } });
8958
10679
 
8959
10680
  /**
8960
10681
  * Компонент статуса оплаты заказа.
@@ -10067,255 +11788,6 @@ const scGetCurrentRoute = (route) => {
10067
11788
  return currentRoute;
10068
11789
  };
10069
11790
 
10070
- /**
10071
- * Токен времени ожидания загрузки скрипта Yandex SmartCaptcha в миллисекундах.
10072
- */
10073
- const SC_SMART_CAPTCHA_LOAD_TIMEOUT = new InjectionToken('SC_SMART_CAPTCHA_LOAD_TIMEOUT', {
10074
- factory: () => 20_000,
10075
- });
10076
-
10077
- /**
10078
- * Сервис загрузки скрипта Yandex SmartCaptcha.
10079
- */
10080
- class ScSmartCaptchaLoaderService {
10081
- constructor() {
10082
- /**
10083
- * Сервис для вставки внешних скриптов.
10084
- */
10085
- this.scriptsService = inject(ScScriptsService);
10086
- /**
10087
- * Окно браузера с API Yandex SmartCaptcha.
10088
- */
10089
- this.window = inject(WA_WINDOW);
10090
- /**
10091
- * Признак того, что приложение запущено в браузере.
10092
- */
10093
- this.isBrowser = inject(IS_BROWSER);
10094
- /**
10095
- * Время ожидания загрузки скрипта в миллисекундах.
10096
- */
10097
- this.loadTimeout = inject(SC_SMART_CAPTCHA_LOAD_TIMEOUT);
10098
- /**
10099
- * Имя функции окна, которую скрипт вызывает после загрузки.
10100
- */
10101
- this.onloadCallbackName = 'scSmartCaptchaOnload';
10102
- /**
10103
- * Адрес скрипта.
10104
- */
10105
- this.scriptUrl = `https://smartcaptcha.cloud.yandex.ru/captcha.js?render=onload&onload=${this.onloadCallbackName}`;
10106
- /**
10107
- * Загрузка API, общая для всех виджетов. Скрипт загружается один раз; отписка и истечение ожидания у подписчика загрузку не прерывают, после ошибки следующая подписка загружает скрипт заново.
10108
- */
10109
- this.loading$ = defer(() => this.load$()).pipe(shareReplay(1));
10110
- /**
10111
- * {@link Observable} API Yandex SmartCaptcha. Значения и ошибки приходят вне зоны Angular, ожидание первого значения ограничено {@link SC_SMART_CAPTCHA_LOAD_TIMEOUT}.
10112
- */
10113
- this.api$ = this.loading$.pipe(timeout({ first: this.loadTimeout }), tuiZonefree());
10114
- }
10115
- /**
10116
- * Возвращает API Yandex SmartCaptcha, при необходимости загружая скрипт. На сервере ничего не возвращает.
10117
- */
10118
- load$() {
10119
- if (!this.isBrowser) {
10120
- return EMPTY;
10121
- }
10122
- if (this.window.smartCaptcha) {
10123
- return of(this.window.smartCaptcha);
10124
- }
10125
- return merge(this.onload$(), this.scriptsService.loadScript$(this.scriptUrl).pipe(ignoreElements()));
10126
- }
10127
- /**
10128
- * Ждёт вызова функции из параметра `onload` адреса скрипта и возвращает API, которое скрипт к этому моменту создал.
10129
- */
10130
- onload$() {
10131
- return new Observable((subscriber) => {
10132
- this.window[this.onloadCallbackName] = () => {
10133
- if (this.window.smartCaptcha) {
10134
- subscriber.next(this.window.smartCaptcha);
10135
- subscriber.complete();
10136
- }
10137
- else {
10138
- subscriber.error(new Error('Yandex SmartCaptcha API is unavailable'));
10139
- }
10140
- };
10141
- return () => {
10142
- this.window[this.onloadCallbackName] = undefined;
10143
- };
10144
- });
10145
- }
10146
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScSmartCaptchaLoaderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
10147
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScSmartCaptchaLoaderService, providedIn: 'root' }); }
10148
- }
10149
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScSmartCaptchaLoaderService, decorators: [{
10150
- type: Injectable,
10151
- args: [{
10152
- providedIn: 'root',
10153
- }]
10154
- }] });
10155
-
10156
- /**
10157
- * Токен настроек Yandex SmartCaptcha. Задаётся приложением.
10158
- */
10159
- const SC_SMART_CAPTCHA_SETTINGS = new InjectionToken('SC_SMART_CAPTCHA_SETTINGS');
10160
-
10161
- /* eslint-disable no-use-before-define */
10162
- /**
10163
- * Виджет Yandex SmartCaptcha. Значение поля ввода - токен прохождения проверки, `null` пока проверка не пройдена или токен истёк.
10164
- */
10165
- class ScSmartCaptchaComponent {
10166
- /**
10167
- * Инициализирует экземпляр класса {@link ScSmartCaptchaComponent}.
10168
- */
10169
- constructor() {
10170
- /**
10171
- * Контейнер, в котором отрисовывается виджет.
10172
- */
10173
- this.container = viewChild.required('container');
10174
- /**
10175
- * Настройки Yandex SmartCaptcha.
10176
- */
10177
- this.settings = inject(SC_SMART_CAPTCHA_SETTINGS);
10178
- /**
10179
- * Сервис загрузки скрипта Yandex SmartCaptcha.
10180
- */
10181
- this.loader = inject(ScSmartCaptchaLoaderService);
10182
- /**
10183
- * {@link NgZone} для отрисовки виджета вне зоны Angular и возврата его событий в зону.
10184
- */
10185
- this.ngZone = inject(NgZone);
10186
- /**
10187
- * Ссылка для автоматического управления уничтожением зависимостей.
10188
- */
10189
- this.destroyRef = inject(DestroyRef);
10190
- /**
10191
- * Признак того, что капчу не удалось загрузить.
10192
- */
10193
- this.hasError = signal(false, ...(ngDevMode ? [{ debugName: "hasError" }] : /* istanbul ignore next */ []));
10194
- /**
10195
- * Функции отписки от событий виджета.
10196
- */
10197
- this.unsubscribers = [];
10198
- /**
10199
- * Обработчик изменения значения поля ввода.
10200
- */
10201
- this.onChange = noop$1;
10202
- /**
10203
- * Обработчик касания поля ввода.
10204
- */
10205
- this.onTouched = noop$1;
10206
- afterNextRender(() => {
10207
- this.load();
10208
- });
10209
- this.destroyRef.onDestroy(() => {
10210
- this.destroyWidget();
10211
- });
10212
- }
10213
- /** @inheritDoc */
10214
- writeValue(token) {
10215
- const { api, widgetId } = this;
10216
- if (!token && api && widgetId !== undefined) {
10217
- this.ngZone.runOutsideAngular(() => {
10218
- api.reset(widgetId);
10219
- });
10220
- }
10221
- }
10222
- /** @inheritDoc */
10223
- registerOnChange(onChange) {
10224
- this.onChange = onChange;
10225
- }
10226
- /** @inheritDoc */
10227
- registerOnTouched(onTouched) {
10228
- this.onTouched = onTouched;
10229
- }
10230
- /**
10231
- * Повторяет загрузку капчи после ошибки.
10232
- */
10233
- retry() {
10234
- this.hasError.set(false);
10235
- this.load();
10236
- }
10237
- /**
10238
- * Загружает API Yandex SmartCaptcha и отрисовывает виджет (API приходит вне зоны Angular). При ошибке загрузки или отрисовки показывает сообщение.
10239
- */
10240
- load() {
10241
- this.loader.api$
10242
- .pipe(tap((api) => {
10243
- this.render(api);
10244
- }), takeUntilDestroyed(this.destroyRef))
10245
- .subscribe({
10246
- error: () => {
10247
- this.showError();
10248
- },
10249
- });
10250
- }
10251
- /**
10252
- * Отрисовывает виджет и подписывается на его события.
10253
- *
10254
- * @param api API Yandex SmartCaptcha.
10255
- */
10256
- render(api) {
10257
- const widgetId = api.render(this.container().nativeElement, { sitekey: this.settings.sitekey, hl: this.settings.language });
10258
- this.api = api;
10259
- this.widgetId = widgetId;
10260
- this.unsubscribers = [
10261
- api.subscribe(widgetId, 'success', (token) => {
10262
- this.updateValue(isString(token) ? token : null);
10263
- }),
10264
- api.subscribe(widgetId, 'token-expired', () => {
10265
- this.updateValue(null);
10266
- api.reset(widgetId);
10267
- }),
10268
- api.subscribe(widgetId, 'javascript-error', () => {
10269
- this.showError();
10270
- }),
10271
- ];
10272
- }
10273
- /**
10274
- * Передаёт форме новое значение токена.
10275
- *
10276
- * @param token Токен прохождения проверки.
10277
- */
10278
- updateValue(token) {
10279
- this.ngZone.run(() => {
10280
- this.onChange(token);
10281
- this.onTouched();
10282
- });
10283
- }
10284
- /**
10285
- * Удаляет виджет, очищает токен и показывает сообщение об ошибке.
10286
- */
10287
- showError() {
10288
- this.destroyWidget();
10289
- this.ngZone.run(() => {
10290
- this.hasError.set(true);
10291
- this.onChange(null);
10292
- });
10293
- }
10294
- /**
10295
- * Удаляет виджет вместе с созданными им элементами и обработчиками.
10296
- */
10297
- destroyWidget() {
10298
- this.unsubscribers.forEach((unsubscribe) => {
10299
- unsubscribe();
10300
- });
10301
- this.unsubscribers = [];
10302
- const { api, widgetId } = this;
10303
- if (api && widgetId !== undefined) {
10304
- this.ngZone.runOutsideAngular(() => {
10305
- api.destroy(widgetId);
10306
- });
10307
- }
10308
- this.api = undefined;
10309
- this.widgetId = undefined;
10310
- }
10311
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScSmartCaptchaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
10312
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScSmartCaptchaComponent, isStandalone: true, selector: "sc-smart-captcha", providers: [tuiProvide(NG_VALUE_ACCESSOR, ScSmartCaptchaComponent, true)], viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n #container\n class=\"min-h-[7.375rem]\"\n [class.hidden]=\"hasError()\"\n></div>\n@if (hasError()) {\n <p\n role=\"alert\"\n class=\"text-body-s text-tui-text-negative\"\n >\n \u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0443 \u00AB\u042F \u043D\u0435 \u0440\u043E\u0431\u043E\u0442\u00BB.\n <button\n tuiLink\n type=\"button\"\n (click)=\"retry()\"\n >\n \u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C\n </button>\n </p>\n}\n", dependencies: [{ kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
10313
- }
10314
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScSmartCaptchaComponent, decorators: [{
10315
- type: Component,
10316
- args: [{ standalone: true, selector: 'sc-smart-captcha', imports: [TuiLink], providers: [tuiProvide(NG_VALUE_ACCESSOR, ScSmartCaptchaComponent, true)], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n #container\n class=\"min-h-[7.375rem]\"\n [class.hidden]=\"hasError()\"\n></div>\n@if (hasError()) {\n <p\n role=\"alert\"\n class=\"text-body-s text-tui-text-negative\"\n >\n \u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0443 \u00AB\u042F \u043D\u0435 \u0440\u043E\u0431\u043E\u0442\u00BB.\n <button\n tuiLink\n type=\"button\"\n (click)=\"retry()\"\n >\n \u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C\n </button>\n </p>\n}\n" }]
10317
- }], ctorParameters: () => [], propDecorators: { container: [{ type: i0.ViewChild, args: ['container', { isSignal: true }] }] } });
10318
-
10319
11791
  /**
10320
11792
  * Компонент формы обратной связи.
10321
11793
  */
@@ -10387,7 +11859,7 @@ class ScFeedbackFormComponent {
10387
11859
  }
10388
11860
  }));
10389
11861
  /**
10390
- * Поле ввода токена капчи, имя `recaptcha` задано API.
11862
+ * Поле ввода для recaptcha.
10391
11863
  */
10392
11864
  this.recaptchaControl = new FormControl(null, Validators.required);
10393
11865
  /**
@@ -10429,10 +11901,8 @@ class ScFeedbackFormComponent {
10429
11901
  }),
10430
11902
  // eslint-disable-next-line rxjs/no-implicit-any-catch
10431
11903
  catchError((error) => {
10432
- // Токен капчи одноразовый: для повторной отправки нужна новая проверка.
10433
- this.recaptchaControl.reset();
10434
11904
  this.form.markAllAsTouched();
10435
- const { errors, message } = (error.error ?? {});
11905
+ const { errors, message } = error.error;
10436
11906
  if (errors) {
10437
11907
  Object.keys(errors).forEach((key) => {
10438
11908
  const control = this.form.get(key);
@@ -10469,7 +11939,17 @@ class ScFeedbackFormComponent {
10469
11939
  * Список стран.
10470
11940
  */
10471
11941
  this.countries = getCountries();
10472
- merge(this.accepted$, this.user$, this.loadedFile.valueChanges.pipe(tap((files) => {
11942
+ /**
11943
+ * Это решение ошибки #4940, было @see [предложено](https://github.com/DethAriel/ng-recaptcha/issues/123#issuecomment-426112101) автором {@link RecaptchaComponent}.
11944
+ */
11945
+ RecaptchaComponent.prototype.ngOnDestroy = function () {
11946
+ // eslint-disable-next-line @typescript-eslint/dot-notation
11947
+ if (this['subscription']) {
11948
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @typescript-eslint/dot-notation
11949
+ this['subscription'].unsubscribe();
11950
+ }
11951
+ };
11952
+ merge(this.user$, this.accepted$.pipe(tap((files) => {
10473
11953
  this.form.controls.files.reset([]);
10474
11954
  this.onUploadFile(files);
10475
11955
  })))
@@ -10592,7 +12072,7 @@ class ScFeedbackFormComponent {
10592
12072
  return ScPhoneService.isValidPhoneNumberForMessenger(value);
10593
12073
  }
10594
12074
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: ScFeedbackFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
10595
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScFeedbackFormComponent, isStandalone: true, selector: "sc-feedback-form", inputs: { slugInput: { classPropertyName: "slugInput", publicName: "slug", isSignal: true, isRequired: false, transformFunction: null }, fieldsInput: { classPropertyName: "fieldsInput", publicName: "fields", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clickOffer: "clickOffer", sendSuccess: "sendSuccess" }, ngImport: i0, template: "@let fieldsList = fields();\n@if (fieldsList.length > 0) {\n <form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit.next()\"\n class=\"flex flex-col justify-between gap-4\"\n >\n <!-- \u0424\u0418\u041E -->\n @if (fieldsList.includes('name')) {\n <label tuiLabel>\n \u0424\u0418\u041E\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n placeholder=\"\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0412\u0430\u0448\u0438 \u0424.\u0418.\u041E.\"\n />\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n }\n <!-- \u0422\u0435\u043B\u0435\u0444\u043E\u043D -->\n @if (fieldsList.includes('phone')) {\n <label tuiLabel>\n \u0422\u0435\u043B\u0435\u0444\u043E\u043D\n <tui-textfield>\n <input\n formControlName=\"phone\"\n tuiInputPhoneInternational\n [countrySearch]=\"true\"\n [countries]=\"(countries | tuiSortCountries) || []\"\n autocomplete=\"phone\"\n placeholder=\"\u0422\u0435\u043B\u0435\u0444\u043E\u043D\"\n />\n </tui-textfield>\n <tui-error formControlName=\"phone\" />\n </label>\n @if (fieldsList.includes('isShouldUseMessenger') && form.controls.phone.value && isValidPhoneNumberForMessenger(form.controls.phone.value)) {\n <label tuiLabel>\n <input\n formControlName=\"isShouldUseMessenger\"\n tuiCheckbox\n type=\"checkbox\"\n />\n <span tuiTitle> \u041D\u0430\u043F\u0438\u0441\u0430\u0442\u044C \u0432 \u043C\u0435\u0441\u0441\u0435\u043D\u0434\u0436\u0435\u0440\u0430\u0445, \u0430 \u043D\u0435 \u0437\u0432\u043E\u043D\u0438\u0442\u044C </span>\n </label>\n }\n }\n <!-- \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B -->\n @if (fieldsList.includes('email')) {\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"email\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.email\"\n />\n </tui-textfield>\n <tui-error formControlName=\"email\" />\n </label>\n }\n <!-- \u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439 -->\n @if (fieldsList.includes('message')) {\n <label tuiLabel>\n \u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439\n <tui-textfield>\n <textarea\n tuiTextarea\n formControlName=\"message\"\n [min]=\"3\"\n [max]=\"6\"\n placeholder=\"\u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439\"\n ></textarea>\n </tui-textfield>\n <tui-error formControlName=\"message\" />\n </label>\n }\n <!-- \u0424\u0430\u0439\u043B\u044B -->\n @if (fieldsList.includes('files')) {\n <div class=\"flex flex-col gap-1\">\n <label\n tuiInputFiles\n class=\"self-start !min-h-0 !p-0\"\n >\n <input\n #validator=\"tuiInputFilesValidator\"\n accept=\".doc,.docx,.pdf,image/*\"\n tuiInputFiles\n [formControl]=\"loadedFile\"\n [multiple]=\"true\"\n (reject)=\"onReject($event)\"\n class=\"opacity-0\"\n />\n <ng-template>\n <button\n tuiButton\n type=\"button\"\n tabindex=\"-1\"\n appearance=\"secondary\"\n size=\"m\"\n iconStart=\"@tui.paperclip\"\n >\n \u041F\u0440\u0438\u043A\u0440\u0435\u043F\u0438\u0442\u044C \u0444\u0430\u0439\u043B\n </button>\n </ng-template>\n </label>\n @if (loadedFile.invalid) {\n <tui-error\n [order]=\"['maxLength']\"\n [formControl]=\"loadedFile\"\n />\n }\n @let accepted = accepted$ | async;\n @if (accepted?.length || rejected.length) {\n <tui-files class=\"tui-space_top-1\">\n @for (file of accepted; track file) {\n <tui-file\n [file]=\"file\"\n (remove)=\"onRemove(file)\"\n />\n }\n @for (file of rejected; track file) {\n <tui-file\n state=\"error\"\n [file]=\"(file | tuiFileRejected: validator | async) || file\"\n (remove)=\"onRemove(file)\"\n />\n }\n </tui-files>\n }\n </div>\n }\n <!-- \u041A\u0430\u043F\u0447\u0430 -->\n @if (form.get('recaptcha'); as recaptcha) {\n <div\n class=\"mb-3 max-h-[7.5rem] overflow-hidden duration-500\"\n [ngClass]=\"{ '!max-h-0 !-m-2': recaptcha.valid }\"\n [attr.inert]=\"recaptcha.valid ? '' : null\"\n >\n <sc-smart-captcha formControlName=\"recaptcha\" />\n </div>\n @if (recaptcha.getError('serverResponse'); as serverErrors) {\n <tui-error [error]=\"serverErrors.join(' ')\" />\n }\n }\n <!-- \u042D\u043B\u0435\u043C\u0435\u043D\u0442\u044B \u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F -->\n <div class=\"flex flex-wrap items-center gap-3\">\n <button\n tuiButton\n [disabled]=\"form.invalid\"\n [loading]=\"!!(loading$ | async)\"\n type=\"submit\"\n iconStart=\"@tui.sc.send\"\n class=\"self-center\"\n >\n \u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C\n </button>\n <div class=\"grow basis-60 text-body-s\">\n \u041D\u0430\u0436\u0438\u043C\u0430\u044F \u043D\u0430 \u043A\u043D\u043E\u043F\u043A\u0443, \u0432\u044B \u0441\u043E\u0433\u043B\u0430\u0448\u0430\u0435\u0442\u0435\u0441\u044C \u0441\n <button\n tuiLink\n [style.text-decoration-line]=\"'underline'\"\n type=\"button\"\n (click)=\"context?.data?.onClickOfferHandler(); clickOffer.emit()\"\n >\n \u041F\u043E\u043B\u0438\u0442\u0438\u043A\u043E\u0439 \u043A\u043E\u043D\u0444\u0438\u0434\u0435\u043D\u0446\u0438\u0430\u043B\u044C\u043D\u043E\u0441\u0442\u0438\n </button>\n </div>\n </div>\n </form>\n}\n", dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i2.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i2.TuiErrorDirective, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName], tui-error[formArray]", inputs: ["order"] }, { kind: "component", type: ScSuggestionFieldComponent, selector: "sc-suggestion-field", inputs: ["type"], outputs: ["selectedClick"] }, { kind: "directive", type: i2$3.TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i3$1.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "directive", type: i2.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "invalid", "focused", "state"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }, { kind: "component", type: ScSmartCaptchaComponent, selector: "sc-smart-captcha" }, { kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]" }, { kind: "component", type: i1$1.TuiTextareaComponent, selector: "textarea[tuiTextarea]", inputs: ["min", "max", "content"] }, { kind: "component", type: TuiCheckbox, selector: "input[type=\"checkbox\"][tuiCheckbox]" }, { kind: "directive", type: TuiTitle, selector: "[tuiTitle]", inputs: ["tuiTitle"] }, { kind: "component", type: i1$1.TuiFile, selector: "tui-file,a[tuiFile],button[tuiFile]", inputs: ["file", "state", "size", "showDelete", "showSize", "leftContent"], outputs: ["remove"] }, { kind: "component", type: i1$1.TuiInputFiles, selector: "label[tuiInputFiles]", inputs: ["tuiInputFiles"] }, { kind: "component", type: i1$1.TuiFilesComponent, selector: "tui-files", inputs: ["max", "expanded"], outputs: ["expandedChange"] }, { kind: "directive", type: i1$1.TuiInputFilesDirective, selector: "input[tuiInputFiles]", outputs: ["reject"] }, { kind: "component", type: i1$1.TuiInputPhoneInternationalComponent, selector: "input[tuiInputPhoneInternational]", inputs: ["countrySearch", "countryIsoCode", "countries"], outputs: ["countryIsoCodeChange"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: i1$1.TuiFileRejectedPipe, name: "tuiFileRejected" }, { kind: "pipe", type: TuiSortCountriesPipe, name: "tuiSortCountries" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
12075
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.16", type: ScFeedbackFormComponent, isStandalone: true, selector: "sc-feedback-form", inputs: { slugInput: { classPropertyName: "slugInput", publicName: "slug", isSignal: true, isRequired: false, transformFunction: null }, fieldsInput: { classPropertyName: "fieldsInput", publicName: "fields", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clickOffer: "clickOffer", sendSuccess: "sendSuccess" }, ngImport: i0, template: "@let fieldsList = fields();\n@if (fieldsList.length > 0) {\n <form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit.next()\"\n class=\"flex flex-col justify-between gap-4\"\n >\n <!-- \u0424\u0418\u041E -->\n @if (fieldsList.includes('name')) {\n <label tuiLabel>\n \u0424\u0418\u041E\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n placeholder=\"\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0412\u0430\u0448\u0438 \u0424.\u0418.\u041E.\"\n />\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n }\n <!-- \u0422\u0435\u043B\u0435\u0444\u043E\u043D -->\n @if (fieldsList.includes('phone')) {\n <label tuiLabel>\n \u0422\u0435\u043B\u0435\u0444\u043E\u043D\n <tui-textfield>\n <input\n formControlName=\"phone\"\n tuiInputPhoneInternational\n [countrySearch]=\"true\"\n [countries]=\"(countries | tuiSortCountries) || []\"\n autocomplete=\"phone\"\n placeholder=\"\u0422\u0435\u043B\u0435\u0444\u043E\u043D\"\n />\n </tui-textfield>\n <tui-error formControlName=\"phone\" />\n </label>\n @if (fieldsList.includes('isShouldUseMessenger') && form.controls.phone.value && isValidPhoneNumberForMessenger(form.controls.phone.value)) {\n <label tuiLabel>\n <input\n formControlName=\"isShouldUseMessenger\"\n tuiCheckbox\n type=\"checkbox\"\n />\n <span tuiTitle> \u041D\u0430\u043F\u0438\u0441\u0430\u0442\u044C \u0432 \u043C\u0435\u0441\u0441\u0435\u043D\u0434\u0436\u0435\u0440\u0430\u0445, \u0430 \u043D\u0435 \u0437\u0432\u043E\u043D\u0438\u0442\u044C </span>\n </label>\n }\n }\n <!-- \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B -->\n @if (fieldsList.includes('email')) {\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"email\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.email\"\n />\n </tui-textfield>\n <tui-error formControlName=\"email\" />\n </label>\n }\n <!-- \u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439 -->\n @if (fieldsList.includes('message')) {\n <label tuiLabel>\n \u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439\n <tui-textfield>\n <textarea\n tuiTextarea\n formControlName=\"message\"\n [min]=\"3\"\n [max]=\"6\"\n placeholder=\"\u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439\"\n ></textarea>\n </tui-textfield>\n <tui-error formControlName=\"message\" />\n </label>\n }\n <!-- \u0424\u0430\u0439\u043B\u044B -->\n @if (fieldsList.includes('files')) {\n <div class=\"flex flex-col gap-1\">\n <label\n tuiInputFiles\n class=\"self-start !min-h-0 !p-0\"\n >\n <input\n #validator=\"tuiInputFilesValidator\"\n accept=\".doc,.docx,.pdf,image/*\"\n tuiInputFiles\n [formControl]=\"loadedFile\"\n [multiple]=\"true\"\n (reject)=\"onReject($event)\"\n class=\"opacity-0\"\n />\n <ng-template>\n <button\n tuiButton\n type=\"button\"\n tabindex=\"-1\"\n appearance=\"secondary\"\n size=\"m\"\n iconStart=\"@tui.paperclip\"\n >\n \u041F\u0440\u0438\u043A\u0440\u0435\u043F\u0438\u0442\u044C \u0444\u0430\u0439\u043B\n </button>\n </ng-template>\n </label>\n @if (loadedFile.invalid) {\n <tui-error\n [order]=\"['maxLength']\"\n [formControl]=\"loadedFile\"\n />\n }\n @let accepted = accepted$ | async;\n @if (accepted?.length || rejected.length) {\n <tui-files class=\"tui-space_top-1\">\n @for (file of accepted; track file) {\n <tui-file\n [file]=\"file\"\n (remove)=\"onRemove(file)\"\n />\n }\n @for (file of rejected; track file) {\n <tui-file\n state=\"error\"\n [file]=\"(file | tuiFileRejected: validator | async) || file\"\n (remove)=\"onRemove(file)\"\n />\n }\n </tui-files>\n }\n </div>\n }\n <!-- recaptcha -->\n @if (form.get('recaptcha')) {\n <div\n class=\"mb-3 max-h-20 overflow-hidden duration-500\"\n [ngClass]=\"{ '!max-h-0 !-m-2': form.get('recaptcha')?.valid }\"\n >\n <re-captcha formControlName=\"recaptcha\" />\n </div>\n }\n <!-- \u042D\u043B\u0435\u043C\u0435\u043D\u0442\u044B \u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F -->\n <div class=\"flex flex-wrap items-center gap-3\">\n <button\n tuiButton\n [disabled]=\"form.invalid\"\n [loading]=\"!!(loading$ | async)\"\n type=\"submit\"\n iconStart=\"@tui.sc.send\"\n class=\"self-center\"\n >\n \u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C\n </button>\n <div class=\"grow basis-60 text-body-s\">\n \u041D\u0430\u0436\u0438\u043C\u0430\u044F \u043D\u0430 \u043A\u043D\u043E\u043F\u043A\u0443, \u0432\u044B \u0441\u043E\u0433\u043B\u0430\u0448\u0430\u0435\u0442\u0435\u0441\u044C \u0441\n <button\n tuiLink\n [style.text-decoration-line]=\"'underline'\"\n type=\"button\"\n (click)=\"context?.data?.onClickOfferHandler(); clickOffer.emit()\"\n >\n \u041F\u043E\u043B\u0438\u0442\u0438\u043A\u043E\u0439 \u043A\u043E\u043D\u0444\u0438\u0434\u0435\u043D\u0446\u0438\u0430\u043B\u044C\u043D\u043E\u0441\u0442\u0438\n </button>\n </div>\n </div>\n </form>\n}\n", dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i2.TuiErrorComponent, selector: "tui-error", inputs: ["error"] }, { kind: "directive", type: i2.TuiErrorDirective, selector: "tui-error[ngModel], tui-error[formControlName], tui-error[formControl], tui-error[formGroup], tui-error[formGroupName], tui-error[formArrayName], tui-error[formArray]", inputs: ["order"] }, { kind: "component", type: ScSuggestionFieldComponent, selector: "sc-suggestion-field", inputs: ["type"], outputs: ["selectedClick"] }, { kind: "directive", type: i2$3.TuiLabel, selector: "label[tuiLabel]" }, { kind: "component", type: i3$1.TuiTextfieldComponent, selector: "tui-textfield:not([multi])", inputs: ["content", "filler"] }, { kind: "directive", type: i3.TuiDropdownContent, selector: "ng-template[tuiDropdown]" }, { kind: "directive", type: i2.TuiInputDirective, selector: "input[tuiInput]", inputs: ["readOnly", "invalid", "focused", "state"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiButtonLoading, selector: "[tuiButton][loading],[tuiIconButton][loading]", inputs: ["size", "loading"] }, { kind: "ngmodule", type: RecaptchaFormsModule }, { kind: "directive", type: i6$2.RecaptchaValueAccessorDirective, selector: "re-captcha[formControlName],re-captcha[formControl],re-captcha[ngModel]" }, { kind: "ngmodule", type: RecaptchaModule }, { kind: "component", type: i6$2.RecaptchaComponent, selector: "re-captcha", inputs: ["id", "siteKey", "theme", "type", "size", "tabIndex", "badge", "errorMode"], outputs: ["resolved", "error", "errored"], exportAs: ["reCaptcha"] }, { kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]" }, { kind: "component", type: i1$1.TuiTextareaComponent, selector: "textarea[tuiTextarea]", inputs: ["min", "max", "content"] }, { kind: "component", type: TuiCheckbox, selector: "input[type=\"checkbox\"][tuiCheckbox]" }, { kind: "directive", type: TuiTitle, selector: "[tuiTitle]", inputs: ["tuiTitle"] }, { kind: "component", type: i1$1.TuiFile, selector: "tui-file,a[tuiFile],button[tuiFile]", inputs: ["file", "state", "size", "showDelete", "showSize", "leftContent"], outputs: ["remove"] }, { kind: "component", type: i1$1.TuiInputFiles, selector: "label[tuiInputFiles]", inputs: ["tuiInputFiles"] }, { kind: "component", type: i1$1.TuiFilesComponent, selector: "tui-files", inputs: ["max", "expanded"], outputs: ["expandedChange"] }, { kind: "directive", type: i1$1.TuiInputFilesDirective, selector: "input[tuiInputFiles]", outputs: ["reject"] }, { kind: "component", type: i1$1.TuiInputPhoneInternationalComponent, selector: "input[tuiInputPhoneInternational]", inputs: ["countrySearch", "countryIsoCode", "countries"], outputs: ["countryIsoCodeChange"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: i1$1.TuiFileRejectedPipe, name: "tuiFileRejected" }, { kind: "pipe", type: TuiSortCountriesPipe, name: "tuiSortCountries" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
10596
12076
  }
10597
12077
  __decorate([
10598
12078
  tuiPure
@@ -10610,7 +12090,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
10610
12090
  TuiButton,
10611
12091
  TuiButtonLoading,
10612
12092
  TuiLabel,
10613
- ScSmartCaptchaComponent,
12093
+ RecaptchaFormsModule,
12094
+ RecaptchaModule,
10614
12095
  TuiLink,
10615
12096
  TuiTextarea,
10616
12097
  TuiCheckbox,
@@ -10619,7 +12100,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
10619
12100
  TuiInputPhoneInternational,
10620
12101
  ...TuiInput,
10621
12102
  TuiSortCountriesPipe,
10622
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let fieldsList = fields();\n@if (fieldsList.length > 0) {\n <form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit.next()\"\n class=\"flex flex-col justify-between gap-4\"\n >\n <!-- \u0424\u0418\u041E -->\n @if (fieldsList.includes('name')) {\n <label tuiLabel>\n \u0424\u0418\u041E\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n placeholder=\"\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0412\u0430\u0448\u0438 \u0424.\u0418.\u041E.\"\n />\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n }\n <!-- \u0422\u0435\u043B\u0435\u0444\u043E\u043D -->\n @if (fieldsList.includes('phone')) {\n <label tuiLabel>\n \u0422\u0435\u043B\u0435\u0444\u043E\u043D\n <tui-textfield>\n <input\n formControlName=\"phone\"\n tuiInputPhoneInternational\n [countrySearch]=\"true\"\n [countries]=\"(countries | tuiSortCountries) || []\"\n autocomplete=\"phone\"\n placeholder=\"\u0422\u0435\u043B\u0435\u0444\u043E\u043D\"\n />\n </tui-textfield>\n <tui-error formControlName=\"phone\" />\n </label>\n @if (fieldsList.includes('isShouldUseMessenger') && form.controls.phone.value && isValidPhoneNumberForMessenger(form.controls.phone.value)) {\n <label tuiLabel>\n <input\n formControlName=\"isShouldUseMessenger\"\n tuiCheckbox\n type=\"checkbox\"\n />\n <span tuiTitle> \u041D\u0430\u043F\u0438\u0441\u0430\u0442\u044C \u0432 \u043C\u0435\u0441\u0441\u0435\u043D\u0434\u0436\u0435\u0440\u0430\u0445, \u0430 \u043D\u0435 \u0437\u0432\u043E\u043D\u0438\u0442\u044C </span>\n </label>\n }\n }\n <!-- \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B -->\n @if (fieldsList.includes('email')) {\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"email\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.email\"\n />\n </tui-textfield>\n <tui-error formControlName=\"email\" />\n </label>\n }\n <!-- \u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439 -->\n @if (fieldsList.includes('message')) {\n <label tuiLabel>\n \u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439\n <tui-textfield>\n <textarea\n tuiTextarea\n formControlName=\"message\"\n [min]=\"3\"\n [max]=\"6\"\n placeholder=\"\u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439\"\n ></textarea>\n </tui-textfield>\n <tui-error formControlName=\"message\" />\n </label>\n }\n <!-- \u0424\u0430\u0439\u043B\u044B -->\n @if (fieldsList.includes('files')) {\n <div class=\"flex flex-col gap-1\">\n <label\n tuiInputFiles\n class=\"self-start !min-h-0 !p-0\"\n >\n <input\n #validator=\"tuiInputFilesValidator\"\n accept=\".doc,.docx,.pdf,image/*\"\n tuiInputFiles\n [formControl]=\"loadedFile\"\n [multiple]=\"true\"\n (reject)=\"onReject($event)\"\n class=\"opacity-0\"\n />\n <ng-template>\n <button\n tuiButton\n type=\"button\"\n tabindex=\"-1\"\n appearance=\"secondary\"\n size=\"m\"\n iconStart=\"@tui.paperclip\"\n >\n \u041F\u0440\u0438\u043A\u0440\u0435\u043F\u0438\u0442\u044C \u0444\u0430\u0439\u043B\n </button>\n </ng-template>\n </label>\n @if (loadedFile.invalid) {\n <tui-error\n [order]=\"['maxLength']\"\n [formControl]=\"loadedFile\"\n />\n }\n @let accepted = accepted$ | async;\n @if (accepted?.length || rejected.length) {\n <tui-files class=\"tui-space_top-1\">\n @for (file of accepted; track file) {\n <tui-file\n [file]=\"file\"\n (remove)=\"onRemove(file)\"\n />\n }\n @for (file of rejected; track file) {\n <tui-file\n state=\"error\"\n [file]=\"(file | tuiFileRejected: validator | async) || file\"\n (remove)=\"onRemove(file)\"\n />\n }\n </tui-files>\n }\n </div>\n }\n <!-- \u041A\u0430\u043F\u0447\u0430 -->\n @if (form.get('recaptcha'); as recaptcha) {\n <div\n class=\"mb-3 max-h-[7.5rem] overflow-hidden duration-500\"\n [ngClass]=\"{ '!max-h-0 !-m-2': recaptcha.valid }\"\n [attr.inert]=\"recaptcha.valid ? '' : null\"\n >\n <sc-smart-captcha formControlName=\"recaptcha\" />\n </div>\n @if (recaptcha.getError('serverResponse'); as serverErrors) {\n <tui-error [error]=\"serverErrors.join(' ')\" />\n }\n }\n <!-- \u042D\u043B\u0435\u043C\u0435\u043D\u0442\u044B \u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F -->\n <div class=\"flex flex-wrap items-center gap-3\">\n <button\n tuiButton\n [disabled]=\"form.invalid\"\n [loading]=\"!!(loading$ | async)\"\n type=\"submit\"\n iconStart=\"@tui.sc.send\"\n class=\"self-center\"\n >\n \u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C\n </button>\n <div class=\"grow basis-60 text-body-s\">\n \u041D\u0430\u0436\u0438\u043C\u0430\u044F \u043D\u0430 \u043A\u043D\u043E\u043F\u043A\u0443, \u0432\u044B \u0441\u043E\u0433\u043B\u0430\u0448\u0430\u0435\u0442\u0435\u0441\u044C \u0441\n <button\n tuiLink\n [style.text-decoration-line]=\"'underline'\"\n type=\"button\"\n (click)=\"context?.data?.onClickOfferHandler(); clickOffer.emit()\"\n >\n \u041F\u043E\u043B\u0438\u0442\u0438\u043A\u043E\u0439 \u043A\u043E\u043D\u0444\u0438\u0434\u0435\u043D\u0446\u0438\u0430\u043B\u044C\u043D\u043E\u0441\u0442\u0438\n </button>\n </div>\n </div>\n </form>\n}\n" }]
12103
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let fieldsList = fields();\n@if (fieldsList.length > 0) {\n <form\n [formGroup]=\"form\"\n (ngSubmit)=\"onSubmit.next()\"\n class=\"flex flex-col justify-between gap-4\"\n >\n <!-- \u0424\u0418\u041E -->\n @if (fieldsList.includes('name')) {\n <label tuiLabel>\n \u0424\u0418\u041E\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"name\"\n placeholder=\"\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0412\u0430\u0448\u0438 \u0424.\u0418.\u041E.\"\n />\n </tui-textfield>\n <tui-error formControlName=\"name\" />\n </label>\n }\n <!-- \u0422\u0435\u043B\u0435\u0444\u043E\u043D -->\n @if (fieldsList.includes('phone')) {\n <label tuiLabel>\n \u0422\u0435\u043B\u0435\u0444\u043E\u043D\n <tui-textfield>\n <input\n formControlName=\"phone\"\n tuiInputPhoneInternational\n [countrySearch]=\"true\"\n [countries]=\"(countries | tuiSortCountries) || []\"\n autocomplete=\"phone\"\n placeholder=\"\u0422\u0435\u043B\u0435\u0444\u043E\u043D\"\n />\n </tui-textfield>\n <tui-error formControlName=\"phone\" />\n </label>\n @if (fieldsList.includes('isShouldUseMessenger') && form.controls.phone.value && isValidPhoneNumberForMessenger(form.controls.phone.value)) {\n <label tuiLabel>\n <input\n formControlName=\"isShouldUseMessenger\"\n tuiCheckbox\n type=\"checkbox\"\n />\n <span tuiTitle> \u041D\u0430\u043F\u0438\u0441\u0430\u0442\u044C \u0432 \u043C\u0435\u0441\u0441\u0435\u043D\u0434\u0436\u0435\u0440\u0430\u0445, \u0430 \u043D\u0435 \u0437\u0432\u043E\u043D\u0438\u0442\u044C </span>\n </label>\n }\n }\n <!-- \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B -->\n @if (fieldsList.includes('email')) {\n <label tuiLabel>\n \u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\n <tui-textfield>\n <input\n tuiInput\n formControlName=\"email\"\n placeholder=\"\u0410\u0434\u0440\u0435\u0441 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u044B\"\n />\n <sc-suggestion-field\n *tuiDropdown\n [type]=\"suggestionType.email\"\n />\n </tui-textfield>\n <tui-error formControlName=\"email\" />\n </label>\n }\n <!-- \u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439 -->\n @if (fieldsList.includes('message')) {\n <label tuiLabel>\n \u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439\n <tui-textfield>\n <textarea\n tuiTextarea\n formControlName=\"message\"\n [min]=\"3\"\n [max]=\"6\"\n placeholder=\"\u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439\"\n ></textarea>\n </tui-textfield>\n <tui-error formControlName=\"message\" />\n </label>\n }\n <!-- \u0424\u0430\u0439\u043B\u044B -->\n @if (fieldsList.includes('files')) {\n <div class=\"flex flex-col gap-1\">\n <label\n tuiInputFiles\n class=\"self-start !min-h-0 !p-0\"\n >\n <input\n #validator=\"tuiInputFilesValidator\"\n accept=\".doc,.docx,.pdf,image/*\"\n tuiInputFiles\n [formControl]=\"loadedFile\"\n [multiple]=\"true\"\n (reject)=\"onReject($event)\"\n class=\"opacity-0\"\n />\n <ng-template>\n <button\n tuiButton\n type=\"button\"\n tabindex=\"-1\"\n appearance=\"secondary\"\n size=\"m\"\n iconStart=\"@tui.paperclip\"\n >\n \u041F\u0440\u0438\u043A\u0440\u0435\u043F\u0438\u0442\u044C \u0444\u0430\u0439\u043B\n </button>\n </ng-template>\n </label>\n @if (loadedFile.invalid) {\n <tui-error\n [order]=\"['maxLength']\"\n [formControl]=\"loadedFile\"\n />\n }\n @let accepted = accepted$ | async;\n @if (accepted?.length || rejected.length) {\n <tui-files class=\"tui-space_top-1\">\n @for (file of accepted; track file) {\n <tui-file\n [file]=\"file\"\n (remove)=\"onRemove(file)\"\n />\n }\n @for (file of rejected; track file) {\n <tui-file\n state=\"error\"\n [file]=\"(file | tuiFileRejected: validator | async) || file\"\n (remove)=\"onRemove(file)\"\n />\n }\n </tui-files>\n }\n </div>\n }\n <!-- recaptcha -->\n @if (form.get('recaptcha')) {\n <div\n class=\"mb-3 max-h-20 overflow-hidden duration-500\"\n [ngClass]=\"{ '!max-h-0 !-m-2': form.get('recaptcha')?.valid }\"\n >\n <re-captcha formControlName=\"recaptcha\" />\n </div>\n }\n <!-- \u042D\u043B\u0435\u043C\u0435\u043D\u0442\u044B \u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F -->\n <div class=\"flex flex-wrap items-center gap-3\">\n <button\n tuiButton\n [disabled]=\"form.invalid\"\n [loading]=\"!!(loading$ | async)\"\n type=\"submit\"\n iconStart=\"@tui.sc.send\"\n class=\"self-center\"\n >\n \u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C\n </button>\n <div class=\"grow basis-60 text-body-s\">\n \u041D\u0430\u0436\u0438\u043C\u0430\u044F \u043D\u0430 \u043A\u043D\u043E\u043F\u043A\u0443, \u0432\u044B \u0441\u043E\u0433\u043B\u0430\u0448\u0430\u0435\u0442\u0435\u0441\u044C \u0441\n <button\n tuiLink\n [style.text-decoration-line]=\"'underline'\"\n type=\"button\"\n (click)=\"context?.data?.onClickOfferHandler(); clickOffer.emit()\"\n >\n \u041F\u043E\u043B\u0438\u0442\u0438\u043A\u043E\u0439 \u043A\u043E\u043D\u0444\u0438\u0434\u0435\u043D\u0446\u0438\u0430\u043B\u044C\u043D\u043E\u0441\u0442\u0438\n </button>\n </div>\n </div>\n </form>\n}\n" }]
10623
12104
  }], ctorParameters: () => [], propDecorators: { slugInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "slug", required: false }] }], fieldsInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "fields", required: false }] }], clickOffer: [{ type: i0.Output, args: ["clickOffer"] }], sendSuccess: [{ type: i0.Output, args: ["sendSuccess"] }], isValidPhoneNumberForMessenger: [] } });
10624
12105
 
10625
12106
  /**
@@ -11105,5 +12586,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
11105
12586
  * Generated bundle index. Do not edit.
11106
12587
  */
11107
12588
 
11108
- export { AbstractScPriceCard, AuthMethod, CURRENT_COUNTRY_ID, CostWithDiscountComponent, FilesAndDocumentsComponent, FinishDateTimeTransformerDirective, IDLE_ITEM_STATE, IS_DEFAULT_COUNTRY, MAX_FILES_IN_FORM_INPUT, SC_ALLOW_SELECT_TERMINATED, SC_BANNER_DURATION, SC_CATALOG_PRODUCTS_FILTERS, SC_CATALOG_SHOW_PRODUCTS_RECURSIVELY, SC_DATE_FORMATTER, SC_DEBOUNCE_TIME_DEFAULT, SC_DIALOG_SERVICE_TOKEN, SC_ERROR_CHANGE_HANDLER, SC_FAQ_GROUP_QUERY_PARAM, SC_FAQ_QUESTION_ANCHOR_PREFIX, SC_HELP_NOTIFICATION_CLOSE, SC_HELP_NOTIFICATION_LIMIT, SC_HIDDEN_PRINT_ELEMENTS, SC_MANAGER_QR_HANDLER, SC_NOTIFY_WHEN_IN_STOCK_REQUIRED_FIELDS, SC_ORDER_FORM_CONFIG, SC_ORDER_OPTIONS, SC_PAGE_SIZE_OPTIONS$1 as SC_PAGE_SIZE_OPTIONS, SC_SHOW_HELP_NOTIFICATION_IN_PHONE_INPUT, SC_SMART_CAPTCHA_LOAD_TIMEOUT, SC_SMART_CAPTCHA_SETTINGS, SC_USER_CITY_INFO, SC_USER_INFO, SC_USER_PROVIDERS, SC_VERIFICATION_CODE_TIMEOUT, ScAccordionComponent, ScAccordionContentDirective, ScAddContactDialogComponent, ScAddContragentBankAccountsDialogComponent, ScAddContragentDialogComponent, ScAddDeliveryAddressDialogComponent, ScAddOrEditingCartItemDialogComponent, ScAddOrEditingCartItemFormComponent, ScAddressesSelectionFieldComponent, ScBannerComponent, ScBrandsListComponent, ScCartAddProductsFromCsvDialogComponent, ScCatalogFilterCollapsibleComponent, ScCatalogFiltersComponent, ScCategoryCardComponent, ScContactsAccordionComponent, ScContragentsAccordionComponent, ScContragentsAccordionItemComponent, ScDeliveryAddressAccordionComponent, ScDeliveryAddressAccordionItemComponent, ScDownloadPriceListComponent, ScDraftComponent, ScEmailLinkDirective, ScErrorBlockStatusComponent, ScErrorHandlerComponent, ScFavoriteButtonComponent, ScFeedbackFormComponent, ScFocusFirstInvalidFieldDirective, ScFormatDatePipe, ScFrequentlyAskedQuestionsComponent, ScFrequentlyAskedQuestionsGroupSelectorComponent, ScFrequentlyAskedQuestionsWithGroupsComponent, ScGratitudeComponent, ScHelpNotificationService, ScHoverImageCarouselComponent, ScInputQuantityComponent, ScLinks, ScManagerCardComponent, ScManagerCardPushComponent, ScNewContactFormComponent, ScNewContragentBankAccountsFormComponent, ScNewContragentFormComponent, ScNewOrderItemsComponent, ScNewsCardComponent, ScNewsCardSkeletonComponent, ScNewsListComponent, ScNextInputFocusDirective, ScNoindexDirective, ScNoindexWrapperComponent, ScNotifyWhenInStockDialogComponent, ScOrderAccessorDirective, ScOrderFormComponent, ScOrderItemComponent, ScOrderItemsListByStockComponent, ScOrderItemsListComponent, ScOrderItemsListWithActionsComponent, ScPaginationLinksComponent, ScPaymentStatusComponent, ScPersonalDataProcessingPolicyComponent, ScPhoneFormatPipe, ScPreviewSampleComponent, ScPreviewSamplesMosquitoComponent, ScPriceCardComponent, ScPriceCardInlineComponent, ScPriceHistoryComponent, ScPriceListPaginationComponent, ScPriceWarehouseStockComponent, ScPrintDirective, ScPrintService, ScPrivacyPolicyComponent, ScProductInAllWarehousesPipe, ScProfileAccordionsContentComponent, ScPublicOfferComponent, ScQRCodeDialogComponent, ScResetUserPasswordComponent, ScResourcePreviewComponent, ScSandwichComponent, ScSandwichM2Component, ScSandwichM2SkeletonComponent, ScSandwichSkeletonComponent, ScScriptsService, ScSelectOnFocusinDirective, ScSeoTagsComponent, ScShareButtonComponent, ScShareDialogComponent, ScShareMessengersLinksComponent, ScShareService, ScSignInFormByEmailComponent, ScSignInFormByPhoneComponent, ScSignInFormComponent, ScSignUpFormComponent, ScSimpleSignUpFormComponent, ScSmartCaptchaComponent, ScSmartCaptchaLoaderService, ScSuggestionFieldComponent, ScTelLinkDirective, ScTerminalLinkDirective, ScUpdateUserInfoDialogComponent, ScUserManagersComponent, ScUserPhoneApproveDialogComponent, ScVerificationPhoneCheckFormComponent, TreeDirective, TreeIconService, TreeLoaderService, TreeTopDirective, phoneValidator, scAtLeastOneRequiredValidator, scBicValidator, scClientUiIconsName, scCorrespondentAccountValidator, scGetCurrentRoute, scGetFaqGroupQueryParams, scGetFaqQuestionAnchor, scGetFaqQuestionIdFromAnchor, scPasswordConfirmMatchingValidator, stepValidator, tuiDateValueTransformerDefaultProvider };
12589
+ export { AbstractScPriceCard, AuthMethod, CURRENT_COUNTRY_ID, CostWithDiscountComponent, FilesAndDocumentsComponent, FinishDateTimeTransformerDirective, IDLE_ITEM_STATE, IS_DEFAULT_COUNTRY, MAX_FILES_IN_FORM_INPUT, SC_ALLOW_SELECT_TERMINATED, SC_BANNER_DURATION, SC_BLOCK_INCOMPLETE_ADDRESS, SC_CATALOG_FILTER_PREVIEWS, SC_CATALOG_PRODUCTS_FILTERS, SC_CATALOG_SHOW_PRODUCTS_RECURSIVELY, SC_DATE_FORMATTER, SC_DEBOUNCE_TIME_DEFAULT, SC_DIALOG_SERVICE_TOKEN, SC_ERROR_CHANGE_HANDLER, SC_FAQ_GROUP_QUERY_PARAM, SC_FAQ_QUESTION_ANCHOR_PREFIX, SC_HELP_NOTIFICATION_CLOSE, SC_HELP_NOTIFICATION_LIMIT, SC_HIDDEN_PRINT_ELEMENTS, SC_MANAGER_QR_HANDLER, SC_NOTIFY_WHEN_IN_STOCK_REQUIRED_FIELDS, SC_ORDER_FORM_CONFIG, SC_ORDER_OPTIONS, SC_PAGE_SIZE_OPTIONS$1 as SC_PAGE_SIZE_OPTIONS, SC_SHOW_HELP_NOTIFICATION_IN_PHONE_INPUT, SC_USER_CITY_INFO, SC_USER_INFO, SC_USER_PROVIDERS, SC_VERIFICATION_CODE_TIMEOUT, ScAccordionComponent, ScAccordionContentDirective, ScAddContactDialogComponent, ScAddContragentBankAccountsDialogComponent, ScAddContragentDialogComponent, ScAddDeliveryAddressDialogComponent, ScAddOrEditingCartItemDialogComponent, ScAddOrEditingCartItemFormComponent, ScAddressQualityDirective, ScAddressQualityService, ScAddressesSelectionFieldComponent, ScBannerComponent, ScBrandsListComponent, ScCartAddProductsFromCsvDialogComponent, ScCatalogFilterCollapsibleComponent, ScCatalogFiltersComponent, ScCategoryCardComponent, ScConfirmAlertComponent, ScContactsAccordionComponent, ScContragentsAccordionComponent, ScContragentsAccordionItemComponent, ScDeliveryAddressAccordionComponent, ScDeliveryAddressAccordionItemComponent, ScDownloadPriceListComponent, ScDraftComponent, ScDraftExpirationClockService, ScDraftListHelper, ScDraftListUpdatesService, ScEmailLinkDirective, ScErrorBlockStatusComponent, ScErrorHandlerComponent, ScFavoriteButtonComponent, ScFeedbackFormComponent, ScFocusFirstInvalidFieldDirective, ScFormatDatePipe, ScFrequentlyAskedQuestionsComponent, ScFrequentlyAskedQuestionsGroupSelectorComponent, ScFrequentlyAskedQuestionsWithGroupsComponent, ScGratitudeComponent, ScHelpNotificationService, ScHoverImageCarouselComponent, ScInputQuantityComponent, ScLinks, ScManagerCardComponent, ScManagerCardPushComponent, ScNewContactFormComponent, ScNewContragentBankAccountsFormComponent, ScNewContragentFormComponent, ScNewOrderItemsComponent, ScNewsCardComponent, ScNewsCardSkeletonComponent, ScNewsListComponent, ScNextInputFocusDirective, ScNoindexDirective, ScNoindexWrapperComponent, ScNotifyWhenInStockDialogComponent, ScOrderAccessorDirective, ScOrderFormComponent, ScOrderItemComponent, ScOrderItemsListByStockComponent, ScOrderItemsListComponent, ScOrderItemsListWithActionsComponent, ScPaginationLinksComponent, ScPaymentStatusComponent, ScPersonalDataProcessingPolicyComponent, ScPhoneFormatPipe, ScPreviewSampleComponent, ScPreviewSamplesMosquitoComponent, ScPriceCardComponent, ScPriceCardInlineComponent, ScPriceHistoryComponent, ScPriceListPaginationComponent, ScPriceWarehouseStockComponent, ScPrintDirective, ScPrintService, ScPrivacyPolicyComponent, ScProductInAllWarehousesPipe, ScProfileAccordionsContentComponent, ScProfstroyActualizationPanelComponent, ScProfstroyBadgeComponent, ScProfstroyDraftBadgesComponent, ScProfstroyDraftCreateDialogComponent, ScProfstroyDraftHelper, ScProfstroyDraftState, ScPublicOfferComponent, ScQRCodeDialogComponent, ScResetUserPasswordComponent, ScResourcePreviewComponent, ScSandwichComponent, ScSandwichM2Component, ScSandwichM2SkeletonComponent, ScSandwichSkeletonComponent, ScSelectOnFocusinDirective, ScSeoTagsComponent, ScShareButtonComponent, ScShareDialogComponent, ScShareMessengersLinksComponent, ScShareService, ScSignInFormByEmailComponent, ScSignInFormByPhoneComponent, ScSignInFormComponent, ScSignUpFormComponent, ScSimpleSignUpFormComponent, ScSuggestionFieldComponent, ScTelLinkDirective, ScTerminalLinkDirective, ScUpdateUserInfoDialogComponent, ScUserManagersComponent, ScUserPhoneApproveDialogComponent, ScVerificationPhoneCheckFormComponent, TreeDirective, TreeIconService, TreeLoaderService, TreeTopDirective, cleanupRecaptchaArtifacts, phoneValidator, scAtLeastOneRequiredValidator, scBicValidator, scClientUiIconsName, scCorrespondentAccountValidator, scGetCurrentRoute, scGetFaqGroupQueryParams, scGetFaqQuestionAnchor, scGetFaqQuestionIdFromAnchor, scPasswordConfirmMatchingValidator, stepValidator, tuiDateValueTransformerDefaultProvider };
11109
12590
  //# sourceMappingURL=snabcentr-client-ui.mjs.map