@solercia/ui 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1806 @@
1
+ import * as i0 from '@angular/core';
2
+ import { input, computed, ChangeDetectionStrategy, Component, output, signal, effect, untracked, inject, DestroyRef, ElementRef, afterNextRender, linkedSignal } from '@angular/core';
3
+ import { sanitizeAssetUrl, SOL_I18N, resolveCssVars, ThemeService, SolIconComponent } from '@solercia/ui';
4
+ import { take } from 'rxjs';
5
+
6
+ const LOGIN_EFFECTS = ['zoom', 'focus', 'none'];
7
+ const LOGIN_TRANSITIONS = ['fade', 'focus'];
8
+ const LOGIN_POSITIONS = ['left', 'center', 'right'];
9
+ const LOGIN_BACKGROUNDS = [
10
+ 'glass-fade',
11
+ 'glass',
12
+ 'solid',
13
+ 'triangles',
14
+ 'split-circle',
15
+ 'facets',
16
+ 'circles',
17
+ ];
18
+ const LOGIN_CAPTION_POSITIONS = ['bottom-left', 'bottom-right', 'top-left', 'top-right'];
19
+ const LOGIN_MAX_IMAGES = 12;
20
+ const LOGIN_INTERVAL_MIN_MS = 3000;
21
+ const LOGIN_INTERVAL_MAX_MS = 20000;
22
+ const LOGIN_INTERVAL_DEFAULT_MS = 7000;
23
+ const LOGIN_DEFAULT_EFFECT = 'zoom';
24
+ const LOGIN_DEFAULT_TRANSITION = 'fade';
25
+ const LOGIN_DEFAULT_POSITION = 'right';
26
+ const LOGIN_DEFAULT_BACKGROUND = 'glass-fade';
27
+ /** Backgrounds whose shape is the form container; the others use a rectangular panel. */
28
+ const LOGIN_SHAPE_BACKGROUNDS = ['triangles', 'split-circle', 'facets', 'circles'];
29
+ const hasLoginShapes = (background) => LOGIN_SHAPE_BACKGROUNDS.includes(background);
30
+ /**
31
+ * Full shape of the block for the Theme Studio importer (`metaExtrasSchema`): the importer rejects
32
+ * any key missing from its reference, so a bare `login: {}` would reject every theme with `login`.
33
+ */
34
+ const MODE_SCHEMA = {
35
+ position: '',
36
+ background: '',
37
+ captionPosition: '',
38
+ veil: { rgb: '', from: 0, to: 0, bottom: 0 },
39
+ panel: { bg: '', blur: '', saturate: 0, border: '', radius: '' },
40
+ };
41
+ const LOGIN_META_SCHEMA = {
42
+ images: [''],
43
+ intervalMs: 0,
44
+ effect: '',
45
+ transition: '',
46
+ caption: { label: '', indicators: true },
47
+ modes: { dark: MODE_SCHEMA, light: MODE_SCHEMA },
48
+ };
49
+
50
+ /**
51
+ * Everything that arrives through `meta.login` (or a host's anonymous appearance endpoint) goes
52
+ * through here before it reaches a CSS variable or an `src`: an imported theme is JSON written by a
53
+ * person, not trusted data. Closed values fall back to their default; free values are bounded.
54
+ */
55
+ const HEX_COLOR = /^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;
56
+ const RGBA_COLOR = /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d*\.?\d+)\s*)?\)$/;
57
+ const PIXELS = /^(\d{1,2})px$/;
58
+ const BORDER = /^(\d)px solid (.+)$/;
59
+ const RGB_TRIPLE = /^\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*$/;
60
+ const MAX_BLUR_PX = 60;
61
+ const MAX_RADIUS_PX = 32;
62
+ const MAX_BORDER_PX = 4;
63
+ const MAX_LABEL = 80;
64
+ const MAX_URL_LENGTH = 2048;
65
+ /**
66
+ * Photo URLs: `https://`, a root-relative path (`/…`, never `//`) or `assets/…`, ending in a raster
67
+ * image extension (optional query string). No quotes, parentheses, spaces or `..`.
68
+ */
69
+ const IMAGE_URL = /^(?:https:\/\/[^/\s]|\/(?!\/)|assets\/)[^\s"'<>()\\]*\.(?:png|jpe?g|webp|avif)(?:\?[^\s"'<>()\\#]*)?$/i;
70
+ const SAFE_LOGO_URL = /^(?:\/(?!\/)|assets\/|https:\/\/)[^\s<>"'()\\]+$/;
71
+ const DEFAULT_VEIL = {
72
+ dark: { rgb: '15,23,42', from: 0.12, to: 0.94, bottom: 0.7 },
73
+ light: { rgb: '248,250,252', from: 0.12, to: 0.86, bottom: 0.55 },
74
+ };
75
+ const DEFAULT_PANEL = {
76
+ dark: {
77
+ bg: 'color-mix(in srgb, var(--sol-bg-surface) 42%, transparent)',
78
+ blur: '34px',
79
+ saturate: 1.3,
80
+ border: '1px solid color-mix(in srgb, var(--sol-color-text-primary) 10%, transparent)',
81
+ radius: '12px',
82
+ },
83
+ light: {
84
+ bg: 'color-mix(in srgb, var(--sol-bg-surface) 48%, transparent)',
85
+ blur: '42px',
86
+ saturate: 1.5,
87
+ border: '1px solid color-mix(in srgb, var(--sol-bg-surface) 80%, transparent)',
88
+ radius: '12px',
89
+ },
90
+ };
91
+ const isRecord = (v) => typeof v === 'object' && v !== null && !Array.isArray(v);
92
+ function oneOf(value, allowed) {
93
+ return typeof value === 'string' && allowed.includes(value) ? value : undefined;
94
+ }
95
+ function bounded(value, min, max) {
96
+ return typeof value === 'number' && Number.isFinite(value) ? Math.min(max, Math.max(min, value)) : undefined;
97
+ }
98
+ function cssColor(value) {
99
+ if (typeof value !== 'string')
100
+ return undefined;
101
+ if (HEX_COLOR.test(value))
102
+ return value;
103
+ const rgba = RGBA_COLOR.exec(value);
104
+ if (!rgba || [rgba[1], rgba[2], rgba[3]].some(c => Number(c) > 255))
105
+ return undefined;
106
+ return rgba[4] === undefined || Number(rgba[4]) <= 1 ? value : undefined;
107
+ }
108
+ function cssPixels(value, max) {
109
+ if (typeof value !== 'string')
110
+ return undefined;
111
+ const px = PIXELS.exec(value);
112
+ return px && Number(px[1]) <= max ? value : undefined;
113
+ }
114
+ function cssBorder(value) {
115
+ if (typeof value !== 'string')
116
+ return undefined;
117
+ const border = BORDER.exec(value);
118
+ return border && Number(border[1]) <= MAX_BORDER_PX && cssColor(border[2]) ? value : undefined;
119
+ }
120
+ /** Drops keys without a value; `undefined` when none is left. */
121
+ function withoutEmpty(obj) {
122
+ const filled = Object.fromEntries(Object.entries(obj).filter(([, v]) => v !== undefined));
123
+ return Object.keys(filled).length > 0 ? filled : undefined;
124
+ }
125
+ /** `true` for a photo URL the login may paint (see `IMAGE_URL`). */
126
+ function isAllowedLoginImage(url) {
127
+ return typeof url === 'string' && url.length <= MAX_URL_LENGTH && !url.includes('..') && IMAGE_URL.test(url);
128
+ }
129
+ function normalizeVeil(raw) {
130
+ if (!isRecord(raw))
131
+ return undefined;
132
+ const rgb = typeof raw['rgb'] === 'string' ? RGB_TRIPLE.exec(raw['rgb']) : null;
133
+ const valid = rgb && [rgb[1], rgb[2], rgb[3]].every(c => Number(c) <= 255);
134
+ return withoutEmpty({
135
+ rgb: valid ? `${rgb[1]},${rgb[2]},${rgb[3]}` : undefined,
136
+ from: bounded(raw['from'], 0, 1),
137
+ to: bounded(raw['to'], 0, 1),
138
+ bottom: bounded(raw['bottom'], 0, 1),
139
+ });
140
+ }
141
+ function normalizePanel(raw) {
142
+ if (!isRecord(raw))
143
+ return undefined;
144
+ return withoutEmpty({
145
+ bg: cssColor(raw['bg']),
146
+ blur: cssPixels(raw['blur'], MAX_BLUR_PX),
147
+ saturate: bounded(raw['saturate'], 0, 3),
148
+ border: cssBorder(raw['border']),
149
+ radius: cssPixels(raw['radius'], MAX_RADIUS_PX),
150
+ });
151
+ }
152
+ function normalizeMode(raw) {
153
+ if (!isRecord(raw))
154
+ return undefined;
155
+ const veil = normalizeVeil(raw['veil']);
156
+ const panel = normalizePanel(raw['panel']);
157
+ const captionPosition = oneOf(raw['captionPosition'], LOGIN_CAPTION_POSITIONS);
158
+ return {
159
+ position: oneOf(raw['position'], LOGIN_POSITIONS) ?? LOGIN_DEFAULT_POSITION,
160
+ background: oneOf(raw['background'], LOGIN_BACKGROUNDS) ?? LOGIN_DEFAULT_BACKGROUND,
161
+ ...(captionPosition ? { captionPosition } : {}),
162
+ ...(veil ? { veil } : {}),
163
+ ...(panel ? { panel } : {}),
164
+ };
165
+ }
166
+ function normalizeImages(raw) {
167
+ if (!Array.isArray(raw))
168
+ return [];
169
+ return [...new Set(raw.filter(isAllowedLoginImage))].slice(0, LOGIN_MAX_IMAGES);
170
+ }
171
+ function normalizeInterval(raw) {
172
+ const interval = bounded(raw, LOGIN_INTERVAL_MIN_MS, LOGIN_INTERVAL_MAX_MS);
173
+ return interval === undefined ? LOGIN_INTERVAL_DEFAULT_MS : Math.round(interval);
174
+ }
175
+ function normalizeCaption(raw) {
176
+ if (!isRecord(raw))
177
+ return undefined;
178
+ const label = typeof raw['label'] === 'string' ? raw['label'].trim().slice(0, MAX_LABEL) : '';
179
+ return withoutEmpty({
180
+ label: label || undefined,
181
+ indicators: typeof raw['indicators'] === 'boolean' ? raw['indicators'] : undefined,
182
+ });
183
+ }
184
+ /** Closed and bounded values; anything unrecognized is dropped or takes its default. */
185
+ function normalizeLogin(raw) {
186
+ if (!isRecord(raw))
187
+ return null;
188
+ const modes = isRecord(raw['modes']) ? raw['modes'] : {};
189
+ const dark = normalizeMode(modes['dark']);
190
+ const light = normalizeMode(modes['light']);
191
+ const caption = normalizeCaption(raw['caption']);
192
+ return {
193
+ images: normalizeImages(raw['images']),
194
+ intervalMs: normalizeInterval(raw['intervalMs']),
195
+ effect: oneOf(raw['effect'], LOGIN_EFFECTS) ?? LOGIN_DEFAULT_EFFECT,
196
+ transition: oneOf(raw['transition'], LOGIN_TRANSITIONS) ?? LOGIN_DEFAULT_TRANSITION,
197
+ ...(caption ? { caption } : {}),
198
+ modes: { ...(dark ? { dark } : {}), ...(light ? { light } : {}) },
199
+ };
200
+ }
201
+ function normalizeLogo(raw) {
202
+ if (!isRecord(raw) || typeof raw['url'] !== 'string' || !SAFE_LOGO_URL.test(raw['url']))
203
+ return null;
204
+ const dark = raw['urlDark'];
205
+ return {
206
+ url: raw['url'],
207
+ urlDark: typeof dark === 'string' && SAFE_LOGO_URL.test(dark) ? dark : null,
208
+ altText: typeof raw['altText'] === 'string' ? raw['altText'].trim() : '',
209
+ };
210
+ }
211
+ /**
212
+ * Body a host serves before sign-in (`{ login, logo, mode }`); `null` when it carries nothing
213
+ * usable. The library never fetches it: the host calls its own endpoint and passes the body here.
214
+ */
215
+ function normalizeLoginAppearance(raw) {
216
+ if (!isRecord(raw))
217
+ return null;
218
+ const login = normalizeLogin(raw['login']);
219
+ const logo = normalizeLogo(raw['logo']);
220
+ const mode = raw['mode'] === 'light' || raw['mode'] === 'dark' ? raw['mode'] : null;
221
+ return login || logo || mode ? { login, logo, mode } : null;
222
+ }
223
+ /** The caption never shares a side with the form: the JSON may carry a combination that covers it. */
224
+ function captionClear(position, caption) {
225
+ const opposite = position === 'left' ? 'right' : 'left';
226
+ if (!caption)
227
+ return `bottom-${opposite}`;
228
+ if (position === 'center')
229
+ return caption;
230
+ const [vertical, side] = caption.split('-');
231
+ return (side === position ? `${vertical}-${opposite}` : caption);
232
+ }
233
+ /** Form margin towards its edge, per shape (% of the width). */
234
+ const SHAPE_MARGIN = {
235
+ triangles: 'clamp(24px, 11.7%, 200px)',
236
+ 'split-circle': 'clamp(24px, 8.75%, 200px)',
237
+ facets: 'clamp(24px, 11.7%, 200px)',
238
+ circles: 'clamp(24px, 12.5%, 200px)',
239
+ };
240
+ /**
241
+ * The caption sits on the photo in both modes over its own darkening veil, so in light mode it is
242
+ * still light text. In dark mode it follows the theme tokens.
243
+ */
244
+ const CAPTION_BY_MODE = {
245
+ light: {
246
+ '--sol-auth-caption-rgb': '15,23,42',
247
+ '--sol-auth-caption-reach': '30%',
248
+ '--sol-auth-caption-color': '#FFFFFF',
249
+ '--sol-auth-caption-label': '#FFFFFF',
250
+ '--sol-auth-caption-label-opacity': '0.85',
251
+ },
252
+ dark: {
253
+ '--sol-auth-caption-rgb': '2,6,23',
254
+ '--sol-auth-caption-reach': '38%',
255
+ '--sol-auth-caption-color': 'var(--sol-color-text-primary)',
256
+ '--sol-auth-caption-label': 'var(--sol-color-secondary)',
257
+ '--sol-auth-caption-label-opacity': '1',
258
+ },
259
+ };
260
+ function modeVariables(mode, config) {
261
+ const veil = { ...DEFAULT_VEIL[mode], ...config?.veil };
262
+ const panel = { ...DEFAULT_PANEL[mode], ...config?.panel };
263
+ const margin = SHAPE_MARGIN[config?.background ?? LOGIN_DEFAULT_BACKGROUND];
264
+ return {
265
+ ...(margin ? { '--sol-auth-shape-margin': margin } : {}),
266
+ ...(mode === 'dark'
267
+ ? {
268
+ '--sol-input-bg': 'color-mix(in srgb, var(--sol-color-text-primary) 6%, transparent)',
269
+ '--sol-input-border': '1px solid color-mix(in srgb, var(--sol-color-text-primary) 16%, transparent)',
270
+ }
271
+ : {}),
272
+ '--sol-auth-veil-rgb': veil.rgb,
273
+ '--sol-auth-veil-from': String(veil.from),
274
+ '--sol-auth-veil-to': String(veil.to),
275
+ '--sol-auth-veil-bottom': String(veil.bottom),
276
+ ...CAPTION_BY_MODE[mode],
277
+ '--sol-auth-panel-bg': panel.bg,
278
+ '--sol-auth-panel-filter': `blur(${panel.blur}) saturate(${panel.saturate})`,
279
+ '--sol-auth-panel-border': panel.border,
280
+ '--sol-auth-panel-radius': panel.radius,
281
+ // Secondary theme tones lack contrast on a translucent surface; a firmer border keeps checkboxes
282
+ // and fields distinguishable from the card.
283
+ '--sol-color-text-secondary': 'color-mix(in srgb, var(--sol-color-text-primary) 74%, var(--sol-bg-surface))',
284
+ '--sol-color-text-muted': 'color-mix(in srgb, var(--sol-color-text-primary) 74%, var(--sol-bg-surface))',
285
+ '--sol-border-color-default': 'color-mix(in srgb, var(--sol-color-text-primary) 45%, var(--sol-bg-surface))',
286
+ };
287
+ }
288
+ /** Resolves a normalized `meta.login` for one mode. `images` are the photos to paint (non-empty). */
289
+ function buildLoginView(login, images, dark) {
290
+ const mode = dark ? 'dark' : 'light';
291
+ const config = login?.modes?.[mode];
292
+ const position = config?.position ?? LOGIN_DEFAULT_POSITION;
293
+ return {
294
+ images,
295
+ intervalMs: login?.intervalMs ?? LOGIN_INTERVAL_DEFAULT_MS,
296
+ effect: login?.effect ?? LOGIN_DEFAULT_EFFECT,
297
+ transition: login?.transition ?? LOGIN_DEFAULT_TRANSITION,
298
+ label: login?.caption?.label ?? null,
299
+ indicators: login?.caption?.indicators ?? true,
300
+ position,
301
+ background: config?.background ?? LOGIN_DEFAULT_BACKGROUND,
302
+ captionPosition: captionClear(position, config?.captionPosition),
303
+ variables: modeVariables(mode, config),
304
+ };
305
+ }
306
+ /**
307
+ * Precedence: published appearance → theme `meta.login` → fallback photos → classic layout (`null`).
308
+ * Photos resolve separately: a configuration without photos keeps its motion and composition but
309
+ * takes the photos of the next source that has them.
310
+ */
311
+ function resolveLoginView(sources, dark) {
312
+ const theme = normalizeLogin(sources.theme);
313
+ const login = sources.published ?? theme;
314
+ const fallback = (sources.fallbackImages ?? []).filter(isAllowedLoginImage);
315
+ const images = [sources.published?.images, theme?.images, fallback].find(list => list && list.length > 0);
316
+ return images ? buildLoginView(login, images, dark) : null;
317
+ }
318
+
319
+ /**
320
+ * Brand above the form title: the theme logo (its dark variant in dark mode) and an optional
321
+ * tagline. Without a usable logo it writes the alternative text as a wordmark, so the block never
322
+ * renders a broken image.
323
+ */
324
+ class SolLoginBrandComponent {
325
+ logo = input(null, /* @ts-ignore */
326
+ ...(ngDevMode ? [{ debugName: "logo" }] : /* istanbul ignore next */ []));
327
+ dark = input(false, /* @ts-ignore */
328
+ ...(ngDevMode ? [{ debugName: "dark" }] : /* istanbul ignore next */ []));
329
+ tagline = input(null, /* @ts-ignore */
330
+ ...(ngDevMode ? [{ debugName: "tagline" }] : /* istanbul ignore next */ []));
331
+ src = computed(() => {
332
+ const logo = this.logo();
333
+ if (!logo)
334
+ return null;
335
+ return (this.dark() ? sanitizeAssetUrl(logo.urlDark) : null) ?? sanitizeAssetUrl(logo.url);
336
+ }, /* @ts-ignore */
337
+ ...(ngDevMode ? [{ debugName: "src" }] : /* istanbul ignore next */ []));
338
+ alt = computed(() => this.logo()?.altText?.trim() ?? '', /* @ts-ignore */
339
+ ...(ngDevMode ? [{ debugName: "alt" }] : /* istanbul ignore next */ []));
340
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolLoginBrandComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
341
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: SolLoginBrandComponent, isStandalone: true, selector: "sol-login-brand", inputs: { logo: { classPropertyName: "logo", publicName: "logo", isSignal: true, isRequired: false, transformFunction: null }, dark: { classPropertyName: "dark", publicName: "dark", isSignal: true, isRequired: false, transformFunction: null }, tagline: { classPropertyName: "tagline", publicName: "tagline", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
342
+ @if (src(); as url) {
343
+ <img data-testid="login-brand-logo" [src]="url" [alt]="alt()" />
344
+ } @else if (alt()) {
345
+ <span class="wordmark" data-testid="login-brand-wordmark">{{ alt() }}</span>
346
+ }
347
+ @if (tagline()) {
348
+ <p class="tagline" data-testid="login-brand-tagline">{{ tagline() }}</p>
349
+ }
350
+ `, isInline: true, styles: [":host{display:flex;flex-direction:column;align-items:center;gap:var(--sol-space-xs, 4px);margin-bottom:var(--sol-space-md, 16px);text-align:center}img{display:block;height:64px;max-width:100%;width:auto;object-fit:contain}.wordmark{font-family:var(--sol-font-display, var(--sol-font-family));font-size:var(--sol-font-size-lg, 16px);font-weight:var(--sol-font-weight-bold, 600);letter-spacing:.04em;color:var(--sol-color-text-primary)}.tagline{margin:0;font-size:var(--sol-font-size-sm, 12px);color:var(--sol-color-text-secondary)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
351
+ }
352
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolLoginBrandComponent, decorators: [{
353
+ type: Component,
354
+ args: [{ standalone: true, selector: 'sol-login-brand', changeDetection: ChangeDetectionStrategy.OnPush, template: `
355
+ @if (src(); as url) {
356
+ <img data-testid="login-brand-logo" [src]="url" [alt]="alt()" />
357
+ } @else if (alt()) {
358
+ <span class="wordmark" data-testid="login-brand-wordmark">{{ alt() }}</span>
359
+ }
360
+ @if (tagline()) {
361
+ <p class="tagline" data-testid="login-brand-tagline">{{ tagline() }}</p>
362
+ }
363
+ `, styles: [":host{display:flex;flex-direction:column;align-items:center;gap:var(--sol-space-xs, 4px);margin-bottom:var(--sol-space-md, 16px);text-align:center}img{display:block;height:64px;max-width:100%;width:auto;object-fit:contain}.wordmark{font-family:var(--sol-font-display, var(--sol-font-family));font-size:var(--sol-font-size-lg, 16px);font-weight:var(--sol-font-weight-bold, 600);letter-spacing:.04em;color:var(--sol-color-text-primary)}.tagline{margin:0;font-size:var(--sol-font-size-sm, 12px);color:var(--sol-color-text-secondary)}\n"] }]
364
+ }], propDecorators: { logo: [{ type: i0.Input, args: [{ isSignal: true, alias: "logo", required: false }] }], dark: [{ type: i0.Input, args: [{ isSignal: true, alias: "dark", required: false }] }], tagline: [{ type: i0.Input, args: [{ isSignal: true, alias: "tagline", required: false }] }] } });
365
+
366
+ /**
367
+ * Background of the form. With gradient, glass or solid it is the rectangular panel (driven by the
368
+ * `--sol-auth-panel-*` variables). With a shape there is no panel or veil: the shape is the
369
+ * container. Below 768 px, with a shape, a simple panel comes back.
370
+ */
371
+ class SolLoginPanelBackgroundComponent {
372
+ background = input.required(/* @ts-ignore */
373
+ ...(ngDevMode ? [{ debugName: "background" }] : /* istanbul ignore next */ []));
374
+ position = input.required(/* @ts-ignore */
375
+ ...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []));
376
+ classes = computed(() => [`bg-${this.background()}`, `side-${this.position()}`, hasLoginShapes(this.background()) ? 'with-shapes' : ''].join(' ').trim(), /* @ts-ignore */
377
+ ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
378
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolLoginPanelBackgroundComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
379
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.6", type: SolLoginPanelBackgroundComponent, isStandalone: true, selector: "sol-login-panel-background", inputs: { background: { classPropertyName: "background", publicName: "background", isSignal: true, isRequired: true, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: true, transformFunction: null } }, host: { attributes: { "aria-hidden": "true" }, properties: { "class": "classes()" } }, ngImport: i0, template: `<span class="panel"></span>`, isInline: true, styles: [":host{position:absolute;inset:0;pointer-events:none;border-radius:var(--sol-auth-panel-radius, var(--sol-card-radius, var(--sol-border-radius-lg)))}:host(:not(.with-shapes)){z-index:-1}span{position:absolute;inset:0;border-radius:inherit}.panel{background:var(--sol-auth-panel-bg, color-mix(in srgb, var(--sol-bg-surface) 48%, transparent));border:var(--sol-auth-panel-border, 1px solid transparent);backdrop-filter:var(--sol-auth-panel-filter, none);-webkit-backdrop-filter:var(--sol-auth-panel-filter, none)}:host(.side-right){--sol-login-fade: 270deg}:host(.side-left){--sol-login-fade: 90deg}:host(.bg-glass-fade:not(.side-center)) .panel{-webkit-mask-image:linear-gradient(var(--sol-login-fade),transparent 0%,rgba(0,0,0,.04) 14%,rgba(0,0,0,.35) 42%,black 72%);mask-image:linear-gradient(var(--sol-login-fade),transparent 0%,rgba(0,0,0,.04) 14%,rgba(0,0,0,.35) 42%,black 72%)}:host(.bg-glass-fade.side-center) .panel{-webkit-mask-image:radial-gradient(ellipse 72% 72% at center,black 62%,transparent 100%);mask-image:radial-gradient(ellipse 72% 72% at center,black 62%,transparent 100%)}:host(.bg-solid) .panel{background:var(--sol-bg-surface);backdrop-filter:none;-webkit-backdrop-filter:none}:host(.with-shapes) .panel{display:none}@media(max-width:767.98px){:host(.bg-glass-fade) .panel{-webkit-mask-image:none;mask-image:none}:host(.with-shapes) .panel{display:block;background:color-mix(in srgb,var(--sol-bg-surface) 88%,transparent);border:0;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
380
+ }
381
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolLoginPanelBackgroundComponent, decorators: [{
382
+ type: Component,
383
+ args: [{ standalone: true, selector: 'sol-login-panel-background', changeDetection: ChangeDetectionStrategy.OnPush, host: { 'aria-hidden': 'true', '[class]': 'classes()' }, template: `<span class="panel"></span>`, styles: [":host{position:absolute;inset:0;pointer-events:none;border-radius:var(--sol-auth-panel-radius, var(--sol-card-radius, var(--sol-border-radius-lg)))}:host(:not(.with-shapes)){z-index:-1}span{position:absolute;inset:0;border-radius:inherit}.panel{background:var(--sol-auth-panel-bg, color-mix(in srgb, var(--sol-bg-surface) 48%, transparent));border:var(--sol-auth-panel-border, 1px solid transparent);backdrop-filter:var(--sol-auth-panel-filter, none);-webkit-backdrop-filter:var(--sol-auth-panel-filter, none)}:host(.side-right){--sol-login-fade: 270deg}:host(.side-left){--sol-login-fade: 90deg}:host(.bg-glass-fade:not(.side-center)) .panel{-webkit-mask-image:linear-gradient(var(--sol-login-fade),transparent 0%,rgba(0,0,0,.04) 14%,rgba(0,0,0,.35) 42%,black 72%);mask-image:linear-gradient(var(--sol-login-fade),transparent 0%,rgba(0,0,0,.04) 14%,rgba(0,0,0,.35) 42%,black 72%)}:host(.bg-glass-fade.side-center) .panel{-webkit-mask-image:radial-gradient(ellipse 72% 72% at center,black 62%,transparent 100%);mask-image:radial-gradient(ellipse 72% 72% at center,black 62%,transparent 100%)}:host(.bg-solid) .panel{background:var(--sol-bg-surface);backdrop-filter:none;-webkit-backdrop-filter:none}:host(.with-shapes) .panel{display:none}@media(max-width:767.98px){:host(.bg-glass-fade) .panel{-webkit-mask-image:none;mask-image:none}:host(.with-shapes) .panel{display:block;background:color-mix(in srgb,var(--sol-bg-surface) 88%,transparent);border:0;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}}\n"] }]
384
+ }], propDecorators: { background: [{ type: i0.Input, args: [{ isSignal: true, alias: "background", required: true }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: true }] }] } });
385
+
386
+ /** The background animation outlasts the interval to cover each photo on its way out. */
387
+ const ANIMATION_TAIL_MS = 2000;
388
+ /**
389
+ * Full-screen photos of the login. The effect (what happens to the photo while in front) and the
390
+ * transition (how the next one comes in) are independent. It is decorative, so it is hidden from
391
+ * screen readers. Whoever asks for reduced motion sees the first photo, still. Photo URLs come from
392
+ * the theme only (`meta.login.images`, already normalized).
393
+ */
394
+ class SolLoginPhotosComponent {
395
+ photos = input.required(/* @ts-ignore */
396
+ ...(ngDevMode ? [{ debugName: "photos" }] : /* istanbul ignore next */ []));
397
+ effect = input(LOGIN_DEFAULT_EFFECT, /* @ts-ignore */
398
+ ...(ngDevMode ? [{ debugName: "effect" }] : /* istanbul ignore next */ []));
399
+ transition = input(LOGIN_DEFAULT_TRANSITION, /* @ts-ignore */
400
+ ...(ngDevMode ? [{ debugName: "transition" }] : /* istanbul ignore next */ []));
401
+ intervalMs = input(LOGIN_INTERVAL_DEFAULT_MS, /* @ts-ignore */
402
+ ...(ngDevMode ? [{ debugName: "intervalMs" }] : /* istanbul ignore next */ []));
403
+ /** Index of the photo in front after each change. */
404
+ activePhoto = output();
405
+ active = signal(0, /* @ts-ignore */
406
+ ...(ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []));
407
+ previous = signal(null, /* @ts-ignore */
408
+ ...(ngDevMode ? [{ debugName: "previous" }] : /* istanbul ignore next */ []));
409
+ duration = computed(() => `${this.intervalMs() + ANIMATION_TAIL_MS}ms`, /* @ts-ignore */
410
+ ...(ngDevMode ? [{ debugName: "duration" }] : /* istanbul ignore next */ []));
411
+ timer;
412
+ /** Reschedules when the list or the interval change: the theme preview edits them live. */
413
+ carousel = effect(() => {
414
+ const total = this.photos().length;
415
+ const interval = this.intervalMs();
416
+ this.stop();
417
+ if (untracked(this.active) >= total)
418
+ this.active.set(0);
419
+ if (total < 2 || globalThis.matchMedia?.('(prefers-reduced-motion: reduce)').matches)
420
+ return;
421
+ this.timer = setInterval(() => this.advance(), interval);
422
+ }, /* @ts-ignore */
423
+ ...(ngDevMode ? [{ debugName: "carousel" }] : /* istanbul ignore next */ []));
424
+ constructor() {
425
+ inject(DestroyRef).onDestroy(() => this.stop());
426
+ }
427
+ stop() {
428
+ if (this.timer !== undefined)
429
+ clearInterval(this.timer);
430
+ this.timer = undefined;
431
+ }
432
+ advance() {
433
+ this.previous.set(this.active());
434
+ this.active.update(current => (current + 1) % this.photos().length);
435
+ this.activePhoto.emit(this.active());
436
+ }
437
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolLoginPhotosComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
438
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: SolLoginPhotosComponent, isStandalone: true, selector: "sol-login-photos", inputs: { photos: { classPropertyName: "photos", publicName: "photos", isSignal: true, isRequired: true, transformFunction: null }, effect: { classPropertyName: "effect", publicName: "effect", isSignal: true, isRequired: false, transformFunction: null }, transition: { classPropertyName: "transition", publicName: "transition", isSignal: true, isRequired: false, transformFunction: null }, intervalMs: { classPropertyName: "intervalMs", publicName: "intervalMs", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activePhoto: "activePhoto" }, host: { attributes: { "aria-hidden": "true" }, properties: { "style.--sol-login-photo-duration": "duration()" } }, ngImport: i0, template: `
439
+ @for (photo of photos(); track photo; let i = $index) {
440
+ <img
441
+ data-testid="login-photo"
442
+ [class]="'photo photo--' + effect() + ' enter--' + transition()"
443
+ [class.photo--active]="i === active()"
444
+ [class.photo--leaving]="i === previous()"
445
+ [src]="photo"
446
+ alt=""
447
+ />
448
+ }
449
+ `, isInline: true, styles: [":host{position:fixed;inset:0;overflow:hidden;background-image:var(--sol-auth-hero-bg, none);background-color:var(--sol-color-primary)}.photo{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;transition:opacity 1.6s var(--sol-ease, ease),filter 1.6s var(--sol-ease, ease);will-change:opacity,transform}.photo:nth-of-type(4n+1){--sol-login-move-x: -3%;--sol-login-move-y: -1.5%}.photo:nth-of-type(4n+2){--sol-login-move-x: 3%;--sol-login-move-y: -2%}.photo:nth-of-type(4n+3){--sol-login-move-x: -2%;--sol-login-move-y: 2%}.photo:nth-of-type(4n+4){--sol-login-move-x: 3%;--sol-login-move-y: 1.5%}.photo--active{opacity:1}.photo--zoom.photo--active,.photo--zoom.photo--leaving{animation:sol-login-zoom-in var(--sol-login-photo-duration, 9s) linear forwards}.photo--focus.photo--active,.photo--focus.photo--leaving{animation:sol-login-zoom-out var(--sol-login-photo-duration, 9s) cubic-bezier(.2,.6,.3,1) forwards}.enter--focus{filter:blur(18px) brightness(1.25)}.enter--focus.photo--active{filter:none}@keyframes sol-login-zoom-in{0%{transform:scale(1.04)}to{transform:scale(1.2) translate(var(--sol-login-move-x),var(--sol-login-move-y))}}@keyframes sol-login-zoom-out{0%{transform:scale(1.22)}to{transform:scale(1.02)}}@media(prefers-reduced-motion:reduce){.photo{transition:none;filter:none}.photo--active,.photo--leaving{animation:none!important}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
450
+ }
451
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolLoginPhotosComponent, decorators: [{
452
+ type: Component,
453
+ args: [{ standalone: true, selector: 'sol-login-photos', changeDetection: ChangeDetectionStrategy.OnPush, host: { 'aria-hidden': 'true', '[style.--sol-login-photo-duration]': 'duration()' }, template: `
454
+ @for (photo of photos(); track photo; let i = $index) {
455
+ <img
456
+ data-testid="login-photo"
457
+ [class]="'photo photo--' + effect() + ' enter--' + transition()"
458
+ [class.photo--active]="i === active()"
459
+ [class.photo--leaving]="i === previous()"
460
+ [src]="photo"
461
+ alt=""
462
+ />
463
+ }
464
+ `, styles: [":host{position:fixed;inset:0;overflow:hidden;background-image:var(--sol-auth-hero-bg, none);background-color:var(--sol-color-primary)}.photo{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;transition:opacity 1.6s var(--sol-ease, ease),filter 1.6s var(--sol-ease, ease);will-change:opacity,transform}.photo:nth-of-type(4n+1){--sol-login-move-x: -3%;--sol-login-move-y: -1.5%}.photo:nth-of-type(4n+2){--sol-login-move-x: 3%;--sol-login-move-y: -2%}.photo:nth-of-type(4n+3){--sol-login-move-x: -2%;--sol-login-move-y: 2%}.photo:nth-of-type(4n+4){--sol-login-move-x: 3%;--sol-login-move-y: 1.5%}.photo--active{opacity:1}.photo--zoom.photo--active,.photo--zoom.photo--leaving{animation:sol-login-zoom-in var(--sol-login-photo-duration, 9s) linear forwards}.photo--focus.photo--active,.photo--focus.photo--leaving{animation:sol-login-zoom-out var(--sol-login-photo-duration, 9s) cubic-bezier(.2,.6,.3,1) forwards}.enter--focus{filter:blur(18px) brightness(1.25)}.enter--focus.photo--active{filter:none}@keyframes sol-login-zoom-in{0%{transform:scale(1.04)}to{transform:scale(1.2) translate(var(--sol-login-move-x),var(--sol-login-move-y))}}@keyframes sol-login-zoom-out{0%{transform:scale(1.22)}to{transform:scale(1.02)}}@media(prefers-reduced-motion:reduce){.photo{transition:none;filter:none}.photo--active,.photo--leaving{animation:none!important}}\n"] }]
465
+ }], ctorParameters: () => [], propDecorators: { photos: [{ type: i0.Input, args: [{ isSignal: true, alias: "photos", required: true }] }], effect: [{ type: i0.Input, args: [{ isSignal: true, alias: "effect", required: false }] }], transition: [{ type: i0.Input, args: [{ isSignal: true, alias: "transition", required: false }] }], intervalMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "intervalMs", required: false }] }], activePhoto: [{ type: i0.Output, args: ["activePhoto"] }] } });
466
+
467
+ /**
468
+ * What sits behind the form: photos, veil, shapes and caption. Every layer is fixed to the
469
+ * viewport (or to the preview canvas, whose `transform` contains them) and takes no events. The
470
+ * real login (`sol-login-frame`) and the editor preview share it.
471
+ */
472
+ class SolLoginSceneComponent {
473
+ view = input.required(/* @ts-ignore */
474
+ ...(ngDevMode ? [{ debugName: "view" }] : /* istanbul ignore next */ []));
475
+ /** Large caption text (for example, the theme `meta.tagline`). Empty hides it. */
476
+ tagline = input('', /* @ts-ignore */
477
+ ...(ngDevMode ? [{ debugName: "tagline" }] : /* istanbul ignore next */ []));
478
+ activePhoto = signal(0, /* @ts-ignore */
479
+ ...(ngDevMode ? [{ debugName: "activePhoto" }] : /* istanbul ignore next */ []));
480
+ withShapes = computed(() => hasLoginShapes(this.view().background), /* @ts-ignore */
481
+ ...(ngDevMode ? [{ debugName: "withShapes" }] : /* istanbul ignore next */ []));
482
+ /** With a gradient and the caption below, a bottom band; otherwise only the caption corner. */
483
+ captionVeilClass = computed(() => {
484
+ const { captionPosition } = this.view();
485
+ const band = !this.withShapes() && captionPosition.startsWith('bottom');
486
+ return `caption-veil caption-veil--${band ? 'bottom' : captionPosition}`;
487
+ }, /* @ts-ignore */
488
+ ...(ngDevMode ? [{ debugName: "captionVeilClass" }] : /* istanbul ignore next */ []));
489
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolLoginSceneComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
490
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: SolLoginSceneComponent, isStandalone: true, selector: "sol-login-scene", inputs: { view: { classPropertyName: "view", publicName: "view", isSignal: true, isRequired: true, transformFunction: null }, tagline: { classPropertyName: "tagline", publicName: "tagline", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
491
+ <sol-login-photos
492
+ [photos]="view().images"
493
+ [effect]="view().effect"
494
+ [transition]="view().transition"
495
+ [intervalMs]="view().intervalMs"
496
+ (activePhoto)="activePhoto.set($event)"
497
+ />
498
+ @if (!withShapes()) {
499
+ <div [class]="'veil veil--' + view().position" aria-hidden="true" data-testid="login-veil"></div>
500
+ }
501
+ <div [class]="captionVeilClass()" aria-hidden="true" data-testid="login-caption-veil"></div>
502
+ <div [class]="'caption caption--' + view().captionPosition" [class.caption--marks-below]="!withShapes()">
503
+ @if (view().indicators && view().images.length > 1) {
504
+ <div class="caption__marks" data-testid="login-caption-indicators" aria-hidden="true">
505
+ @for (photo of view().images; track photo; let i = $index) {
506
+ <span class="caption__mark" [class.caption__mark--active]="i === activePhoto()"></span>
507
+ }
508
+ </div>
509
+ }
510
+ @if (view().label; as label) {
511
+ <p class="caption__label" data-testid="login-caption-label">{{ label }}</p>
512
+ }
513
+ @if (tagline()) {
514
+ <p class="caption__text sol-display" data-testid="login-caption-text">{{ tagline() }}</p>
515
+ }
516
+ </div>
517
+ `, isInline: true, styles: [".veil,.caption-veil{position:fixed;inset:0;pointer-events:none}.veil--right,.veil--left{--sol-login-veil-end: max(30%, 520px);--sol-login-veil-start: min(.96, calc(var(--sol-auth-veil-to, .94) * 1.12));background:linear-gradient(var(--sol-login-veil-dir),rgba(var(--sol-auth-veil-rgb),var(--sol-login-veil-start)) 0%,rgba(var(--sol-auth-veil-rgb),calc(var(--sol-login-veil-start) * .96)) calc(var(--sol-login-veil-end) * .2),rgba(var(--sol-auth-veil-rgb),calc(var(--sol-login-veil-start) * .84)) calc(var(--sol-login-veil-end) * .4),rgba(var(--sol-auth-veil-rgb),calc(var(--sol-login-veil-start) * .62)) calc(var(--sol-login-veil-end) * .6),rgba(var(--sol-auth-veil-rgb),calc(var(--sol-login-veil-start) * .4)) calc(var(--sol-login-veil-end) * .75),rgba(var(--sol-auth-veil-rgb),calc(var(--sol-login-veil-start) * .14)) calc(var(--sol-login-veil-end) * .9),rgba(var(--sol-auth-veil-rgb),0) var(--sol-login-veil-end))}.veil--right{--sol-login-veil-dir: 270deg}.veil--left{--sol-login-veil-dir: 90deg}.veil--center{background:radial-gradient(ellipse 32% 62% at center,rgba(var(--sol-auth-veil-rgb),calc(var(--sol-auth-veil-to, .94) * .8)) 58%,rgba(var(--sol-auth-veil-rgb),0))}.caption-veil--bottom{background:linear-gradient(0deg,rgba(var(--sol-auth-caption-rgb),var(--sol-auth-veil-bottom, .55)) 0%,rgba(var(--sol-auth-caption-rgb),0) var(--sol-auth-caption-reach, 30%))}.caption-veil--bottom-left{background:radial-gradient(ellipse 55% 50% at 0% 100%,rgba(var(--sol-auth-caption-rgb),.72),transparent)}.caption-veil--bottom-right{background:radial-gradient(ellipse 55% 50% at 100% 100%,rgba(var(--sol-auth-caption-rgb),.72),transparent)}.caption-veil--top-left{background:radial-gradient(ellipse 55% 50% at 0% 0%,rgba(var(--sol-auth-caption-rgb),.72),transparent)}.caption-veil--top-right{background:radial-gradient(ellipse 55% 50% at 100% 0%,rgba(var(--sol-auth-caption-rgb),.72),transparent)}.caption{position:absolute;z-index:1;display:flex;flex-direction:column;gap:var(--sol-space-sm, 8px);max-width:min(34vw,420px);color:var(--sol-auth-caption-color, var(--sol-color-text-primary));pointer-events:none}.caption--bottom-left{left:clamp(24px,4vw,56px);bottom:clamp(24px,4vw,56px)}.caption--bottom-right{right:clamp(24px,4vw,56px);bottom:clamp(24px,4vw,56px);text-align:right;align-items:flex-end}.caption--top-left{left:clamp(24px,4vw,56px);top:clamp(24px,4vw,56px)}.caption--top-right{right:clamp(24px,4vw,56px);top:clamp(24px,4vw,56px);text-align:right;align-items:flex-end}.caption__marks{display:flex;gap:6px}.caption--marks-below .caption__marks{order:1}.caption__mark{width:28px;height:2px;border-radius:2px;background:currentColor;opacity:.35;transition:opacity .6s var(--sol-ease, ease)}.caption__mark--active{opacity:1}.caption__label{margin:0;color:var(--sol-auth-caption-label, currentColor);opacity:var(--sol-auth-caption-label-opacity, .85);font-size:11px;letter-spacing:.14em;text-transform:uppercase;font-weight:500}.caption__text{margin:0;font-size:22px;font-weight:500;line-height:1.25;text-wrap:pretty}@media(max-width:1099.98px){.caption,.caption-veil{display:none}}\n"], dependencies: [{ kind: "component", type: SolLoginPhotosComponent, selector: "sol-login-photos", inputs: ["photos", "effect", "transition", "intervalMs"], outputs: ["activePhoto"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
518
+ }
519
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolLoginSceneComponent, decorators: [{
520
+ type: Component,
521
+ args: [{ standalone: true, selector: 'sol-login-scene', changeDetection: ChangeDetectionStrategy.OnPush, imports: [SolLoginPhotosComponent], template: `
522
+ <sol-login-photos
523
+ [photos]="view().images"
524
+ [effect]="view().effect"
525
+ [transition]="view().transition"
526
+ [intervalMs]="view().intervalMs"
527
+ (activePhoto)="activePhoto.set($event)"
528
+ />
529
+ @if (!withShapes()) {
530
+ <div [class]="'veil veil--' + view().position" aria-hidden="true" data-testid="login-veil"></div>
531
+ }
532
+ <div [class]="captionVeilClass()" aria-hidden="true" data-testid="login-caption-veil"></div>
533
+ <div [class]="'caption caption--' + view().captionPosition" [class.caption--marks-below]="!withShapes()">
534
+ @if (view().indicators && view().images.length > 1) {
535
+ <div class="caption__marks" data-testid="login-caption-indicators" aria-hidden="true">
536
+ @for (photo of view().images; track photo; let i = $index) {
537
+ <span class="caption__mark" [class.caption__mark--active]="i === activePhoto()"></span>
538
+ }
539
+ </div>
540
+ }
541
+ @if (view().label; as label) {
542
+ <p class="caption__label" data-testid="login-caption-label">{{ label }}</p>
543
+ }
544
+ @if (tagline()) {
545
+ <p class="caption__text sol-display" data-testid="login-caption-text">{{ tagline() }}</p>
546
+ }
547
+ </div>
548
+ `, styles: [".veil,.caption-veil{position:fixed;inset:0;pointer-events:none}.veil--right,.veil--left{--sol-login-veil-end: max(30%, 520px);--sol-login-veil-start: min(.96, calc(var(--sol-auth-veil-to, .94) * 1.12));background:linear-gradient(var(--sol-login-veil-dir),rgba(var(--sol-auth-veil-rgb),var(--sol-login-veil-start)) 0%,rgba(var(--sol-auth-veil-rgb),calc(var(--sol-login-veil-start) * .96)) calc(var(--sol-login-veil-end) * .2),rgba(var(--sol-auth-veil-rgb),calc(var(--sol-login-veil-start) * .84)) calc(var(--sol-login-veil-end) * .4),rgba(var(--sol-auth-veil-rgb),calc(var(--sol-login-veil-start) * .62)) calc(var(--sol-login-veil-end) * .6),rgba(var(--sol-auth-veil-rgb),calc(var(--sol-login-veil-start) * .4)) calc(var(--sol-login-veil-end) * .75),rgba(var(--sol-auth-veil-rgb),calc(var(--sol-login-veil-start) * .14)) calc(var(--sol-login-veil-end) * .9),rgba(var(--sol-auth-veil-rgb),0) var(--sol-login-veil-end))}.veil--right{--sol-login-veil-dir: 270deg}.veil--left{--sol-login-veil-dir: 90deg}.veil--center{background:radial-gradient(ellipse 32% 62% at center,rgba(var(--sol-auth-veil-rgb),calc(var(--sol-auth-veil-to, .94) * .8)) 58%,rgba(var(--sol-auth-veil-rgb),0))}.caption-veil--bottom{background:linear-gradient(0deg,rgba(var(--sol-auth-caption-rgb),var(--sol-auth-veil-bottom, .55)) 0%,rgba(var(--sol-auth-caption-rgb),0) var(--sol-auth-caption-reach, 30%))}.caption-veil--bottom-left{background:radial-gradient(ellipse 55% 50% at 0% 100%,rgba(var(--sol-auth-caption-rgb),.72),transparent)}.caption-veil--bottom-right{background:radial-gradient(ellipse 55% 50% at 100% 100%,rgba(var(--sol-auth-caption-rgb),.72),transparent)}.caption-veil--top-left{background:radial-gradient(ellipse 55% 50% at 0% 0%,rgba(var(--sol-auth-caption-rgb),.72),transparent)}.caption-veil--top-right{background:radial-gradient(ellipse 55% 50% at 100% 0%,rgba(var(--sol-auth-caption-rgb),.72),transparent)}.caption{position:absolute;z-index:1;display:flex;flex-direction:column;gap:var(--sol-space-sm, 8px);max-width:min(34vw,420px);color:var(--sol-auth-caption-color, var(--sol-color-text-primary));pointer-events:none}.caption--bottom-left{left:clamp(24px,4vw,56px);bottom:clamp(24px,4vw,56px)}.caption--bottom-right{right:clamp(24px,4vw,56px);bottom:clamp(24px,4vw,56px);text-align:right;align-items:flex-end}.caption--top-left{left:clamp(24px,4vw,56px);top:clamp(24px,4vw,56px)}.caption--top-right{right:clamp(24px,4vw,56px);top:clamp(24px,4vw,56px);text-align:right;align-items:flex-end}.caption__marks{display:flex;gap:6px}.caption--marks-below .caption__marks{order:1}.caption__mark{width:28px;height:2px;border-radius:2px;background:currentColor;opacity:.35;transition:opacity .6s var(--sol-ease, ease)}.caption__mark--active{opacity:1}.caption__label{margin:0;color:var(--sol-auth-caption-label, currentColor);opacity:var(--sol-auth-caption-label-opacity, .85);font-size:11px;letter-spacing:.14em;text-transform:uppercase;font-weight:500}.caption__text{margin:0;font-size:22px;font-weight:500;line-height:1.25;text-wrap:pretty}@media(max-width:1099.98px){.caption,.caption-veil{display:none}}\n"] }]
549
+ }], propDecorators: { view: [{ type: i0.Input, args: [{ isSignal: true, alias: "view", required: true }] }], tagline: [{ type: i0.Input, args: [{ isSignal: true, alias: "tagline", required: false }] }] } });
550
+
551
+ const SHAPE_TONES = {
552
+ a: 'var(--sol-bg-surface)',
553
+ b: 'color-mix(in srgb, var(--sol-bg-surface) 92%, var(--sol-color-text-primary))',
554
+ c: 'color-mix(in srgb, var(--sol-bg-surface) 90%, var(--sol-bg-page))',
555
+ d: 'var(--sol-bg-page)',
556
+ e: 'color-mix(in srgb, var(--sol-bg-page) 92%, var(--sol-color-primary))',
557
+ p: 'var(--sol-color-secondary)',
558
+ q: 'var(--sol-color-primary)',
559
+ r: 'color-mix(in srgb, var(--sol-color-primary) 72%, black)',
560
+ s: 'color-mix(in srgb, var(--sol-color-secondary) 78%, white)',
561
+ t: 'color-mix(in srgb, var(--sol-color-primary) 46%, var(--sol-bg-page))',
562
+ u: 'color-mix(in srgb, var(--sol-color-primary) 24%, var(--sol-bg-page))',
563
+ };
564
+ const SHAPE_CANVAS = { width: 1280, height: 800 };
565
+ /** Form box in the design, padding included: the reference to scale the shapes. */
566
+ const SHAPE_FORM_BOX = { width: 412, height: 448 };
567
+ const CELL$1 = 64;
568
+ /** Mosaic: `column.row`, cell half (A or B), tone, opacity and `x` when it multiplies. */
569
+ const MOSAIC = `8.0Ba75 11.0Bb90 12.0Ap79x 12.0Bt83x 13.0Ab86 13.0Be79 14.0Aa74 14.0Br88x 15.0Ad77 15.0Bq62 16.0Aq78 16.0Bq65x
570
+ 17.0Au76x 17.0Bt77 18.0Ap88x 18.0Bu67x 19.0Ae73 9.1At63 9.1Bu60 12.1Br58x 13.1Ap72 13.1Ba79 14.1Ae94 14.1Bc93
571
+ 15.1Ae97 15.1Be93 16.1Ae94 16.1Be97 17.1Ab95 17.1Ba94 18.1Ap80 18.1Bc93 19.1Ad87 8.2Ae95 10.2Ae80 10.2Bt75x
572
+ 11.2Aa88 11.2Br89 12.2Ae75 12.2Bq75 13.2Ae96 13.2Bd96 14.2Ad98 14.2Bc97 15.2Ac98 15.2Ba98 16.2Ad95 16.2Bc94
573
+ 17.2Ab95 17.2Ba98 18.2Ac94 18.2Bb99 19.2Ae99 19.2Bb100 7.3Bb88 8.3Bt59x 9.3Ae75 9.3Bp64x 10.3Bb80 11.3Ar83
574
+ 11.3Bc73 12.3Aa97 12.3Bd94 13.3Aa98 13.3Bc96 14.3Ae94 14.3Bc95 15.3Ad93 15.3Bc94 16.3Aa99 16.3Bb98 17.3Ac99
575
+ 17.3Be99 18.3Ab97 18.3Ba96 19.3Ac96 19.3Bc98 10.4Bt89x 11.4At80 11.4Ba76 12.4Ab94 12.4Be99 13.4Ab98 13.4Bc96
576
+ 14.4Ae97 14.4Be95 15.4Ab96 15.4Ba94 16.4Ac95 16.4Be99 17.4Aa98 17.4Be94 18.4Aa99 18.4Bd94 19.4Aa93 19.4Bb99
577
+ 9.5Au56 10.5Bp88x 11.5Ab88 11.5Bc94 12.5Ad97 12.5Ba97 13.5Aa95 13.5Bb97 14.5Ae95 14.5Be93 15.5Ab96 15.5Bb98
578
+ 16.5Ae94 16.5Be97 17.5Ae96 17.5Be99 18.5Ab99 18.5Be94 19.5Ab94 19.5Bd100 7.6Br88 8.6Bt71x 9.6Aq63x 9.6Bu71
579
+ 10.6Ba85 11.6Bb100 12.6Ab97 12.6Be94 13.6Ad98 13.6Bb96 14.6Ac96 14.6Bc94 15.6Ad94 15.6Ba95 16.6Aa97 16.6Bd93
580
+ 17.6Ad99 17.6Be93 18.6Ab95 18.6Bc99 19.6Ab93 19.6Be94 8.7Ap81x 9.7Br64 10.7Bt84 11.7Ab77 11.7Bt61 12.7Ab99
581
+ 12.7Bc99 13.7Ae93 13.7Ba94 14.7Ad97 14.7Be97 15.7Ae99 15.7Be94 16.7Ac96 16.7Ba97 17.7Ab97 17.7Ba96 18.7Aa98
582
+ 18.7Bb95 19.7Aa97 19.7Bc100 10.8Ar59x 10.8Bb80 11.8At60x 11.8Bt77x 12.8Ac94 12.8Be95 13.8Aa94 13.8Ba96 14.8Ad97
583
+ 14.8Bc98 15.8Ab96 15.8Be98 16.8Ad97 16.8Bb99 17.8Ac100 17.8Ba100 18.8Ad94 18.8Ba99 19.8Ae98 19.8Bc95 9.9Ab85
584
+ 10.9Ap73 11.9Ap89 11.9Br77x 12.9At78 12.9Ba98 13.9Ae97 13.9Bb94 14.9Aa96 14.9Bc93 15.9Ac98 15.9Be94 16.9Aa97
585
+ 16.9Bc95 17.9Aa94 17.9Ba96 18.9Ab97 18.9Bc96 19.9Ab99 19.9Be96 10.10Bt84x 11.10Aa77 11.10Ba86 12.10Ap87 13.10Ad94
586
+ 13.10Bd100 14.10Ac95 14.10Bc99 15.10Ab99 15.10Bd94 16.10Ab98 16.10Bd95 17.10Ac98 17.10Bb97 18.10Ad100 18.10Be97 19.10At61x
587
+ 19.10Bq89x 9.11Ar84x 10.11Bu55x 11.11Bt77x 12.11Ad93 12.11Bb87 13.11Ap71x 13.11Bt73x 14.11Au64x 14.11Bb92 15.11Ad95 15.11Bc96
588
+ 16.11Ac96 16.11Bc99 17.11Ae96 17.11Bb93 18.11Ae88 18.11Be75 19.11Ap81 19.11Br82x 9.12At55 12.12Aa87 12.12Bt66x 13.12At69x
589
+ 14.12Bu77x 15.12At65 15.12Be84 16.12Ap65x 16.12Br55x 17.12Ad94 17.12Bp79 18.12Ad76 18.12Br62x 19.12At60x`;
590
+ const HALVES = {
591
+ A: [
592
+ [0, 0],
593
+ [CELL$1, 0],
594
+ [0, CELL$1],
595
+ ],
596
+ B: [
597
+ [CELL$1, 0],
598
+ [CELL$1, CELL$1],
599
+ [0, CELL$1],
600
+ ],
601
+ };
602
+ const MOSAIC_SHAPES = MOSAIC.split(/\s+/).map(token => {
603
+ const m = /^(\d+)\.(\d+)([AB])([a-z])(\d+)(x?)$/.exec(token);
604
+ return {
605
+ l: Number(m[1]) * CELL$1,
606
+ t: Number(m[2]) * CELL$1,
607
+ w: CELL$1,
608
+ h: CELL$1,
609
+ clip: HALVES[m[3]],
610
+ tone: m[4],
611
+ op: Number(m[5]) / 100,
612
+ multiply: m[6] === 'x',
613
+ };
614
+ });
615
+ /** Loose triangle in canvas coordinates, with its own box so it does not over-paint. */
616
+ function triangle(p1, p2, p3, tone, op, multiply = false) {
617
+ const xs = [p1[0], p2[0], p3[0]];
618
+ const ys = [p1[1], p2[1], p3[1]];
619
+ const l = Math.min(...xs);
620
+ const t = Math.min(...ys);
621
+ const w = Math.max(...xs) - l;
622
+ const h = Math.max(...ys) - t;
623
+ return { l, t, w, h, tone, op, multiply, clip: [p1, p2, p3].map(([a, b]) => [a - l, b - t]) };
624
+ }
625
+ const circle = (l, t, d, tone, op, multiply = false) => ({
626
+ l,
627
+ t,
628
+ w: d,
629
+ h: d,
630
+ circle: true,
631
+ tone,
632
+ op,
633
+ multiply,
634
+ });
635
+ /** Full-canvas frame that clips its child (used to split circles). */
636
+ const clipped = (clip, child) => ({ l: 0, t: 0, w: SHAPE_CANVAS.width, h: SHAPE_CANVAS.height, clip, child });
637
+ const rect = (l, t, r, b) => [
638
+ [l, t],
639
+ [r, t],
640
+ [r, b],
641
+ [l, b],
642
+ ];
643
+ /** Centered facets. */
644
+ const FACETS = [
645
+ triangle([630, 410], [440, 120], [720, 90], 'd', 0.95),
646
+ triangle([630, 410], [720, 90], [880, 190], 'a', 0.95),
647
+ triangle([630, 410], [880, 190], [860, 600], 'c', 0.95),
648
+ triangle([630, 410], [860, 600], [760, 720], 'b', 0.95),
649
+ triangle([630, 410], [760, 720], [450, 690], 'e', 0.95),
650
+ triangle([630, 410], [450, 690], [410, 380], 'd', 0.95),
651
+ triangle([630, 410], [410, 380], [440, 120], 'a', 0.95),
652
+ triangle([440, 120], [720, 90], [560, 0], 'q', 0.75, true),
653
+ triangle([720, 90], [880, 190], [960, 40], 't', 0.9),
654
+ triangle([880, 190], [860, 600], [1010, 380], 'r', 0.75, true),
655
+ triangle([860, 600], [760, 720], [940, 790], 'b', 0.85),
656
+ triangle([760, 720], [450, 690], [600, 800], 'q', 0.6, true),
657
+ triangle([450, 690], [410, 380], [300, 620], 't', 0.82),
658
+ triangle([410, 380], [440, 120], [290, 260], 'r', 0.7, true),
659
+ triangle([290, 260], [410, 380], [230, 420], 'u', 0.55),
660
+ triangle([960, 40], [880, 190], [1060, 170], 'p', 0.5, true),
661
+ triangle([1010, 380], [860, 600], [1080, 560], 't', 0.55, true),
662
+ triangle([300, 620], [450, 690], [330, 770], 'q', 0.45, true),
663
+ triangle([560, 0], [720, 90], [700, 0], 'u', 0.6),
664
+ triangle([1060, 170], [1010, 380], [1130, 300], 'r', 0.35, true),
665
+ triangle([230, 420], [300, 620], [180, 560], 't', 0.4, true),
666
+ ];
667
+ /** Circles with the form in the center. */
668
+ const CIRCLES_CENTER = [
669
+ circle(680, 10, 460, 'q', 0.72, true),
670
+ circle(190, 460, 340, 'r', 0.68, true),
671
+ circle(240, 70, 720, 't', 0.85),
672
+ clipped(rect(640, 610, 1280, 1600), circle(620, 350, 520, 'u', 0.62)),
673
+ circle(330, 90, 640, 'a', 0.98),
674
+ clipped(rect(0, 0, 650, 800), circle(330, 90, 640, 'b', 0.98)),
675
+ clipped(rect(0, 410, 650, 800), circle(330, 90, 640, 'c', 0.98)),
676
+ circle(860, 300, 240, 'p', 0.45, true),
677
+ { l: 250, t: 10, w: 800, h: 800, circle: true, ring: { tone: 'p', op: 0.65 }, clip: rect(0, 0, 800, 368) },
678
+ { l: 648, t: -22, w: 524, h: 524, circle: true, ring: { tone: 'text', op: 0.35 }, clip: rect(262, 0, 524, 524) },
679
+ circle(902, 92, 76, 'p', 0.9),
680
+ circle(280, 242, 40, 't', 0.95),
681
+ circle(1016, 676, 28, 's', 0.9),
682
+ ];
683
+ /** Circles with the form on the right. */
684
+ const CIRCLES_SIDE = [
685
+ circle(1078, 88, 144, 'r', 0.6, true),
686
+ circle(664, 104, 592, 'a', 0.97),
687
+ clipped(rect(0, 0, 960, 800), circle(664, 104, 592, 'b', 0.97)),
688
+ // Lower than a tight fit: real forms are taller and the circle would cover the footer.
689
+ circle(640, 600, 172, 'q', 0.62, true),
690
+ { l: 630, t: 70, w: 660, h: 660, circle: true, ring: { tone: 'p', op: 0.6 }, clip: rect(0, 0, 660, 400) },
691
+ circle(641, 291, 18, 's', 0.9),
692
+ circle(1204, 684, 12, 'p', 0.9),
693
+ ];
694
+ const CUT_TOP = [
695
+ [-600, -600],
696
+ [720, -600],
697
+ [720, 30],
698
+ [-600, 433],
699
+ ];
700
+ const CUT_BOTTOM = [
701
+ [-600, 445],
702
+ [720, 42],
703
+ [720, 1600],
704
+ [-600, 1600],
705
+ ];
706
+ const BIG_CIRCLE = { l: -680, t: -200, w: 1240, h: 1240, circle: true };
707
+ /** Split circle with the form on the left. */
708
+ const SPLIT_CIRCLE = [
709
+ clipped(CUT_TOP, { ...BIG_CIRCLE, l: -698, t: -214, tone: 'q', op: 0.92 }),
710
+ clipped(CUT_BOTTOM, { ...BIG_CIRCLE, tone: 'a', op: 0.98 }),
711
+ clipped(CUT_BOTTOM, { ...BIG_CIRCLE, gradient: { side: 100 } }),
712
+ triangle([598, 118], [640, 92], [626, 150], 'p', 0.9),
713
+ triangle([660, 170], [690, 154], [684, 190], 't', 0.9),
714
+ ];
715
+ const CUT_CENTER_TOP = [
716
+ [-600, -600],
717
+ [1880, -600],
718
+ [1880, 4],
719
+ [-600, 236],
720
+ ];
721
+ const CUT_CENTER_BOTTOM = [
722
+ [-600, 248],
723
+ [1880, 16],
724
+ [1880, 1600],
725
+ [-600, 1600],
726
+ ];
727
+ /** Centered split circle: the same circle surrounds the form and the diagonal cut passes above it. */
728
+ const SPLIT_CIRCLE_CENTER = [
729
+ clipped(CUT_CENTER_TOP, circle(192, -44, 860, 'q', 0.92)),
730
+ clipped(CUT_CENTER_BOTTOM, circle(210, -30, 860, 'a', 0.98)),
731
+ triangle([1040, 196], [1082, 170], [1068, 228], 'p', 0.9),
732
+ triangle([1102, 248], [1132, 232], [1126, 268], 't', 0.9),
733
+ ];
734
+ /** Mirrors a shape over an axis `2 * center`; children mirror over their parent. */
735
+ function mirror(s, width) {
736
+ return {
737
+ ...s,
738
+ l: width - s.l - s.w,
739
+ clip: s.clip?.map(([x, y]) => [s.w - x, y]),
740
+ gradient: s.gradient ? { side: 100 - s.gradient.side } : undefined,
741
+ child: s.child ? mirror(s.child, s.w) : undefined,
742
+ };
743
+ }
744
+
745
+ const CELL = 64;
746
+ const INITIAL_SCALE$1 = 1.15;
747
+ /** Mosaic columns repeated towards the edge so it does not fall short on wide screens. */
748
+ const REPEATED_COLUMN = 17 * CELL;
749
+ const COLUMN_SHIFT = 3 * CELL;
750
+ /** Mosaic dimming per shape: a shared `opacity` would break the blend with the photo. */
751
+ const MOSAIC_OPACITY = 0.88;
752
+ const mirrored = (shapes) => shapes.map(s => mirror(s, SHAPE_CANVAS.width));
753
+ function fullMosaic() {
754
+ const extra = MOSAIC_SHAPES.filter(s => s.l >= REPEATED_COLUMN).map(s => ({ ...s, l: s.l + COLUMN_SHIFT }));
755
+ return [...MOSAIC_SHAPES, ...extra];
756
+ }
757
+ /** The mosaic is drawn on one side: centered, its sparse half repeats mirrored outwards. */
758
+ function centeredMosaic() {
759
+ const edge = 15 * CELL;
760
+ const half = MOSAIC_SHAPES.filter(s => s.l < edge);
761
+ return [...half.map(s => ({ ...s, l: s.l - 320 })), ...half.map(s => mirror(s, 1600))];
762
+ }
763
+ function composition(background, position) {
764
+ const left = position === 'left';
765
+ switch (background) {
766
+ case 'triangles':
767
+ if (position === 'center')
768
+ return { shapes: centeredMosaic(), anchor: [640, 400] };
769
+ return left ? { shapes: mirrored(fullMosaic()), anchor: [320, 400] } : { shapes: fullMosaic(), anchor: [960, 400] };
770
+ case 'split-circle':
771
+ if (position === 'center')
772
+ return { shapes: SPLIT_CIRCLE_CENTER, anchor: [640, 400] };
773
+ return left ? { shapes: SPLIT_CIRCLE, anchor: [282, 478] } : { shapes: mirrored(SPLIT_CIRCLE), anchor: [998, 478] };
774
+ case 'facets':
775
+ return left ? { shapes: mirrored(FACETS), anchor: [640, 408] } : { shapes: FACETS, anchor: [640, 408] };
776
+ case 'circles':
777
+ if (position === 'center')
778
+ return { shapes: CIRCLES_CENTER, anchor: [650, 410] };
779
+ return left ? { shapes: mirrored(CIRCLES_SIDE), anchor: [320, 400] } : { shapes: CIRCLES_SIDE, anchor: [960, 400] };
780
+ default:
781
+ return { shapes: [], anchor: [0, 0] };
782
+ }
783
+ }
784
+ function shapeStyle(s, ox, oy, dimming = 1) {
785
+ const style = {
786
+ left: `${s.l - ox}em`,
787
+ top: `${s.t - oy}em`,
788
+ width: `${s.w}em`,
789
+ height: `${s.h}em`,
790
+ };
791
+ if (s.circle)
792
+ style['border-radius'] = '50%';
793
+ if (s.clip)
794
+ style['clip-path'] = `polygon(${s.clip.map(([x, y]) => `${x}em ${y}em`).join(', ')})`;
795
+ if (s.tone)
796
+ style['background'] = SHAPE_TONES[s.tone];
797
+ if (s.op !== undefined)
798
+ style['opacity'] = String(s.op * dimming);
799
+ if (s.multiply)
800
+ style['mix-blend-mode'] = 'multiply';
801
+ if (s.ring) {
802
+ const color = s.ring.tone === 'text' ? 'var(--sol-color-text-primary)' : SHAPE_TONES[s.ring.tone];
803
+ style['border'] = `1.5em solid ${color}`;
804
+ style['box-sizing'] = 'border-box';
805
+ style['opacity'] = String(s.ring.op);
806
+ }
807
+ if (s.gradient) {
808
+ style['background'] = `radial-gradient(circle at ${s.gradient.side}% 50%, color-mix(in srgb, ${SHAPE_TONES.t} 55%, transparent), transparent 45%)`;
809
+ }
810
+ return style;
811
+ }
812
+ /**
813
+ * Shapes of the background: they are the form container. They live inside the card, anchored to
814
+ * its center, and scale with the real form box (see `SHAPE_FORM_BOX`). They are `div`s with
815
+ * `clip-path` and `mix-blend-mode`; the blend with the photo only works when no ancestor creates its
816
+ * own stacking context, which is why `em` does the scaling instead of `transform`. Below 768 px
817
+ * they are hidden and the card uses the simple panel.
818
+ */
819
+ class SolLoginShapesComponent {
820
+ element = inject(ElementRef);
821
+ destroyRef = inject(DestroyRef);
822
+ background = input.required(/* @ts-ignore */
823
+ ...(ngDevMode ? [{ debugName: "background" }] : /* istanbul ignore next */ []));
824
+ position = input.required(/* @ts-ignore */
825
+ ...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []));
826
+ /** Explicit scale for editor thumbnails, which are not anchored to a form. */
827
+ fixedScale = input(null, /* @ts-ignore */
828
+ ...(ngDevMode ? [{ debugName: "fixedScale" }] : /* istanbul ignore next */ []));
829
+ scale = signal(INITIAL_SCALE$1, /* @ts-ignore */
830
+ ...(ngDevMode ? [{ debugName: "scale" }] : /* istanbul ignore next */ []));
831
+ effectiveScale = computed(() => this.fixedScale() ?? this.scale(), /* @ts-ignore */
832
+ ...(ngDevMode ? [{ debugName: "effectiveScale" }] : /* istanbul ignore next */ []));
833
+ shapes = computed(() => {
834
+ if (!hasLoginShapes(this.background()))
835
+ return [];
836
+ const { shapes, anchor } = composition(this.background(), this.position());
837
+ const dimming = this.background() === 'triangles' ? MOSAIC_OPACITY : 1;
838
+ return shapes.map(s => ({
839
+ style: shapeStyle(s, anchor[0], anchor[1], dimming),
840
+ child: s.child ? shapeStyle(s.child, 0, 0) : null,
841
+ }));
842
+ }, /* @ts-ignore */
843
+ ...(ngDevMode ? [{ debugName: "shapes" }] : /* istanbul ignore next */ []));
844
+ constructor() {
845
+ afterNextRender(() => this.observe());
846
+ }
847
+ observe() {
848
+ if (this.fixedScale() !== null || typeof ResizeObserver === 'undefined')
849
+ return;
850
+ const host = this.element.nativeElement;
851
+ const card = host.parentElement;
852
+ if (!card)
853
+ return;
854
+ const canvas = host.closest('[data-login-frame]');
855
+ const measure = () => {
856
+ const byBox = Math.max(card.offsetWidth / SHAPE_FORM_BOX.width, card.offsetHeight / SHAPE_FORM_BOX.height);
857
+ // The mosaic goes edge to edge: besides holding the form it must cover the height.
858
+ const byHeight = this.background() === 'triangles' && canvas ? canvas.clientHeight / SHAPE_CANVAS.height : 0;
859
+ const scale = Math.max(byBox, byHeight);
860
+ if (scale > 0)
861
+ this.scale.set(scale);
862
+ };
863
+ const observer = new ResizeObserver(measure);
864
+ observer.observe(card);
865
+ if (canvas)
866
+ observer.observe(canvas);
867
+ this.destroyRef.onDestroy(() => observer.disconnect());
868
+ }
869
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolLoginShapesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
870
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: SolLoginShapesComponent, isStandalone: true, selector: "sol-login-shapes", inputs: { background: { classPropertyName: "background", publicName: "background", isSignal: true, isRequired: true, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: true, transformFunction: null }, fixedScale: { classPropertyName: "fixedScale", publicName: "fixedScale", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-hidden": "true" }, properties: { "style.font-size.px": "effectiveScale()", "class.fixed-scale": "fixedScale() !== null" } }, ngImport: i0, template: `
871
+ @for (shape of shapes(); track $index) {
872
+ <div class="s" [style]="shape.style">
873
+ @if (shape.child; as child) {
874
+ <div class="s" [style]="child"></div>
875
+ }
876
+ </div>
877
+ }
878
+ `, isInline: true, styles: [":host{position:absolute;left:50%;top:50%;width:0;height:0;pointer-events:none}.s{position:absolute}@media(max-width:767.98px){:host(:not(.fixed-scale)){display:none}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
879
+ }
880
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolLoginShapesComponent, decorators: [{
881
+ type: Component,
882
+ args: [{ standalone: true, selector: 'sol-login-shapes', changeDetection: ChangeDetectionStrategy.OnPush, host: {
883
+ 'aria-hidden': 'true',
884
+ '[style.font-size.px]': 'effectiveScale()',
885
+ '[class.fixed-scale]': 'fixedScale() !== null',
886
+ }, template: `
887
+ @for (shape of shapes(); track $index) {
888
+ <div class="s" [style]="shape.style">
889
+ @if (shape.child; as child) {
890
+ <div class="s" [style]="child"></div>
891
+ }
892
+ </div>
893
+ }
894
+ `, styles: [":host{position:absolute;left:50%;top:50%;width:0;height:0;pointer-events:none}.s{position:absolute}@media(max-width:767.98px){:host(:not(.fixed-scale)){display:none}}\n"] }]
895
+ }], ctorParameters: () => [], propDecorators: { background: [{ type: i0.Input, args: [{ isSignal: true, alias: "background", required: true }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: true }] }], fixedScale: [{ type: i0.Input, args: [{ isSignal: true, alias: "fixedScale", required: false }] }] } });
896
+
897
+ /**
898
+ * Themed sign-in frame: photos, veil, shapes and caption from `meta.login`, and the card where the
899
+ * host projects its own form (`<ng-content>`: user and password, SSO buttons, notices…). The
900
+ * library ships no auth logic and makes no HTTP call. With `view` null (no photos anywhere) it
901
+ * renders a plain centered card on the page background, so the host keeps one template.
902
+ *
903
+ * ```html
904
+ * <sol-login-frame [view]="view()" [tagline]="tagline()" [logo]="logo()" [dark]="isDark()">
905
+ * <h1>…</h1>
906
+ * <my-login-form />
907
+ * </sol-login-frame>
908
+ * ```
909
+ */
910
+ class SolLoginFrameComponent {
911
+ /** Resolved appearance (`resolveLoginView` / `buildLoginView`); `null` keeps the classic card. */
912
+ view = input(null, /* @ts-ignore */
913
+ ...(ngDevMode ? [{ debugName: "view" }] : /* istanbul ignore next */ []));
914
+ /** Large caption text over the photo (for example, the theme `meta.tagline`). */
915
+ tagline = input('', /* @ts-ignore */
916
+ ...(ngDevMode ? [{ debugName: "tagline" }] : /* istanbul ignore next */ []));
917
+ /** Brand block above the projected form; without it the host renders its own. */
918
+ logo = input(null, /* @ts-ignore */
919
+ ...(ngDevMode ? [{ debugName: "logo" }] : /* istanbul ignore next */ []));
920
+ /** Optional line under the logo. */
921
+ brandTagline = input(null, /* @ts-ignore */
922
+ ...(ngDevMode ? [{ debugName: "brandTagline" }] : /* istanbul ignore next */ []));
923
+ /** Active mode, to pick the dark logo variant. */
924
+ dark = input(false, /* @ts-ignore */
925
+ ...(ngDevMode ? [{ debugName: "dark" }] : /* istanbul ignore next */ []));
926
+ withShapes = computed(() => {
927
+ const view = this.view();
928
+ return view !== null && hasLoginShapes(view.background);
929
+ }, /* @ts-ignore */
930
+ ...(ngDevMode ? [{ debugName: "withShapes" }] : /* istanbul ignore next */ []));
931
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolLoginFrameComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
932
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: SolLoginFrameComponent, isStandalone: true, selector: "sol-login-frame", inputs: { view: { classPropertyName: "view", publicName: "view", isSignal: true, isRequired: false, transformFunction: null }, tagline: { classPropertyName: "tagline", publicName: "tagline", isSignal: true, isRequired: false, transformFunction: null }, logo: { classPropertyName: "logo", publicName: "logo", isSignal: true, isRequired: false, transformFunction: null }, brandTagline: { classPropertyName: "brandTagline", publicName: "brandTagline", isSignal: true, isRequired: false, transformFunction: null }, dark: { classPropertyName: "dark", publicName: "dark", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
933
+ <div
934
+ class="frame"
935
+ data-login-frame
936
+ data-testid="login-frame"
937
+ [class.frame--immersive]="view() !== null"
938
+ [class.frame--shapes]="withShapes()"
939
+ [attr.data-pos]="view()?.position ?? null"
940
+ [attr.data-background]="view()?.background ?? null"
941
+ [style]="view()?.variables ?? null"
942
+ >
943
+ @if (view(); as scene) {
944
+ <sol-login-scene [view]="scene" [tagline]="tagline()" />
945
+ }
946
+ <main class="frame__panel">
947
+ <div class="frame__card" data-testid="login-frame-card">
948
+ @if (view(); as scene) {
949
+ @if (withShapes()) {
950
+ <sol-login-shapes [background]="scene.background" [position]="scene.position" />
951
+ }
952
+ <sol-login-panel-background [background]="scene.background" [position]="scene.position" />
953
+ }
954
+ <div class="frame__content">
955
+ @if (logo()) {
956
+ <sol-login-brand [logo]="logo()" [dark]="dark()" [tagline]="brandTagline()" />
957
+ }
958
+ <ng-content />
959
+ </div>
960
+ </div>
961
+ </main>
962
+ </div>
963
+ `, isInline: true, styles: [":host{display:block}.frame{position:relative;isolation:isolate;display:flex;box-sizing:border-box;min-height:100vh;min-height:100dvh;padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px);overflow:hidden;color:var(--sol-color-text-primary);background-color:var(--sol-bg-page)}.frame__panel{position:relative;z-index:1;flex:1 1 auto;display:flex;align-items:center;justify-content:center;padding:clamp(24px,4vw,48px)}.frame__card{position:relative;width:100%;max-width:400px;box-sizing:border-box;padding:clamp(24px,3vw,36px);background:var(--sol-card-bg, var(--sol-bg-surface));border:var(--sol-card-border, 1px solid transparent);border-radius:var(--sol-card-radius, var(--sol-border-radius-lg));box-shadow:var(--sol-card-shadow, var(--sol-shadow-lg))}.frame__content{position:relative;z-index:1;display:flex;flex-direction:column}@media(min-width:768px){.frame[data-pos=left] .frame__panel{justify-content:flex-start}.frame[data-pos=right] .frame__panel{justify-content:flex-end}}.frame--immersive .frame__card{max-width:420px;background:none;border:0;box-shadow:none}.frame--immersive:not(.frame--shapes) .frame__card{isolation:isolate}@media(max-height:700px){.frame--immersive .frame__panel{padding-block:var(--sol-space-sm, 8px)}}.frame--shapes .frame__panel{z-index:auto;padding-inline:var(--sol-auth-shape-margin, 48px)}.frame--shapes .frame__card{border-radius:0}@media(max-width:767.98px){.frame__panel{padding:var(--sol-space-lg, 24px) var(--sol-space-md, 16px) var(--sol-space-xl, 48px)}.frame--shapes .frame__panel{padding-inline:var(--sol-space-md, 16px)}}\n"], dependencies: [{ kind: "component", type: SolLoginSceneComponent, selector: "sol-login-scene", inputs: ["view", "tagline"] }, { kind: "component", type: SolLoginShapesComponent, selector: "sol-login-shapes", inputs: ["background", "position", "fixedScale"] }, { kind: "component", type: SolLoginPanelBackgroundComponent, selector: "sol-login-panel-background", inputs: ["background", "position"] }, { kind: "component", type: SolLoginBrandComponent, selector: "sol-login-brand", inputs: ["logo", "dark", "tagline"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
964
+ }
965
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolLoginFrameComponent, decorators: [{
966
+ type: Component,
967
+ args: [{ standalone: true, selector: 'sol-login-frame', changeDetection: ChangeDetectionStrategy.OnPush, imports: [SolLoginSceneComponent, SolLoginShapesComponent, SolLoginPanelBackgroundComponent, SolLoginBrandComponent], template: `
968
+ <div
969
+ class="frame"
970
+ data-login-frame
971
+ data-testid="login-frame"
972
+ [class.frame--immersive]="view() !== null"
973
+ [class.frame--shapes]="withShapes()"
974
+ [attr.data-pos]="view()?.position ?? null"
975
+ [attr.data-background]="view()?.background ?? null"
976
+ [style]="view()?.variables ?? null"
977
+ >
978
+ @if (view(); as scene) {
979
+ <sol-login-scene [view]="scene" [tagline]="tagline()" />
980
+ }
981
+ <main class="frame__panel">
982
+ <div class="frame__card" data-testid="login-frame-card">
983
+ @if (view(); as scene) {
984
+ @if (withShapes()) {
985
+ <sol-login-shapes [background]="scene.background" [position]="scene.position" />
986
+ }
987
+ <sol-login-panel-background [background]="scene.background" [position]="scene.position" />
988
+ }
989
+ <div class="frame__content">
990
+ @if (logo()) {
991
+ <sol-login-brand [logo]="logo()" [dark]="dark()" [tagline]="brandTagline()" />
992
+ }
993
+ <ng-content />
994
+ </div>
995
+ </div>
996
+ </main>
997
+ </div>
998
+ `, styles: [":host{display:block}.frame{position:relative;isolation:isolate;display:flex;box-sizing:border-box;min-height:100vh;min-height:100dvh;padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px);overflow:hidden;color:var(--sol-color-text-primary);background-color:var(--sol-bg-page)}.frame__panel{position:relative;z-index:1;flex:1 1 auto;display:flex;align-items:center;justify-content:center;padding:clamp(24px,4vw,48px)}.frame__card{position:relative;width:100%;max-width:400px;box-sizing:border-box;padding:clamp(24px,3vw,36px);background:var(--sol-card-bg, var(--sol-bg-surface));border:var(--sol-card-border, 1px solid transparent);border-radius:var(--sol-card-radius, var(--sol-border-radius-lg));box-shadow:var(--sol-card-shadow, var(--sol-shadow-lg))}.frame__content{position:relative;z-index:1;display:flex;flex-direction:column}@media(min-width:768px){.frame[data-pos=left] .frame__panel{justify-content:flex-start}.frame[data-pos=right] .frame__panel{justify-content:flex-end}}.frame--immersive .frame__card{max-width:420px;background:none;border:0;box-shadow:none}.frame--immersive:not(.frame--shapes) .frame__card{isolation:isolate}@media(max-height:700px){.frame--immersive .frame__panel{padding-block:var(--sol-space-sm, 8px)}}.frame--shapes .frame__panel{z-index:auto;padding-inline:var(--sol-auth-shape-margin, 48px)}.frame--shapes .frame__card{border-radius:0}@media(max-width:767.98px){.frame__panel{padding:var(--sol-space-lg, 24px) var(--sol-space-md, 16px) var(--sol-space-xl, 48px)}.frame--shapes .frame__panel{padding-inline:var(--sol-space-md, 16px)}}\n"] }]
999
+ }], propDecorators: { view: [{ type: i0.Input, args: [{ isSignal: true, alias: "view", required: false }] }], tagline: [{ type: i0.Input, args: [{ isSignal: true, alias: "tagline", required: false }] }], logo: [{ type: i0.Input, args: [{ isSignal: true, alias: "logo", required: false }] }], brandTagline: [{ type: i0.Input, args: [{ isSignal: true, alias: "brandTagline", required: false }] }], dark: [{ type: i0.Input, args: [{ isSignal: true, alias: "dark", required: false }] }] } });
1000
+
1001
+ /** Default texts in Colombian Spanish (formal, tuteo). The host overrides any key in its engine. */
1002
+ const SOL_LOGIN_APPEARANCE_I18N_ES_CO = {
1003
+ taglineFallback: 'Todo tu trabajo, en un solo lugar.',
1004
+ preview: {
1005
+ title: 'Vista previa · {{ mode }}',
1006
+ modeLight: 'modo claro',
1007
+ modeDark: 'modo oscuro',
1008
+ welcome: 'Te damos la bienvenida',
1009
+ email: 'Correo electrónico',
1010
+ emailPlaceholder: 'correo@ejemplo.com',
1011
+ password: 'Contraseña',
1012
+ passwordPlaceholder: 'Ingresa tu contraseña',
1013
+ remember: 'Recordarme',
1014
+ submit: 'Iniciar sesión',
1015
+ empty: 'Agrega al menos una foto para ver el inicio de sesión.',
1016
+ },
1017
+ editor: {
1018
+ photos: {
1019
+ title: 'Fotos',
1020
+ empty: 'Aún no hay fotos. Sin fotos se usan las predeterminadas de la aplicación o el diseño clásico.',
1021
+ add: 'Agregar fotos',
1022
+ moveUp: 'Subir foto {{ n }}',
1023
+ moveDown: 'Bajar foto {{ n }}',
1024
+ remove: 'Quitar foto {{ n }}',
1025
+ limit: 'Llegaste al máximo de {{ max }} fotos. Quita una para agregar otra.',
1026
+ uploading: 'Subiendo {{ current }} de {{ total }}…',
1027
+ partial: 'Solo se agregaron {{ count }} fotos: el máximo es {{ max }}.',
1028
+ invalidUrl: 'La foto «{{ name }}» se subió, pero su dirección no se puede usar. Inténtalo de nuevo.',
1029
+ uploadError: 'No se pudo subir «{{ name }}». {{ detail }}',
1030
+ uploadErrorDetail: 'Revisa que sea una imagen válida e inténtalo de nuevo.',
1031
+ uploadUnavailable: 'La carga de fotos no está disponible en esta aplicación.',
1032
+ },
1033
+ motion: {
1034
+ title: 'Movimiento',
1035
+ duration: 'Duración de cada foto',
1036
+ less: 'Menos tiempo',
1037
+ more: 'Más tiempo',
1038
+ seconds: '{{ s }} s',
1039
+ range: 'Entre {{ min }} y {{ max }} segundos',
1040
+ effect: 'Efecto de la imagen',
1041
+ transition: 'Transición entre fotos',
1042
+ },
1043
+ effect: { zoom: 'Zoom', focus: 'Enfoque', none: 'Sin efecto' },
1044
+ transition: { fade: 'Fundido', focus: 'Desenfoque' },
1045
+ perMode: {
1046
+ title: 'Por modo',
1047
+ ariaLabel: 'Modo que estás editando',
1048
+ light: 'Claro',
1049
+ dark: 'Oscuro',
1050
+ position: 'Posición del formulario',
1051
+ background: 'Tipo de fondo',
1052
+ },
1053
+ position: { left: 'Izquierda', center: 'Centro', right: 'Derecha' },
1054
+ background: {
1055
+ 'glass-fade': 'Degradado con desenfoque',
1056
+ glass: 'Vidrio',
1057
+ solid: 'Sólido',
1058
+ triangles: 'Triángulos',
1059
+ 'split-circle': 'Círculo partido',
1060
+ facets: 'Facetas',
1061
+ circles: 'Círculos',
1062
+ },
1063
+ caption: {
1064
+ title: 'Lema',
1065
+ label: 'Etiqueta',
1066
+ labelPlaceholder: 'Por ejemplo, el nombre de tu marca',
1067
+ indicators: 'Mostrar indicadores de foto',
1068
+ },
1069
+ reset: 'Restablecer valores predeterminados',
1070
+ undo: 'Deshacer',
1071
+ resetDone: 'Se restablecieron los valores predeterminados.',
1072
+ applyHint: 'Los cambios se guardan con «Aplicar tema» en la pestaña Apariencia general.',
1073
+ goToApply: 'Ir a Aplicar tema',
1074
+ },
1075
+ };
1076
+ const SOL_LOGIN_APPEARANCE_I18N_EN = {
1077
+ taglineFallback: 'All your work, in one place.',
1078
+ preview: {
1079
+ title: 'Preview · {{ mode }}',
1080
+ modeLight: 'light mode',
1081
+ modeDark: 'dark mode',
1082
+ welcome: 'Welcome',
1083
+ email: 'Email',
1084
+ emailPlaceholder: 'email@example.com',
1085
+ password: 'Password',
1086
+ passwordPlaceholder: 'Enter your password',
1087
+ remember: 'Remember me',
1088
+ submit: 'Sign in',
1089
+ empty: 'Add at least one photo to preview the sign-in screen.',
1090
+ },
1091
+ editor: {
1092
+ photos: {
1093
+ title: 'Photos',
1094
+ empty: 'No photos yet. Without photos the app defaults or the classic layout are used.',
1095
+ add: 'Add photos',
1096
+ moveUp: 'Move photo {{ n }} up',
1097
+ moveDown: 'Move photo {{ n }} down',
1098
+ remove: 'Remove photo {{ n }}',
1099
+ limit: 'You reached the maximum of {{ max }} photos. Remove one to add another.',
1100
+ uploading: 'Uploading {{ current }} of {{ total }}…',
1101
+ partial: 'Only {{ count }} photos were added: the maximum is {{ max }}.',
1102
+ invalidUrl: 'The photo “{{ name }}” was uploaded, but its address cannot be used. Try again.',
1103
+ uploadError: 'Could not upload “{{ name }}”. {{ detail }}',
1104
+ uploadErrorDetail: 'Check that it is a valid image and try again.',
1105
+ uploadUnavailable: 'Photo upload is not available in this app.',
1106
+ },
1107
+ motion: {
1108
+ title: 'Motion',
1109
+ duration: 'Duration of each photo',
1110
+ less: 'Less time',
1111
+ more: 'More time',
1112
+ seconds: '{{ s }} s',
1113
+ range: 'Between {{ min }} and {{ max }} seconds',
1114
+ effect: 'Image effect',
1115
+ transition: 'Transition between photos',
1116
+ },
1117
+ effect: { zoom: 'Zoom', focus: 'Focus', none: 'No effect' },
1118
+ transition: { fade: 'Fade', focus: 'Blur' },
1119
+ perMode: {
1120
+ title: 'Per mode',
1121
+ ariaLabel: 'Mode you are editing',
1122
+ light: 'Light',
1123
+ dark: 'Dark',
1124
+ position: 'Form position',
1125
+ background: 'Background type',
1126
+ },
1127
+ position: { left: 'Left', center: 'Center', right: 'Right' },
1128
+ background: {
1129
+ 'glass-fade': 'Blurred gradient',
1130
+ glass: 'Glass',
1131
+ solid: 'Solid',
1132
+ triangles: 'Triangles',
1133
+ 'split-circle': 'Split circle',
1134
+ facets: 'Facets',
1135
+ circles: 'Circles',
1136
+ },
1137
+ caption: {
1138
+ title: 'Caption',
1139
+ label: 'Label',
1140
+ labelPlaceholder: 'For example, your brand name',
1141
+ indicators: 'Show photo indicators',
1142
+ },
1143
+ reset: 'Restore defaults',
1144
+ undo: 'Undo',
1145
+ resetDone: 'Defaults were restored.',
1146
+ applyHint: 'Changes are saved with “Apply theme” in the General appearance tab.',
1147
+ goToApply: 'Go to Apply theme',
1148
+ },
1149
+ };
1150
+ /** Prefix of every key in the host translation engine. */
1151
+ const LOGIN_APPEARANCE_I18N_PREFIX = 'sol.loginAppearance.';
1152
+ function lookup(dictionary, path) {
1153
+ let node = dictionary;
1154
+ for (const segment of path.split('.')) {
1155
+ if (node === undefined || typeof node === 'string')
1156
+ return undefined;
1157
+ node = node[segment];
1158
+ }
1159
+ return typeof node === 'string' ? node : undefined;
1160
+ }
1161
+ function interpolate(template, params) {
1162
+ if (!params)
1163
+ return template;
1164
+ return template.replace(/\{\{\s*(\w+)\s*\}\}/g, (match, name) => (name in params ? String(params[name]) : match));
1165
+ }
1166
+ /**
1167
+ * Translator (call in an injection context): resolves `sol.loginAppearance.<key>` with `SOL_I18N`
1168
+ * and, when the host lacks the key, falls back to the default dictionary of the active language
1169
+ * (`en*` → English; anything else → Colombian Spanish). Reads `activeLang()`, so it reacts to
1170
+ * language changes.
1171
+ */
1172
+ function injectLoginAppearanceText() {
1173
+ const i18n = inject(SOL_I18N);
1174
+ return (key, params) => {
1175
+ const fullKey = LOGIN_APPEARANCE_I18N_PREFIX + key;
1176
+ const translated = i18n.translate(fullKey, params);
1177
+ if (translated && translated !== fullKey)
1178
+ return translated;
1179
+ const dictionary = i18n.activeLang().toLowerCase().startsWith('en') ? SOL_LOGIN_APPEARANCE_I18N_EN : SOL_LOGIN_APPEARANCE_I18N_ES_CO;
1180
+ return interpolate(lookup(dictionary, key) ?? lookup(SOL_LOGIN_APPEARANCE_I18N_ES_CO, key) ?? fullKey, params);
1181
+ };
1182
+ }
1183
+
1184
+ const FRAME_WIDTH = 1280;
1185
+ const FRAME_HEIGHT = 800;
1186
+ const INITIAL_SCALE = 0.4;
1187
+ /**
1188
+ * The login, scaled inside a frame, with the same scene, shapes and panel as the real one. The
1189
+ * canvas `transform` is the containing block of its `position: fixed` layers. The tokens of the
1190
+ * shown mode apply only here: "Dark" looks dark even when the app is light, and vice versa. The
1191
+ * form is an inert mock: the preview never signs in.
1192
+ */
1193
+ class SolLoginPreviewComponent {
1194
+ element = inject(ElementRef);
1195
+ destroyRef = inject(DestroyRef);
1196
+ t = injectLoginAppearanceText();
1197
+ view = input.required(/* @ts-ignore */
1198
+ ...(ngDevMode ? [{ debugName: "view" }] : /* istanbul ignore next */ []));
1199
+ /** Theme whose tokens paint the frame for the shown mode; `null` keeps the app tokens. */
1200
+ theme = input(null, /* @ts-ignore */
1201
+ ...(ngDevMode ? [{ debugName: "theme" }] : /* istanbul ignore next */ []));
1202
+ dark = input(false, /* @ts-ignore */
1203
+ ...(ngDevMode ? [{ debugName: "dark" }] : /* istanbul ignore next */ []));
1204
+ /** Caption text; by default the theme `meta.tagline` or the library fallback. */
1205
+ tagline = input(null, /* @ts-ignore */
1206
+ ...(ngDevMode ? [{ debugName: "tagline" }] : /* istanbul ignore next */ []));
1207
+ shownTagline = computed(() => this.tagline() ?? (this.theme()?.meta?.tagline?.trim() || this.t('taglineFallback')), /* @ts-ignore */
1208
+ ...(ngDevMode ? [{ debugName: "shownTagline" }] : /* istanbul ignore next */ []));
1209
+ logo = computed(() => this.theme()?.meta?.logo ?? null, /* @ts-ignore */
1210
+ ...(ngDevMode ? [{ debugName: "logo" }] : /* istanbul ignore next */ []));
1211
+ scale = signal(INITIAL_SCALE, /* @ts-ignore */
1212
+ ...(ngDevMode ? [{ debugName: "scale" }] : /* istanbul ignore next */ []));
1213
+ height = signal(FRAME_HEIGHT * INITIAL_SCALE, /* @ts-ignore */
1214
+ ...(ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []));
1215
+ withShapes = computed(() => hasLoginShapes(this.view().background), /* @ts-ignore */
1216
+ ...(ngDevMode ? [{ debugName: "withShapes" }] : /* istanbul ignore next */ []));
1217
+ variables = computed(() => ({ ...this.modeTokens(), ...this.view().variables }), /* @ts-ignore */
1218
+ ...(ngDevMode ? [{ debugName: "variables" }] : /* istanbul ignore next */ []));
1219
+ constructor() {
1220
+ afterNextRender(() => this.observeWidth());
1221
+ }
1222
+ /** A theme that cannot be resolved must not break the preview: it keeps the app tokens. */
1223
+ modeTokens() {
1224
+ const theme = this.theme();
1225
+ if (!theme)
1226
+ return {};
1227
+ try {
1228
+ return Object.fromEntries(resolveCssVars(theme, this.dark() ? 'dark' : 'light'));
1229
+ }
1230
+ catch {
1231
+ return {};
1232
+ }
1233
+ }
1234
+ observeWidth() {
1235
+ if (typeof ResizeObserver === 'undefined')
1236
+ return;
1237
+ const observer = new ResizeObserver(([entry]) => {
1238
+ const scale = entry.contentRect.width / FRAME_WIDTH;
1239
+ if (scale <= 0)
1240
+ return;
1241
+ this.scale.set(scale);
1242
+ this.height.set(FRAME_HEIGHT * scale);
1243
+ });
1244
+ observer.observe(this.element.nativeElement);
1245
+ this.destroyRef.onDestroy(() => observer.disconnect());
1246
+ }
1247
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolLoginPreviewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1248
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: SolLoginPreviewComponent, isStandalone: true, selector: "sol-login-preview", inputs: { view: { classPropertyName: "view", publicName: "view", isSignal: true, isRequired: true, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: false, transformFunction: null }, dark: { classPropertyName: "dark", publicName: "dark", isSignal: true, isRequired: false, transformFunction: null }, tagline: { classPropertyName: "tagline", publicName: "tagline", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
1249
+ <div class="frame" [style.height.px]="height()">
1250
+ <div
1251
+ class="canvas"
1252
+ inert
1253
+ data-login-frame
1254
+ [class.canvas--shapes]="withShapes()"
1255
+ [style]="variables()"
1256
+ [style.transform]="'scale(' + scale() + ')'"
1257
+ [attr.data-pos]="view().position"
1258
+ data-testid="login-preview"
1259
+ >
1260
+ <sol-login-scene [view]="view()" [tagline]="shownTagline()" />
1261
+ <div class="panel">
1262
+ <div class="card">
1263
+ @if (withShapes()) {
1264
+ <sol-login-shapes [background]="view().background" [position]="view().position" />
1265
+ }
1266
+ <sol-login-panel-background [background]="view().background" [position]="view().position" />
1267
+ <div class="content">
1268
+ <sol-login-brand [logo]="logo()" [dark]="dark()" />
1269
+ <p class="title">{{ t('preview.welcome') }}</p>
1270
+ <div class="field">
1271
+ <span class="field__label">{{ t('preview.email') }}</span>
1272
+ <span class="field__box">{{ t('preview.emailPlaceholder') }}</span>
1273
+ </div>
1274
+ <div class="field">
1275
+ <span class="field__label">{{ t('preview.password') }}</span>
1276
+ <span class="field__box">{{ t('preview.passwordPlaceholder') }}</span>
1277
+ </div>
1278
+ <span class="check"><span class="check__box"></span>{{ t('preview.remember') }}</span>
1279
+ <span class="button">{{ t('preview.submit') }}</span>
1280
+ </div>
1281
+ </div>
1282
+ </div>
1283
+ </div>
1284
+ </div>
1285
+ `, isInline: true, styles: [":host{display:block}.frame{position:relative;overflow:hidden;border-radius:var(--sol-border-radius-md);background:var(--sol-bg-page)}.canvas{position:absolute;top:0;left:0;width:1280px;height:800px;overflow:hidden;transform-origin:top left;isolation:isolate;color:var(--sol-color-text-primary);background:var(--sol-bg-page);font-family:var(--sol-font-family)}.panel{position:absolute;inset:0;z-index:1;display:flex;align-items:center;justify-content:center;padding:48px}.canvas[data-pos=left] .panel{justify-content:flex-start}.canvas[data-pos=right] .panel{justify-content:flex-end}.canvas--shapes .panel{z-index:auto;padding-inline:var(--sol-auth-shape-margin, 48px)}.card{position:relative;isolation:isolate;width:420px;padding:36px}.canvas--shapes .card{isolation:auto}.content{position:relative;z-index:1;display:flex;flex-direction:column;gap:14px}.title{margin:0;font-size:28px;font-weight:600;text-align:center}.field{display:flex;flex-direction:column;gap:6px}.field__label{font-size:12px;font-weight:500;color:var(--sol-color-text-secondary)}.field__box{display:flex;align-items:center;height:42px;padding:0 12px;box-sizing:border-box;border-radius:var(--sol-input-radius, var(--sol-border-radius-md));background:var(--sol-input-bg, var(--sol-bg-surface));border:var(--sol-input-border, 1px solid var(--sol-border-color-default));color:var(--sol-color-text-muted);font-size:14px}.check{display:flex;align-items:center;gap:8px;font-size:13px}.check__box{width:16px;height:16px;border-radius:4px;border:2px solid var(--sol-border-color-default);box-sizing:border-box}.button{display:flex;align-items:center;justify-content:center;height:44px;border-radius:var(--sol-button-radius, var(--sol-border-radius-md));background:var(--sol-color-primary);color:var(--sol-color-primary-contrast);font-weight:600}\n"], dependencies: [{ kind: "component", type: SolLoginSceneComponent, selector: "sol-login-scene", inputs: ["view", "tagline"] }, { kind: "component", type: SolLoginShapesComponent, selector: "sol-login-shapes", inputs: ["background", "position", "fixedScale"] }, { kind: "component", type: SolLoginBrandComponent, selector: "sol-login-brand", inputs: ["logo", "dark", "tagline"] }, { kind: "component", type: SolLoginPanelBackgroundComponent, selector: "sol-login-panel-background", inputs: ["background", "position"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1286
+ }
1287
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolLoginPreviewComponent, decorators: [{
1288
+ type: Component,
1289
+ args: [{ standalone: true, selector: 'sol-login-preview', changeDetection: ChangeDetectionStrategy.OnPush, imports: [SolLoginSceneComponent, SolLoginShapesComponent, SolLoginBrandComponent, SolLoginPanelBackgroundComponent], template: `
1290
+ <div class="frame" [style.height.px]="height()">
1291
+ <div
1292
+ class="canvas"
1293
+ inert
1294
+ data-login-frame
1295
+ [class.canvas--shapes]="withShapes()"
1296
+ [style]="variables()"
1297
+ [style.transform]="'scale(' + scale() + ')'"
1298
+ [attr.data-pos]="view().position"
1299
+ data-testid="login-preview"
1300
+ >
1301
+ <sol-login-scene [view]="view()" [tagline]="shownTagline()" />
1302
+ <div class="panel">
1303
+ <div class="card">
1304
+ @if (withShapes()) {
1305
+ <sol-login-shapes [background]="view().background" [position]="view().position" />
1306
+ }
1307
+ <sol-login-panel-background [background]="view().background" [position]="view().position" />
1308
+ <div class="content">
1309
+ <sol-login-brand [logo]="logo()" [dark]="dark()" />
1310
+ <p class="title">{{ t('preview.welcome') }}</p>
1311
+ <div class="field">
1312
+ <span class="field__label">{{ t('preview.email') }}</span>
1313
+ <span class="field__box">{{ t('preview.emailPlaceholder') }}</span>
1314
+ </div>
1315
+ <div class="field">
1316
+ <span class="field__label">{{ t('preview.password') }}</span>
1317
+ <span class="field__box">{{ t('preview.passwordPlaceholder') }}</span>
1318
+ </div>
1319
+ <span class="check"><span class="check__box"></span>{{ t('preview.remember') }}</span>
1320
+ <span class="button">{{ t('preview.submit') }}</span>
1321
+ </div>
1322
+ </div>
1323
+ </div>
1324
+ </div>
1325
+ </div>
1326
+ `, styles: [":host{display:block}.frame{position:relative;overflow:hidden;border-radius:var(--sol-border-radius-md);background:var(--sol-bg-page)}.canvas{position:absolute;top:0;left:0;width:1280px;height:800px;overflow:hidden;transform-origin:top left;isolation:isolate;color:var(--sol-color-text-primary);background:var(--sol-bg-page);font-family:var(--sol-font-family)}.panel{position:absolute;inset:0;z-index:1;display:flex;align-items:center;justify-content:center;padding:48px}.canvas[data-pos=left] .panel{justify-content:flex-start}.canvas[data-pos=right] .panel{justify-content:flex-end}.canvas--shapes .panel{z-index:auto;padding-inline:var(--sol-auth-shape-margin, 48px)}.card{position:relative;isolation:isolate;width:420px;padding:36px}.canvas--shapes .card{isolation:auto}.content{position:relative;z-index:1;display:flex;flex-direction:column;gap:14px}.title{margin:0;font-size:28px;font-weight:600;text-align:center}.field{display:flex;flex-direction:column;gap:6px}.field__label{font-size:12px;font-weight:500;color:var(--sol-color-text-secondary)}.field__box{display:flex;align-items:center;height:42px;padding:0 12px;box-sizing:border-box;border-radius:var(--sol-input-radius, var(--sol-border-radius-md));background:var(--sol-input-bg, var(--sol-bg-surface));border:var(--sol-input-border, 1px solid var(--sol-border-color-default));color:var(--sol-color-text-muted);font-size:14px}.check{display:flex;align-items:center;gap:8px;font-size:13px}.check__box{width:16px;height:16px;border-radius:4px;border:2px solid var(--sol-border-color-default);box-sizing:border-box}.button{display:flex;align-items:center;justify-content:center;height:44px;border-radius:var(--sol-button-radius, var(--sol-border-radius-md));background:var(--sol-color-primary);color:var(--sol-color-primary-contrast);font-weight:600}\n"] }]
1327
+ }], ctorParameters: () => [], propDecorators: { view: [{ type: i0.Input, args: [{ isSignal: true, alias: "view", required: true }] }], theme: [{ type: i0.Input, args: [{ isSignal: true, alias: "theme", required: false }] }], dark: [{ type: i0.Input, args: [{ isSignal: true, alias: "dark", required: false }] }], tagline: [{ type: i0.Input, args: [{ isSignal: true, alias: "tagline", required: false }] }] } });
1328
+
1329
+ /** First value of an upload, as a promise that never rejects (an empty stream counts as an error). */
1330
+ function settle(source) {
1331
+ return new Promise(resolve => {
1332
+ source.pipe(take(1)).subscribe({
1333
+ next: url => resolve({ url: String(url) }),
1334
+ error: (error) => resolve({ error }),
1335
+ complete: () => resolve({ error: null }),
1336
+ });
1337
+ });
1338
+ }
1339
+ const INTERVAL_STEP_MS = 1000;
1340
+ const MODES = ['light', 'dark'];
1341
+ /**
1342
+ * Editor of the theme `meta.login` block: photos, motion, per-mode composition and caption, with
1343
+ * a live preview. It emits the whole block only when the person changes something; saving is the
1344
+ * host's job (inside `sol-theme-studio`, its «Aplicar tema»). Veil and panel have no controls: they
1345
+ * travel untouched inside the block.
1346
+ */
1347
+ class SolLoginAppearanceEditorComponent {
1348
+ themeService = inject(ThemeService);
1349
+ t = injectLoginAppearanceText();
1350
+ /** Current `meta.login`, already normalized; untouched, the editor only shows it. */
1351
+ base = input.required(/* @ts-ignore */
1352
+ ...(ngDevMode ? [{ debugName: "base" }] : /* istanbul ignore next */ []));
1353
+ /** Theme whose tokens paint the preview (the one being edited); by default the active one. */
1354
+ theme = input(null, /* @ts-ignore */
1355
+ ...(ngDevMode ? [{ debugName: "theme" }] : /* istanbul ignore next */ []));
1356
+ /** Host photos for the preview when the block has none, and what «Restablecer» restores. */
1357
+ fallbackImages = input([], /* @ts-ignore */
1358
+ ...(ngDevMode ? [{ debugName: "fallbackImages" }] : /* istanbul ignore next */ []));
1359
+ /** Photo upload; without it the editor only orders and removes photos. */
1360
+ uploader = input(null, /* @ts-ignore */
1361
+ ...(ngDevMode ? [{ debugName: "uploader" }] : /* istanbul ignore next */ []));
1362
+ /** Readable message of an upload error (for example, the store `extractStoreErrorMessage`). */
1363
+ describeError = input(null, /* @ts-ignore */
1364
+ ...(ngDevMode ? [{ debugName: "describeError" }] : /* istanbul ignore next */ []));
1365
+ /** Shows the note and the button that send the person to «Aplicar tema». */
1366
+ showApplyShortcut = input(false, /* @ts-ignore */
1367
+ ...(ngDevMode ? [{ debugName: "showApplyShortcut" }] : /* istanbul ignore next */ []));
1368
+ /** Full `meta.login` after each change made by the person. */
1369
+ loginChange = output();
1370
+ goToApply = output();
1371
+ effects = LOGIN_EFFECTS;
1372
+ transitions = LOGIN_TRANSITIONS;
1373
+ positions = LOGIN_POSITIONS;
1374
+ backgrounds = LOGIN_BACKGROUNDS;
1375
+ modes = MODES;
1376
+ maxImages = LOGIN_MAX_IMAGES;
1377
+ minSeconds = LOGIN_INTERVAL_MIN_MS / 1000;
1378
+ maxSeconds = LOGIN_INTERVAL_MAX_MS / 1000;
1379
+ /** Draft of the person's edits; a new `base` (import, version, apply) discards it. */
1380
+ draft = linkedSignal({ ...(ngDevMode ? { debugName: "draft" } : /* istanbul ignore next */ {}), source: this.base, computation: () => null });
1381
+ value = computed(() => this.draft() ?? this.base(), /* @ts-ignore */
1382
+ ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
1383
+ previewTheme = computed(() => this.theme() ?? this.themeService.activeTheme(), /* @ts-ignore */
1384
+ ...(ngDevMode ? [{ debugName: "previewTheme" }] : /* istanbul ignore next */ []));
1385
+ mode = signal(this.themeService.isDark() ? 'dark' : 'light', /* @ts-ignore */
1386
+ ...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
1387
+ modeConfig = computed(() => {
1388
+ const config = this.value().modes?.[this.mode()];
1389
+ return { ...config, position: config?.position ?? LOGIN_DEFAULT_POSITION, background: config?.background ?? LOGIN_DEFAULT_BACKGROUND };
1390
+ }, /* @ts-ignore */
1391
+ ...(ngDevMode ? [{ debugName: "modeConfig" }] : /* istanbul ignore next */ []));
1392
+ images = computed(() => this.value().images ?? [], /* @ts-ignore */
1393
+ ...(ngDevMode ? [{ debugName: "images" }] : /* istanbul ignore next */ []));
1394
+ full = computed(() => this.images().length >= LOGIN_MAX_IMAGES, /* @ts-ignore */
1395
+ ...(ngDevMode ? [{ debugName: "full" }] : /* istanbul ignore next */ []));
1396
+ seconds = computed(() => (this.value().intervalMs ?? LOGIN_INTERVAL_DEFAULT_MS) / 1000, /* @ts-ignore */
1397
+ ...(ngDevMode ? [{ debugName: "seconds" }] : /* istanbul ignore next */ []));
1398
+ effect = computed(() => this.value().effect ?? LOGIN_DEFAULT_EFFECT, /* @ts-ignore */
1399
+ ...(ngDevMode ? [{ debugName: "effect" }] : /* istanbul ignore next */ []));
1400
+ transition = computed(() => this.value().transition ?? LOGIN_DEFAULT_TRANSITION, /* @ts-ignore */
1401
+ ...(ngDevMode ? [{ debugName: "transition" }] : /* istanbul ignore next */ []));
1402
+ captionLabel = computed(() => this.value().caption?.label ?? '', /* @ts-ignore */
1403
+ ...(ngDevMode ? [{ debugName: "captionLabel" }] : /* istanbul ignore next */ []));
1404
+ indicators = computed(() => this.value().caption?.indicators ?? true, /* @ts-ignore */
1405
+ ...(ngDevMode ? [{ debugName: "indicators" }] : /* istanbul ignore next */ []));
1406
+ uploading = signal(null, /* @ts-ignore */
1407
+ ...(ngDevMode ? [{ debugName: "uploading" }] : /* istanbul ignore next */ []));
1408
+ photoError = signal(null, /* @ts-ignore */
1409
+ ...(ngDevMode ? [{ debugName: "photoError" }] : /* istanbul ignore next */ []));
1410
+ previous = signal(null, /* @ts-ignore */
1411
+ ...(ngDevMode ? [{ debugName: "previous" }] : /* istanbul ignore next */ []));
1412
+ canUndo = computed(() => this.previous() !== null, /* @ts-ignore */
1413
+ ...(ngDevMode ? [{ debugName: "canUndo" }] : /* istanbul ignore next */ []));
1414
+ resetDone = signal(false, /* @ts-ignore */
1415
+ ...(ngDevMode ? [{ debugName: "resetDone" }] : /* istanbul ignore next */ []));
1416
+ safeFallback = computed(() => this.fallbackImages().filter(isAllowedLoginImage), /* @ts-ignore */
1417
+ ...(ngDevMode ? [{ debugName: "safeFallback" }] : /* istanbul ignore next */ []));
1418
+ previewView = computed(() => {
1419
+ const own = this.images();
1420
+ const images = own.length > 0 ? own : this.safeFallback();
1421
+ return images.length > 0 ? buildLoginView(this.value(), images, this.mode() === 'dark') : null;
1422
+ }, /* @ts-ignore */
1423
+ ...(ngDevMode ? [{ debugName: "previewView" }] : /* istanbul ignore next */ []));
1424
+ commit(next) {
1425
+ this.resetDone.set(false);
1426
+ this.previous.set(null);
1427
+ this.draft.set(next);
1428
+ this.loginChange.emit(next);
1429
+ }
1430
+ set(changes) {
1431
+ this.commit({ ...this.value(), ...changes });
1432
+ }
1433
+ setMode(changes) {
1434
+ const mode = this.mode();
1435
+ const current = this.value();
1436
+ this.commit({ ...current, modes: { ...current.modes, [mode]: { ...current.modes?.[mode], ...changes } } });
1437
+ }
1438
+ stepSeconds(delta) {
1439
+ const next = Math.min(this.maxSeconds, Math.max(this.minSeconds, this.seconds() + delta)) * INTERVAL_STEP_MS;
1440
+ if (next !== (this.value().intervalMs ?? LOGIN_INTERVAL_DEFAULT_MS))
1441
+ this.set({ intervalMs: next });
1442
+ }
1443
+ setLabel(event) {
1444
+ const label = event.target.value;
1445
+ this.set({ caption: { ...this.value().caption, label } });
1446
+ }
1447
+ setIndicators(event) {
1448
+ this.set({ caption: { ...this.value().caption, indicators: event.target.checked } });
1449
+ }
1450
+ move(index, delta) {
1451
+ const list = [...this.images()];
1452
+ const [photo] = list.splice(index, 1);
1453
+ list.splice(index + delta, 0, photo);
1454
+ this.set({ images: list });
1455
+ }
1456
+ remove(index) {
1457
+ this.set({ images: this.images().filter((_, i) => i !== index) });
1458
+ }
1459
+ nameOf(url) {
1460
+ return url.split('?')[0].split('/').pop() || url;
1461
+ }
1462
+ async onFiles(event) {
1463
+ const field = event.target;
1464
+ const files = Array.from(field.files ?? []);
1465
+ field.value = '';
1466
+ const room = LOGIN_MAX_IMAGES - this.images().length;
1467
+ const batch = files.slice(0, Math.max(0, room));
1468
+ if (batch.length === 0)
1469
+ return;
1470
+ this.photoError.set(null);
1471
+ for (const [index, file] of batch.entries()) {
1472
+ this.uploading.set({ current: index + 1, total: batch.length });
1473
+ const url = await this.upload(file);
1474
+ if (url && !this.images().includes(url))
1475
+ this.set({ images: [...this.images(), url] });
1476
+ }
1477
+ this.uploading.set(null);
1478
+ if (files.length > batch.length) {
1479
+ this.photoError.update(e => e ?? this.t('editor.photos.partial', { count: batch.length, max: LOGIN_MAX_IMAGES }));
1480
+ }
1481
+ }
1482
+ async upload(file) {
1483
+ const uploader = this.uploader();
1484
+ if (!uploader)
1485
+ return null;
1486
+ const result = await settle(uploader(file));
1487
+ if ('error' in result) {
1488
+ const detail = this.describeError()?.(result.error) || this.t('editor.photos.uploadErrorDetail');
1489
+ this.photoError.set(this.t('editor.photos.uploadError', { name: file.name, detail }));
1490
+ return null;
1491
+ }
1492
+ const url = result.url.trim();
1493
+ if (isAllowedLoginImage(url))
1494
+ return url;
1495
+ this.photoError.set(this.t('editor.photos.invalidUrl', { name: file.name }));
1496
+ return null;
1497
+ }
1498
+ reset() {
1499
+ const prior = this.value();
1500
+ const keep = (mode) => ({
1501
+ ...(prior.modes?.[mode]?.veil ? { veil: prior.modes[mode]?.veil } : {}),
1502
+ ...(prior.modes?.[mode]?.panel ? { panel: prior.modes[mode]?.panel } : {}),
1503
+ });
1504
+ this.commit({
1505
+ images: [...this.safeFallback()],
1506
+ intervalMs: LOGIN_INTERVAL_DEFAULT_MS,
1507
+ effect: LOGIN_DEFAULT_EFFECT,
1508
+ transition: LOGIN_DEFAULT_TRANSITION,
1509
+ caption: { indicators: true },
1510
+ modes: {
1511
+ dark: { position: 'right', background: LOGIN_DEFAULT_BACKGROUND, captionPosition: 'bottom-left', ...keep('dark') },
1512
+ light: { position: 'left', background: LOGIN_DEFAULT_BACKGROUND, captionPosition: 'bottom-right', ...keep('light') },
1513
+ },
1514
+ });
1515
+ this.previous.set(prior);
1516
+ this.resetDone.set(true);
1517
+ }
1518
+ undo() {
1519
+ const prior = this.previous();
1520
+ if (prior)
1521
+ this.commit(prior);
1522
+ }
1523
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolLoginAppearanceEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1524
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: SolLoginAppearanceEditorComponent, isStandalone: true, selector: "sol-login-appearance-editor", inputs: { base: { classPropertyName: "base", publicName: "base", isSignal: true, isRequired: true, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: false, transformFunction: null }, fallbackImages: { classPropertyName: "fallbackImages", publicName: "fallbackImages", isSignal: true, isRequired: false, transformFunction: null }, uploader: { classPropertyName: "uploader", publicName: "uploader", isSignal: true, isRequired: false, transformFunction: null }, describeError: { classPropertyName: "describeError", publicName: "describeError", isSignal: true, isRequired: false, transformFunction: null }, showApplyShortcut: { classPropertyName: "showApplyShortcut", publicName: "showApplyShortcut", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { loginChange: "loginChange", goToApply: "goToApply" }, ngImport: i0, template: `
1525
+ <div class="editor">
1526
+ <div class="controls">
1527
+ <fieldset>
1528
+ <legend>{{ t('editor.photos.title') }}</legend>
1529
+ @if (images().length === 0) {
1530
+ <p class="hint" data-testid="login-photos-empty">{{ t('editor.photos.empty') }}</p>
1531
+ }
1532
+ <ul class="photos">
1533
+ @for (photo of images(); track photo; let i = $index) {
1534
+ <li>
1535
+ <img [src]="photo" alt="" />
1536
+ <span class="photos__name">{{ nameOf(photo) }}</span>
1537
+ <button type="button" class="icon" [attr.aria-label]="t('editor.photos.moveUp', { n: i + 1 })" [disabled]="i === 0" (click)="move(i, -1)" [attr.data-testid]="'login-photo-up-' + i">
1538
+ <sol-icon name="chevron-up" size="sm" />
1539
+ </button>
1540
+ <button type="button" class="icon" [attr.aria-label]="t('editor.photos.moveDown', { n: i + 1 })" [disabled]="i === images().length - 1" (click)="move(i, 1)" [attr.data-testid]="'login-photo-down-' + i">
1541
+ <sol-icon name="chevron-down" size="sm" />
1542
+ </button>
1543
+ <button type="button" class="icon" [attr.aria-label]="t('editor.photos.remove', { n: i + 1 })" (click)="remove(i)" [attr.data-testid]="'login-photo-remove-' + i">
1544
+ <sol-icon name="x-mark" size="sm" />
1545
+ </button>
1546
+ </li>
1547
+ }
1548
+ </ul>
1549
+ @if (uploader()) {
1550
+ <input #file class="visually-hidden" type="file" accept="image/png,image/jpeg,image/webp,image/avif" multiple tabindex="-1" [disabled]="full() || uploading() !== null" data-testid="login-photos-file" (change)="onFiles($event)" />
1551
+ <button type="button" class="btn" data-testid="login-photos-add" [disabled]="full() || uploading() !== null" (click)="file.click()">{{ t('editor.photos.add') }}</button>
1552
+ } @else {
1553
+ <p class="hint" data-testid="login-photos-unavailable">{{ t('editor.photos.uploadUnavailable') }}</p>
1554
+ }
1555
+ @if (full()) {
1556
+ <p class="hint" data-testid="login-photos-limit">{{ t('editor.photos.limit', { max: maxImages }) }}</p>
1557
+ }
1558
+ @if (uploading(); as u) {
1559
+ <p class="hint" role="status" aria-live="polite" data-testid="login-photos-uploading">{{ t('editor.photos.uploading', { current: u.current, total: u.total }) }}</p>
1560
+ }
1561
+ @if (photoError(); as error) {
1562
+ <p class="error" role="alert" data-testid="login-photos-error">{{ error }}</p>
1563
+ }
1564
+ </fieldset>
1565
+
1566
+ <fieldset>
1567
+ <legend>{{ t('editor.motion.title') }}</legend>
1568
+ <p class="label" id="sol-login-duration">{{ t('editor.motion.duration') }}</p>
1569
+ <div class="stepper" role="group" aria-labelledby="sol-login-duration">
1570
+ <button type="button" class="icon" [attr.aria-label]="t('editor.motion.less')" [disabled]="seconds() <= minSeconds" data-testid="login-duration-less" (click)="stepSeconds(-1)">
1571
+ <sol-icon name="minus" size="sm" />
1572
+ </button>
1573
+ <output data-testid="login-duration-value">{{ t('editor.motion.seconds', { s: seconds() }) }}</output>
1574
+ <button type="button" class="icon" [attr.aria-label]="t('editor.motion.more')" [disabled]="seconds() >= maxSeconds" data-testid="login-duration-more" (click)="stepSeconds(1)">
1575
+ <sol-icon name="plus" size="sm" />
1576
+ </button>
1577
+ <span class="hint">{{ t('editor.motion.range', { min: minSeconds, max: maxSeconds }) }}</span>
1578
+ </div>
1579
+
1580
+ <p class="label">{{ t('editor.motion.effect') }}</p>
1581
+ <div class="options">
1582
+ @for (e of effects; track e) {
1583
+ <button type="button" class="option" [class.option--on]="effect() === e" [attr.aria-pressed]="effect() === e" [attr.data-testid]="'login-effect-' + e" (click)="set({ effect: e })">{{ t('editor.effect.' + e) }}</button>
1584
+ }
1585
+ </div>
1586
+
1587
+ <p class="label">{{ t('editor.motion.transition') }}</p>
1588
+ <div class="options">
1589
+ @for (tr of transitions; track tr) {
1590
+ <button type="button" class="option" [class.option--on]="transition() === tr" [attr.aria-pressed]="transition() === tr" [attr.data-testid]="'login-transition-' + tr" (click)="set({ transition: tr })">{{ t('editor.transition.' + tr) }}</button>
1591
+ }
1592
+ </div>
1593
+ </fieldset>
1594
+
1595
+ <fieldset>
1596
+ <legend>{{ t('editor.perMode.title') }}</legend>
1597
+ <div class="options" role="group" [attr.aria-label]="t('editor.perMode.ariaLabel')">
1598
+ @for (m of modes; track m) {
1599
+ <button type="button" class="option" [class.option--on]="mode() === m" [attr.aria-pressed]="mode() === m" [attr.data-testid]="'login-mode-' + m" (click)="mode.set(m)">{{ t('editor.perMode.' + m) }}</button>
1600
+ }
1601
+ </div>
1602
+
1603
+ <p class="label">{{ t('editor.perMode.position') }}</p>
1604
+ <div class="options">
1605
+ @for (p of positions; track p) {
1606
+ <button type="button" class="option" [class.option--on]="modeConfig().position === p" [attr.aria-pressed]="modeConfig().position === p" [attr.data-testid]="'login-position-' + p" (click)="setMode({ position: p })">{{ t('editor.position.' + p) }}</button>
1607
+ }
1608
+ </div>
1609
+
1610
+ <p class="label">{{ t('editor.perMode.background') }}</p>
1611
+ <div class="tiles">
1612
+ @for (b of backgrounds; track b) {
1613
+ <button type="button" class="tile" [class.tile--on]="modeConfig().background === b" [attr.aria-pressed]="modeConfig().background === b" [attr.data-testid]="'login-background-' + b" (click)="setMode({ background: b })">
1614
+ <span [class]="'tile__sample sample--' + b"><sol-login-shapes [background]="b" [position]="modeConfig().position" [fixedScale]="0.09" /></span>
1615
+ <span>{{ t('editor.background.' + b) }}</span>
1616
+ </button>
1617
+ }
1618
+ </div>
1619
+ </fieldset>
1620
+
1621
+ <fieldset>
1622
+ <legend>{{ t('editor.caption.title') }}</legend>
1623
+ <label class="label" for="sol-login-caption-label">{{ t('editor.caption.label') }}</label>
1624
+ <input id="sol-login-caption-label" class="text" type="text" maxlength="80" data-testid="login-caption-label-input" [placeholder]="t('editor.caption.labelPlaceholder')" [value]="captionLabel()" (input)="setLabel($event)" />
1625
+ <label class="check">
1626
+ <input type="checkbox" data-testid="login-caption-indicators-input" [checked]="indicators()" (change)="setIndicators($event)" />
1627
+ {{ t('editor.caption.indicators') }}
1628
+ </label>
1629
+ </fieldset>
1630
+
1631
+ <div class="footer">
1632
+ <button type="button" class="btn btn--secondary" data-testid="login-reset" (click)="reset()">{{ t('editor.reset') }}</button>
1633
+ @if (canUndo()) {
1634
+ <button type="button" class="btn btn--secondary" data-testid="login-undo" (click)="undo()">{{ t('editor.undo') }}</button>
1635
+ }
1636
+ @if (resetDone()) {
1637
+ <p class="hint" role="status">{{ t('editor.resetDone') }}</p>
1638
+ }
1639
+ @if (showApplyShortcut()) {
1640
+ <p class="hint">{{ t('editor.applyHint') }}</p>
1641
+ <button type="button" class="btn" data-testid="login-go-to-apply" (click)="goToApply.emit()">{{ t('editor.goToApply') }}</button>
1642
+ }
1643
+ </div>
1644
+ </div>
1645
+
1646
+ <div class="preview">
1647
+ <p class="label">{{ t('preview.title', { mode: mode() === 'dark' ? t('preview.modeDark') : t('preview.modeLight') }) }}</p>
1648
+ @if (previewView(); as view) {
1649
+ <sol-login-preview [view]="view" [theme]="previewTheme()" [dark]="mode() === 'dark'" />
1650
+ } @else {
1651
+ <p class="hint" data-testid="login-preview-empty">{{ t('preview.empty') }}</p>
1652
+ }
1653
+ </div>
1654
+ </div>
1655
+ `, isInline: true, styles: [":host{display:block;padding:var(--sol-space-md, 16px);color:var(--sol-color-text-primary)}.editor{display:grid;gap:var(--sol-space-lg, 24px);grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);align-items:start}.preview{position:sticky;top:var(--sol-space-md, 16px)}@media(max-width:991.98px){.editor{grid-template-columns:minmax(0,1fr)}.preview{position:static;order:-1}}.controls{display:flex;flex-direction:column;gap:var(--sol-space-md, 16px);min-width:0}fieldset{margin:0;padding:var(--sol-space-md, 16px);border:0;border-radius:var(--sol-border-radius-lg);background:var(--sol-bg-surface);min-width:0}legend{padding:0;font-weight:var(--sol-font-weight-bold);font-size:var(--sol-font-size-base);float:left;width:100%;margin-bottom:var(--sol-space-sm, 8px)}legend+*{clear:both}.label{display:block;margin:var(--sol-space-sm, 8px) 0 var(--sol-space-xs, 4px);font-size:var(--sol-font-size-sm);font-weight:var(--sol-font-weight-bold)}.hint{margin:var(--sol-space-xs, 4px) 0;font-size:var(--sol-font-size-sm);color:var(--sol-color-text-muted)}.error{margin:var(--sol-space-xs, 4px) 0;font-size:var(--sol-font-size-sm);color:var(--sol-color-danger)}.visually-hidden{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}button{font:inherit;cursor:pointer}button:disabled{cursor:not-allowed;opacity:.5}:is(button,input):focus-visible{outline:2px solid var(--sol-color-primary);outline-offset:2px}.btn{min-height:var(--sol-size-component-md, 36px);padding:0 var(--sol-space-md, 16px);border:0;border-radius:var(--sol-border-radius-md);background:var(--sol-color-primary);color:var(--sol-color-primary-contrast);font-weight:var(--sol-font-weight-bold)}.btn--secondary{background:transparent;color:var(--sol-color-text-primary);border:var(--sol-border-width-default, 1px) solid var(--sol-border-color-default)}.icon{display:inline-flex;align-items:center;justify-content:center;width:var(--sol-size-component-md, 36px);height:var(--sol-size-component-md, 36px);flex:none;padding:0;border:var(--sol-border-width-default, 1px) solid var(--sol-border-color-default);border-radius:var(--sol-border-radius-md);background:transparent;color:inherit}.options{display:flex;flex-wrap:wrap;gap:var(--sol-space-xs, 4px)}.option{min-height:var(--sol-size-component-md, 36px);padding:0 var(--sol-space-md, 16px);border:var(--sol-border-width-default, 1px) solid var(--sol-border-color-default);border-radius:var(--sol-border-radius-md);background:transparent;color:inherit}.option--on{background:var(--sol-color-primary);border-color:var(--sol-color-primary);color:var(--sol-color-primary-contrast);font-weight:var(--sol-font-weight-bold)}.stepper{display:flex;align-items:center;gap:var(--sol-space-sm, 8px);flex-wrap:wrap}output{min-width:3.5em;text-align:center;font-weight:var(--sol-font-weight-bold)}.photos{list-style:none;margin:0 0 var(--sol-space-sm, 8px);padding:0;display:flex;flex-direction:column;gap:var(--sol-space-xs, 4px)}.photos li{display:flex;align-items:center;gap:var(--sol-space-xs, 4px)}.photos img{width:64px;height:40px;object-fit:cover;border-radius:var(--sol-border-radius-sm);flex:none}.photos__name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--sol-font-size-sm)}.tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:var(--sol-space-sm, 8px)}.tile{display:flex;flex-direction:column;gap:var(--sol-space-xs, 4px);padding:var(--sol-space-xs, 4px);border:2px solid transparent;border-radius:var(--sol-border-radius-md);background:transparent;color:inherit;font-size:var(--sol-font-size-sm)}.tile--on{border-color:var(--sol-color-primary);font-weight:var(--sol-font-weight-bold)}.tile__sample{position:relative;display:block;height:60px;overflow:hidden;border-radius:var(--sol-border-radius-sm);background:color-mix(in srgb,var(--sol-color-primary) 22%,var(--sol-bg-page));transform:translateZ(0)}.sample--glass-fade:after,.sample--glass:after,.sample--solid:after{content:\"\";position:absolute;inset:12px 12px 12px 48%;border-radius:var(--sol-border-radius-sm);background:var(--sol-bg-surface)}.sample--glass-fade:after{-webkit-mask-image:linear-gradient(90deg,transparent,black 70%);mask-image:linear-gradient(90deg,transparent,black 70%)}.sample--glass:after{opacity:.55}.text{width:100%;box-sizing:border-box;min-height:var(--sol-size-component-md, 36px);padding:0 var(--sol-space-sm, 8px);border:var(--sol-border-width-default, 1px) solid var(--sol-border-color-default);border-radius:var(--sol-input-radius, var(--sol-border-radius-md));background:var(--sol-input-bg, transparent);color:inherit;font:inherit}.check{display:flex;align-items:center;gap:var(--sol-space-sm, 8px);margin-top:var(--sol-space-sm, 8px);min-height:var(--sol-size-component-md, 36px);font-size:var(--sol-font-size-sm)}.footer{display:flex;flex-direction:column;align-items:flex-start;gap:var(--sol-space-sm, 8px)}@media(max-width:767.98px){.btn,.option,.check,.text{min-height:var(--sol-size-control-touch, 44px)}.icon{width:var(--sol-size-control-touch, 44px);height:var(--sol-size-control-touch, 44px)}.text{font-size:var(--sol-font-size-touch-input, 16px)}}\n"], dependencies: [{ kind: "component", type: SolLoginPreviewComponent, selector: "sol-login-preview", inputs: ["view", "theme", "dark", "tagline"] }, { kind: "component", type: SolLoginShapesComponent, selector: "sol-login-shapes", inputs: ["background", "position", "fixedScale"] }, { kind: "component", type: SolIconComponent, selector: "sol-icon", inputs: ["name", "size", "variant"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1656
+ }
1657
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolLoginAppearanceEditorComponent, decorators: [{
1658
+ type: Component,
1659
+ args: [{ standalone: true, selector: 'sol-login-appearance-editor', changeDetection: ChangeDetectionStrategy.OnPush, imports: [SolLoginPreviewComponent, SolLoginShapesComponent, SolIconComponent], template: `
1660
+ <div class="editor">
1661
+ <div class="controls">
1662
+ <fieldset>
1663
+ <legend>{{ t('editor.photos.title') }}</legend>
1664
+ @if (images().length === 0) {
1665
+ <p class="hint" data-testid="login-photos-empty">{{ t('editor.photos.empty') }}</p>
1666
+ }
1667
+ <ul class="photos">
1668
+ @for (photo of images(); track photo; let i = $index) {
1669
+ <li>
1670
+ <img [src]="photo" alt="" />
1671
+ <span class="photos__name">{{ nameOf(photo) }}</span>
1672
+ <button type="button" class="icon" [attr.aria-label]="t('editor.photos.moveUp', { n: i + 1 })" [disabled]="i === 0" (click)="move(i, -1)" [attr.data-testid]="'login-photo-up-' + i">
1673
+ <sol-icon name="chevron-up" size="sm" />
1674
+ </button>
1675
+ <button type="button" class="icon" [attr.aria-label]="t('editor.photos.moveDown', { n: i + 1 })" [disabled]="i === images().length - 1" (click)="move(i, 1)" [attr.data-testid]="'login-photo-down-' + i">
1676
+ <sol-icon name="chevron-down" size="sm" />
1677
+ </button>
1678
+ <button type="button" class="icon" [attr.aria-label]="t('editor.photos.remove', { n: i + 1 })" (click)="remove(i)" [attr.data-testid]="'login-photo-remove-' + i">
1679
+ <sol-icon name="x-mark" size="sm" />
1680
+ </button>
1681
+ </li>
1682
+ }
1683
+ </ul>
1684
+ @if (uploader()) {
1685
+ <input #file class="visually-hidden" type="file" accept="image/png,image/jpeg,image/webp,image/avif" multiple tabindex="-1" [disabled]="full() || uploading() !== null" data-testid="login-photos-file" (change)="onFiles($event)" />
1686
+ <button type="button" class="btn" data-testid="login-photos-add" [disabled]="full() || uploading() !== null" (click)="file.click()">{{ t('editor.photos.add') }}</button>
1687
+ } @else {
1688
+ <p class="hint" data-testid="login-photos-unavailable">{{ t('editor.photos.uploadUnavailable') }}</p>
1689
+ }
1690
+ @if (full()) {
1691
+ <p class="hint" data-testid="login-photos-limit">{{ t('editor.photos.limit', { max: maxImages }) }}</p>
1692
+ }
1693
+ @if (uploading(); as u) {
1694
+ <p class="hint" role="status" aria-live="polite" data-testid="login-photos-uploading">{{ t('editor.photos.uploading', { current: u.current, total: u.total }) }}</p>
1695
+ }
1696
+ @if (photoError(); as error) {
1697
+ <p class="error" role="alert" data-testid="login-photos-error">{{ error }}</p>
1698
+ }
1699
+ </fieldset>
1700
+
1701
+ <fieldset>
1702
+ <legend>{{ t('editor.motion.title') }}</legend>
1703
+ <p class="label" id="sol-login-duration">{{ t('editor.motion.duration') }}</p>
1704
+ <div class="stepper" role="group" aria-labelledby="sol-login-duration">
1705
+ <button type="button" class="icon" [attr.aria-label]="t('editor.motion.less')" [disabled]="seconds() <= minSeconds" data-testid="login-duration-less" (click)="stepSeconds(-1)">
1706
+ <sol-icon name="minus" size="sm" />
1707
+ </button>
1708
+ <output data-testid="login-duration-value">{{ t('editor.motion.seconds', { s: seconds() }) }}</output>
1709
+ <button type="button" class="icon" [attr.aria-label]="t('editor.motion.more')" [disabled]="seconds() >= maxSeconds" data-testid="login-duration-more" (click)="stepSeconds(1)">
1710
+ <sol-icon name="plus" size="sm" />
1711
+ </button>
1712
+ <span class="hint">{{ t('editor.motion.range', { min: minSeconds, max: maxSeconds }) }}</span>
1713
+ </div>
1714
+
1715
+ <p class="label">{{ t('editor.motion.effect') }}</p>
1716
+ <div class="options">
1717
+ @for (e of effects; track e) {
1718
+ <button type="button" class="option" [class.option--on]="effect() === e" [attr.aria-pressed]="effect() === e" [attr.data-testid]="'login-effect-' + e" (click)="set({ effect: e })">{{ t('editor.effect.' + e) }}</button>
1719
+ }
1720
+ </div>
1721
+
1722
+ <p class="label">{{ t('editor.motion.transition') }}</p>
1723
+ <div class="options">
1724
+ @for (tr of transitions; track tr) {
1725
+ <button type="button" class="option" [class.option--on]="transition() === tr" [attr.aria-pressed]="transition() === tr" [attr.data-testid]="'login-transition-' + tr" (click)="set({ transition: tr })">{{ t('editor.transition.' + tr) }}</button>
1726
+ }
1727
+ </div>
1728
+ </fieldset>
1729
+
1730
+ <fieldset>
1731
+ <legend>{{ t('editor.perMode.title') }}</legend>
1732
+ <div class="options" role="group" [attr.aria-label]="t('editor.perMode.ariaLabel')">
1733
+ @for (m of modes; track m) {
1734
+ <button type="button" class="option" [class.option--on]="mode() === m" [attr.aria-pressed]="mode() === m" [attr.data-testid]="'login-mode-' + m" (click)="mode.set(m)">{{ t('editor.perMode.' + m) }}</button>
1735
+ }
1736
+ </div>
1737
+
1738
+ <p class="label">{{ t('editor.perMode.position') }}</p>
1739
+ <div class="options">
1740
+ @for (p of positions; track p) {
1741
+ <button type="button" class="option" [class.option--on]="modeConfig().position === p" [attr.aria-pressed]="modeConfig().position === p" [attr.data-testid]="'login-position-' + p" (click)="setMode({ position: p })">{{ t('editor.position.' + p) }}</button>
1742
+ }
1743
+ </div>
1744
+
1745
+ <p class="label">{{ t('editor.perMode.background') }}</p>
1746
+ <div class="tiles">
1747
+ @for (b of backgrounds; track b) {
1748
+ <button type="button" class="tile" [class.tile--on]="modeConfig().background === b" [attr.aria-pressed]="modeConfig().background === b" [attr.data-testid]="'login-background-' + b" (click)="setMode({ background: b })">
1749
+ <span [class]="'tile__sample sample--' + b"><sol-login-shapes [background]="b" [position]="modeConfig().position" [fixedScale]="0.09" /></span>
1750
+ <span>{{ t('editor.background.' + b) }}</span>
1751
+ </button>
1752
+ }
1753
+ </div>
1754
+ </fieldset>
1755
+
1756
+ <fieldset>
1757
+ <legend>{{ t('editor.caption.title') }}</legend>
1758
+ <label class="label" for="sol-login-caption-label">{{ t('editor.caption.label') }}</label>
1759
+ <input id="sol-login-caption-label" class="text" type="text" maxlength="80" data-testid="login-caption-label-input" [placeholder]="t('editor.caption.labelPlaceholder')" [value]="captionLabel()" (input)="setLabel($event)" />
1760
+ <label class="check">
1761
+ <input type="checkbox" data-testid="login-caption-indicators-input" [checked]="indicators()" (change)="setIndicators($event)" />
1762
+ {{ t('editor.caption.indicators') }}
1763
+ </label>
1764
+ </fieldset>
1765
+
1766
+ <div class="footer">
1767
+ <button type="button" class="btn btn--secondary" data-testid="login-reset" (click)="reset()">{{ t('editor.reset') }}</button>
1768
+ @if (canUndo()) {
1769
+ <button type="button" class="btn btn--secondary" data-testid="login-undo" (click)="undo()">{{ t('editor.undo') }}</button>
1770
+ }
1771
+ @if (resetDone()) {
1772
+ <p class="hint" role="status">{{ t('editor.resetDone') }}</p>
1773
+ }
1774
+ @if (showApplyShortcut()) {
1775
+ <p class="hint">{{ t('editor.applyHint') }}</p>
1776
+ <button type="button" class="btn" data-testid="login-go-to-apply" (click)="goToApply.emit()">{{ t('editor.goToApply') }}</button>
1777
+ }
1778
+ </div>
1779
+ </div>
1780
+
1781
+ <div class="preview">
1782
+ <p class="label">{{ t('preview.title', { mode: mode() === 'dark' ? t('preview.modeDark') : t('preview.modeLight') }) }}</p>
1783
+ @if (previewView(); as view) {
1784
+ <sol-login-preview [view]="view" [theme]="previewTheme()" [dark]="mode() === 'dark'" />
1785
+ } @else {
1786
+ <p class="hint" data-testid="login-preview-empty">{{ t('preview.empty') }}</p>
1787
+ }
1788
+ </div>
1789
+ </div>
1790
+ `, styles: [":host{display:block;padding:var(--sol-space-md, 16px);color:var(--sol-color-text-primary)}.editor{display:grid;gap:var(--sol-space-lg, 24px);grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);align-items:start}.preview{position:sticky;top:var(--sol-space-md, 16px)}@media(max-width:991.98px){.editor{grid-template-columns:minmax(0,1fr)}.preview{position:static;order:-1}}.controls{display:flex;flex-direction:column;gap:var(--sol-space-md, 16px);min-width:0}fieldset{margin:0;padding:var(--sol-space-md, 16px);border:0;border-radius:var(--sol-border-radius-lg);background:var(--sol-bg-surface);min-width:0}legend{padding:0;font-weight:var(--sol-font-weight-bold);font-size:var(--sol-font-size-base);float:left;width:100%;margin-bottom:var(--sol-space-sm, 8px)}legend+*{clear:both}.label{display:block;margin:var(--sol-space-sm, 8px) 0 var(--sol-space-xs, 4px);font-size:var(--sol-font-size-sm);font-weight:var(--sol-font-weight-bold)}.hint{margin:var(--sol-space-xs, 4px) 0;font-size:var(--sol-font-size-sm);color:var(--sol-color-text-muted)}.error{margin:var(--sol-space-xs, 4px) 0;font-size:var(--sol-font-size-sm);color:var(--sol-color-danger)}.visually-hidden{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}button{font:inherit;cursor:pointer}button:disabled{cursor:not-allowed;opacity:.5}:is(button,input):focus-visible{outline:2px solid var(--sol-color-primary);outline-offset:2px}.btn{min-height:var(--sol-size-component-md, 36px);padding:0 var(--sol-space-md, 16px);border:0;border-radius:var(--sol-border-radius-md);background:var(--sol-color-primary);color:var(--sol-color-primary-contrast);font-weight:var(--sol-font-weight-bold)}.btn--secondary{background:transparent;color:var(--sol-color-text-primary);border:var(--sol-border-width-default, 1px) solid var(--sol-border-color-default)}.icon{display:inline-flex;align-items:center;justify-content:center;width:var(--sol-size-component-md, 36px);height:var(--sol-size-component-md, 36px);flex:none;padding:0;border:var(--sol-border-width-default, 1px) solid var(--sol-border-color-default);border-radius:var(--sol-border-radius-md);background:transparent;color:inherit}.options{display:flex;flex-wrap:wrap;gap:var(--sol-space-xs, 4px)}.option{min-height:var(--sol-size-component-md, 36px);padding:0 var(--sol-space-md, 16px);border:var(--sol-border-width-default, 1px) solid var(--sol-border-color-default);border-radius:var(--sol-border-radius-md);background:transparent;color:inherit}.option--on{background:var(--sol-color-primary);border-color:var(--sol-color-primary);color:var(--sol-color-primary-contrast);font-weight:var(--sol-font-weight-bold)}.stepper{display:flex;align-items:center;gap:var(--sol-space-sm, 8px);flex-wrap:wrap}output{min-width:3.5em;text-align:center;font-weight:var(--sol-font-weight-bold)}.photos{list-style:none;margin:0 0 var(--sol-space-sm, 8px);padding:0;display:flex;flex-direction:column;gap:var(--sol-space-xs, 4px)}.photos li{display:flex;align-items:center;gap:var(--sol-space-xs, 4px)}.photos img{width:64px;height:40px;object-fit:cover;border-radius:var(--sol-border-radius-sm);flex:none}.photos__name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--sol-font-size-sm)}.tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:var(--sol-space-sm, 8px)}.tile{display:flex;flex-direction:column;gap:var(--sol-space-xs, 4px);padding:var(--sol-space-xs, 4px);border:2px solid transparent;border-radius:var(--sol-border-radius-md);background:transparent;color:inherit;font-size:var(--sol-font-size-sm)}.tile--on{border-color:var(--sol-color-primary);font-weight:var(--sol-font-weight-bold)}.tile__sample{position:relative;display:block;height:60px;overflow:hidden;border-radius:var(--sol-border-radius-sm);background:color-mix(in srgb,var(--sol-color-primary) 22%,var(--sol-bg-page));transform:translateZ(0)}.sample--glass-fade:after,.sample--glass:after,.sample--solid:after{content:\"\";position:absolute;inset:12px 12px 12px 48%;border-radius:var(--sol-border-radius-sm);background:var(--sol-bg-surface)}.sample--glass-fade:after{-webkit-mask-image:linear-gradient(90deg,transparent,black 70%);mask-image:linear-gradient(90deg,transparent,black 70%)}.sample--glass:after{opacity:.55}.text{width:100%;box-sizing:border-box;min-height:var(--sol-size-component-md, 36px);padding:0 var(--sol-space-sm, 8px);border:var(--sol-border-width-default, 1px) solid var(--sol-border-color-default);border-radius:var(--sol-input-radius, var(--sol-border-radius-md));background:var(--sol-input-bg, transparent);color:inherit;font:inherit}.check{display:flex;align-items:center;gap:var(--sol-space-sm, 8px);margin-top:var(--sol-space-sm, 8px);min-height:var(--sol-size-component-md, 36px);font-size:var(--sol-font-size-sm)}.footer{display:flex;flex-direction:column;align-items:flex-start;gap:var(--sol-space-sm, 8px)}@media(max-width:767.98px){.btn,.option,.check,.text{min-height:var(--sol-size-control-touch, 44px)}.icon{width:var(--sol-size-control-touch, 44px);height:var(--sol-size-control-touch, 44px)}.text{font-size:var(--sol-font-size-touch-input, 16px)}}\n"] }]
1791
+ }], propDecorators: { base: [{ type: i0.Input, args: [{ isSignal: true, alias: "base", required: true }] }], theme: [{ type: i0.Input, args: [{ isSignal: true, alias: "theme", required: false }] }], fallbackImages: [{ type: i0.Input, args: [{ isSignal: true, alias: "fallbackImages", required: false }] }], uploader: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploader", required: false }] }], describeError: [{ type: i0.Input, args: [{ isSignal: true, alias: "describeError", required: false }] }], showApplyShortcut: [{ type: i0.Input, args: [{ isSignal: true, alias: "showApplyShortcut", required: false }] }], loginChange: [{ type: i0.Output, args: ["loginChange"] }], goToApply: [{ type: i0.Output, args: ["goToApply"] }] } });
1792
+
1793
+ /*
1794
+ * Public API Surface of @solercia/ui/login-appearance
1795
+ *
1796
+ * Secondary entry point: the themed sign-in frame driven by `meta.login`. It ships no auth logic
1797
+ * and makes no HTTP call; the host projects its own form inside `<sol-login-frame>`.
1798
+ */
1799
+ // Contract of `meta.login` and its bounds.
1800
+
1801
+ /**
1802
+ * Generated bundle index. Do not edit.
1803
+ */
1804
+
1805
+ export { LOGIN_APPEARANCE_I18N_PREFIX, LOGIN_BACKGROUNDS, LOGIN_CAPTION_POSITIONS, LOGIN_DEFAULT_BACKGROUND, LOGIN_DEFAULT_EFFECT, LOGIN_DEFAULT_POSITION, LOGIN_DEFAULT_TRANSITION, LOGIN_EFFECTS, LOGIN_INTERVAL_DEFAULT_MS, LOGIN_INTERVAL_MAX_MS, LOGIN_INTERVAL_MIN_MS, LOGIN_MAX_IMAGES, LOGIN_META_SCHEMA, LOGIN_POSITIONS, LOGIN_SHAPE_BACKGROUNDS, LOGIN_TRANSITIONS, SOL_LOGIN_APPEARANCE_I18N_EN, SOL_LOGIN_APPEARANCE_I18N_ES_CO, SolLoginAppearanceEditorComponent, SolLoginBrandComponent, SolLoginFrameComponent, SolLoginPanelBackgroundComponent, SolLoginPhotosComponent, SolLoginPreviewComponent, SolLoginSceneComponent, SolLoginShapesComponent, buildLoginView, hasLoginShapes, isAllowedLoginImage, normalizeLogin, normalizeLoginAppearance, resolveLoginView };
1806
+ //# sourceMappingURL=solercia-ui-login-appearance.mjs.map