@forgeroute/ui 0.4.91 → 0.4.93

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.
@@ -1833,6 +1833,8 @@ const UI_DEFAULT_LABELS = {
1833
1833
  "dataTable.skipAlreadyHas_other": "{{ count }} selected rows already have this value and will be skipped.",
1834
1834
  "dataTable.noChangesBlocked": "No changes — the selected rows can't be changed to {{ option }}.",
1835
1835
  "dataTable.noChangesAlready": "No changes — all selected {{ item }} already have {{ option }}.",
1836
+ "dataTable.bulkCannotApply": "The selected rows can't all be changed to {{ option }} together.",
1837
+ "dataTable.bulkOptionBlocked": "{{ option }}: {{ reason }}",
1836
1838
  "dataTable.doneUpdated": "updated",
1837
1839
  "dataTable.doneDeleted": "deleted",
1838
1840
  "dataTable.doneDownloaded": "downloaded",
@@ -5357,7 +5359,7 @@ function createFieldReveal(showErrors) {
5357
5359
  });
5358
5360
  return {
5359
5361
  touched,
5360
- revealed: computed(() => touched() || showErrors())
5362
+ revealed: computed(() => touched())
5361
5363
  };
5362
5364
  }
5363
5365
  const isEnglishLocale = (locale) => {
@@ -5512,7 +5514,7 @@ var CheckboxComponent = class CheckboxComponent {
5512
5514
  this.invalid = computed(() => !!this.error() || !!this._issue(), ...ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []);
5513
5515
  this.errorMessage = computed(() => this._issue()?.message ?? "", ...ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []);
5514
5516
  this.invalidChange = output();
5515
- this._activeError = computed(() => this.error() || (this._reveal.revealed() ? this.errorMessage() : ""), ...ngDevMode ? [{ debugName: "_activeError" }] : /* istanbul ignore next */ []);
5517
+ this._activeError = computed(() => this._reveal.revealed() ? this.error() || this.errorMessage() : "", ...ngDevMode ? [{ debugName: "_activeError" }] : /* istanbul ignore next */ []);
5516
5518
  this._onValidatorChange = () => {};
5517
5519
  this._disabledInput = input(false, {
5518
5520
  ...ngDevMode ? { debugName: "_disabledInput" } : /* istanbul ignore next */ {},
@@ -7598,7 +7600,7 @@ var TextInputComponent = class TextInputComponent {
7598
7600
  this._issue = computed(() => this._check(this._value()), ...ngDevMode ? [{ debugName: "_issue" }] : /* istanbul ignore next */ []);
7599
7601
  this.invalid = computed(() => !!this.error() || !!this._issue(), ...ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []);
7600
7602
  this.errorMessage = computed(() => this._issue()?.message ?? "", ...ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []);
7601
- this._activeError = computed(() => this.error() || (this._reveal.revealed() ? this.errorMessage() : ""), ...ngDevMode ? [{ debugName: "_activeError" }] : /* istanbul ignore next */ []);
7603
+ this._activeError = computed(() => this._reveal.revealed() ? this.error() || this.errorMessage() : "", ...ngDevMode ? [{ debugName: "_activeError" }] : /* istanbul ignore next */ []);
7602
7604
  this._inputId = `ti-${Math.random().toString(36).slice(2, 8)}`;
7603
7605
  this._onChange = (_) => {};
7604
7606
  this._onTouched = () => {};
@@ -10047,7 +10049,7 @@ var SelectComponent = class SelectComponent {
10047
10049
  this.errorMessage = computed(() => this._issue()?.message ?? "", ...ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []);
10048
10050
  this.invalidChange = output();
10049
10051
  this.valueChange = output();
10050
- this._activeError = computed(() => this.error() || (this._reveal.revealed() ? this.errorMessage() : ""), ...ngDevMode ? [{ debugName: "_activeError" }] : /* istanbul ignore next */ []);
10052
+ this._activeError = computed(() => this._reveal.revealed() ? this.error() || this.errorMessage() : "", ...ngDevMode ? [{ debugName: "_activeError" }] : /* istanbul ignore next */ []);
10051
10053
  this._onValidatorChange = () => {};
10052
10054
  this._selectId = `sl-${Math.random().toString(36).slice(2, 8)}`;
10053
10055
  this._labels = inject(UiLabelsService);
@@ -14706,9 +14708,35 @@ var DataTableComponent = class DataTableComponent {
14706
14708
  }
14707
14709
  }
14708
14710
  _bulkOptionsFor(def) {
14709
- const opts = this._getOptionsForField(def.field);
14711
+ const opts = def.listAll ? this._listAllOptions(def) : this._getOptionsForField(def.field);
14710
14712
  return def.exclude?.length ? opts.filter((o) => !this._isBulkExcluded(def, o.value)) : opts;
14711
14713
  }
14714
+ _listAllOptions(def) {
14715
+ const col = this.columns().find((c) => c.key === def.field);
14716
+ const label = (value) => col?.badgeFn ? col.badgeFn(value, null)?.label || value : value;
14717
+ const values = Array.isArray(def.listAll) ? [...def.listAll] : [...this._getOptionsForField(def.field).map((o) => o.value), ...Object.keys(def.allowedFrom ?? {})];
14718
+ return [...new Set(values.filter((v) => typeof v === "string" && v.trim() !== ""))].map((value) => ({
14719
+ value,
14720
+ label: label(value)
14721
+ }));
14722
+ }
14723
+ _selectedRows() {
14724
+ return this._items().filter((i) => this._selectedIds().has(i["id"]));
14725
+ }
14726
+ _applyVerdict(def, target, rows, optionLabel) {
14727
+ if (!def.canApply) return { ok: true };
14728
+ let verdict;
14729
+ try {
14730
+ verdict = def.canApply([...rows], target);
14731
+ } catch {
14732
+ verdict = false;
14733
+ }
14734
+ if (verdict === true) return { ok: true };
14735
+ return {
14736
+ ok: false,
14737
+ reason: typeof verdict === "string" && verdict.trim() !== "" ? verdict.trim() : this.labels.t("dataTable.bulkCannotApply", { option: optionLabel })
14738
+ };
14739
+ }
14712
14740
  _canBulkMove(def, current, target, row) {
14713
14741
  const cur = String(current ?? "");
14714
14742
  if (cur === String(target)) return false;
@@ -15035,7 +15063,7 @@ var DataTableComponent = class DataTableComponent {
15035
15063
  if (def.field) {
15036
15064
  this._activeBulkType.set(def.type);
15037
15065
  const opts = this._eligibleBulkOptions();
15038
- this._bulkSelectStr = opts[0]?.value ?? "";
15066
+ this._bulkSelectStr = opts.find((o) => !o.disabled)?.value ?? "";
15039
15067
  }
15040
15068
  }
15041
15069
  async applyBulkAction() {
@@ -15043,9 +15071,14 @@ var DataTableComponent = class DataTableComponent {
15043
15071
  if (!def || !this._bulkSelectStr || !def.field) return;
15044
15072
  if (this._confirmingBulk || this._applyingBulk()) return;
15045
15073
  if (this._isBulkExcluded(def, this._bulkSelectStr)) return;
15046
- const { eligibleIds, skippedCount } = this._getEligible(def.type, this._bulkSelectStr, def);
15047
15074
  const selectedValue = this._bulkSelectStr;
15048
15075
  const optionLabel = this._bulkOptionsFor(def).find((o) => o.value === selectedValue)?.label ?? selectedValue;
15076
+ const verdict = this._applyVerdict(def, selectedValue, this._selectedRows(), optionLabel);
15077
+ if (!verdict.ok) {
15078
+ this._toast.error(verdict.reason);
15079
+ return;
15080
+ }
15081
+ const { eligibleIds, skippedCount } = this._getEligible(def.type, selectedValue, def);
15049
15082
  const selectedRows = this._items().filter((i) => this._selectedIds().has(i.id));
15050
15083
  const alreadyCount = selectedRows.filter((i) => String(i[def.field] ?? "") === selectedValue).length;
15051
15084
  const blockedCount = skippedCount - alreadyCount;
@@ -15221,6 +15254,7 @@ var DataTableComponent = class DataTableComponent {
15221
15254
  this.page = input("", ...ngDevMode ? [{ debugName: "page" }] : /* istanbul ignore next */ []);
15222
15255
  this.showToolbar = input(true, ...ngDevMode ? [{ debugName: "showToolbar" }] : /* istanbul ignore next */ []);
15223
15256
  this.showMoreActions = input(true, ...ngDevMode ? [{ debugName: "showMoreActions" }] : /* istanbul ignore next */ []);
15257
+ this.quickTabLabelFn = input(null, ...ngDevMode ? [{ debugName: "quickTabLabelFn" }] : /* istanbul ignore next */ []);
15224
15258
  this.showSearch = input(true, ...ngDevMode ? [{ debugName: "showSearch" }] : /* istanbul ignore next */ []);
15225
15259
  this.showQuickTabs = input(true, ...ngDevMode ? [{ debugName: "showQuickTabs" }] : /* istanbul ignore next */ []);
15226
15260
  this.showPagination = input(true, ...ngDevMode ? [{ debugName: "showPagination" }] : /* istanbul ignore next */ []);
@@ -15285,7 +15319,8 @@ var DataTableComponent = class DataTableComponent {
15285
15319
  const active = this._activeTab();
15286
15320
  const keys = Object.keys(counts).length > 0 && active && !present.includes(active) ? [...present, active] : present;
15287
15321
  if (!keys.length) return [];
15288
- const toLabel = (s) => this._columnBadgeLabel(s) ?? (/[a-z]/.test(s) ? s : s.toLowerCase()).replace(/([a-z])([A-Z])/g, "$1 $2").replace(/-/g, " ").replace(/(^|\s)\p{L}/gu, (c) => c.toUpperCase());
15322
+ const hostLabel = this.quickTabLabelFn();
15323
+ const toLabel = (s) => hostLabel?.(s) || (this._columnBadgeLabel(s) ?? (/[a-z]/.test(s) ? s : s.toLowerCase()).replace(/([a-z])([A-Z])/g, "$1 $2").replace(/-/g, " ").replace(/(^|\s)\p{L}/gu, (c) => c.toUpperCase()));
15289
15324
  const singleValue = keys.length === 1;
15290
15325
  return [{
15291
15326
  value: "",
@@ -15471,6 +15506,8 @@ var DataTableComponent = class DataTableComponent {
15471
15506
  const col = this.columns().find((c) => c.key === key);
15472
15507
  const allowedFrom = typeof entry === "string" ? void 0 : entry.allowedFrom;
15473
15508
  const canChange = typeof entry === "string" ? void 0 : entry.canChange;
15509
+ const canApply = typeof entry === "string" ? void 0 : entry.canApply;
15510
+ const listAll = typeof entry === "string" ? void 0 : entry.listAll;
15474
15511
  const custom = typeof entry === "string" ? "" : entry.label?.trim() ?? "";
15475
15512
  return {
15476
15513
  type: `change-${key}`,
@@ -15481,6 +15518,8 @@ var DataTableComponent = class DataTableComponent {
15481
15518
  ...exclude.length ? { exclude } : {},
15482
15519
  ...allowedFrom ? { allowedFrom } : {},
15483
15520
  ...canChange ? { canChange } : {},
15521
+ ...canApply ? { canApply } : {},
15522
+ ...listAll === true || Array.isArray(listAll) && listAll.length ? { listAll } : {},
15484
15523
  ...confirm ? { confirm } : {}
15485
15524
  };
15486
15525
  }).filter((def) => !def.field || !def.exclude?.length || this._bulkOptionsFor(def).length > 0).filter((def, i, all) => !def.action || all.findIndex((d) => d.type === def.type) === i), ...ngDevMode ? [{ debugName: "_bulkDefs" }] : /* istanbul ignore next */ []);
@@ -15498,9 +15537,27 @@ var DataTableComponent = class DataTableComponent {
15498
15537
  const allOpts = this._bulkOptionsFor(def);
15499
15538
  const selected = this._items().filter((i) => this._selectedIds().has(i["id"]));
15500
15539
  const eligible = getEligibleOptions(allOpts, selected, def.field);
15501
- if (!def.allowedFrom && !def.canChange) return eligible;
15502
- return eligible.filter((o) => selected.some((i) => this._canBulkMove(def, i[def.field], o.value, i)));
15540
+ const reachable = !def.allowedFrom && !def.canChange ? eligible : eligible.filter((o) => selected.some((i) => this._canBulkMove(def, i[def.field], o.value, i)));
15541
+ if (!def.canApply) return reachable;
15542
+ return reachable.map((o) => this._applyVerdict(def, o.value, selected, o.label).ok ? o : {
15543
+ ...o,
15544
+ disabled: true
15545
+ });
15503
15546
  }, ...ngDevMode ? [{ debugName: "_eligibleBulkOptions" }] : /* istanbul ignore next */ []);
15547
+ this._bulkHintId = `dt-bulk-hint-${Math.random().toString(36).slice(2, 8)}`;
15548
+ this._bulkOptionHintIds = computed(() => this._bulkOptionHints().map((_, i) => `${this._bulkHintId}-${i}`).join(" "), ...ngDevMode ? [{ debugName: "_bulkOptionHintIds" }] : /* istanbul ignore next */ []);
15549
+ this._bulkOptionHints = computed(() => {
15550
+ const def = this._activeBulkDef();
15551
+ if (!def?.canApply) return [];
15552
+ const selected = this._items().filter((i) => this._selectedIds().has(i["id"]));
15553
+ return this._eligibleBulkOptions().filter((o) => o.disabled).flatMap((o) => {
15554
+ const verdict = this._applyVerdict(def, o.value, selected, o.label);
15555
+ return verdict.ok ? [] : [this.labels.t("dataTable.bulkOptionBlocked", {
15556
+ option: o.label,
15557
+ reason: verdict.reason
15558
+ })];
15559
+ });
15560
+ }, ...ngDevMode ? [{ debugName: "_bulkOptionHints" }] : /* istanbul ignore next */ []);
15504
15561
  this._allSelected = computed(() => {
15505
15562
  const items = this._items();
15506
15563
  const sel = this._selectedIds();
@@ -16335,6 +16392,13 @@ var DataTableComponent = class DataTableComponent {
16335
16392
  isRequired: false,
16336
16393
  transformFunction: null
16337
16394
  },
16395
+ quickTabLabelFn: {
16396
+ classPropertyName: "quickTabLabelFn",
16397
+ publicName: "quickTabLabelFn",
16398
+ isSignal: true,
16399
+ isRequired: false,
16400
+ transformFunction: null
16401
+ },
16338
16402
  showSearch: {
16339
16403
  classPropertyName: "showSearch",
16340
16404
  publicName: "showSearch",
@@ -16596,9 +16660,12 @@ var DataTableComponent = class DataTableComponent {
16596
16660
  <div class="dt-bulk-actions">
16597
16661
  @if (_activeBulkDef(); as def) {
16598
16662
  <!-- Inline select for field-based bulk actions -->
16599
- <ui-select name="dt-bulk" size="sm" [ariaLabel]="def.label" [ngModel]="_bulkSelectStr" (ngModelChange)="_bulkSelectStr = $event" [options]="_eligibleBulkOptions()" />
16663
+ <ui-select name="dt-bulk" size="sm" [ariaLabel]="def.label" [ngModel]="_bulkSelectStr" (ngModelChange)="_bulkSelectStr = $event" [options]="_eligibleBulkOptions()" [ariaDescribedBy]="_bulkOptionHintIds()" />
16600
16664
  <ui-button variant="primary" size="sm" [disabled]="!_bulkSelectStr" [loading]="_applyingBulk()" (click)="applyBulkAction()">{{ labels.t('dataTable.apply') }}</ui-button>
16601
16665
  <ui-button variant="ghost" size="sm" [disabled]="_applyingBulk()" (click)="_activeBulkType.set(null)">{{ labels.t('dataTable.cancel') }}</ui-button>
16666
+ @for (hint of _bulkOptionHints(); track $index) {
16667
+ <span class="dt-bulk-hint" role="status" data-testid="dt-bulk-option-hint" [id]="_bulkHintId + '-' + $index">{{ hint }}</span>
16668
+ }
16602
16669
  } @else {
16603
16670
  @for (def of _bulkDefs(); track def.type) {
16604
16671
  @if (!_bulkHidden(def)) {
@@ -17744,9 +17811,12 @@ i0.ɵɵngDeclareClassMetadata({
17744
17811
  <div class="dt-bulk-actions">
17745
17812
  @if (_activeBulkDef(); as def) {
17746
17813
  <!-- Inline select for field-based bulk actions -->
17747
- <ui-select name="dt-bulk" size="sm" [ariaLabel]="def.label" [ngModel]="_bulkSelectStr" (ngModelChange)="_bulkSelectStr = $event" [options]="_eligibleBulkOptions()" />
17814
+ <ui-select name="dt-bulk" size="sm" [ariaLabel]="def.label" [ngModel]="_bulkSelectStr" (ngModelChange)="_bulkSelectStr = $event" [options]="_eligibleBulkOptions()" [ariaDescribedBy]="_bulkOptionHintIds()" />
17748
17815
  <ui-button variant="primary" size="sm" [disabled]="!_bulkSelectStr" [loading]="_applyingBulk()" (click)="applyBulkAction()">{{ labels.t('dataTable.apply') }}</ui-button>
17749
17816
  <ui-button variant="ghost" size="sm" [disabled]="_applyingBulk()" (click)="_activeBulkType.set(null)">{{ labels.t('dataTable.cancel') }}</ui-button>
17817
+ @for (hint of _bulkOptionHints(); track $index) {
17818
+ <span class="dt-bulk-hint" role="status" data-testid="dt-bulk-option-hint" [id]="_bulkHintId + '-' + $index">{{ hint }}</span>
17819
+ }
17750
17820
  } @else {
17751
17821
  @for (def of _bulkDefs(); track def.type) {
17752
17822
  @if (!_bulkHidden(def)) {
@@ -18503,6 +18573,14 @@ i0.ɵɵngDeclareClassMetadata({
18503
18573
  required: false
18504
18574
  }]
18505
18575
  }],
18576
+ quickTabLabelFn: [{
18577
+ type: i0.Input,
18578
+ args: [{
18579
+ isSignal: true,
18580
+ alias: "quickTabLabelFn",
18581
+ required: false
18582
+ }]
18583
+ }],
18506
18584
  showSearch: [{
18507
18585
  type: i0.Input,
18508
18586
  args: [{
@@ -21840,7 +21918,7 @@ var StarRatingComponent = class StarRatingComponent {
21840
21918
  this._issue = computed(() => this._check(this._value()), ...ngDevMode ? [{ debugName: "_issue" }] : /* istanbul ignore next */ []);
21841
21919
  this.invalid = computed(() => !!this.error() || !!this._issue(), ...ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []);
21842
21920
  this.errorMessage = computed(() => this._issue()?.message ?? "", ...ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []);
21843
- this._activeError = computed(() => this.error() || (this._reveal.revealed() ? this.errorMessage() : ""), ...ngDevMode ? [{ debugName: "_activeError" }] : /* istanbul ignore next */ []);
21921
+ this._activeError = computed(() => this._reveal.revealed() ? this.error() || this.errorMessage() : "", ...ngDevMode ? [{ debugName: "_activeError" }] : /* istanbul ignore next */ []);
21844
21922
  this._onValidatorChange = () => {};
21845
21923
  this._onChange = (_) => {};
21846
21924
  this._onTouched = () => {};
@@ -23525,7 +23603,7 @@ var BusinessHoursComponent = class BusinessHoursComponent {
23525
23603
  this.invalid = computed(() => !!this.error() || !!this._issue(), ...ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []);
23526
23604
  this.errorMessage = computed(() => this._issue()?.message ?? "", ...ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []);
23527
23605
  this.invalidChange = output();
23528
- this._activeError = computed(() => this.error() || (this._reveal.revealed() ? this.errorMessage() : ""), ...ngDevMode ? [{ debugName: "_activeError" }] : /* istanbul ignore next */ []);
23606
+ this._activeError = computed(() => this._reveal.revealed() ? this.error() || this.errorMessage() : "", ...ngDevMode ? [{ debugName: "_activeError" }] : /* istanbul ignore next */ []);
23529
23607
  this._onValidatorChange = () => {};
23530
23608
  this._options = computed(() => businessTimeOptions(this.step(), this.hour24(), this.labels.locale()), ...ngDevMode ? [{ debugName: "_options" }] : /* istanbul ignore next */ []);
23531
23609
  this._onChange = (_) => {};
@@ -24636,7 +24714,7 @@ var RadioGroupComponent = class RadioGroupComponent {
24636
24714
  this.invalid = computed(() => !!this.error() || !!this._issue(), ...ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []);
24637
24715
  this.errorMessage = computed(() => this._issue()?.message ?? "", ...ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []);
24638
24716
  this.invalidChange = output();
24639
- this._activeError = computed(() => this.error() || (this._reveal.revealed() ? this.errorMessage() : ""), ...ngDevMode ? [{ debugName: "_activeError" }] : /* istanbul ignore next */ []);
24717
+ this._activeError = computed(() => this._reveal.revealed() ? this.error() || this.errorMessage() : "", ...ngDevMode ? [{ debugName: "_activeError" }] : /* istanbul ignore next */ []);
24640
24718
  this._onValidatorChange = () => {};
24641
24719
  this._onChange = (_) => {};
24642
24720
  this._onTouched = () => {};
@@ -26840,7 +26918,7 @@ var ContactPickerComponent = class ContactPickerComponent {
26840
26918
  this.fieldInvalid = computed(() => this.invalid() || this.requiredEmpty(), ...ngDevMode ? [{ debugName: "fieldInvalid" }] : /* istanbul ignore next */ []);
26841
26919
  this.errorMessage = computed(() => this.requiredEmpty() ? requiredIssue(this.label()).message : "", ...ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []);
26842
26920
  this.visibleErrorMessage = computed(() => this.reveal.revealed() ? this.errorMessage() : "", ...ngDevMode ? [{ debugName: "visibleErrorMessage" }] : /* istanbul ignore next */ []);
26843
- this.ariaInvalid = computed(() => this.invalid() || this.showErrors() && this.requiredEmpty(), ...ngDevMode ? [{ debugName: "ariaInvalid" }] : /* istanbul ignore next */ []);
26921
+ this.ariaInvalid = computed(() => this.reveal.revealed() && (this.invalid() || this.requiredEmpty()), ...ngDevMode ? [{ debugName: "ariaInvalid" }] : /* istanbul ignore next */ []);
26844
26922
  this.showHint = computed(() => this.isMultiSelect() || !this.selected(), ...ngDevMode ? [{ debugName: "showHint" }] : /* istanbul ignore next */ []);
26845
26923
  this.describedBy = computed(() => {
26846
26924
  const ids = [this.hint() && this.showHint() ? this.hintId : "", this.errorId()].filter(Boolean);
@@ -26898,6 +26976,9 @@ var ContactPickerComponent = class ContactPickerComponent {
26898
26976
  this.clearBlurTimer();
26899
26977
  if (this.query.length >= 2) this.showResults.set(true);
26900
26978
  }
26979
+ onSelectedFocusOut() {
26980
+ this.reveal.touched.set(true);
26981
+ }
26901
26982
  onBlur() {
26902
26983
  this.reveal.touched.set(true);
26903
26984
  this.clearBlurTimer();
@@ -27202,7 +27283,7 @@ var ContactPickerComponent = class ContactPickerComponent {
27202
27283
  <!-- ── Single-select mode ── -->
27203
27284
  } @else {
27204
27285
  @if (selected()) {
27205
- <div class="selected-input" role="group" tabindex="-1" [attr.aria-labelledby]="label() ? labelId : null"
27286
+ <div class="selected-input" role="group" tabindex="-1" (focusout)="onSelectedFocusOut()" [attr.aria-labelledby]="label() ? labelId : null"
27206
27287
  [attr.aria-describedby]="describedBy()" [attr.aria-invalid]="ariaInvalid() ? 'true' : null">
27207
27288
  <span>{{ selected()!.name }}</span>
27208
27289
  <button type="button" class="clear-btn" (click)="clear()" [attr.aria-label]="labels.t('contactPicker.clearSelection')">&times;</button>
@@ -27445,7 +27526,7 @@ i0.ɵɵngDeclareClassMetadata({
27445
27526
  <!-- ── Single-select mode ── -->
27446
27527
  } @else {
27447
27528
  @if (selected()) {
27448
- <div class="selected-input" role="group" tabindex="-1" [attr.aria-labelledby]="label() ? labelId : null"
27529
+ <div class="selected-input" role="group" tabindex="-1" (focusout)="onSelectedFocusOut()" [attr.aria-labelledby]="label() ? labelId : null"
27449
27530
  [attr.aria-describedby]="describedBy()" [attr.aria-invalid]="ariaInvalid() ? 'true' : null">
27450
27531
  <span>{{ selected()!.name }}</span>
27451
27532
  <button type="button" class="clear-btn" (click)="clear()" [attr.aria-label]="labels.t('contactPicker.clearSelection')">&times;</button>
@@ -27670,7 +27751,7 @@ var TextareaInputComponent = class TextareaInputComponent {
27670
27751
  this.invalidChange = output();
27671
27752
  this.focused = output();
27672
27753
  this.blurred = output();
27673
- this._activeError = computed(() => this.error() || (this._reveal.revealed() ? this.errorMessage() : ""), ...ngDevMode ? [{ debugName: "_activeError" }] : /* istanbul ignore next */ []);
27754
+ this._activeError = computed(() => this._reveal.revealed() ? this.error() || this.errorMessage() : "", ...ngDevMode ? [{ debugName: "_activeError" }] : /* istanbul ignore next */ []);
27674
27755
  this._onValidatorChange = () => {};
27675
27756
  this._inputId = `ta-${Math.random().toString(36).slice(2, 8)}`;
27676
27757
  this._hostEl = inject(ElementRef);
@@ -30116,7 +30197,7 @@ var FileInputComponent = class FileInputComponent {
30116
30197
  this._issue = computed(() => this.disabled() || !this.required() || this._files().length > 0 ? null : requiredIssue(this.label() || this.labels.t("common.file")), ...ngDevMode ? [{ debugName: "_issue" }] : /* istanbul ignore next */ []);
30117
30198
  this.invalid = computed(() => !!this.error() || !!this._rejection() || !!this._issue(), ...ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []);
30118
30199
  this.errorMessage = computed(() => (this.listRejections() && this._rejected().length > 0 ? this.rejectionLines().join(" ") : this._rejection()) || this._issue()?.message || "", ...ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []);
30119
- this._shownError = computed(() => (this.showField() ? this.error() : "") || this._rejection() || (this._reveal.revealed() ? this._issue()?.message ?? "" : ""), ...ngDevMode ? [{ debugName: "_shownError" }] : /* istanbul ignore next */ []);
30200
+ this._shownError = computed(() => this._rejection() || (this._reveal.revealed() ? (this.showField() ? this.error() : "") || (this._issue()?.message ?? "") : ""), ...ngDevMode ? [{ debugName: "_shownError" }] : /* istanbul ignore next */ []);
30120
30201
  this.summary = computed(() => {
30121
30202
  const f = this._files();
30122
30203
  if (f.length === 0) return "";
@@ -31386,7 +31467,7 @@ var DateInputComponent = class DateInputComponent {
31386
31467
  this.errorMessage = computed(() => this._issue()?.message ?? "", ...ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []);
31387
31468
  this.invalidChange = output();
31388
31469
  this.valueChange = output();
31389
- this._activeError = computed(() => this.error() || (this._reveal.revealed() ? this.errorMessage() : ""), ...ngDevMode ? [{ debugName: "_activeError" }] : /* istanbul ignore next */ []);
31470
+ this._activeError = computed(() => this._reveal.revealed() ? this.error() || this.errorMessage() : "", ...ngDevMode ? [{ debugName: "_activeError" }] : /* istanbul ignore next */ []);
31390
31471
  this._onValidatorChange = () => {};
31391
31472
  this._inputId = `di-${Math.random().toString(36).slice(2, 8)}`;
31392
31473
  this._onChange = (_) => {};
@@ -31762,7 +31843,7 @@ var DatetimeInputComponent = class DatetimeInputComponent {
31762
31843
  this.invalid = computed(() => !!this.error() || !!this._issue(), ...ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []);
31763
31844
  this.errorMessage = computed(() => this._issue()?.message ?? "", ...ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []);
31764
31845
  this.invalidChange = output();
31765
- this._activeError = computed(() => this.error() || (this._reveal.revealed() ? this.errorMessage() : ""), ...ngDevMode ? [{ debugName: "_activeError" }] : /* istanbul ignore next */ []);
31846
+ this._activeError = computed(() => this._reveal.revealed() ? this.error() || this.errorMessage() : "", ...ngDevMode ? [{ debugName: "_activeError" }] : /* istanbul ignore next */ []);
31766
31847
  this._onValidatorChange = () => {};
31767
31848
  this._inputId = `dti-${Math.random().toString(36).slice(2, 8)}`;
31768
31849
  this._onChange = (_) => {};
@@ -32132,7 +32213,7 @@ var TimeInputComponent = class TimeInputComponent {
32132
32213
  this.invalid = computed(() => !!this.error() || !!this._issue(), ...ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []);
32133
32214
  this.errorMessage = computed(() => this._issue()?.message ?? "", ...ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []);
32134
32215
  this.invalidChange = output();
32135
- this._activeError = computed(() => this.error() || (this._reveal.revealed() ? this.errorMessage() : ""), ...ngDevMode ? [{ debugName: "_activeError" }] : /* istanbul ignore next */ []);
32216
+ this._activeError = computed(() => this._reveal.revealed() ? this.error() || this.errorMessage() : "", ...ngDevMode ? [{ debugName: "_activeError" }] : /* istanbul ignore next */ []);
32136
32217
  this._onValidatorChange = () => {};
32137
32218
  this._onChange = (_) => {};
32138
32219
  this._onTouched = () => {};
@@ -32555,7 +32636,7 @@ var ComboboxComponent = class ComboboxComponent {
32555
32636
  this._issue = computed(() => this._check(this._selected()), ...ngDevMode ? [{ debugName: "_issue" }] : /* istanbul ignore next */ []);
32556
32637
  this.invalid = computed(() => !!this.error() || !!this._issue(), ...ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []);
32557
32638
  this.errorMessage = computed(() => this._issue()?.message ?? "", ...ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []);
32558
- this._activeError = computed(() => this.error() || (this._reveal.revealed() ? this.errorMessage() : ""), ...ngDevMode ? [{ debugName: "_activeError" }] : /* istanbul ignore next */ []);
32639
+ this._activeError = computed(() => this._reveal.revealed() ? this.error() || this.errorMessage() : "", ...ngDevMode ? [{ debugName: "_activeError" }] : /* istanbul ignore next */ []);
32559
32640
  this._inputText = computed(() => this._editing() ? this._text() : this.displayText() || this._selected()?.label || "", ...ngDevMode ? [{ debugName: "_inputText" }] : /* istanbul ignore next */ []);
32560
32641
  this._showClear = computed(() => !this.disabled() && !this._editing() && !!(this._selected() || this.displayText()), ...ngDevMode ? [{ debugName: "_showClear" }] : /* istanbul ignore next */ []);
32561
32642
  this._belowMin = computed(() => this._term().length < this.minChars(), ...ngDevMode ? [{ debugName: "_belowMin" }] : /* istanbul ignore next */ []);
@@ -33548,8 +33629,13 @@ var MultiSelectComponent = class MultiSelectComponent {
33548
33629
  return q ? this.options().filter((o) => fold(o.label).includes(q)) : this.options();
33549
33630
  }, ...ngDevMode ? [{ debugName: "_filteredOptions" }] : /* istanbul ignore next */ []);
33550
33631
  this._onChange = (_) => {};
33632
+ this._touched = signal(false, ...ngDevMode ? [{ debugName: "_touched" }] : /* istanbul ignore next */ []);
33633
+ this._shownError = computed(() => this._touched() ? this.error() : "", ...ngDevMode ? [{ debugName: "_shownError" }] : /* istanbul ignore next */ []);
33551
33634
  this._onTouched = () => {};
33552
33635
  }
33636
+ resetTouched() {
33637
+ this._touched.set(false);
33638
+ }
33553
33639
  writeValue(val) {
33554
33640
  this.selected.set(val ?? []);
33555
33641
  }
@@ -33565,6 +33651,12 @@ var MultiSelectComponent = class MultiSelectComponent {
33565
33651
  onDocumentClick(event) {
33566
33652
  if (this._open() && !this.el.nativeElement.contains(event.target)) this.close();
33567
33653
  }
33654
+ onFocusOut(event) {
33655
+ const next = event.relatedTarget;
33656
+ if (!next || this.el.nativeElement.contains(next)) return;
33657
+ this._touched.set(true);
33658
+ this._onTouched();
33659
+ }
33568
33660
  onEscape(event) {
33569
33661
  if (!this._open()) return;
33570
33662
  event.preventDefault();
@@ -33589,6 +33681,7 @@ var MultiSelectComponent = class MultiSelectComponent {
33589
33681
  close() {
33590
33682
  this._open.set(false);
33591
33683
  this._query.set("");
33684
+ this._touched.set(true);
33592
33685
  this._onTouched();
33593
33686
  }
33594
33687
  _set(values) {
@@ -33685,7 +33778,10 @@ var MultiSelectComponent = class MultiSelectComponent {
33685
33778
  }
33686
33779
  },
33687
33780
  outputs: { selected: "selectedChange" },
33688
- host: { listeners: { "document:click": "onDocumentClick($event)" } },
33781
+ host: { listeners: {
33782
+ "document:click": "onDocumentClick($event)",
33783
+ "focusout": "onFocusOut($event)"
33784
+ } },
33689
33785
  providers: [{
33690
33786
  provide: NG_VALUE_ACCESSOR,
33691
33787
  useExisting: forwardRef(() => MultiSelectComponent),
@@ -33693,7 +33789,7 @@ var MultiSelectComponent = class MultiSelectComponent {
33693
33789
  }],
33694
33790
  ngImport: i0,
33695
33791
  template: `
33696
- <div class="ms-field" [class.ms-has-error]="error()" [class.ms-disabled]="disabled()">
33792
+ <div class="ms-field" [class.ms-has-error]="_shownError()" [class.ms-disabled]="disabled()">
33697
33793
  @if (label()) {
33698
33794
  <span class="ms-label" [id]="_id + '-label'">
33699
33795
  {{ label() }}
@@ -33719,8 +33815,8 @@ var MultiSelectComponent = class MultiSelectComponent {
33719
33815
  [attr.aria-expanded]="_open()"
33720
33816
  [attr.aria-controls]="_open() ? _id + '-options' : null"
33721
33817
  [attr.aria-labelledby]="label() ? _id + '-label' : null"
33722
- [attr.aria-describedby]="error() ? _id + '-error' : (hint() ? _id + '-hint' : null)"
33723
- [attr.aria-invalid]="error() ? 'true' : null"
33818
+ [attr.aria-describedby]="_shownError() ? _id + '-error' : (hint() ? _id + '-hint' : null)"
33819
+ [attr.aria-invalid]="_shownError() ? 'true' : null"
33724
33820
  [attr.aria-required]="required() ? 'true' : null"
33725
33821
  (click)="toggleOpen()"
33726
33822
  (keydown.escape)="onEscape($event)">
@@ -33758,8 +33854,8 @@ var MultiSelectComponent = class MultiSelectComponent {
33758
33854
  }
33759
33855
  </div>
33760
33856
 
33761
- @if (error()) {
33762
- <p class="ms-desc ms-desc-error" [id]="_id + '-error'" role="alert">{{ error() }}</p>
33857
+ @if (_shownError()) {
33858
+ <p class="ms-desc ms-desc-error" [id]="_id + '-error'" role="alert">{{ _shownError() }}</p>
33763
33859
  } @else if (hint()) {
33764
33860
  <p class="ms-desc" [id]="_id + '-hint'">{{ hint() }}</p>
33765
33861
  }
@@ -33832,7 +33928,7 @@ i0.ɵɵngDeclareClassMetadata({
33832
33928
  multi: true
33833
33929
  }],
33834
33930
  template: `
33835
- <div class="ms-field" [class.ms-has-error]="error()" [class.ms-disabled]="disabled()">
33931
+ <div class="ms-field" [class.ms-has-error]="_shownError()" [class.ms-disabled]="disabled()">
33836
33932
  @if (label()) {
33837
33933
  <span class="ms-label" [id]="_id + '-label'">
33838
33934
  {{ label() }}
@@ -33858,8 +33954,8 @@ i0.ɵɵngDeclareClassMetadata({
33858
33954
  [attr.aria-expanded]="_open()"
33859
33955
  [attr.aria-controls]="_open() ? _id + '-options' : null"
33860
33956
  [attr.aria-labelledby]="label() ? _id + '-label' : null"
33861
- [attr.aria-describedby]="error() ? _id + '-error' : (hint() ? _id + '-hint' : null)"
33862
- [attr.aria-invalid]="error() ? 'true' : null"
33957
+ [attr.aria-describedby]="_shownError() ? _id + '-error' : (hint() ? _id + '-hint' : null)"
33958
+ [attr.aria-invalid]="_shownError() ? 'true' : null"
33863
33959
  [attr.aria-required]="required() ? 'true' : null"
33864
33960
  (click)="toggleOpen()"
33865
33961
  (keydown.escape)="onEscape($event)">
@@ -33897,8 +33993,8 @@ i0.ɵɵngDeclareClassMetadata({
33897
33993
  }
33898
33994
  </div>
33899
33995
 
33900
- @if (error()) {
33901
- <p class="ms-desc ms-desc-error" [id]="_id + '-error'" role="alert">{{ error() }}</p>
33996
+ @if (_shownError()) {
33997
+ <p class="ms-desc ms-desc-error" [id]="_id + '-error'" role="alert">{{ _shownError() }}</p>
33902
33998
  } @else if (hint()) {
33903
33999
  <p class="ms-desc" [id]="_id + '-hint'">{{ hint() }}</p>
33904
34000
  }
@@ -33994,6 +34090,10 @@ i0.ɵɵngDeclareClassMetadata({
33994
34090
  onDocumentClick: [{
33995
34091
  type: HostListener,
33996
34092
  args: ["document:click", ["$event"]]
34093
+ }],
34094
+ onFocusOut: [{
34095
+ type: HostListener,
34096
+ args: ["focusout", ["$event"]]
33997
34097
  }]
33998
34098
  }
33999
34099
  });
@@ -35902,10 +36002,15 @@ function actionFromMethod(error) {
35902
36002
  function withoutLeadingArticle(ctx) {
35903
36003
  return ctx.replace(/^(?:the|an?)\s+/i, "") || ctx;
35904
36004
  }
36005
+ const usableText = (value) => typeof value === "string" && value.trim() !== "";
36006
+ const sentenceOf = (value) => usableText(value) ? value.trim() : null;
36007
+ const withFullStop = (text) => /[.!?…。!?‼⁇⁈⁉][)\]}"'”’»›)]}」』】〉》]*$/.test(text) ? text : `${text}.`;
35905
36008
  function getErrorMessage(error, fallbackContext, action) {
35906
- const ctx = fallbackContext?.trim() || uiText("errors.dataWord");
36009
+ const sentences = fallbackContext !== null && typeof fallbackContext === "object" ? fallbackContext : null;
36010
+ const noun = sentences ? sentences.context : fallbackContext;
36011
+ const ctx = (typeof noun === "string" ? noun.trim() : "") || uiText("errors.dataWord");
35907
36012
  const act = action ?? (error instanceof HttpErrorResponse ? actionFromMethod(error) : "load");
35908
- const failed = uiText("errors.failed", {
36013
+ const failed = sentenceOf(sentences?.failed) !== null ? withFullStop(sentenceOf(sentences?.failed)) : uiText("errors.failed", {
35909
36014
  verb: uiText(`errors.verb.${act}`),
35910
36015
  ctx
35911
36016
  });
@@ -35915,11 +36020,11 @@ function getErrorMessage(error, fallbackContext, action) {
35915
36020
  switch (error.status) {
35916
36021
  case 0: return `${failed} ${uiText("errors.checkConnection")}`;
35917
36022
  case 401: return uiText("errors.sessionExpired");
35918
- case 403: return uiText("errors.noPermission", {
36023
+ case 403: return sentenceOf(sentences?.noPermission) ?? uiText("errors.noPermission", {
35919
36024
  verb: uiText(`errors.permissionVerb.${act}`),
35920
36025
  ctx
35921
36026
  });
35922
- case 404: return uiText("errors.notFound", { ctx: withoutLeadingArticle(ctx) });
36027
+ case 404: return sentenceOf(sentences?.notFound) ?? uiText("errors.notFound", { ctx: withoutLeadingArticle(ctx) });
35923
36028
  case 408: return `${failed} ${uiText("errors.timedOut")}`;
35924
36029
  case 422: return uiText("errors.invalidData");
35925
36030
  case 429: return `${failed} ${uiText("errors.tooManyRequests")}`;
@@ -42413,7 +42518,8 @@ var AddressInputComponent = class AddressInputComponent {
42413
42518
  this.invalid = computed(() => !!this.error() || this._firstIssue(this._issues()) !== null, ...ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []);
42414
42519
  this.errorMessage = computed(() => this._firstIssue(this._issues())?.message ?? "", ...ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []);
42415
42520
  this._req = computed(() => this.required() || this.requireComplete() && this._hasText(this._v()), ...ngDevMode ? [{ debugName: "_req" }] : /* istanbul ignore next */ []);
42416
- this._describedBy = computed(() => this.error() ? this._errorId : this.hint() ? this._hintId : null, ...ngDevMode ? [{ debugName: "_describedBy" }] : /* istanbul ignore next */ []);
42521
+ this._shownError = computed(() => this._touched().size > 0 ? this.error() : "", ...ngDevMode ? [{ debugName: "_shownError" }] : /* istanbul ignore next */ []);
42522
+ this._describedBy = computed(() => this._shownError() ? this._errorId : this.hint() ? this._hintId : null, ...ngDevMode ? [{ debugName: "_describedBy" }] : /* istanbul ignore next */ []);
42417
42523
  this._onChange = (_) => {};
42418
42524
  this._textModel = false;
42419
42525
  this._edited = /* @__PURE__ */ new Set();
@@ -42488,7 +42594,7 @@ var AddressInputComponent = class AddressInputComponent {
42488
42594
  if (!next || !this.host.nativeElement.contains(next)) this._onTouched();
42489
42595
  }
42490
42596
  _revealed(field) {
42491
- return this.showErrors() || this._touched().has(field);
42597
+ return this._touched().has(field);
42492
42598
  }
42493
42599
  _fieldError(field) {
42494
42600
  if (this.disabled() || this.readonly()) return "";
@@ -42845,8 +42951,8 @@ var AddressInputComponent = class AddressInputComponent {
42845
42951
  (focusout)="_onFocusOut('zip', $event)" />
42846
42952
  </ui-form-row>
42847
42953
  </ui-form-section>
42848
- @if (error()) {
42849
- <ui-error [errorId]="_errorId" [message]="error()" />
42954
+ @if (_shownError()) {
42955
+ <ui-error [errorId]="_errorId" [message]="_shownError()" />
42850
42956
  } @else if (hint()) {
42851
42957
  <ui-hint [attr.id]="_hintId">{{ hint() }}</ui-hint>
42852
42958
  }
@@ -43064,8 +43170,8 @@ i0.ɵɵngDeclareClassMetadata({
43064
43170
  (focusout)="_onFocusOut('zip', $event)" />
43065
43171
  </ui-form-row>
43066
43172
  </ui-form-section>
43067
- @if (error()) {
43068
- <ui-error [errorId]="_errorId" [message]="error()" />
43173
+ @if (_shownError()) {
43174
+ <ui-error [errorId]="_errorId" [message]="_shownError()" />
43069
43175
  } @else if (hint()) {
43070
43176
  <ui-hint [attr.id]="_hintId">{{ hint() }}</ui-hint>
43071
43177
  }
@@ -45601,6 +45707,9 @@ const STATE_COMMANDS = [
45601
45707
  ];
45602
45708
  let nextId$3 = 0;
45603
45709
  var RichTextEditorComponent = class RichTextEditorComponent {
45710
+ resetTouched() {
45711
+ this._touched.set(false);
45712
+ }
45604
45713
  headingText(tag) {
45605
45714
  return this.labels.t(`richTextEditor.heading.${tag}`);
45606
45715
  }
@@ -45622,6 +45731,8 @@ var RichTextEditorComponent = class RichTextEditorComponent {
45622
45731
  this.readonly = input(false, ...ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []);
45623
45732
  this.hint = input("", ...ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []);
45624
45733
  this.error = input("", ...ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []);
45734
+ this._touched = signal(false, ...ngDevMode ? [{ debugName: "_touched" }] : /* istanbul ignore next */ []);
45735
+ this._activeError = computed(() => this._touched() ? this.error() : "", ...ngDevMode ? [{ debugName: "_activeError" }] : /* istanbul ignore next */ []);
45625
45736
  this.minHeight = input(200, ...ngDevMode ? [{ debugName: "minHeight" }] : /* istanbul ignore next */ []);
45626
45737
  this.maxHeight = input(600, ...ngDevMode ? [{ debugName: "maxHeight" }] : /* istanbul ignore next */ []);
45627
45738
  this.hide = input([], ...ngDevMode ? [{ debugName: "hide" }] : /* istanbul ignore next */ []);
@@ -45725,6 +45836,7 @@ var RichTextEditorComponent = class RichTextEditorComponent {
45725
45836
  }
45726
45837
  onBlur() {
45727
45838
  this._saveSelection();
45839
+ this._touched.set(true);
45728
45840
  this._onTouched();
45729
45841
  }
45730
45842
  onToolbarMouseDown(event) {
@@ -46014,7 +46126,7 @@ var RichTextEditorComponent = class RichTextEditorComponent {
46014
46126
  }],
46015
46127
  ngImport: i0,
46016
46128
  template: `
46017
- <div class="rte-field" [class.rte-error]="error()" [class.rte-disabled]="disabled()">
46129
+ <div class="rte-field" [class.rte-error]="_activeError()" [class.rte-disabled]="disabled()">
46018
46130
  @if (label()) {
46019
46131
  <label class="rte-label" [id]="_labelId" (click)="focus()">
46020
46132
  {{ label() }}
@@ -46228,8 +46340,8 @@ var RichTextEditorComponent = class RichTextEditorComponent {
46228
46340
  [attr.aria-required]="required() || null"
46229
46341
  [attr.aria-readonly]="readonly() || null"
46230
46342
  [attr.aria-disabled]="disabled() || null"
46231
- [attr.aria-invalid]="error() ? 'true' : null"
46232
- [attr.aria-describedby]="error() ? _errorId : null"
46343
+ [attr.aria-invalid]="_activeError() ? 'true' : null"
46344
+ [attr.aria-describedby]="_activeError() ? _errorId : null"
46233
46345
  [attr.data-placeholder]="placeholder()"
46234
46346
  [attr.data-empty]="empty() ? 'true' : null"
46235
46347
  [style.min-height.px]="minHeight()"
@@ -46243,8 +46355,8 @@ var RichTextEditorComponent = class RichTextEditorComponent {
46243
46355
  ></div>
46244
46356
  </div>
46245
46357
 
46246
- @if (error()) {
46247
- <p class="rte-desc rte-desc-error" [id]="_errorId" role="alert">{{ error() }}</p>
46358
+ @if (_activeError()) {
46359
+ <p class="rte-desc rte-desc-error" [id]="_errorId" role="alert">{{ _activeError() }}</p>
46248
46360
  }
46249
46361
  </div>
46250
46362
  `,
@@ -46275,7 +46387,7 @@ i0.ɵɵngDeclareClassMetadata({
46275
46387
  "(document:selectionchange)": "onSelectionChange()"
46276
46388
  },
46277
46389
  template: `
46278
- <div class="rte-field" [class.rte-error]="error()" [class.rte-disabled]="disabled()">
46390
+ <div class="rte-field" [class.rte-error]="_activeError()" [class.rte-disabled]="disabled()">
46279
46391
  @if (label()) {
46280
46392
  <label class="rte-label" [id]="_labelId" (click)="focus()">
46281
46393
  {{ label() }}
@@ -46489,8 +46601,8 @@ i0.ɵɵngDeclareClassMetadata({
46489
46601
  [attr.aria-required]="required() || null"
46490
46602
  [attr.aria-readonly]="readonly() || null"
46491
46603
  [attr.aria-disabled]="disabled() || null"
46492
- [attr.aria-invalid]="error() ? 'true' : null"
46493
- [attr.aria-describedby]="error() ? _errorId : null"
46604
+ [attr.aria-invalid]="_activeError() ? 'true' : null"
46605
+ [attr.aria-describedby]="_activeError() ? _errorId : null"
46494
46606
  [attr.data-placeholder]="placeholder()"
46495
46607
  [attr.data-empty]="empty() ? 'true' : null"
46496
46608
  [style.min-height.px]="minHeight()"
@@ -46504,8 +46616,8 @@ i0.ɵɵngDeclareClassMetadata({
46504
46616
  ></div>
46505
46617
  </div>
46506
46618
 
46507
- @if (error()) {
46508
- <p class="rte-desc rte-desc-error" [id]="_errorId" role="alert">{{ error() }}</p>
46619
+ @if (_activeError()) {
46620
+ <p class="rte-desc rte-desc-error" [id]="_errorId" role="alert">{{ _activeError() }}</p>
46509
46621
  }
46510
46622
  </div>
46511
46623
  `,
@@ -46637,7 +46749,7 @@ var SwatchPickerComponent = class SwatchPickerComponent {
46637
46749
  this.errorMessage = computed(() => this._issue()?.message ?? "", ...ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []);
46638
46750
  this.invalidChange = output();
46639
46751
  this.valueChange = output();
46640
- this._activeError = computed(() => this.error() || (this._reveal.revealed() ? this.errorMessage() : ""), ...ngDevMode ? [{ debugName: "_activeError" }] : /* istanbul ignore next */ []);
46752
+ this._activeError = computed(() => this._reveal.revealed() ? this.error() || this.errorMessage() : "", ...ngDevMode ? [{ debugName: "_activeError" }] : /* istanbul ignore next */ []);
46641
46753
  this._onValidatorChange = () => {};
46642
46754
  this._onChange = (_) => {};
46643
46755
  this._onTouched = () => {};
@@ -47049,7 +47161,7 @@ var IconPickerComponent = class IconPickerComponent {
47049
47161
  this.errorMessage = computed(() => this._issue()?.message ?? "", ...ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []);
47050
47162
  this.invalidChange = output();
47051
47163
  this.valueChange = output();
47052
- this._activeError = computed(() => this.error() || (this._reveal.revealed() ? this.errorMessage() : ""), ...ngDevMode ? [{ debugName: "_activeError" }] : /* istanbul ignore next */ []);
47164
+ this._activeError = computed(() => this._reveal.revealed() ? this.error() || this.errorMessage() : "", ...ngDevMode ? [{ debugName: "_activeError" }] : /* istanbul ignore next */ []);
47053
47165
  this._onValidatorChange = () => {};
47054
47166
  this._onChange = (_) => {};
47055
47167
  this._onTouched = () => {};
@@ -47461,7 +47573,7 @@ var RadioMatrixComponent = class RadioMatrixComponent {
47461
47573
  this.invalid = computed(() => !!this.error() || !!this._issue(), ...ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []);
47462
47574
  this.errorMessage = computed(() => this._issue()?.message ?? "", ...ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []);
47463
47575
  this.invalidChange = output();
47464
- this._activeError = computed(() => this.error() || (this._reveal.revealed() ? this.errorMessage() : ""), ...ngDevMode ? [{ debugName: "_activeError" }] : /* istanbul ignore next */ []);
47576
+ this._activeError = computed(() => this._reveal.revealed() ? this.error() || this.errorMessage() : "", ...ngDevMode ? [{ debugName: "_activeError" }] : /* istanbul ignore next */ []);
47465
47577
  this._onValidatorChange = () => {};
47466
47578
  this._onChange = (_) => {};
47467
47579
  this._onTouched = () => {};
@@ -47898,12 +48010,17 @@ i0.ɵɵngDeclareClassMetadata({
47898
48010
  });
47899
48011
  let nextPadId = 0;
47900
48012
  var SignaturePadComponent = class SignaturePadComponent {
48013
+ resetTouched() {
48014
+ this._touched.set(false);
48015
+ }
47901
48016
  constructor() {
47902
48017
  this.labels = inject(UiLabelsService);
47903
48018
  this.label = input("", ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
47904
48019
  this.ariaLabel = input("", ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
47905
48020
  this.hint = input("", ...ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []);
47906
48021
  this.error = input("", ...ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []);
48022
+ this._touched = signal(false, ...ngDevMode ? [{ debugName: "_touched" }] : /* istanbul ignore next */ []);
48023
+ this._activeError = computed(() => this._touched() ? this.error() : "", ...ngDevMode ? [{ debugName: "_activeError" }] : /* istanbul ignore next */ []);
47907
48024
  this.width = input(600, ...ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []);
47908
48025
  this.height = input(120, ...ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []);
47909
48026
  this.outputWidth = input(600, ...ngDevMode ? [{ debugName: "outputWidth" }] : /* istanbul ignore next */ []);
@@ -47936,7 +48053,7 @@ var SignaturePadComponent = class SignaturePadComponent {
47936
48053
  this._descId = `sp-desc-${this._id}`;
47937
48054
  this._helpId = `sp-help-${this._id}`;
47938
48055
  this._accessibleName = computed(() => this.ariaLabel() || (this.label() ? null : this.labels.t("signaturePad.name")), ...ngDevMode ? [{ debugName: "_accessibleName" }] : /* istanbul ignore next */ []);
47939
- this._describedBy = computed(() => (this.error() || this.hint() ? this._descId + " " : "") + this._helpId, ...ngDevMode ? [{ debugName: "_describedBy" }] : /* istanbul ignore next */ []);
48056
+ this._describedBy = computed(() => (this._activeError() || this.hint() ? this._descId + " " : "") + this._helpId, ...ngDevMode ? [{ debugName: "_describedBy" }] : /* istanbul ignore next */ []);
47940
48057
  this._ctx = null;
47941
48058
  this._pointerId = null;
47942
48059
  this._dirty = false;
@@ -48073,6 +48190,7 @@ var SignaturePadComponent = class SignaturePadComponent {
48073
48190
  onPointerEnd(event) {
48074
48191
  if (this._pointerId === null || event.pointerId !== this._pointerId) return;
48075
48192
  this._pointerId = null;
48193
+ this._touched.set(true);
48076
48194
  this._commit();
48077
48195
  }
48078
48196
  onKeyDown(event) {
@@ -48132,6 +48250,7 @@ var SignaturePadComponent = class SignaturePadComponent {
48132
48250
  onBlur() {
48133
48251
  this._stopKeyboardStroke();
48134
48252
  this._cursorVisible.set(false);
48253
+ this._touched.set(true);
48135
48254
  this._onTouched();
48136
48255
  }
48137
48256
  _stopKeyboardStroke() {
@@ -48331,7 +48450,7 @@ var SignaturePadComponent = class SignaturePadComponent {
48331
48450
  }],
48332
48451
  ngImport: i0,
48333
48452
  template: `
48334
- <div class="sp-field" [class.sp-disabled]="disabled()" [class.sp-error]="!!error()">
48453
+ <div class="sp-field" [class.sp-disabled]="disabled()" [class.sp-error]="!!_activeError()">
48335
48454
  @if (label()) {
48336
48455
  <span class="sp-label" [id]="_labelId">{{ label() }}</span>
48337
48456
  }
@@ -48348,7 +48467,7 @@ var SignaturePadComponent = class SignaturePadComponent {
48348
48467
  [attr.aria-labelledby]="!ariaLabel() && label() ? _labelId : null"
48349
48468
  [attr.aria-describedby]="_describedBy()"
48350
48469
  [attr.aria-disabled]="disabled() ? 'true' : null"
48351
- [attr.aria-invalid]="error() ? 'true' : null"
48470
+ [attr.aria-invalid]="_activeError() ? 'true' : null"
48352
48471
  (pointerdown)="onPointerDown($event)"
48353
48472
  (pointermove)="onPointerMove($event)"
48354
48473
  (pointerup)="onPointerEnd($event)"
@@ -48363,8 +48482,8 @@ var SignaturePadComponent = class SignaturePadComponent {
48363
48482
  </div>
48364
48483
  <span class="sp-sr" [id]="_helpId">{{ labels.t('signaturePad.keyboardHelp') }}</span>
48365
48484
  <span class="sp-sr" role="status" aria-live="polite">{{ _announcement() }}</span>
48366
- @if (error()) {
48367
- <p class="sp-desc sp-desc-error" [id]="_descId" role="alert">{{ error() }}</p>
48485
+ @if (_activeError()) {
48486
+ <p class="sp-desc sp-desc-error" [id]="_descId" role="alert">{{ _activeError() }}</p>
48368
48487
  } @else if (hint()) {
48369
48488
  <p class="sp-desc" [id]="_descId">{{ hint() }}</p>
48370
48489
  }
@@ -48427,7 +48546,7 @@ i0.ɵɵngDeclareClassMetadata({
48427
48546
  multi: true
48428
48547
  }],
48429
48548
  template: `
48430
- <div class="sp-field" [class.sp-disabled]="disabled()" [class.sp-error]="!!error()">
48549
+ <div class="sp-field" [class.sp-disabled]="disabled()" [class.sp-error]="!!_activeError()">
48431
48550
  @if (label()) {
48432
48551
  <span class="sp-label" [id]="_labelId">{{ label() }}</span>
48433
48552
  }
@@ -48444,7 +48563,7 @@ i0.ɵɵngDeclareClassMetadata({
48444
48563
  [attr.aria-labelledby]="!ariaLabel() && label() ? _labelId : null"
48445
48564
  [attr.aria-describedby]="_describedBy()"
48446
48565
  [attr.aria-disabled]="disabled() ? 'true' : null"
48447
- [attr.aria-invalid]="error() ? 'true' : null"
48566
+ [attr.aria-invalid]="_activeError() ? 'true' : null"
48448
48567
  (pointerdown)="onPointerDown($event)"
48449
48568
  (pointermove)="onPointerMove($event)"
48450
48569
  (pointerup)="onPointerEnd($event)"
@@ -48459,8 +48578,8 @@ i0.ɵɵngDeclareClassMetadata({
48459
48578
  </div>
48460
48579
  <span class="sp-sr" [id]="_helpId">{{ labels.t('signaturePad.keyboardHelp') }}</span>
48461
48580
  <span class="sp-sr" role="status" aria-live="polite">{{ _announcement() }}</span>
48462
- @if (error()) {
48463
- <p class="sp-desc sp-desc-error" [id]="_descId" role="alert">{{ error() }}</p>
48581
+ @if (_activeError()) {
48582
+ <p class="sp-desc sp-desc-error" [id]="_descId" role="alert">{{ _activeError() }}</p>
48464
48583
  } @else if (hint()) {
48465
48584
  <p class="sp-desc" [id]="_descId">{{ hint() }}</p>
48466
48585
  }
@@ -50297,7 +50416,7 @@ var ColorInputComponent = class ColorInputComponent {
50297
50416
  this._issue = computed(() => this._check(this._model(), this._edited()), ...ngDevMode ? [{ debugName: "_issue" }] : /* istanbul ignore next */ []);
50298
50417
  this.invalid = computed(() => !!this.error() || !!this._issue(), ...ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []);
50299
50418
  this.errorMessage = computed(() => this._issue()?.message ?? "", ...ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []);
50300
- this._activeError = computed(() => this.error() || (this._reveal.revealed() ? this.errorMessage() : ""), ...ngDevMode ? [{ debugName: "_activeError" }] : /* istanbul ignore next */ []);
50419
+ this._activeError = computed(() => this._reveal.revealed() ? this.error() || this.errorMessage() : "", ...ngDevMode ? [{ debugName: "_activeError" }] : /* istanbul ignore next */ []);
50301
50420
  this._valid = computed(() => normalizeHexColor(this._model(), this.allowAlpha()), ...ngDevMode ? [{ debugName: "_valid" }] : /* istanbul ignore next */ []);
50302
50421
  this._swatchColor = computed(() => this._valid() ?? "transparent", ...ngDevMode ? [{ debugName: "_swatchColor" }] : /* istanbul ignore next */ []);
50303
50422
  this._nativeValue = computed(() => (this._valid() ?? "#000000").slice(0, 7), ...ngDevMode ? [{ debugName: "_nativeValue" }] : /* istanbul ignore next */ []);
@@ -59657,12 +59776,13 @@ var EmailTemplateEditorComponent = class EmailTemplateEditorComponent {
59657
59776
  this.submitAttempted = signal(false, ...ngDevMode ? [{ debugName: "submitAttempted" }] : /* istanbul ignore next */ []);
59658
59777
  this.nameTouched = signal(false, ...ngDevMode ? [{ debugName: "nameTouched" }] : /* istanbul ignore next */ []);
59659
59778
  this.subjectTouched = signal(false, ...ngDevMode ? [{ debugName: "subjectTouched" }] : /* istanbul ignore next */ []);
59660
- this.nameErrorShown = computed(() => this.nameTouched() || this.submitAttempted() ? this.nameError() : "", ...ngDevMode ? [{ debugName: "nameErrorShown" }] : /* istanbul ignore next */ []);
59661
- this.subjectErrorShown = computed(() => this.subjectTouched() || this.submitAttempted() ? this.subjectError() : "", ...ngDevMode ? [{ debugName: "subjectErrorShown" }] : /* istanbul ignore next */ []);
59662
- this.bodyErrorShown = computed(() => this.bodyEdited() || this.submitAttempted() ? this.bodyError() : "", ...ngDevMode ? [{ debugName: "bodyErrorShown" }] : /* istanbul ignore next */ []);
59779
+ this.nameErrorShown = computed(() => this.nameTouched() ? this.nameError() : "", ...ngDevMode ? [{ debugName: "nameErrorShown" }] : /* istanbul ignore next */ []);
59780
+ this.subjectErrorShown = computed(() => this.subjectTouched() ? this.subjectError() : "", ...ngDevMode ? [{ debugName: "subjectErrorShown" }] : /* istanbul ignore next */ []);
59781
+ this.bodyBlurred = signal(false, ...ngDevMode ? [{ debugName: "bodyBlurred" }] : /* istanbul ignore next */ []);
59782
+ this.bodyErrorShown = computed(() => this.bodyEdited() || this.bodyBlurred() ? this.bodyError() : "", ...ngDevMode ? [{ debugName: "bodyErrorShown" }] : /* istanbul ignore next */ []);
59663
59783
  this.assignmentError = computed(() => this.assignmentOptions().length > 0 && !this.assignmentState().some((a) => a.assigned) ? this.labels.t("emailTemplateEditor.assignmentRequired") : "", ...ngDevMode ? [{ debugName: "assignmentError" }] : /* istanbul ignore next */ []);
59664
59784
  this.assignmentsTouched = signal(false, ...ngDevMode ? [{ debugName: "assignmentsTouched" }] : /* istanbul ignore next */ []);
59665
- this.assignmentErrorShown = computed(() => this.assignmentsTouched() || this.submitAttempted() ? this.assignmentError() : "", ...ngDevMode ? [{ debugName: "assignmentErrorShown" }] : /* istanbul ignore next */ []);
59785
+ this.assignmentErrorShown = computed(() => this.assignmentsTouched() ? this.assignmentError() : "", ...ngDevMode ? [{ debugName: "assignmentErrorShown" }] : /* istanbul ignore next */ []);
59666
59786
  this.canSave = computed(() => !this.nameError() && !this.subjectError() && !this.bodyError() && !this.datesError() && !this.assignmentError(), ...ngDevMode ? [{ debugName: "canSave" }] : /* istanbul ignore next */ []);
59667
59787
  this.saveDisabled = computed(() => !this.canWrite() || !this.canSave(), ...ngDevMode ? [{ debugName: "saveDisabled" }] : /* istanbul ignore next */ []);
59668
59788
  this.saveHint = computed(() => {
@@ -59674,6 +59794,11 @@ var EmailTemplateEditorComponent = class EmailTemplateEditorComponent {
59674
59794
  if (this.assignmentError()) missing.push(this.labels.t("emailTemplateEditor.missing.assignment"));
59675
59795
  return missing.length ? this.labels.t("emailTemplateEditor.saveHint", { items: missing.join(", ") }) : this.datesError();
59676
59796
  }, ...ngDevMode ? [{ debugName: "saveHint" }] : /* istanbul ignore next */ []);
59797
+ this.datesTouched = signal(false, ...ngDevMode ? [{ debugName: "datesTouched" }] : /* istanbul ignore next */ []);
59798
+ this.saveHintVisible = computed(() => {
59799
+ const hint = this.saveHint();
59800
+ return hint && hint === this.datesError() && !this.datesTouched() ? "" : hint;
59801
+ }, ...ngDevMode ? [{ debugName: "saveHintVisible" }] : /* istanbul ignore next */ []);
59677
59802
  this.normalizedLink = computed(() => {
59678
59803
  const url = this.linkUrl().trim();
59679
59804
  if (!url) return "";
@@ -59761,6 +59886,8 @@ var EmailTemplateEditorComponent = class EmailTemplateEditorComponent {
59761
59886
  this.blockSpacing.set(this.blocks()[0]?.spacing ?? "");
59762
59887
  this.loadedBody.set(t?.id ? t.body ?? "" : null);
59763
59888
  this.bodyEdited.set(false);
59889
+ this.bodyBlurred.set(false);
59890
+ this.datesTouched.set(false);
59764
59891
  this.submitAttempted.set(false);
59765
59892
  this.nameTouched.set(false);
59766
59893
  this.subjectTouched.set(false);
@@ -59768,6 +59895,16 @@ var EmailTemplateEditorComponent = class EmailTemplateEditorComponent {
59768
59895
  this.assignmentsTouched.set(false);
59769
59896
  this.savedSnapshot.set(t?.id ? this.snapshot() : null);
59770
59897
  }
59898
+ onBodyFocusOut(event) {
59899
+ const next = event.relatedTarget;
59900
+ if (next && event.currentTarget.contains(next)) return;
59901
+ this.bodyBlurred.set(true);
59902
+ }
59903
+ onAssignmentsFocusOut(event) {
59904
+ const next = event.relatedTarget;
59905
+ if (next && event.currentTarget.contains(next)) return;
59906
+ this.assignmentsTouched.set(true);
59907
+ }
59771
59908
  onSave() {
59772
59909
  if (this.saving() || !this.canWrite()) return;
59773
59910
  if (!this.canSave()) {
@@ -60476,6 +60613,10 @@ var EmailTemplateEditorComponent = class EmailTemplateEditorComponent {
60476
60613
  <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"/><polyline points="17 21 17 13 7 13 7 21"/><polyline points="7 3 7 8 15 8"/></svg>{{ labels.t('emailTemplateEditor.saveTemplate') }}</ui-button>
60477
60614
  </span>
60478
60615
  </div>
60616
+ @if (saveHintVisible(); as hint) {
60617
+ <!-- A blocked Save explains itself in visible text, not only in the tooltip. -->
60618
+ <p class="save-hint" role="status" data-testid="save-hint">{{ hint }}</p>
60619
+ }
60479
60620
  </div>
60480
60621
  <ui-divider />
60481
60622
 
@@ -60498,12 +60639,12 @@ var EmailTemplateEditorComponent = class EmailTemplateEditorComponent {
60498
60639
 
60499
60640
  <div class="form-field">
60500
60641
  <ui-text-input [label]="labels.t('common.name')" [required]="true" [(ngModel)]="name" [readonly]="!canWrite()" [maxlength]="maxTextLength()"
60501
- [placeholder]="namePlaceholder()" [error]="nameErrorShown()" [showErrors]="nameTouched() || submitAttempted()" (blurred)="nameTouched.set(true)" />
60642
+ [placeholder]="namePlaceholder()" [error]="nameErrorShown()" [showErrors]="nameTouched()" (blurred)="nameTouched.set(true)" />
60502
60643
  </div>
60503
60644
 
60504
60645
  <div class="form-field">
60505
60646
  <ui-text-input [label]="labels.t('common.subject')" [required]="true" [(ngModel)]="subject" [readonly]="!canWrite()" [maxlength]="maxTextLength()"
60506
- [placeholder]="subjectPlaceholder()" [error]="subjectErrorShown()" [showErrors]="subjectTouched() || submitAttempted()" (blurred)="subjectTouched.set(true)">
60647
+ [placeholder]="subjectPlaceholder()" [error]="subjectErrorShown()" [showErrors]="subjectTouched()" (blurred)="subjectTouched.set(true)">
60507
60648
  </ui-text-input>
60508
60649
  </div>
60509
60650
 
@@ -60514,7 +60655,7 @@ var EmailTemplateEditorComponent = class EmailTemplateEditorComponent {
60514
60655
  <ui-checkbox [label]="labels.t('emailTemplateEditor.useThisTemplateAllYear')" [(checked)]="useAllYear" [disabled]="!canWrite()" />
60515
60656
 
60516
60657
  @if (!useAllYear()) {
60517
- <div class="form-row-dates">
60658
+ <div class="form-row-dates" (focusout)="datesTouched.set(true)">
60518
60659
  <ui-date-input [label]="labels.t('emailTemplateEditor.activeFrom')" [(ngModel)]="activeFrom" [disabled]="!canWrite()" />
60519
60660
  <ui-date-input [label]="labels.t('emailTemplateEditor.activeTo')" [(ngModel)]="activeTo" [disabled]="!canWrite()" [min]="activeFrom()" [error]="datesError()" />
60520
60661
  </div>
@@ -60530,7 +60671,7 @@ var EmailTemplateEditorComponent = class EmailTemplateEditorComponent {
60530
60671
  @if (filteredAssignments().length === 0) {
60531
60672
  <ui-empty-state iconType="search" [title]="labels.t('emailTemplateEditor.noAssignmentsFound')" [message]="labels.t('emailTemplateEditor.noAssignmentsMatchYourSearch')" />
60532
60673
  }
60533
- <div class="assignment-list" [hidden]="filteredAssignments().length === 0">
60674
+ <div class="assignment-list" [hidden]="filteredAssignments().length === 0" (focusout)="onAssignmentsFocusOut($event)">
60534
60675
  @for (item of filteredAssignments(); track item.key) {
60535
60676
  <div class="assignment-item" [class.assignment-readonly]="!canWrite()" [attr.role]="canWrite() ? 'switch' : null" [attr.tabindex]="canWrite() ? 0 : null"
60536
60677
  [attr.aria-checked]="canWrite() ? item.assigned : null" [attr.aria-label]="canWrite() ? item.name : null"
@@ -60674,7 +60815,7 @@ var EmailTemplateEditorComponent = class EmailTemplateEditorComponent {
60674
60815
  <ui-error [errorId]="idPrefix() + '-body-error'" [message]="bodyErrorShown()" />
60675
60816
 
60676
60817
  <!-- Block Canvas with DnD -->
60677
- <div class="blocks-canvas" (dragover)="onCanvasDragOver($event)" (drop)="onDropZoneDrop($event, blocks().length)">
60818
+ <div class="blocks-canvas" (dragover)="onCanvasDragOver($event)" (drop)="onDropZoneDrop($event, blocks().length)" (focusout)="onBodyFocusOut($event)">
60678
60819
  <!-- Initial drop zone (before first block) -->
60679
60820
  <div class="drop-zone" [class.active]="dragOverIndex() === 0" (dragover)="onDropZoneDragOver($event, 0)" (dragleave)="onDropZoneLeave()" (drop)="onDropZoneDrop($event, 0)">
60680
60821
  <span class="drop-zone-label">{{ labels.t('emailTemplateEditor.dropHere') }}</span>
@@ -60904,7 +61045,7 @@ var EmailTemplateEditorComponent = class EmailTemplateEditorComponent {
60904
61045
 
60905
61046
  `,
60906
61047
  isInline: true,
60907
- styles: [":host{display:flex;flex-direction:column;flex:1;min-height:0}.required{color:#ef4444;font-weight:400}.editor-page{display:flex;flex-direction:column;flex:1;min-height:0;background:#f8fafc;overflow:hidden}.editor-actions{display:flex;justify-content:space-between;align-items:center;gap:8px 16px;flex-wrap:wrap;padding:0 0 12px;flex-shrink:0}.editor-heading{margin:0;font-size:1.25rem;font-weight:700;color:#1e293b;line-height:1.3;min-width:0}.save-wrap{display:inline-flex}.editor-actions-buttons{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap;margin-left:auto}.readonly-note{margin:0;padding:8px 16px;font-size:.8125rem;color:#92400e;background:#fffbeb;border-bottom:1px solid #fde68a}.readonly-note.system-note{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.editor-body{display:grid;grid-template-columns:340px minmax(0,1fr) 300px;grid-template-rows:minmax(0,1fr);flex:1;min-height:0;overflow:hidden}.panel-left{background:#fff;border-right:1px solid #e2e8f0;padding:24px;overflow-y:auto}.panel-title{font-size:1.0625rem;font-weight:700;color:#1e293b;margin:0 0 20px}.form-field{display:flex;flex-direction:column;gap:6px;margin-bottom:16px}.form-row-dates{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:16px}.assignments-section{border-top:1px solid #e2e8f0;padding-top:20px;margin-top:16px}.section-title{font-size:.9375rem;font-weight:700;color:#1e293b;margin:0 0 6px}.section-desc{font-size:.8125rem;color:#64748b;line-height:1.5;margin:0 0 12px}.assignment-list{max-height:340px;overflow-y:auto;margin-top:12px;border:1px solid #e2e8f0;border-radius:8px}.assignment-item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 14px;cursor:pointer;border-bottom:1px solid #f1f5f9;transition:background .1s}.assignment-item:last-child{border-bottom:none}.assignment-item:hover{background:#f8fafc}.assignment-item:focus-visible{outline:2px solid #3b82f6;outline-offset:-2px}.assignment-item.assignment-readonly{cursor:default}.assignment-item.assignment-readonly:hover{background:transparent}.assignment-text{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}.assignment-text strong{font-size:.8125rem;color:#1e293b}.assignment-text span{font-size:.75rem;color:#64748b}.assignment-channels{display:flex;gap:4px;flex-shrink:0}.channel-badge{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:4px;background:#f1f5f9;color:#64748b;transition:all .15s}.channel-badge.active{background:#3b82f6;color:#fff}.channel-badge.disabled{opacity:.4;cursor:not-allowed}.config-desc{font-size:.875rem;color:#64748b;line-height:1.5;margin:0}.config-divider{border:none;border-top:1px solid #e2e8f0;margin:20px 0}.config-section{display:flex;flex-direction:column;gap:12px}.config-section-label{font-size:.6875rem;font-weight:700;color:#3b82f6;text-transform:uppercase;letter-spacing:.04em}.config-field{display:flex;flex-direction:column;gap:6px}.config-field-mt{margin-top:16px}.config-label{font-size:.8125rem;font-weight:600;color:#1e293b}.config-readonly{padding:9px 12px;border:1px solid #e2e8f0;border-radius:8px;background:#f8fafc;font-size:.875rem;color:#1e293b}.config-hint{font-size:.75rem;color:#64748b}.test-save-note{display:flex;align-items:center;gap:8px;padding:10px 14px;background:#fef3c7;border:1px solid #fcd34d;border-radius:8px;font-size:.8125rem;color:#92400e;margin-top:12px}.test-save-note svg{flex-shrink:0}.panel-center{display:flex;flex-direction:column;min-height:0;min-width:0;overflow:hidden}.editor-tabs{display:flex;gap:2px;padding:12px 20px 0;background:#fff;border-bottom:1px solid #e2e8f0;overflow-x:auto;-webkit-overflow-scrolling:touch}.editor-tab{display:flex;align-items:center;gap:6px;padding:10px 16px;border:1px solid #e2e8f0;border-bottom:none;border-radius:8px 8px 0 0;background:#f8fafc;font-size:.8125rem;font-weight:600;color:#64748b;cursor:pointer;font-family:inherit;white-space:nowrap}.editor-tab:hover{background:#fff;color:#1e293b}.editor-tab.active{background:#eff6ff;color:#1d4ed8;border-color:#93c5fd}.editor-tab:focus-visible,.right-tab:focus-visible,.block-group-header:focus-visible,.variable-item:focus-visible,.add-block-btn:focus-visible,.block-item:focus-visible,.video-lib-item:focus-visible{outline:2px solid #3b82f6;outline-offset:-2px}.editor-toolbar{display:flex;align-items:center;gap:8px;padding:10px 20px;background:#fff;border-bottom:1px solid #e2e8f0;flex-wrap:wrap}.toolbar-row-2{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:8px 20px;background:#fff;border-bottom:1px solid #e2e8f0}.toolbar-group{display:flex;align-items:center;gap:2px;padding-right:8px;border-right:1px solid #e2e8f0}.toolbar-group:last-child{border-right:none;padding-right:0}.toolbar-select{display:block;min-width:96px}.toolbar-label{font-size:.75rem;font-weight:600;color:#64748b;white-space:nowrap;margin-right:6px}.hidden-color-input{position:absolute;width:0;height:0;opacity:0;pointer-events:none;border:none;padding:0}.color-indicator{display:flex;flex-direction:column;align-items:center;gap:2px;color:#475569}.color-bar{display:block;width:16px;height:3px;border-radius:2px;border:1px solid rgba(0,0,0,.1)}.link-dialog{background:#fff;border-bottom:1px solid #e2e8f0;padding:12px 20px}.link-dialog-inner{display:flex;align-items:flex-start;gap:8px;flex-wrap:wrap}.link-dialog-title{font-size:.8125rem;font-weight:700;color:#1e293b;white-space:nowrap;padding-top:10px}.link-dialog-input{display:block;width:240px;max-width:100%}.link-dialog-actions{display:flex;gap:6px}.preview-frame{flex:1;display:flex;justify-content:center;align-items:stretch;padding:24px;overflow-y:auto;background:#f1f5f9}.preview-frame.mobile{align-items:flex-start}.preview-content{display:block;flex:1 1 auto;max-width:600px;width:100%;box-sizing:border-box;min-height:400px;background:#fff;border:1px solid #e2e8f0;border-radius:8px}.mobile-shell{width:375px;max-width:100%;box-sizing:border-box;min-height:600px;border:2px solid #1e293b;border-radius:24px;padding:40px 12px 24px;background:#fff;box-shadow:0 8px 32px #0000001f}.mobile-shell .preview-content{border:none;border-radius:0;max-width:100%;height:520px;min-height:0}.blocks-canvas{flex:1 1 0;min-height:0;padding:16px 20px 24px 56px;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;background:#f1f5f9;display:flex;flex-direction:column}.block-wrapper{flex-shrink:0;position:relative;display:flex;align-items:flex-start;background:#fff;border:2px solid transparent;border-radius:8px;transition:border-color .15s,box-shadow .15s}.block-wrapper:hover,.block-wrapper.selected,.block-wrapper:focus-within{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61a}.block-wrapper:hover .block-drag-handle,.block-wrapper.selected .block-drag-handle,.block-wrapper:focus-within .block-drag-handle{opacity:1}.block-wrapper:hover .block-controls,.block-wrapper.selected .block-controls,.block-wrapper:focus-within .block-controls{opacity:1;pointer-events:all}.block-wrapper.dragging{opacity:.4}.block-drag-handle{flex-shrink:0;width:28px;display:flex;align-items:flex-start;justify-content:center;padding-top:14px;opacity:0;transition:opacity .15s;cursor:grab;color:#94a3b8}.block-drag-handle:active{cursor:grabbing}.block-content{flex:1;min-width:0;padding:12px 16px;outline:none;font-size:.9375rem;color:#1e293b;line-height:1.6;min-height:48px;overflow-wrap:anywhere}.block-content:empty:before{content:attr(data-placeholder);color:#64748b;font-style:italic;pointer-events:none}.block-content p{margin:0 0 8px}.block-content p:last-child{margin:0}.block-content h1,.block-content h2,.block-content h3{margin:8px 0 6px;color:#1e293b}.block-content a{color:#3b82f6}.block-content img{max-width:100%;border-radius:6px}.block-content ul,.block-content ol{padding-left:20px;margin:0 0 8px}.block-controls{position:absolute;top:0;left:-48px;flex-direction:column;display:flex;gap:2px;opacity:0;pointer-events:none;transition:opacity .15s;background:#fff;border:1px solid #e2e8f0;border-radius:6px;padding:3px;box-shadow:0 2px 6px #00000014}@media(pointer:coarse){.editor-tab,.right-tab,.block-group-header{min-height:44px}}@media(hover:none){.block-wrapper.selected .block-controls{opacity:1;pointer-events:all}}.drop-zone{flex-shrink:0;height:8px;display:flex;align-items:center;justify-content:center;border-radius:4px;transition:height .15s,background .15s;position:relative}.drop-zone-label{font-size:.75rem;font-weight:600;color:#1d4ed8;opacity:0;transition:opacity .1s}.drop-zone.active{height:40px;background:#3b82f614;border:2px dashed #3b82f6}.drop-zone.active .drop-zone-label{opacity:1}.add-block-btn{flex-shrink:0;display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:44px;padding:12px;margin-top:8px;border:2px dashed #e2e8f0;border-radius:8px;background:none;font-size:.875rem;font-weight:600;color:#475569;cursor:pointer;font-family:inherit;transition:border-color .15s,color .15s,background .15s}.add-block-btn:hover{border-color:#3b82f6;color:#3b82f6;background:#3b82f60a}.panel-right{background:#fff;border-left:1px solid #e2e8f0;display:flex;flex-direction:column;min-height:0;min-width:0}.right-tabs{display:flex;border-bottom:1px solid #e2e8f0}.right-tab{flex:1;display:flex;align-items:center;justify-content:center;gap:6px;padding:12px;min-height:44px;border:none;background:none;font-size:.8125rem;font-weight:600;color:#64748b;cursor:pointer;font-family:inherit;border-bottom:2px solid transparent}.right-tab:hover{color:#1e293b}.right-tab.active{color:#1d4ed8;background:#eff6ff;border-bottom-color:#3b82f6}.right-panel-body{flex:1;padding:20px;overflow-y:auto}.right-section-title{font-size:.9375rem;font-weight:700;color:#1e293b;margin:0 0 12px}.right-section-desc{font-size:.8125rem;color:#64748b;margin:0 0 16px;line-height:1.5}.right-section-hint{font-size:.8125rem;color:#64748b;margin:0 0 12px;line-height:1.5}.block-group{border-bottom:1px solid #f1f5f9}.block-group-header{display:flex;align-items:center;gap:8px;width:100%;min-height:44px;padding:12px 0;border:none;background:none;font-size:.875rem;font-weight:600;color:#1e293b;cursor:pointer;font-family:inherit;text-align:left}.block-group-header .chevron{transition:transform .2s;color:#94a3b8}.block-group-header .chevron.expanded{transform:rotate(90deg)}.block-group-header span:nth-of-type(1){flex:1}.block-count{font-size:.75rem;font-weight:600;color:#475569;background:#f1f5f9;padding:2px 8px;border-radius:10px;margin-left:auto}.block-list{display:flex;flex-direction:column;gap:2px;padding-bottom:8px}.variable-list{display:flex;flex-direction:column;padding-bottom:8px}.variable-item+.variable-item{border-top:1px solid #f1f5f9;border-radius:0}.block-item{display:flex;align-items:center;gap:6px;box-sizing:border-box;width:100%;min-height:44px;padding:8px 0;font-size:.8125rem;color:#64748b;cursor:pointer;text-align:left;border-radius:4px;font-family:inherit;-webkit-user-select:none;user-select:none}.block-item:hover{background:#f8fafc;color:#1e293b}.block-item-drag{color:#cbd5e1;flex-shrink:0;cursor:grab}.variable-item{display:flex;flex-direction:column;align-items:flex-start;gap:4px;min-height:44px;padding:8px 0;min-width:0;width:100%;box-sizing:border-box;border:none;background:none;cursor:pointer;text-align:left;border-radius:4px;font-family:inherit}.variable-item:hover{background:#f8fafc}.var-tag{max-width:100%;overflow-wrap:anywhere;font-size:.75rem;font-weight:600;color:#1d4ed8;background:#3b82f614;padding:2px 6px;border-radius:4px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.var-example{font-size:.75rem;color:#64748b;overflow-wrap:anywhere}.var-description{font-size:.75rem;color:#64748b;line-height:1.4;overflow-wrap:anywhere}.video-library-panel{padding:0}.video-library-panel .right-section-title,.video-library-panel .right-section-hint{padding:0 16px}.video-library-panel .right-section-title{padding-top:16px}.video-config-section{display:flex;flex-direction:column;gap:8px;padding:12px 16px;border-bottom:1px solid #f1f5f9}.video-config-section:last-of-type{border-bottom:none}.video-lib-list{display:flex;flex-direction:column;gap:2px;padding:8px 8px 16px}.video-lib-item{display:flex;align-items:center;gap:10px;width:100%;min-height:44px;padding:8px;border:1px solid transparent;border-radius:8px;background:none;cursor:pointer;text-align:left;font-family:inherit;transition:background .15s,border-color .15s}.video-lib-item:hover{background:#f8fafc;border-color:#e2e8f0}.video-lib-item.selected{background:#eff6ff;border-color:#93c5fd}.vli-thumb{position:relative;flex-shrink:0;width:56px;height:40px;border-radius:6px;background:linear-gradient(135deg,#f1f5f9,#e2e8f0);display:flex;align-items:center;justify-content:center}.vli-dur{position:absolute;bottom:2px;right:3px;font-size:.625rem;font-weight:600;color:#fff;background:#000000a6;padding:1px 4px;border-radius:3px}.vli-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.vli-title{font-size:.8125rem;font-weight:600;color:#1e293b;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vli-cat{font-size:.75rem;color:#475569}.vli-check{flex-shrink:0}.video-lib-loading{padding:8px}.video-lib-skeleton{display:flex;align-items:center;gap:10px;padding:8px;margin-bottom:4px}.vls-info{flex:1;display:flex;flex-direction:column;gap:6px}@media(max-width:1200px){.editor-body{grid-template-columns:280px minmax(0,1fr) 260px}}@media(max-width:900px){:host{flex:none}.editor-page{flex:none;min-height:100vh;min-height:100dvh;overflow:visible}.editor-body{display:flex;flex-direction:column;flex:none;overflow:visible}.panel-left{border-right:none;border-bottom:1px solid #e2e8f0;overflow:visible;padding:16px}.panel-center{overflow:visible;min-height:480px}.blocks-canvas{overflow:visible;min-height:320px}.panel-right{border-left:none;border-top:1px solid #e2e8f0}.right-panel-body{overflow:visible}.editor-toolbar,.toolbar-row-2,.link-dialog,.editor-tabs{padding-left:12px;padding-right:12px}.preview-frame{padding:12px}.form-row-dates{grid-template-columns:1fr}}@media(prefers-reduced-motion:reduce){*{transition:none!important}}\n"],
61048
+ styles: [":host{display:flex;flex-direction:column;flex:1;min-height:0}.required{color:#ef4444;font-weight:400}.editor-page{display:flex;flex-direction:column;flex:1;min-height:0;background:#f8fafc;overflow:hidden}.editor-actions{display:flex;justify-content:space-between;align-items:center;gap:8px 16px;flex-wrap:wrap;padding:0 0 12px;flex-shrink:0}.editor-heading{margin:0;font-size:1.25rem;font-weight:700;color:#1e293b;line-height:1.3;min-width:0}.save-wrap{display:inline-flex}.save-hint{margin:0;font-size:12px;color:#475569;flex-basis:100%;text-align:right}.editor-actions-buttons{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap;margin-left:auto}.readonly-note{margin:0;padding:8px 16px;font-size:.8125rem;color:#92400e;background:#fffbeb;border-bottom:1px solid #fde68a}.readonly-note.system-note{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.editor-body{display:grid;grid-template-columns:340px minmax(0,1fr) 300px;grid-template-rows:minmax(0,1fr);flex:1;min-height:0;overflow:hidden}.panel-left{background:#fff;border-right:1px solid #e2e8f0;padding:24px;overflow-y:auto}.panel-title{font-size:1.0625rem;font-weight:700;color:#1e293b;margin:0 0 20px}.form-field{display:flex;flex-direction:column;gap:6px;margin-bottom:16px}.form-row-dates{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:16px}.assignments-section{border-top:1px solid #e2e8f0;padding-top:20px;margin-top:16px}.section-title{font-size:.9375rem;font-weight:700;color:#1e293b;margin:0 0 6px}.section-desc{font-size:.8125rem;color:#64748b;line-height:1.5;margin:0 0 12px}.assignment-list{max-height:340px;overflow-y:auto;margin-top:12px;border:1px solid #e2e8f0;border-radius:8px}.assignment-item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 14px;cursor:pointer;border-bottom:1px solid #f1f5f9;transition:background .1s}.assignment-item:last-child{border-bottom:none}.assignment-item:hover{background:#f8fafc}.assignment-item:focus-visible{outline:2px solid #3b82f6;outline-offset:-2px}.assignment-item.assignment-readonly{cursor:default}.assignment-item.assignment-readonly:hover{background:transparent}.assignment-text{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}.assignment-text strong{font-size:.8125rem;color:#1e293b}.assignment-text span{font-size:.75rem;color:#64748b}.assignment-channels{display:flex;gap:4px;flex-shrink:0}.channel-badge{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:4px;background:#f1f5f9;color:#64748b;transition:all .15s}.channel-badge.active{background:#3b82f6;color:#fff}.channel-badge.disabled{opacity:.4;cursor:not-allowed}.config-desc{font-size:.875rem;color:#64748b;line-height:1.5;margin:0}.config-divider{border:none;border-top:1px solid #e2e8f0;margin:20px 0}.config-section{display:flex;flex-direction:column;gap:12px}.config-section-label{font-size:.6875rem;font-weight:700;color:#3b82f6;text-transform:uppercase;letter-spacing:.04em}.config-field{display:flex;flex-direction:column;gap:6px}.config-field-mt{margin-top:16px}.config-label{font-size:.8125rem;font-weight:600;color:#1e293b}.config-readonly{padding:9px 12px;border:1px solid #e2e8f0;border-radius:8px;background:#f8fafc;font-size:.875rem;color:#1e293b}.config-hint{font-size:.75rem;color:#64748b}.test-save-note{display:flex;align-items:center;gap:8px;padding:10px 14px;background:#fef3c7;border:1px solid #fcd34d;border-radius:8px;font-size:.8125rem;color:#92400e;margin-top:12px}.test-save-note svg{flex-shrink:0}.panel-center{display:flex;flex-direction:column;min-height:0;min-width:0;overflow:hidden}.editor-tabs{display:flex;gap:2px;padding:12px 20px 0;background:#fff;border-bottom:1px solid #e2e8f0;overflow-x:auto;-webkit-overflow-scrolling:touch}.editor-tab{display:flex;align-items:center;gap:6px;padding:10px 16px;border:1px solid #e2e8f0;border-bottom:none;border-radius:8px 8px 0 0;background:#f8fafc;font-size:.8125rem;font-weight:600;color:#64748b;cursor:pointer;font-family:inherit;white-space:nowrap}.editor-tab:hover{background:#fff;color:#1e293b}.editor-tab.active{background:#eff6ff;color:#1d4ed8;border-color:#93c5fd}.editor-tab:focus-visible,.right-tab:focus-visible,.block-group-header:focus-visible,.variable-item:focus-visible,.add-block-btn:focus-visible,.block-item:focus-visible,.video-lib-item:focus-visible{outline:2px solid #3b82f6;outline-offset:-2px}.editor-toolbar{display:flex;align-items:center;gap:8px;padding:10px 20px;background:#fff;border-bottom:1px solid #e2e8f0;flex-wrap:wrap}.toolbar-row-2{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:8px 20px;background:#fff;border-bottom:1px solid #e2e8f0}.toolbar-group{display:flex;align-items:center;gap:2px;padding-right:8px;border-right:1px solid #e2e8f0}.toolbar-group:last-child{border-right:none;padding-right:0}.toolbar-select{display:block;min-width:96px}.toolbar-label{font-size:.75rem;font-weight:600;color:#64748b;white-space:nowrap;margin-right:6px}.hidden-color-input{position:absolute;width:0;height:0;opacity:0;pointer-events:none;border:none;padding:0}.color-indicator{display:flex;flex-direction:column;align-items:center;gap:2px;color:#475569}.color-bar{display:block;width:16px;height:3px;border-radius:2px;border:1px solid rgba(0,0,0,.1)}.link-dialog{background:#fff;border-bottom:1px solid #e2e8f0;padding:12px 20px}.link-dialog-inner{display:flex;align-items:flex-start;gap:8px;flex-wrap:wrap}.link-dialog-title{font-size:.8125rem;font-weight:700;color:#1e293b;white-space:nowrap;padding-top:10px}.link-dialog-input{display:block;width:240px;max-width:100%}.link-dialog-actions{display:flex;gap:6px}.preview-frame{flex:1;display:flex;justify-content:center;align-items:stretch;padding:24px;overflow-y:auto;background:#f1f5f9}.preview-frame.mobile{align-items:flex-start}.preview-content{display:block;flex:1 1 auto;max-width:600px;width:100%;box-sizing:border-box;min-height:400px;background:#fff;border:1px solid #e2e8f0;border-radius:8px}.mobile-shell{width:375px;max-width:100%;box-sizing:border-box;min-height:600px;border:2px solid #1e293b;border-radius:24px;padding:40px 12px 24px;background:#fff;box-shadow:0 8px 32px #0000001f}.mobile-shell .preview-content{border:none;border-radius:0;max-width:100%;height:520px;min-height:0}.blocks-canvas{flex:1 1 0;min-height:0;padding:16px 20px 24px 56px;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;background:#f1f5f9;display:flex;flex-direction:column}.block-wrapper{flex-shrink:0;position:relative;display:flex;align-items:flex-start;background:#fff;border:2px solid transparent;border-radius:8px;transition:border-color .15s,box-shadow .15s}.block-wrapper:hover,.block-wrapper.selected,.block-wrapper:focus-within{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61a}.block-wrapper:hover .block-drag-handle,.block-wrapper.selected .block-drag-handle,.block-wrapper:focus-within .block-drag-handle{opacity:1}.block-wrapper:hover .block-controls,.block-wrapper.selected .block-controls,.block-wrapper:focus-within .block-controls{opacity:1;pointer-events:all}.block-wrapper.dragging{opacity:.4}.block-drag-handle{flex-shrink:0;width:28px;display:flex;align-items:flex-start;justify-content:center;padding-top:14px;opacity:0;transition:opacity .15s;cursor:grab;color:#94a3b8}.block-drag-handle:active{cursor:grabbing}.block-content{flex:1;min-width:0;padding:12px 16px;outline:none;font-size:.9375rem;color:#1e293b;line-height:1.6;min-height:48px;overflow-wrap:anywhere}.block-content:empty:before{content:attr(data-placeholder);color:#64748b;font-style:italic;pointer-events:none}.block-content p{margin:0 0 8px}.block-content p:last-child{margin:0}.block-content h1,.block-content h2,.block-content h3{margin:8px 0 6px;color:#1e293b}.block-content a{color:#3b82f6}.block-content img{max-width:100%;border-radius:6px}.block-content ul,.block-content ol{padding-left:20px;margin:0 0 8px}.block-controls{position:absolute;top:0;left:-48px;flex-direction:column;display:flex;gap:2px;opacity:0;pointer-events:none;transition:opacity .15s;background:#fff;border:1px solid #e2e8f0;border-radius:6px;padding:3px;box-shadow:0 2px 6px #00000014}@media(pointer:coarse){.editor-tab,.right-tab,.block-group-header{min-height:44px}}@media(hover:none){.block-wrapper.selected .block-controls{opacity:1;pointer-events:all}}.drop-zone{flex-shrink:0;height:8px;display:flex;align-items:center;justify-content:center;border-radius:4px;transition:height .15s,background .15s;position:relative}.drop-zone-label{font-size:.75rem;font-weight:600;color:#1d4ed8;opacity:0;transition:opacity .1s}.drop-zone.active{height:40px;background:#3b82f614;border:2px dashed #3b82f6}.drop-zone.active .drop-zone-label{opacity:1}.add-block-btn{flex-shrink:0;display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:44px;padding:12px;margin-top:8px;border:2px dashed #e2e8f0;border-radius:8px;background:none;font-size:.875rem;font-weight:600;color:#475569;cursor:pointer;font-family:inherit;transition:border-color .15s,color .15s,background .15s}.add-block-btn:hover{border-color:#3b82f6;color:#3b82f6;background:#3b82f60a}.panel-right{background:#fff;border-left:1px solid #e2e8f0;display:flex;flex-direction:column;min-height:0;min-width:0}.right-tabs{display:flex;border-bottom:1px solid #e2e8f0}.right-tab{flex:1;display:flex;align-items:center;justify-content:center;gap:6px;padding:12px;min-height:44px;border:none;background:none;font-size:.8125rem;font-weight:600;color:#64748b;cursor:pointer;font-family:inherit;border-bottom:2px solid transparent}.right-tab:hover{color:#1e293b}.right-tab.active{color:#1d4ed8;background:#eff6ff;border-bottom-color:#3b82f6}.right-panel-body{flex:1;padding:20px;overflow-y:auto}.right-section-title{font-size:.9375rem;font-weight:700;color:#1e293b;margin:0 0 12px}.right-section-desc{font-size:.8125rem;color:#64748b;margin:0 0 16px;line-height:1.5}.right-section-hint{font-size:.8125rem;color:#64748b;margin:0 0 12px;line-height:1.5}.block-group{border-bottom:1px solid #f1f5f9}.block-group-header{display:flex;align-items:center;gap:8px;width:100%;min-height:44px;padding:12px 0;border:none;background:none;font-size:.875rem;font-weight:600;color:#1e293b;cursor:pointer;font-family:inherit;text-align:left}.block-group-header .chevron{transition:transform .2s;color:#94a3b8}.block-group-header .chevron.expanded{transform:rotate(90deg)}.block-group-header span:nth-of-type(1){flex:1}.block-count{font-size:.75rem;font-weight:600;color:#475569;background:#f1f5f9;padding:2px 8px;border-radius:10px;margin-left:auto}.block-list{display:flex;flex-direction:column;gap:2px;padding-bottom:8px}.variable-list{display:flex;flex-direction:column;padding-bottom:8px}.variable-item+.variable-item{border-top:1px solid #f1f5f9;border-radius:0}.block-item{display:flex;align-items:center;gap:6px;box-sizing:border-box;width:100%;min-height:44px;padding:8px 0;font-size:.8125rem;color:#64748b;cursor:pointer;text-align:left;border-radius:4px;font-family:inherit;-webkit-user-select:none;user-select:none}.block-item:hover{background:#f8fafc;color:#1e293b}.block-item-drag{color:#cbd5e1;flex-shrink:0;cursor:grab}.variable-item{display:flex;flex-direction:column;align-items:flex-start;gap:4px;min-height:44px;padding:8px 0;min-width:0;width:100%;box-sizing:border-box;border:none;background:none;cursor:pointer;text-align:left;border-radius:4px;font-family:inherit}.variable-item:hover{background:#f8fafc}.var-tag{max-width:100%;overflow-wrap:anywhere;font-size:.75rem;font-weight:600;color:#1d4ed8;background:#3b82f614;padding:2px 6px;border-radius:4px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.var-example{font-size:.75rem;color:#64748b;overflow-wrap:anywhere}.var-description{font-size:.75rem;color:#64748b;line-height:1.4;overflow-wrap:anywhere}.video-library-panel{padding:0}.video-library-panel .right-section-title,.video-library-panel .right-section-hint{padding:0 16px}.video-library-panel .right-section-title{padding-top:16px}.video-config-section{display:flex;flex-direction:column;gap:8px;padding:12px 16px;border-bottom:1px solid #f1f5f9}.video-config-section:last-of-type{border-bottom:none}.video-lib-list{display:flex;flex-direction:column;gap:2px;padding:8px 8px 16px}.video-lib-item{display:flex;align-items:center;gap:10px;width:100%;min-height:44px;padding:8px;border:1px solid transparent;border-radius:8px;background:none;cursor:pointer;text-align:left;font-family:inherit;transition:background .15s,border-color .15s}.video-lib-item:hover{background:#f8fafc;border-color:#e2e8f0}.video-lib-item.selected{background:#eff6ff;border-color:#93c5fd}.vli-thumb{position:relative;flex-shrink:0;width:56px;height:40px;border-radius:6px;background:linear-gradient(135deg,#f1f5f9,#e2e8f0);display:flex;align-items:center;justify-content:center}.vli-dur{position:absolute;bottom:2px;right:3px;font-size:.625rem;font-weight:600;color:#fff;background:#000000a6;padding:1px 4px;border-radius:3px}.vli-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.vli-title{font-size:.8125rem;font-weight:600;color:#1e293b;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vli-cat{font-size:.75rem;color:#475569}.vli-check{flex-shrink:0}.video-lib-loading{padding:8px}.video-lib-skeleton{display:flex;align-items:center;gap:10px;padding:8px;margin-bottom:4px}.vls-info{flex:1;display:flex;flex-direction:column;gap:6px}@media(max-width:1200px){.editor-body{grid-template-columns:280px minmax(0,1fr) 260px}}@media(max-width:900px){:host{flex:none}.editor-page{flex:none;min-height:100vh;min-height:100dvh;overflow:visible}.editor-body{display:flex;flex-direction:column;flex:none;overflow:visible}.panel-left{border-right:none;border-bottom:1px solid #e2e8f0;overflow:visible;padding:16px}.panel-center{overflow:visible;min-height:480px}.blocks-canvas{overflow:visible;min-height:320px}.panel-right{border-left:none;border-top:1px solid #e2e8f0}.right-panel-body{overflow:visible}.editor-toolbar,.toolbar-row-2,.link-dialog,.editor-tabs{padding-left:12px;padding-right:12px}.preview-frame{padding:12px}.form-row-dates{grid-template-columns:1fr}}@media(prefers-reduced-motion:reduce){*{transition:none!important}}\n"],
60908
61049
  dependencies: [
60909
61050
  {
60910
61051
  kind: "ngmodule",
@@ -61250,6 +61391,10 @@ i0.ɵɵngDeclareClassMetadata({
61250
61391
  <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"/><polyline points="17 21 17 13 7 13 7 21"/><polyline points="7 3 7 8 15 8"/></svg>{{ labels.t('emailTemplateEditor.saveTemplate') }}</ui-button>
61251
61392
  </span>
61252
61393
  </div>
61394
+ @if (saveHintVisible(); as hint) {
61395
+ <!-- A blocked Save explains itself in visible text, not only in the tooltip. -->
61396
+ <p class="save-hint" role="status" data-testid="save-hint">{{ hint }}</p>
61397
+ }
61253
61398
  </div>
61254
61399
  <ui-divider />
61255
61400
 
@@ -61272,12 +61417,12 @@ i0.ɵɵngDeclareClassMetadata({
61272
61417
 
61273
61418
  <div class="form-field">
61274
61419
  <ui-text-input [label]="labels.t('common.name')" [required]="true" [(ngModel)]="name" [readonly]="!canWrite()" [maxlength]="maxTextLength()"
61275
- [placeholder]="namePlaceholder()" [error]="nameErrorShown()" [showErrors]="nameTouched() || submitAttempted()" (blurred)="nameTouched.set(true)" />
61420
+ [placeholder]="namePlaceholder()" [error]="nameErrorShown()" [showErrors]="nameTouched()" (blurred)="nameTouched.set(true)" />
61276
61421
  </div>
61277
61422
 
61278
61423
  <div class="form-field">
61279
61424
  <ui-text-input [label]="labels.t('common.subject')" [required]="true" [(ngModel)]="subject" [readonly]="!canWrite()" [maxlength]="maxTextLength()"
61280
- [placeholder]="subjectPlaceholder()" [error]="subjectErrorShown()" [showErrors]="subjectTouched() || submitAttempted()" (blurred)="subjectTouched.set(true)">
61425
+ [placeholder]="subjectPlaceholder()" [error]="subjectErrorShown()" [showErrors]="subjectTouched()" (blurred)="subjectTouched.set(true)">
61281
61426
  </ui-text-input>
61282
61427
  </div>
61283
61428
 
@@ -61288,7 +61433,7 @@ i0.ɵɵngDeclareClassMetadata({
61288
61433
  <ui-checkbox [label]="labels.t('emailTemplateEditor.useThisTemplateAllYear')" [(checked)]="useAllYear" [disabled]="!canWrite()" />
61289
61434
 
61290
61435
  @if (!useAllYear()) {
61291
- <div class="form-row-dates">
61436
+ <div class="form-row-dates" (focusout)="datesTouched.set(true)">
61292
61437
  <ui-date-input [label]="labels.t('emailTemplateEditor.activeFrom')" [(ngModel)]="activeFrom" [disabled]="!canWrite()" />
61293
61438
  <ui-date-input [label]="labels.t('emailTemplateEditor.activeTo')" [(ngModel)]="activeTo" [disabled]="!canWrite()" [min]="activeFrom()" [error]="datesError()" />
61294
61439
  </div>
@@ -61304,7 +61449,7 @@ i0.ɵɵngDeclareClassMetadata({
61304
61449
  @if (filteredAssignments().length === 0) {
61305
61450
  <ui-empty-state iconType="search" [title]="labels.t('emailTemplateEditor.noAssignmentsFound')" [message]="labels.t('emailTemplateEditor.noAssignmentsMatchYourSearch')" />
61306
61451
  }
61307
- <div class="assignment-list" [hidden]="filteredAssignments().length === 0">
61452
+ <div class="assignment-list" [hidden]="filteredAssignments().length === 0" (focusout)="onAssignmentsFocusOut($event)">
61308
61453
  @for (item of filteredAssignments(); track item.key) {
61309
61454
  <div class="assignment-item" [class.assignment-readonly]="!canWrite()" [attr.role]="canWrite() ? 'switch' : null" [attr.tabindex]="canWrite() ? 0 : null"
61310
61455
  [attr.aria-checked]="canWrite() ? item.assigned : null" [attr.aria-label]="canWrite() ? item.name : null"
@@ -61448,7 +61593,7 @@ i0.ɵɵngDeclareClassMetadata({
61448
61593
  <ui-error [errorId]="idPrefix() + '-body-error'" [message]="bodyErrorShown()" />
61449
61594
 
61450
61595
  <!-- Block Canvas with DnD -->
61451
- <div class="blocks-canvas" (dragover)="onCanvasDragOver($event)" (drop)="onDropZoneDrop($event, blocks().length)">
61596
+ <div class="blocks-canvas" (dragover)="onCanvasDragOver($event)" (drop)="onDropZoneDrop($event, blocks().length)" (focusout)="onBodyFocusOut($event)">
61452
61597
  <!-- Initial drop zone (before first block) -->
61453
61598
  <div class="drop-zone" [class.active]="dragOverIndex() === 0" (dragover)="onDropZoneDragOver($event, 0)" (dragleave)="onDropZoneLeave()" (drop)="onDropZoneDrop($event, 0)">
61454
61599
  <span class="drop-zone-label">{{ labels.t('emailTemplateEditor.dropHere') }}</span>
@@ -61677,7 +61822,7 @@ i0.ɵɵngDeclareClassMetadata({
61677
61822
 
61678
61823
 
61679
61824
  `,
61680
- styles: [":host{display:flex;flex-direction:column;flex:1;min-height:0}.required{color:#ef4444;font-weight:400}.editor-page{display:flex;flex-direction:column;flex:1;min-height:0;background:#f8fafc;overflow:hidden}.editor-actions{display:flex;justify-content:space-between;align-items:center;gap:8px 16px;flex-wrap:wrap;padding:0 0 12px;flex-shrink:0}.editor-heading{margin:0;font-size:1.25rem;font-weight:700;color:#1e293b;line-height:1.3;min-width:0}.save-wrap{display:inline-flex}.editor-actions-buttons{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap;margin-left:auto}.readonly-note{margin:0;padding:8px 16px;font-size:.8125rem;color:#92400e;background:#fffbeb;border-bottom:1px solid #fde68a}.readonly-note.system-note{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.editor-body{display:grid;grid-template-columns:340px minmax(0,1fr) 300px;grid-template-rows:minmax(0,1fr);flex:1;min-height:0;overflow:hidden}.panel-left{background:#fff;border-right:1px solid #e2e8f0;padding:24px;overflow-y:auto}.panel-title{font-size:1.0625rem;font-weight:700;color:#1e293b;margin:0 0 20px}.form-field{display:flex;flex-direction:column;gap:6px;margin-bottom:16px}.form-row-dates{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:16px}.assignments-section{border-top:1px solid #e2e8f0;padding-top:20px;margin-top:16px}.section-title{font-size:.9375rem;font-weight:700;color:#1e293b;margin:0 0 6px}.section-desc{font-size:.8125rem;color:#64748b;line-height:1.5;margin:0 0 12px}.assignment-list{max-height:340px;overflow-y:auto;margin-top:12px;border:1px solid #e2e8f0;border-radius:8px}.assignment-item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 14px;cursor:pointer;border-bottom:1px solid #f1f5f9;transition:background .1s}.assignment-item:last-child{border-bottom:none}.assignment-item:hover{background:#f8fafc}.assignment-item:focus-visible{outline:2px solid #3b82f6;outline-offset:-2px}.assignment-item.assignment-readonly{cursor:default}.assignment-item.assignment-readonly:hover{background:transparent}.assignment-text{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}.assignment-text strong{font-size:.8125rem;color:#1e293b}.assignment-text span{font-size:.75rem;color:#64748b}.assignment-channels{display:flex;gap:4px;flex-shrink:0}.channel-badge{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:4px;background:#f1f5f9;color:#64748b;transition:all .15s}.channel-badge.active{background:#3b82f6;color:#fff}.channel-badge.disabled{opacity:.4;cursor:not-allowed}.config-desc{font-size:.875rem;color:#64748b;line-height:1.5;margin:0}.config-divider{border:none;border-top:1px solid #e2e8f0;margin:20px 0}.config-section{display:flex;flex-direction:column;gap:12px}.config-section-label{font-size:.6875rem;font-weight:700;color:#3b82f6;text-transform:uppercase;letter-spacing:.04em}.config-field{display:flex;flex-direction:column;gap:6px}.config-field-mt{margin-top:16px}.config-label{font-size:.8125rem;font-weight:600;color:#1e293b}.config-readonly{padding:9px 12px;border:1px solid #e2e8f0;border-radius:8px;background:#f8fafc;font-size:.875rem;color:#1e293b}.config-hint{font-size:.75rem;color:#64748b}.test-save-note{display:flex;align-items:center;gap:8px;padding:10px 14px;background:#fef3c7;border:1px solid #fcd34d;border-radius:8px;font-size:.8125rem;color:#92400e;margin-top:12px}.test-save-note svg{flex-shrink:0}.panel-center{display:flex;flex-direction:column;min-height:0;min-width:0;overflow:hidden}.editor-tabs{display:flex;gap:2px;padding:12px 20px 0;background:#fff;border-bottom:1px solid #e2e8f0;overflow-x:auto;-webkit-overflow-scrolling:touch}.editor-tab{display:flex;align-items:center;gap:6px;padding:10px 16px;border:1px solid #e2e8f0;border-bottom:none;border-radius:8px 8px 0 0;background:#f8fafc;font-size:.8125rem;font-weight:600;color:#64748b;cursor:pointer;font-family:inherit;white-space:nowrap}.editor-tab:hover{background:#fff;color:#1e293b}.editor-tab.active{background:#eff6ff;color:#1d4ed8;border-color:#93c5fd}.editor-tab:focus-visible,.right-tab:focus-visible,.block-group-header:focus-visible,.variable-item:focus-visible,.add-block-btn:focus-visible,.block-item:focus-visible,.video-lib-item:focus-visible{outline:2px solid #3b82f6;outline-offset:-2px}.editor-toolbar{display:flex;align-items:center;gap:8px;padding:10px 20px;background:#fff;border-bottom:1px solid #e2e8f0;flex-wrap:wrap}.toolbar-row-2{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:8px 20px;background:#fff;border-bottom:1px solid #e2e8f0}.toolbar-group{display:flex;align-items:center;gap:2px;padding-right:8px;border-right:1px solid #e2e8f0}.toolbar-group:last-child{border-right:none;padding-right:0}.toolbar-select{display:block;min-width:96px}.toolbar-label{font-size:.75rem;font-weight:600;color:#64748b;white-space:nowrap;margin-right:6px}.hidden-color-input{position:absolute;width:0;height:0;opacity:0;pointer-events:none;border:none;padding:0}.color-indicator{display:flex;flex-direction:column;align-items:center;gap:2px;color:#475569}.color-bar{display:block;width:16px;height:3px;border-radius:2px;border:1px solid rgba(0,0,0,.1)}.link-dialog{background:#fff;border-bottom:1px solid #e2e8f0;padding:12px 20px}.link-dialog-inner{display:flex;align-items:flex-start;gap:8px;flex-wrap:wrap}.link-dialog-title{font-size:.8125rem;font-weight:700;color:#1e293b;white-space:nowrap;padding-top:10px}.link-dialog-input{display:block;width:240px;max-width:100%}.link-dialog-actions{display:flex;gap:6px}.preview-frame{flex:1;display:flex;justify-content:center;align-items:stretch;padding:24px;overflow-y:auto;background:#f1f5f9}.preview-frame.mobile{align-items:flex-start}.preview-content{display:block;flex:1 1 auto;max-width:600px;width:100%;box-sizing:border-box;min-height:400px;background:#fff;border:1px solid #e2e8f0;border-radius:8px}.mobile-shell{width:375px;max-width:100%;box-sizing:border-box;min-height:600px;border:2px solid #1e293b;border-radius:24px;padding:40px 12px 24px;background:#fff;box-shadow:0 8px 32px #0000001f}.mobile-shell .preview-content{border:none;border-radius:0;max-width:100%;height:520px;min-height:0}.blocks-canvas{flex:1 1 0;min-height:0;padding:16px 20px 24px 56px;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;background:#f1f5f9;display:flex;flex-direction:column}.block-wrapper{flex-shrink:0;position:relative;display:flex;align-items:flex-start;background:#fff;border:2px solid transparent;border-radius:8px;transition:border-color .15s,box-shadow .15s}.block-wrapper:hover,.block-wrapper.selected,.block-wrapper:focus-within{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61a}.block-wrapper:hover .block-drag-handle,.block-wrapper.selected .block-drag-handle,.block-wrapper:focus-within .block-drag-handle{opacity:1}.block-wrapper:hover .block-controls,.block-wrapper.selected .block-controls,.block-wrapper:focus-within .block-controls{opacity:1;pointer-events:all}.block-wrapper.dragging{opacity:.4}.block-drag-handle{flex-shrink:0;width:28px;display:flex;align-items:flex-start;justify-content:center;padding-top:14px;opacity:0;transition:opacity .15s;cursor:grab;color:#94a3b8}.block-drag-handle:active{cursor:grabbing}.block-content{flex:1;min-width:0;padding:12px 16px;outline:none;font-size:.9375rem;color:#1e293b;line-height:1.6;min-height:48px;overflow-wrap:anywhere}.block-content:empty:before{content:attr(data-placeholder);color:#64748b;font-style:italic;pointer-events:none}.block-content p{margin:0 0 8px}.block-content p:last-child{margin:0}.block-content h1,.block-content h2,.block-content h3{margin:8px 0 6px;color:#1e293b}.block-content a{color:#3b82f6}.block-content img{max-width:100%;border-radius:6px}.block-content ul,.block-content ol{padding-left:20px;margin:0 0 8px}.block-controls{position:absolute;top:0;left:-48px;flex-direction:column;display:flex;gap:2px;opacity:0;pointer-events:none;transition:opacity .15s;background:#fff;border:1px solid #e2e8f0;border-radius:6px;padding:3px;box-shadow:0 2px 6px #00000014}@media(pointer:coarse){.editor-tab,.right-tab,.block-group-header{min-height:44px}}@media(hover:none){.block-wrapper.selected .block-controls{opacity:1;pointer-events:all}}.drop-zone{flex-shrink:0;height:8px;display:flex;align-items:center;justify-content:center;border-radius:4px;transition:height .15s,background .15s;position:relative}.drop-zone-label{font-size:.75rem;font-weight:600;color:#1d4ed8;opacity:0;transition:opacity .1s}.drop-zone.active{height:40px;background:#3b82f614;border:2px dashed #3b82f6}.drop-zone.active .drop-zone-label{opacity:1}.add-block-btn{flex-shrink:0;display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:44px;padding:12px;margin-top:8px;border:2px dashed #e2e8f0;border-radius:8px;background:none;font-size:.875rem;font-weight:600;color:#475569;cursor:pointer;font-family:inherit;transition:border-color .15s,color .15s,background .15s}.add-block-btn:hover{border-color:#3b82f6;color:#3b82f6;background:#3b82f60a}.panel-right{background:#fff;border-left:1px solid #e2e8f0;display:flex;flex-direction:column;min-height:0;min-width:0}.right-tabs{display:flex;border-bottom:1px solid #e2e8f0}.right-tab{flex:1;display:flex;align-items:center;justify-content:center;gap:6px;padding:12px;min-height:44px;border:none;background:none;font-size:.8125rem;font-weight:600;color:#64748b;cursor:pointer;font-family:inherit;border-bottom:2px solid transparent}.right-tab:hover{color:#1e293b}.right-tab.active{color:#1d4ed8;background:#eff6ff;border-bottom-color:#3b82f6}.right-panel-body{flex:1;padding:20px;overflow-y:auto}.right-section-title{font-size:.9375rem;font-weight:700;color:#1e293b;margin:0 0 12px}.right-section-desc{font-size:.8125rem;color:#64748b;margin:0 0 16px;line-height:1.5}.right-section-hint{font-size:.8125rem;color:#64748b;margin:0 0 12px;line-height:1.5}.block-group{border-bottom:1px solid #f1f5f9}.block-group-header{display:flex;align-items:center;gap:8px;width:100%;min-height:44px;padding:12px 0;border:none;background:none;font-size:.875rem;font-weight:600;color:#1e293b;cursor:pointer;font-family:inherit;text-align:left}.block-group-header .chevron{transition:transform .2s;color:#94a3b8}.block-group-header .chevron.expanded{transform:rotate(90deg)}.block-group-header span:nth-of-type(1){flex:1}.block-count{font-size:.75rem;font-weight:600;color:#475569;background:#f1f5f9;padding:2px 8px;border-radius:10px;margin-left:auto}.block-list{display:flex;flex-direction:column;gap:2px;padding-bottom:8px}.variable-list{display:flex;flex-direction:column;padding-bottom:8px}.variable-item+.variable-item{border-top:1px solid #f1f5f9;border-radius:0}.block-item{display:flex;align-items:center;gap:6px;box-sizing:border-box;width:100%;min-height:44px;padding:8px 0;font-size:.8125rem;color:#64748b;cursor:pointer;text-align:left;border-radius:4px;font-family:inherit;-webkit-user-select:none;user-select:none}.block-item:hover{background:#f8fafc;color:#1e293b}.block-item-drag{color:#cbd5e1;flex-shrink:0;cursor:grab}.variable-item{display:flex;flex-direction:column;align-items:flex-start;gap:4px;min-height:44px;padding:8px 0;min-width:0;width:100%;box-sizing:border-box;border:none;background:none;cursor:pointer;text-align:left;border-radius:4px;font-family:inherit}.variable-item:hover{background:#f8fafc}.var-tag{max-width:100%;overflow-wrap:anywhere;font-size:.75rem;font-weight:600;color:#1d4ed8;background:#3b82f614;padding:2px 6px;border-radius:4px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.var-example{font-size:.75rem;color:#64748b;overflow-wrap:anywhere}.var-description{font-size:.75rem;color:#64748b;line-height:1.4;overflow-wrap:anywhere}.video-library-panel{padding:0}.video-library-panel .right-section-title,.video-library-panel .right-section-hint{padding:0 16px}.video-library-panel .right-section-title{padding-top:16px}.video-config-section{display:flex;flex-direction:column;gap:8px;padding:12px 16px;border-bottom:1px solid #f1f5f9}.video-config-section:last-of-type{border-bottom:none}.video-lib-list{display:flex;flex-direction:column;gap:2px;padding:8px 8px 16px}.video-lib-item{display:flex;align-items:center;gap:10px;width:100%;min-height:44px;padding:8px;border:1px solid transparent;border-radius:8px;background:none;cursor:pointer;text-align:left;font-family:inherit;transition:background .15s,border-color .15s}.video-lib-item:hover{background:#f8fafc;border-color:#e2e8f0}.video-lib-item.selected{background:#eff6ff;border-color:#93c5fd}.vli-thumb{position:relative;flex-shrink:0;width:56px;height:40px;border-radius:6px;background:linear-gradient(135deg,#f1f5f9,#e2e8f0);display:flex;align-items:center;justify-content:center}.vli-dur{position:absolute;bottom:2px;right:3px;font-size:.625rem;font-weight:600;color:#fff;background:#000000a6;padding:1px 4px;border-radius:3px}.vli-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.vli-title{font-size:.8125rem;font-weight:600;color:#1e293b;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vli-cat{font-size:.75rem;color:#475569}.vli-check{flex-shrink:0}.video-lib-loading{padding:8px}.video-lib-skeleton{display:flex;align-items:center;gap:10px;padding:8px;margin-bottom:4px}.vls-info{flex:1;display:flex;flex-direction:column;gap:6px}@media(max-width:1200px){.editor-body{grid-template-columns:280px minmax(0,1fr) 260px}}@media(max-width:900px){:host{flex:none}.editor-page{flex:none;min-height:100vh;min-height:100dvh;overflow:visible}.editor-body{display:flex;flex-direction:column;flex:none;overflow:visible}.panel-left{border-right:none;border-bottom:1px solid #e2e8f0;overflow:visible;padding:16px}.panel-center{overflow:visible;min-height:480px}.blocks-canvas{overflow:visible;min-height:320px}.panel-right{border-left:none;border-top:1px solid #e2e8f0}.right-panel-body{overflow:visible}.editor-toolbar,.toolbar-row-2,.link-dialog,.editor-tabs{padding-left:12px;padding-right:12px}.preview-frame{padding:12px}.form-row-dates{grid-template-columns:1fr}}@media(prefers-reduced-motion:reduce){*{transition:none!important}}\n"]
61825
+ styles: [":host{display:flex;flex-direction:column;flex:1;min-height:0}.required{color:#ef4444;font-weight:400}.editor-page{display:flex;flex-direction:column;flex:1;min-height:0;background:#f8fafc;overflow:hidden}.editor-actions{display:flex;justify-content:space-between;align-items:center;gap:8px 16px;flex-wrap:wrap;padding:0 0 12px;flex-shrink:0}.editor-heading{margin:0;font-size:1.25rem;font-weight:700;color:#1e293b;line-height:1.3;min-width:0}.save-wrap{display:inline-flex}.save-hint{margin:0;font-size:12px;color:#475569;flex-basis:100%;text-align:right}.editor-actions-buttons{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap;margin-left:auto}.readonly-note{margin:0;padding:8px 16px;font-size:.8125rem;color:#92400e;background:#fffbeb;border-bottom:1px solid #fde68a}.readonly-note.system-note{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.editor-body{display:grid;grid-template-columns:340px minmax(0,1fr) 300px;grid-template-rows:minmax(0,1fr);flex:1;min-height:0;overflow:hidden}.panel-left{background:#fff;border-right:1px solid #e2e8f0;padding:24px;overflow-y:auto}.panel-title{font-size:1.0625rem;font-weight:700;color:#1e293b;margin:0 0 20px}.form-field{display:flex;flex-direction:column;gap:6px;margin-bottom:16px}.form-row-dates{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:16px}.assignments-section{border-top:1px solid #e2e8f0;padding-top:20px;margin-top:16px}.section-title{font-size:.9375rem;font-weight:700;color:#1e293b;margin:0 0 6px}.section-desc{font-size:.8125rem;color:#64748b;line-height:1.5;margin:0 0 12px}.assignment-list{max-height:340px;overflow-y:auto;margin-top:12px;border:1px solid #e2e8f0;border-radius:8px}.assignment-item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 14px;cursor:pointer;border-bottom:1px solid #f1f5f9;transition:background .1s}.assignment-item:last-child{border-bottom:none}.assignment-item:hover{background:#f8fafc}.assignment-item:focus-visible{outline:2px solid #3b82f6;outline-offset:-2px}.assignment-item.assignment-readonly{cursor:default}.assignment-item.assignment-readonly:hover{background:transparent}.assignment-text{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}.assignment-text strong{font-size:.8125rem;color:#1e293b}.assignment-text span{font-size:.75rem;color:#64748b}.assignment-channels{display:flex;gap:4px;flex-shrink:0}.channel-badge{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:4px;background:#f1f5f9;color:#64748b;transition:all .15s}.channel-badge.active{background:#3b82f6;color:#fff}.channel-badge.disabled{opacity:.4;cursor:not-allowed}.config-desc{font-size:.875rem;color:#64748b;line-height:1.5;margin:0}.config-divider{border:none;border-top:1px solid #e2e8f0;margin:20px 0}.config-section{display:flex;flex-direction:column;gap:12px}.config-section-label{font-size:.6875rem;font-weight:700;color:#3b82f6;text-transform:uppercase;letter-spacing:.04em}.config-field{display:flex;flex-direction:column;gap:6px}.config-field-mt{margin-top:16px}.config-label{font-size:.8125rem;font-weight:600;color:#1e293b}.config-readonly{padding:9px 12px;border:1px solid #e2e8f0;border-radius:8px;background:#f8fafc;font-size:.875rem;color:#1e293b}.config-hint{font-size:.75rem;color:#64748b}.test-save-note{display:flex;align-items:center;gap:8px;padding:10px 14px;background:#fef3c7;border:1px solid #fcd34d;border-radius:8px;font-size:.8125rem;color:#92400e;margin-top:12px}.test-save-note svg{flex-shrink:0}.panel-center{display:flex;flex-direction:column;min-height:0;min-width:0;overflow:hidden}.editor-tabs{display:flex;gap:2px;padding:12px 20px 0;background:#fff;border-bottom:1px solid #e2e8f0;overflow-x:auto;-webkit-overflow-scrolling:touch}.editor-tab{display:flex;align-items:center;gap:6px;padding:10px 16px;border:1px solid #e2e8f0;border-bottom:none;border-radius:8px 8px 0 0;background:#f8fafc;font-size:.8125rem;font-weight:600;color:#64748b;cursor:pointer;font-family:inherit;white-space:nowrap}.editor-tab:hover{background:#fff;color:#1e293b}.editor-tab.active{background:#eff6ff;color:#1d4ed8;border-color:#93c5fd}.editor-tab:focus-visible,.right-tab:focus-visible,.block-group-header:focus-visible,.variable-item:focus-visible,.add-block-btn:focus-visible,.block-item:focus-visible,.video-lib-item:focus-visible{outline:2px solid #3b82f6;outline-offset:-2px}.editor-toolbar{display:flex;align-items:center;gap:8px;padding:10px 20px;background:#fff;border-bottom:1px solid #e2e8f0;flex-wrap:wrap}.toolbar-row-2{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:8px 20px;background:#fff;border-bottom:1px solid #e2e8f0}.toolbar-group{display:flex;align-items:center;gap:2px;padding-right:8px;border-right:1px solid #e2e8f0}.toolbar-group:last-child{border-right:none;padding-right:0}.toolbar-select{display:block;min-width:96px}.toolbar-label{font-size:.75rem;font-weight:600;color:#64748b;white-space:nowrap;margin-right:6px}.hidden-color-input{position:absolute;width:0;height:0;opacity:0;pointer-events:none;border:none;padding:0}.color-indicator{display:flex;flex-direction:column;align-items:center;gap:2px;color:#475569}.color-bar{display:block;width:16px;height:3px;border-radius:2px;border:1px solid rgba(0,0,0,.1)}.link-dialog{background:#fff;border-bottom:1px solid #e2e8f0;padding:12px 20px}.link-dialog-inner{display:flex;align-items:flex-start;gap:8px;flex-wrap:wrap}.link-dialog-title{font-size:.8125rem;font-weight:700;color:#1e293b;white-space:nowrap;padding-top:10px}.link-dialog-input{display:block;width:240px;max-width:100%}.link-dialog-actions{display:flex;gap:6px}.preview-frame{flex:1;display:flex;justify-content:center;align-items:stretch;padding:24px;overflow-y:auto;background:#f1f5f9}.preview-frame.mobile{align-items:flex-start}.preview-content{display:block;flex:1 1 auto;max-width:600px;width:100%;box-sizing:border-box;min-height:400px;background:#fff;border:1px solid #e2e8f0;border-radius:8px}.mobile-shell{width:375px;max-width:100%;box-sizing:border-box;min-height:600px;border:2px solid #1e293b;border-radius:24px;padding:40px 12px 24px;background:#fff;box-shadow:0 8px 32px #0000001f}.mobile-shell .preview-content{border:none;border-radius:0;max-width:100%;height:520px;min-height:0}.blocks-canvas{flex:1 1 0;min-height:0;padding:16px 20px 24px 56px;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;background:#f1f5f9;display:flex;flex-direction:column}.block-wrapper{flex-shrink:0;position:relative;display:flex;align-items:flex-start;background:#fff;border:2px solid transparent;border-radius:8px;transition:border-color .15s,box-shadow .15s}.block-wrapper:hover,.block-wrapper.selected,.block-wrapper:focus-within{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61a}.block-wrapper:hover .block-drag-handle,.block-wrapper.selected .block-drag-handle,.block-wrapper:focus-within .block-drag-handle{opacity:1}.block-wrapper:hover .block-controls,.block-wrapper.selected .block-controls,.block-wrapper:focus-within .block-controls{opacity:1;pointer-events:all}.block-wrapper.dragging{opacity:.4}.block-drag-handle{flex-shrink:0;width:28px;display:flex;align-items:flex-start;justify-content:center;padding-top:14px;opacity:0;transition:opacity .15s;cursor:grab;color:#94a3b8}.block-drag-handle:active{cursor:grabbing}.block-content{flex:1;min-width:0;padding:12px 16px;outline:none;font-size:.9375rem;color:#1e293b;line-height:1.6;min-height:48px;overflow-wrap:anywhere}.block-content:empty:before{content:attr(data-placeholder);color:#64748b;font-style:italic;pointer-events:none}.block-content p{margin:0 0 8px}.block-content p:last-child{margin:0}.block-content h1,.block-content h2,.block-content h3{margin:8px 0 6px;color:#1e293b}.block-content a{color:#3b82f6}.block-content img{max-width:100%;border-radius:6px}.block-content ul,.block-content ol{padding-left:20px;margin:0 0 8px}.block-controls{position:absolute;top:0;left:-48px;flex-direction:column;display:flex;gap:2px;opacity:0;pointer-events:none;transition:opacity .15s;background:#fff;border:1px solid #e2e8f0;border-radius:6px;padding:3px;box-shadow:0 2px 6px #00000014}@media(pointer:coarse){.editor-tab,.right-tab,.block-group-header{min-height:44px}}@media(hover:none){.block-wrapper.selected .block-controls{opacity:1;pointer-events:all}}.drop-zone{flex-shrink:0;height:8px;display:flex;align-items:center;justify-content:center;border-radius:4px;transition:height .15s,background .15s;position:relative}.drop-zone-label{font-size:.75rem;font-weight:600;color:#1d4ed8;opacity:0;transition:opacity .1s}.drop-zone.active{height:40px;background:#3b82f614;border:2px dashed #3b82f6}.drop-zone.active .drop-zone-label{opacity:1}.add-block-btn{flex-shrink:0;display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:44px;padding:12px;margin-top:8px;border:2px dashed #e2e8f0;border-radius:8px;background:none;font-size:.875rem;font-weight:600;color:#475569;cursor:pointer;font-family:inherit;transition:border-color .15s,color .15s,background .15s}.add-block-btn:hover{border-color:#3b82f6;color:#3b82f6;background:#3b82f60a}.panel-right{background:#fff;border-left:1px solid #e2e8f0;display:flex;flex-direction:column;min-height:0;min-width:0}.right-tabs{display:flex;border-bottom:1px solid #e2e8f0}.right-tab{flex:1;display:flex;align-items:center;justify-content:center;gap:6px;padding:12px;min-height:44px;border:none;background:none;font-size:.8125rem;font-weight:600;color:#64748b;cursor:pointer;font-family:inherit;border-bottom:2px solid transparent}.right-tab:hover{color:#1e293b}.right-tab.active{color:#1d4ed8;background:#eff6ff;border-bottom-color:#3b82f6}.right-panel-body{flex:1;padding:20px;overflow-y:auto}.right-section-title{font-size:.9375rem;font-weight:700;color:#1e293b;margin:0 0 12px}.right-section-desc{font-size:.8125rem;color:#64748b;margin:0 0 16px;line-height:1.5}.right-section-hint{font-size:.8125rem;color:#64748b;margin:0 0 12px;line-height:1.5}.block-group{border-bottom:1px solid #f1f5f9}.block-group-header{display:flex;align-items:center;gap:8px;width:100%;min-height:44px;padding:12px 0;border:none;background:none;font-size:.875rem;font-weight:600;color:#1e293b;cursor:pointer;font-family:inherit;text-align:left}.block-group-header .chevron{transition:transform .2s;color:#94a3b8}.block-group-header .chevron.expanded{transform:rotate(90deg)}.block-group-header span:nth-of-type(1){flex:1}.block-count{font-size:.75rem;font-weight:600;color:#475569;background:#f1f5f9;padding:2px 8px;border-radius:10px;margin-left:auto}.block-list{display:flex;flex-direction:column;gap:2px;padding-bottom:8px}.variable-list{display:flex;flex-direction:column;padding-bottom:8px}.variable-item+.variable-item{border-top:1px solid #f1f5f9;border-radius:0}.block-item{display:flex;align-items:center;gap:6px;box-sizing:border-box;width:100%;min-height:44px;padding:8px 0;font-size:.8125rem;color:#64748b;cursor:pointer;text-align:left;border-radius:4px;font-family:inherit;-webkit-user-select:none;user-select:none}.block-item:hover{background:#f8fafc;color:#1e293b}.block-item-drag{color:#cbd5e1;flex-shrink:0;cursor:grab}.variable-item{display:flex;flex-direction:column;align-items:flex-start;gap:4px;min-height:44px;padding:8px 0;min-width:0;width:100%;box-sizing:border-box;border:none;background:none;cursor:pointer;text-align:left;border-radius:4px;font-family:inherit}.variable-item:hover{background:#f8fafc}.var-tag{max-width:100%;overflow-wrap:anywhere;font-size:.75rem;font-weight:600;color:#1d4ed8;background:#3b82f614;padding:2px 6px;border-radius:4px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.var-example{font-size:.75rem;color:#64748b;overflow-wrap:anywhere}.var-description{font-size:.75rem;color:#64748b;line-height:1.4;overflow-wrap:anywhere}.video-library-panel{padding:0}.video-library-panel .right-section-title,.video-library-panel .right-section-hint{padding:0 16px}.video-library-panel .right-section-title{padding-top:16px}.video-config-section{display:flex;flex-direction:column;gap:8px;padding:12px 16px;border-bottom:1px solid #f1f5f9}.video-config-section:last-of-type{border-bottom:none}.video-lib-list{display:flex;flex-direction:column;gap:2px;padding:8px 8px 16px}.video-lib-item{display:flex;align-items:center;gap:10px;width:100%;min-height:44px;padding:8px;border:1px solid transparent;border-radius:8px;background:none;cursor:pointer;text-align:left;font-family:inherit;transition:background .15s,border-color .15s}.video-lib-item:hover{background:#f8fafc;border-color:#e2e8f0}.video-lib-item.selected{background:#eff6ff;border-color:#93c5fd}.vli-thumb{position:relative;flex-shrink:0;width:56px;height:40px;border-radius:6px;background:linear-gradient(135deg,#f1f5f9,#e2e8f0);display:flex;align-items:center;justify-content:center}.vli-dur{position:absolute;bottom:2px;right:3px;font-size:.625rem;font-weight:600;color:#fff;background:#000000a6;padding:1px 4px;border-radius:3px}.vli-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.vli-title{font-size:.8125rem;font-weight:600;color:#1e293b;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vli-cat{font-size:.75rem;color:#475569}.vli-check{flex-shrink:0}.video-lib-loading{padding:8px}.video-lib-skeleton{display:flex;align-items:center;gap:10px;padding:8px;margin-bottom:4px}.vls-info{flex:1;display:flex;flex-direction:column;gap:6px}@media(max-width:1200px){.editor-body{grid-template-columns:280px minmax(0,1fr) 260px}}@media(max-width:900px){:host{flex:none}.editor-page{flex:none;min-height:100vh;min-height:100dvh;overflow:visible}.editor-body{display:flex;flex-direction:column;flex:none;overflow:visible}.panel-left{border-right:none;border-bottom:1px solid #e2e8f0;overflow:visible;padding:16px}.panel-center{overflow:visible;min-height:480px}.blocks-canvas{overflow:visible;min-height:320px}.panel-right{border-left:none;border-top:1px solid #e2e8f0}.right-panel-body{overflow:visible}.editor-toolbar,.toolbar-row-2,.link-dialog,.editor-tabs{padding-left:12px;padding-right:12px}.preview-frame{padding:12px}.form-row-dates{grid-template-columns:1fr}}@media(prefers-reduced-motion:reduce){*{transition:none!important}}\n"]
61681
61826
  }]
61682
61827
  }],
61683
61828
  ctorParameters: () => [],
@@ -66545,6 +66690,7 @@ var PaymentSidePanelComponent = class PaymentSidePanelComponent {
66545
66690
  this.allocationMode = signal("oldest", ...ngDevMode ? [{ debugName: "allocationMode" }] : /* istanbul ignore next */ []);
66546
66691
  this.selectedCharges = signal({}, ...ngDevMode ? [{ debugName: "selectedCharges" }] : /* istanbul ignore next */ []);
66547
66692
  this.touched = signal(false, ...ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []);
66693
+ this.allocationTouched = signal(false, ...ngDevMode ? [{ debugName: "allocationTouched" }] : /* istanbul ignore next */ []);
66548
66694
  this.submitting = signal(false, ...ngDevMode ? [{ debugName: "submitting" }] : /* istanbul ignore next */ []);
66549
66695
  this.submitError = signal("", ...ngDevMode ? [{ debugName: "submitError" }] : /* istanbul ignore next */ []);
66550
66696
  this.announcement = signal("", ...ngDevMode ? [{ debugName: "announcement" }] : /* istanbul ignore next */ []);
@@ -66641,6 +66787,7 @@ var PaymentSidePanelComponent = class PaymentSidePanelComponent {
66641
66787
  if (mode === "custom" && !this.charges().length) mode = this.defaultAllocationMode() === "custom" ? "oldest" : this.defaultAllocationMode();
66642
66788
  return buildAllocation(mode, this.charges(), this.selectedCharges());
66643
66789
  }, ...ngDevMode ? [{ debugName: "allocationPayload" }] : /* istanbul ignore next */ []);
66790
+ this.allocationMessage = computed(() => this.allocationTouched() ? this.allocation().general : "", ...ngDevMode ? [{ debugName: "allocationMessage" }] : /* istanbul ignore next */ []);
66644
66791
  this.hasInvalid = computed(() => this.fields().some((f) => f.invalid()) || !!this.allocation().general || !!this.referenceError(), ...ngDevMode ? [{ debugName: "hasInvalid" }] : /* istanbul ignore next */ []);
66645
66792
  this.canSplit = computed(() => this.kind() === "manual" && !this.busy(), ...ngDevMode ? [{ debugName: "canSplit" }] : /* istanbul ignore next */ []);
66646
66793
  this.readerOptions = computed(() => this.readers().map((r) => ({
@@ -66709,6 +66856,7 @@ var PaymentSidePanelComponent = class PaymentSidePanelComponent {
66709
66856
  this.allocationMode.set(this.defaultAllocationMode());
66710
66857
  this.selectedCharges.set({});
66711
66858
  this.touched.set(false);
66859
+ this.allocationTouched.set(false);
66712
66860
  this.submitting.set(false);
66713
66861
  this.submitError.set("");
66714
66862
  this.announcement.set("");
@@ -66810,6 +66958,7 @@ var PaymentSidePanelComponent = class PaymentSidePanelComponent {
66810
66958
  this.method.set("");
66811
66959
  this.reference.set("");
66812
66960
  this.touched.set(false);
66961
+ this.allocationTouched.set(false);
66813
66962
  this.announcement.set(this.labels.t("paymentSidePanel.addedToSplit", {
66814
66963
  method: this.methodLabel(entry.method),
66815
66964
  amount: this.money(entry.amount),
@@ -66831,6 +66980,7 @@ var PaymentSidePanelComponent = class PaymentSidePanelComponent {
66831
66980
  return id in this.selectedCharges();
66832
66981
  }
66833
66982
  toggleCharge(charge, checked) {
66983
+ this.allocationTouched.set(true);
66834
66984
  this.selectedCharges.update((current) => {
66835
66985
  const next = { ...current };
66836
66986
  if (checked) next[charge.id] = defaultChargeAmount(charge, current, this.totalPayment());
@@ -66839,6 +66989,7 @@ var PaymentSidePanelComponent = class PaymentSidePanelComponent {
66839
66989
  });
66840
66990
  }
66841
66991
  setChargeAmount(id, value) {
66992
+ this.allocationTouched.set(true);
66842
66993
  this.selectedCharges.update((current) => ({
66843
66994
  ...current,
66844
66995
  [id]: typeof value === "number" ? value : null
@@ -67582,9 +67733,9 @@ var PaymentSidePanelComponent = class PaymentSidePanelComponent {
67582
67733
  @if (charges().length > 0) {
67583
67734
  <div class="psp-allocation" data-testid="psp-allocation" role="group" [attr.aria-labelledby]="ids + '-alloc'">
67584
67735
  <span class="psp-saved-label" [id]="ids + '-alloc'">{{ labels.t('paymentSidePanel.applyPaymentTo') }}</span>
67585
- <ui-select [ariaLabel]="labels.t('paymentSidePanel.applyPaymentTo')" [ariaDescribedBy]="allocation().general ? ids + '-alloc-error' : ''" [options]="allocationOptions()" [disabled]="locked()" [ngModel]="allocationMode()" (ngModelChange)="onAllocationMode($event)" data-testid="psp-allocation-mode" />
67736
+ <ui-select [ariaLabel]="labels.t('paymentSidePanel.applyPaymentTo')" [ariaDescribedBy]="allocationMessage() ? ids + '-alloc-error' : ''" [options]="allocationOptions()" [disabled]="locked()" [ngModel]="allocationMode()" (ngModelChange)="onAllocationMode($event)" data-testid="psp-allocation-mode" />
67586
67737
  @if (allocationMode() === customMode) {
67587
- <div class="psp-charges" data-testid="psp-charges">
67738
+ <div class="psp-charges" data-testid="psp-charges" (focusout)="allocationTouched.set(true)">
67588
67739
  @for (charge of charges(); track charge.id) {
67589
67740
  <div class="psp-charge" data-testid="psp-charge">
67590
67741
  <ui-checkbox [label]="charge.chargeType" [description]="chargeDescription(charge)" [disabled]="locked()" [ngModel]="isTicked(charge.id)" (ngModelChange)="toggleCharge(charge, $event)" [testId]="'psp-charge-' + charge.id" />
@@ -67595,7 +67746,7 @@ var PaymentSidePanelComponent = class PaymentSidePanelComponent {
67595
67746
  </div>
67596
67747
  }
67597
67748
  </div>
67598
- <ui-error [errorId]="ids + '-alloc-error'" [message]="allocation().general" data-testid="psp-allocation-error" />
67749
+ <ui-error [errorId]="ids + '-alloc-error'" [message]="allocationMessage()" data-testid="psp-allocation-error" />
67599
67750
  }
67600
67751
  </div>
67601
67752
  }
@@ -68087,9 +68238,9 @@ i0.ɵɵngDeclareClassMetadata({
68087
68238
  @if (charges().length > 0) {
68088
68239
  <div class="psp-allocation" data-testid="psp-allocation" role="group" [attr.aria-labelledby]="ids + '-alloc'">
68089
68240
  <span class="psp-saved-label" [id]="ids + '-alloc'">{{ labels.t('paymentSidePanel.applyPaymentTo') }}</span>
68090
- <ui-select [ariaLabel]="labels.t('paymentSidePanel.applyPaymentTo')" [ariaDescribedBy]="allocation().general ? ids + '-alloc-error' : ''" [options]="allocationOptions()" [disabled]="locked()" [ngModel]="allocationMode()" (ngModelChange)="onAllocationMode($event)" data-testid="psp-allocation-mode" />
68241
+ <ui-select [ariaLabel]="labels.t('paymentSidePanel.applyPaymentTo')" [ariaDescribedBy]="allocationMessage() ? ids + '-alloc-error' : ''" [options]="allocationOptions()" [disabled]="locked()" [ngModel]="allocationMode()" (ngModelChange)="onAllocationMode($event)" data-testid="psp-allocation-mode" />
68091
68242
  @if (allocationMode() === customMode) {
68092
- <div class="psp-charges" data-testid="psp-charges">
68243
+ <div class="psp-charges" data-testid="psp-charges" (focusout)="allocationTouched.set(true)">
68093
68244
  @for (charge of charges(); track charge.id) {
68094
68245
  <div class="psp-charge" data-testid="psp-charge">
68095
68246
  <ui-checkbox [label]="charge.chargeType" [description]="chargeDescription(charge)" [disabled]="locked()" [ngModel]="isTicked(charge.id)" (ngModelChange)="toggleCharge(charge, $event)" [testId]="'psp-charge-' + charge.id" />
@@ -68100,7 +68251,7 @@ i0.ɵɵngDeclareClassMetadata({
68100
68251
  </div>
68101
68252
  }
68102
68253
  </div>
68103
- <ui-error [errorId]="ids + '-alloc-error'" [message]="allocation().general" data-testid="psp-allocation-error" />
68254
+ <ui-error [errorId]="ids + '-alloc-error'" [message]="allocationMessage()" data-testid="psp-allocation-error" />
68104
68255
  }
68105
68256
  </div>
68106
68257
  }
@@ -68449,7 +68600,7 @@ const BUILT_IN_ENDONYMS = {
68449
68600
  ko: "한국어",
68450
68601
  ru: "Русский"
68451
68602
  };
68452
- const BUILT_IN_LOADERS = /* @__PURE__ */ new Map([["es", () => import("./forgeroute-ui-ui-labels.es-BxCsxFEd.mjs").then((m) => m.UI_LABELS_ES)]]);
68603
+ const BUILT_IN_LOADERS = /* @__PURE__ */ new Map([["es", () => import("./forgeroute-ui-ui-labels.es-Rw5Xm65S.mjs").then((m) => m.UI_LABELS_ES)]]);
68453
68604
  const normalizeTag = (tag) => tag.trim().toLowerCase().replace(/_/g, "-");
68454
68605
  const baseOf = (tag) => normalizeTag(tag).split("-")[0];
68455
68606
  const builtInLoader = (lang) => BUILT_IN_LOADERS.get(normalizeTag(lang)) ?? BUILT_IN_LOADERS.get(baseOf(lang));
@@ -68773,16 +68924,22 @@ var ModuleLabelsRegistry = class ModuleLabelsRegistry {
68773
68924
  en: {},
68774
68925
  es: {}
68775
68926
  };
68776
- for (const entry of this.entries) {
68777
- if (entry.namespace !== handle.namespace) continue;
68778
- Object.assign(overrides.en, clean(handle, entry.overrides.en, true));
68779
- Object.assign(overrides.es, clean(handle, entry.overrides.es, true));
68927
+ const own = this.entries.filter((entry) => entry.namespace === handle.namespace).map((entry) => entry.overrides);
68928
+ for (const source of own) {
68929
+ if (typeof source === "function") continue;
68930
+ Object.assign(overrides.en, clean(handle, source.en, true));
68931
+ Object.assign(overrides.es, clean(handle, source.es, true));
68780
68932
  }
68933
+ const sources = own.some((source) => typeof source === "function") ? own.map((source) => typeof source === "function" ? source : {
68934
+ en: clean(handle, source.en, true),
68935
+ es: clean(handle, source.es, true)
68936
+ }) : null;
68781
68937
  state = {
68782
68938
  handle,
68783
68939
  status: signal("idle"),
68784
68940
  spanish: signal(null),
68785
- overrides
68941
+ overrides,
68942
+ sources
68786
68943
  };
68787
68944
  this.states.set(handle, state);
68788
68945
  const made = state;
@@ -68811,11 +68968,41 @@ var ModuleLabelsRegistry = class ModuleLabelsRegistry {
68811
68968
  if (!this.destroyed) state.status.set("failed");
68812
68969
  });
68813
68970
  }
68971
+ currentOverrides(state) {
68972
+ if (!state.sources) return state.overrides;
68973
+ const merged = {
68974
+ en: {},
68975
+ es: {}
68976
+ };
68977
+ for (const source of state.sources) {
68978
+ if (typeof source !== "function") {
68979
+ Object.assign(merged.en, source.en);
68980
+ Object.assign(merged.es, source.es);
68981
+ continue;
68982
+ }
68983
+ let value;
68984
+ try {
68985
+ value = source();
68986
+ } catch (error) {
68987
+ value = void 0;
68988
+ if (!state.warned && isDevMode()) {
68989
+ state.warned = true;
68990
+ console.warn(`[module labels] The override function for "${state.handle.namespace}" threw and was ignored. It runs on every text lookup, outside any injection context: build the function (or a computed) where inject() works and capture the service there; do not call inject() inside it.`, error);
68991
+ }
68992
+ }
68993
+ if (!value || typeof value !== "object") continue;
68994
+ Object.assign(merged.en, clean(state.handle, value.en, true));
68995
+ Object.assign(merged.es, clean(state.handle, value.es, true));
68996
+ }
68997
+ return merged;
68998
+ }
68814
68999
  create(handle) {
68815
69000
  const state = this.stateFor(handle);
68816
69001
  const language = this.language;
68817
69002
  const text = (key) => {
68818
- return (language() === "es" ? state.overrides.es[key] ?? state.spanish()?.[key] : void 0) ?? state.overrides.en[key] ?? state.handle.en[key] ?? key;
69003
+ const lang = language();
69004
+ const overrides = this.currentOverrides(state);
69005
+ return (lang === "es" ? overrides.es[key] ?? state.spanish()?.[key] : void 0) ?? overrides.en[key] ?? state.handle.en[key] ?? key;
68819
69006
  };
68820
69007
  const labels = this.labels;
68821
69008
  return {