@simai-studio/mail 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +188 -0
- package/README.md +79 -2
- package/dist/package-receipt.json +1176 -0
- package/dist/set.json +97 -0
- package/dist/smart/mail-canvas/component.json +562 -0
- package/dist/smart/mail-canvas/component.json.gz +0 -0
- package/dist/smart/mail-canvas/css/mail-canvas.css +85 -0
- package/dist/smart/mail-canvas/css/mail-canvas.css.gz +0 -0
- package/dist/smart/mail-canvas/css/mail-canvas.min.css +2 -0
- package/dist/smart/mail-canvas/css/mail-canvas.min.css.gz +0 -0
- package/dist/smart/mail-canvas/examples.json +731 -0
- package/dist/smart/mail-canvas/examples.json.gz +0 -0
- package/dist/smart/mail-canvas/js/mail-canvas.js +1039 -0
- package/dist/smart/mail-canvas/js/mail-canvas.js.gz +0 -0
- package/dist/smart/mail-canvas/js/mail-canvas.min.js +22 -0
- package/dist/smart/mail-canvas/js/mail-canvas.min.js.gz +0 -0
- package/dist/smart/mail-canvas/lang/en.json +25 -0
- package/dist/smart/mail-canvas/lang/en.json.gz +0 -0
- package/dist/smart/mail-canvas/lang/ru.json +25 -0
- package/dist/smart/mail-canvas/lang/ru.json.gz +0 -0
- package/dist/smart/mail-canvas/probe.json +465 -0
- package/dist/smart/mail-canvas/probe.json.gz +0 -0
- package/dist/smart/mail-canvas/smart.manifest.json +550 -0
- package/dist/smart/mail-canvas/smart.manifest.json.gz +0 -0
- package/dist/smart/mail-canvas/static/default/notes.html +43 -0
- package/dist/smart/mail-canvas/static/default/notes.html.gz +0 -0
- package/dist/smart/mail-canvas/static/default/phone.html +43 -0
- package/dist/smart/mail-canvas/static/default/phone.html.gz +0 -0
- package/dist/smart/mail-canvas/static/default/reference.html +48 -0
- package/dist/smart/mail-canvas/static/default/reference.html.gz +0 -0
- package/dist/smart/mail-canvas/static/sheets.json +132 -0
- package/dist/smart/mail-canvas/static/sheets.json.gz +0 -0
- package/dist/smart/mail-canvas/studio.fixture.json +63 -0
- package/dist/smart/mail-canvas/studio.fixture.json.gz +0 -0
- package/dist/smart/mail-canvas/studio.scenario.json +39 -0
- package/dist/smart/mail-canvas/studio.scenario.json.gz +0 -0
- package/dist/smart/mail-canvas/template/default.css +73 -0
- package/dist/smart/mail-canvas/template/default.css.gz +0 -0
- package/dist/smart/mail-canvas/template/default.js +38 -0
- package/dist/smart/mail-canvas/template/default.js.gz +0 -0
- package/dist/smart/mail-inspector/component.json +768 -0
- package/dist/smart/mail-inspector/component.json.gz +0 -0
- package/dist/smart/mail-inspector/css/mail-inspector.css +194 -0
- package/dist/smart/mail-inspector/css/mail-inspector.css.gz +0 -0
- package/dist/smart/mail-inspector/css/mail-inspector.min.css +2 -0
- package/dist/smart/mail-inspector/css/mail-inspector.min.css.gz +0 -0
- package/dist/smart/mail-inspector/examples.json +1301 -0
- package/dist/smart/mail-inspector/examples.json.gz +0 -0
- package/dist/smart/mail-inspector/js/mail-inspector.js +1619 -0
- package/dist/smart/mail-inspector/js/mail-inspector.js.gz +0 -0
- package/dist/smart/mail-inspector/js/mail-inspector.min.js +103 -0
- package/dist/smart/mail-inspector/js/mail-inspector.min.js.gz +0 -0
- package/dist/smart/mail-inspector/lang/en.json +29 -0
- package/dist/smart/mail-inspector/lang/en.json.gz +0 -0
- package/dist/smart/mail-inspector/lang/ru.json +29 -0
- package/dist/smart/mail-inspector/lang/ru.json.gz +0 -0
- package/dist/smart/mail-inspector/probe.json +648 -0
- package/dist/smart/mail-inspector/probe.json.gz +0 -0
- package/dist/smart/mail-inspector/smart.manifest.json +920 -0
- package/dist/smart/mail-inspector/smart.manifest.json.gz +0 -0
- package/dist/smart/mail-inspector/static/default/item.html +189 -0
- package/dist/smart/mail-inspector/static/default/item.html.gz +0 -0
- package/dist/smart/mail-inspector/static/default/letter.html +247 -0
- package/dist/smart/mail-inspector/static/default/letter.html.gz +0 -0
- package/dist/smart/mail-inspector/static/default/reference.html +545 -0
- package/dist/smart/mail-inspector/static/default/reference.html.gz +0 -0
- package/dist/smart/mail-inspector/static/sheets.json +226 -0
- package/dist/smart/mail-inspector/static/sheets.json.gz +0 -0
- package/dist/smart/mail-inspector/studio.fixture.json +232 -0
- package/dist/smart/mail-inspector/studio.fixture.json.gz +0 -0
- package/dist/smart/mail-inspector/studio.scenario.json +43 -0
- package/dist/smart/mail-inspector/studio.scenario.json.gz +0 -0
- package/dist/smart/mail-inspector/template/default.css +190 -0
- package/dist/smart/mail-inspector/template/default.css.gz +0 -0
- package/dist/smart/mail-inspector/template/default.js +249 -0
- package/dist/smart/mail-inspector/template/default.js.gz +0 -0
- package/dist/smart/mail-letters/component.json +455 -0
- package/dist/smart/mail-letters/component.json.gz +0 -0
- package/dist/smart/mail-letters/css/mail-letters.css +72 -0
- package/dist/smart/mail-letters/css/mail-letters.css.gz +0 -0
- package/dist/smart/mail-letters/css/mail-letters.min.css +2 -0
- package/dist/smart/mail-letters/css/mail-letters.min.css.gz +0 -0
- package/dist/smart/mail-letters/examples.json +477 -0
- package/dist/smart/mail-letters/examples.json.gz +0 -0
- package/dist/smart/mail-letters/js/mail-letters.js +1772 -0
- package/dist/smart/mail-letters/js/mail-letters.js.gz +0 -0
- package/dist/smart/mail-letters/js/mail-letters.min.js +35 -0
- package/dist/smart/mail-letters/js/mail-letters.min.js.gz +0 -0
- package/dist/smart/mail-letters/lang/en.json +29 -0
- package/dist/smart/mail-letters/lang/en.json.gz +0 -0
- package/dist/smart/mail-letters/lang/ru.json +31 -0
- package/dist/smart/mail-letters/lang/ru.json.gz +0 -0
- package/dist/smart/mail-letters/probe.json +290 -0
- package/dist/smart/mail-letters/probe.json.gz +0 -0
- package/dist/smart/mail-letters/smart.manifest.json +476 -0
- package/dist/smart/mail-letters/smart.manifest.json.gz +0 -0
- package/dist/smart/mail-letters/static/default/by-title.html +177 -0
- package/dist/smart/mail-letters/static/default/by-title.html.gz +0 -0
- package/dist/smart/mail-letters/static/default/empty.html +88 -0
- package/dist/smart/mail-letters/static/default/empty.html.gz +0 -0
- package/dist/smart/mail-letters/static/default/nothing-found.html +88 -0
- package/dist/smart/mail-letters/static/default/nothing-found.html.gz +0 -0
- package/dist/smart/mail-letters/static/default/reference.html +168 -0
- package/dist/smart/mail-letters/static/default/reference.html.gz +0 -0
- package/dist/smart/mail-letters/static/sheets.json +245 -0
- package/dist/smart/mail-letters/static/sheets.json.gz +0 -0
- package/dist/smart/mail-letters/studio.fixture.json +41 -0
- package/dist/smart/mail-letters/studio.fixture.json.gz +0 -0
- package/dist/smart/mail-letters/studio.scenario.json +41 -0
- package/dist/smart/mail-letters/studio.scenario.json.gz +0 -0
- package/dist/smart/mail-letters/template/default.css +79 -0
- package/dist/smart/mail-letters/template/default.css.gz +0 -0
- package/dist/smart/mail-letters/template/default.js +61 -0
- package/dist/smart/mail-letters/template/default.js.gz +0 -0
- package/dist/smart/mail-library/component.json +512 -0
- package/dist/smart/mail-library/component.json.gz +0 -0
- package/dist/smart/mail-library/css/mail-library.css +149 -0
- package/dist/smart/mail-library/css/mail-library.css.gz +0 -0
- package/dist/smart/mail-library/css/mail-library.min.css +2 -0
- package/dist/smart/mail-library/css/mail-library.min.css.gz +0 -0
- package/dist/smart/mail-library/examples.json +616 -0
- package/dist/smart/mail-library/examples.json.gz +0 -0
- package/dist/smart/mail-library/js/mail-library.js +559 -0
- package/dist/smart/mail-library/js/mail-library.js.gz +0 -0
- package/dist/smart/mail-library/js/mail-library.min.js +52 -0
- package/dist/smart/mail-library/js/mail-library.min.js.gz +0 -0
- package/dist/smart/mail-library/lang/en.json +21 -0
- package/dist/smart/mail-library/lang/en.json.gz +0 -0
- package/dist/smart/mail-library/lang/ru.json +21 -0
- package/dist/smart/mail-library/lang/ru.json.gz +0 -0
- package/dist/smart/mail-library/probe.json +275 -0
- package/dist/smart/mail-library/probe.json.gz +0 -0
- package/dist/smart/mail-library/smart.manifest.json +512 -0
- package/dist/smart/mail-library/smart.manifest.json.gz +0 -0
- package/dist/smart/mail-library/static/default/category.html +85 -0
- package/dist/smart/mail-library/static/default/category.html.gz +0 -0
- package/dist/smart/mail-library/static/default/nothing-found.html +81 -0
- package/dist/smart/mail-library/static/default/nothing-found.html.gz +0 -0
- package/dist/smart/mail-library/static/default/one-group.html +67 -0
- package/dist/smart/mail-library/static/default/one-group.html.gz +0 -0
- package/dist/smart/mail-library/static/default/reference.html +135 -0
- package/dist/smart/mail-library/static/default/reference.html.gz +0 -0
- package/dist/smart/mail-library/static/sheets.json +180 -0
- package/dist/smart/mail-library/static/sheets.json.gz +0 -0
- package/dist/smart/mail-library/studio.fixture.json +75 -0
- package/dist/smart/mail-library/studio.fixture.json.gz +0 -0
- package/dist/smart/mail-library/studio.scenario.json +41 -0
- package/dist/smart/mail-library/studio.scenario.json.gz +0 -0
- package/dist/smart/mail-library/template/default.css +133 -0
- package/dist/smart/mail-library/template/default.css.gz +0 -0
- package/dist/smart/mail-library/template/default.js +83 -0
- package/dist/smart/mail-library/template/default.js.gz +0 -0
- package/dist/smart/mail-structure/component.json +497 -0
- package/dist/smart/mail-structure/component.json.gz +0 -0
- package/dist/smart/mail-structure/css/mail-structure.css +106 -0
- package/dist/smart/mail-structure/css/mail-structure.css.gz +0 -0
- package/dist/smart/mail-structure/css/mail-structure.min.css +2 -0
- package/dist/smart/mail-structure/css/mail-structure.min.css.gz +0 -0
- package/dist/smart/mail-structure/examples.json +286 -0
- package/dist/smart/mail-structure/examples.json.gz +0 -0
- package/dist/smart/mail-structure/js/mail-structure.js +767 -0
- package/dist/smart/mail-structure/js/mail-structure.js.gz +0 -0
- package/dist/smart/mail-structure/js/mail-structure.min.js +48 -0
- package/dist/smart/mail-structure/js/mail-structure.min.js.gz +0 -0
- package/dist/smart/mail-structure/lang/en.json +22 -0
- package/dist/smart/mail-structure/lang/en.json.gz +0 -0
- package/dist/smart/mail-structure/lang/ru.json +22 -0
- package/dist/smart/mail-structure/lang/ru.json.gz +0 -0
- package/dist/smart/mail-structure/probe.json +112 -0
- package/dist/smart/mail-structure/probe.json.gz +0 -0
- package/dist/smart/mail-structure/smart.manifest.json +495 -0
- package/dist/smart/mail-structure/smart.manifest.json.gz +0 -0
- package/dist/smart/mail-structure/static/default/empty.html +76 -0
- package/dist/smart/mail-structure/static/default/empty.html.gz +0 -0
- package/dist/smart/mail-structure/static/default/reference.html +98 -0
- package/dist/smart/mail-structure/static/default/reference.html.gz +0 -0
- package/dist/smart/mail-structure/static/default/settings.html +98 -0
- package/dist/smart/mail-structure/static/default/settings.html.gz +0 -0
- package/dist/smart/mail-structure/static/sheets.json +142 -0
- package/dist/smart/mail-structure/static/sheets.json.gz +0 -0
- package/dist/smart/mail-structure/studio.fixture.json +45 -0
- package/dist/smart/mail-structure/studio.fixture.json.gz +0 -0
- package/dist/smart/mail-structure/studio.scenario.json +42 -0
- package/dist/smart/mail-structure/studio.scenario.json.gz +0 -0
- package/dist/smart/mail-structure/template/default.css +100 -0
- package/dist/smart/mail-structure/template/default.css.gz +0 -0
- package/dist/smart/mail-structure/template/default.js +80 -0
- package/dist/smart/mail-structure/template/default.js.gz +0 -0
- package/dist/smart/rule.js +161 -0
- package/dist/smart/rule.js.gz +0 -0
- package/package.json +29 -4
|
@@ -0,0 +1,1772 @@
|
|
|
1
|
+
/******/ (() => { // webpackBootstrap
|
|
2
|
+
/******/ "use strict";
|
|
3
|
+
/******/ var __webpack_modules__ = ({
|
|
4
|
+
|
|
5
|
+
/***/ "151a293c8c90"
|
|
6
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
7
|
+
|
|
8
|
+
__webpack_require__.r(__webpack_exports__);
|
|
9
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
10
|
+
/* harmony export */ ariaKeyShortcuts: () => (/* binding */ ariaKeyShortcuts),
|
|
11
|
+
/* harmony export */ isApplePlatform: () => (/* binding */ isApplePlatform),
|
|
12
|
+
/* harmony export */ isCommandShortcut: () => (/* binding */ isCommandShortcut),
|
|
13
|
+
/* harmony export */ isEditableTarget: () => (/* binding */ isEditableTarget),
|
|
14
|
+
/* harmony export */ matchesShortcut: () => (/* binding */ matchesShortcut),
|
|
15
|
+
/* harmony export */ parseShortcut: () => (/* binding */ parseShortcut),
|
|
16
|
+
/* harmony export */ shortcutCaps: () => (/* binding */ shortcutCaps),
|
|
17
|
+
/* harmony export */ shortcutView: () => (/* binding */ shortcutView)
|
|
18
|
+
/* harmony export */ });
|
|
19
|
+
// A key combination as a `shortcut` setting writes it (sf-button, an entry
|
|
20
|
+
// of sf-menu-context, a row of sf-search): words joined by +, the modifiers
|
|
21
|
+
// first and the key last -- mod+k, shift+/, /, escape. `mod` is the
|
|
22
|
+
// platform's command modifier: Cmd on Apple platforms, Ctrl elsewhere. Read
|
|
23
|
+
// once per render; nothing here holds state.
|
|
24
|
+
//
|
|
25
|
+
// The kbd component owns how a combination reads (owner decision 2026-11-07,
|
|
26
|
+
// docs review R030, rule C04): on an Apple platform the modifiers are glyphs
|
|
27
|
+
// in the platform's order, side by side (⇧⌘P); elsewhere they are words in
|
|
28
|
+
// Ctrl+Shift+P order, and shortcutView() says to join them with + -- the kbd
|
|
29
|
+
// sheet shows the joins where keys are plain glyphs (a menu row, a tooltip)
|
|
30
|
+
// and hides them between caps, which stand apart. A host renders the view
|
|
31
|
+
// and never styles the keys.
|
|
32
|
+
const MODIFIERS = ['mod', 'ctrl', 'alt', 'shift', 'meta']; // What a person reads on a key cap, per platform.
|
|
33
|
+
|
|
34
|
+
const MAC_CAPS = {
|
|
35
|
+
mod: '⌘',
|
|
36
|
+
meta: '⌘',
|
|
37
|
+
ctrl: '⌃',
|
|
38
|
+
alt: '⌥',
|
|
39
|
+
shift: '⇧'
|
|
40
|
+
};
|
|
41
|
+
const OTHER_CAPS = {
|
|
42
|
+
mod: 'Ctrl',
|
|
43
|
+
meta: 'Win',
|
|
44
|
+
ctrl: 'Ctrl',
|
|
45
|
+
alt: 'Alt',
|
|
46
|
+
shift: 'Shift'
|
|
47
|
+
}; // A cap of one character -- a letter, ⌘, ⇧, ↵ -- is a square key; a cap of
|
|
48
|
+
// several letters (Esc, Ctrl, Shift) hugs its word (sheet:
|
|
49
|
+
// .sf-button-shortcut-key--square). A modifier's cap is the platform's own
|
|
50
|
+
// word, so a page printed on a Mac and drawn on Windows widens by the
|
|
51
|
+
// difference: the keys are true to their caps, not to the widest platform
|
|
52
|
+
// (docs review R010, 2026-11-06).
|
|
53
|
+
|
|
54
|
+
const KEY_CAPS = {
|
|
55
|
+
enter: '↵',
|
|
56
|
+
return: '↵',
|
|
57
|
+
escape: 'Esc',
|
|
58
|
+
esc: 'Esc',
|
|
59
|
+
tab: 'Tab',
|
|
60
|
+
space: 'Space',
|
|
61
|
+
backspace: '⌫',
|
|
62
|
+
delete: 'Del',
|
|
63
|
+
up: '↑',
|
|
64
|
+
down: '↓',
|
|
65
|
+
left: '←',
|
|
66
|
+
right: '→',
|
|
67
|
+
arrowup: '↑',
|
|
68
|
+
arrowdown: '↓',
|
|
69
|
+
arrowleft: '←',
|
|
70
|
+
arrowright: '→',
|
|
71
|
+
home: 'Home',
|
|
72
|
+
end: 'End',
|
|
73
|
+
pageup: 'PgUp',
|
|
74
|
+
pagedown: 'PgDn'
|
|
75
|
+
}; // An Apple keyboard's own signs where they differ (component.kbd 1.3.3, CM-9
|
|
76
|
+
// of ui-control research 2026-11-14-context-menu): forward delete is ⌦, as
|
|
77
|
+
// macOS menus print it; Del is a Windows word.
|
|
78
|
+
|
|
79
|
+
const MAC_KEY_CAPS = {
|
|
80
|
+
delete: '⌦'
|
|
81
|
+
}; // The names of KeyboardEvent.key for the words above.
|
|
82
|
+
|
|
83
|
+
const KEY_NAMES = {
|
|
84
|
+
enter: 'Enter',
|
|
85
|
+
return: 'Enter',
|
|
86
|
+
escape: 'Escape',
|
|
87
|
+
esc: 'Escape',
|
|
88
|
+
tab: 'Tab',
|
|
89
|
+
space: ' ',
|
|
90
|
+
backspace: 'Backspace',
|
|
91
|
+
delete: 'Delete',
|
|
92
|
+
up: 'ArrowUp',
|
|
93
|
+
down: 'ArrowDown',
|
|
94
|
+
left: 'ArrowLeft',
|
|
95
|
+
right: 'ArrowRight',
|
|
96
|
+
arrowup: 'ArrowUp',
|
|
97
|
+
arrowdown: 'ArrowDown',
|
|
98
|
+
arrowleft: 'ArrowLeft',
|
|
99
|
+
arrowright: 'ArrowRight',
|
|
100
|
+
home: 'Home',
|
|
101
|
+
end: 'End',
|
|
102
|
+
pageup: 'PageUp',
|
|
103
|
+
pagedown: 'PageDown'
|
|
104
|
+
}; // KeyboardEvent.code of the punctuation a shortcut is usually written with,
|
|
105
|
+
// so the combination is heard on any keyboard layout.
|
|
106
|
+
|
|
107
|
+
const PUNCTUATION_CODES = {
|
|
108
|
+
'/': 'Slash',
|
|
109
|
+
'.': 'Period',
|
|
110
|
+
',': 'Comma',
|
|
111
|
+
';': 'Semicolon',
|
|
112
|
+
"'": 'Quote',
|
|
113
|
+
'[': 'BracketLeft',
|
|
114
|
+
']': 'BracketRight',
|
|
115
|
+
'-': 'Minus',
|
|
116
|
+
'=': 'Equal',
|
|
117
|
+
'`': 'Backquote',
|
|
118
|
+
'\\': 'Backslash'
|
|
119
|
+
};
|
|
120
|
+
function isApplePlatform() {
|
|
121
|
+
const platform = globalThis.navigator?.userAgentData?.platform || globalThis.navigator?.platform || '';
|
|
122
|
+
return /mac|iphone|ipad|ipod/iu.test(platform);
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* The combination as parts: `{modifiers: Set, key}`, or null when there is
|
|
126
|
+
* none. `+` as the key itself is written `mod+plus`.
|
|
127
|
+
*/
|
|
128
|
+
|
|
129
|
+
function parseShortcut(value) {
|
|
130
|
+
const text = String(value ?? '').trim().toLowerCase();
|
|
131
|
+
if (!text) return null;
|
|
132
|
+
const words = text === '+' ? ['+'] : text.split('+').map(word => word.trim()).filter(Boolean);
|
|
133
|
+
if (!words.length) return null;
|
|
134
|
+
const key = words.at(-1) === 'plus' ? '+' : words.at(-1);
|
|
135
|
+
const modifiers = new Set(words.slice(0, -1).filter(word => MODIFIERS.includes(word)));
|
|
136
|
+
return {
|
|
137
|
+
modifiers,
|
|
138
|
+
key
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* What the keys read, one cap per key in the platform's words: {text, square},
|
|
143
|
+
* square when the cap is one character.
|
|
144
|
+
*/
|
|
145
|
+
|
|
146
|
+
function shortcutCaps(parsed, apple = isApplePlatform()) {
|
|
147
|
+
if (!parsed) return [];
|
|
148
|
+
const caps = apple ? MAC_CAPS : OTHER_CAPS;
|
|
149
|
+
const order = apple ? ['ctrl', 'alt', 'shift', 'mod', 'meta'] : ['mod', 'ctrl', 'meta', 'alt', 'shift'];
|
|
150
|
+
const modifiers = [];
|
|
151
|
+
|
|
152
|
+
for (const name of order.filter(one => parsed.modifiers.has(one))) {
|
|
153
|
+
// On a Mac mod and meta are one key.
|
|
154
|
+
if (modifiers.includes(caps[name])) continue;
|
|
155
|
+
modifiers.push(caps[name]);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const key = (apple ? MAC_KEY_CAPS[parsed.key] : undefined) ?? KEY_CAPS[parsed.key] ?? (parsed.key.length === 1 ? parsed.key.toUpperCase() : parsed.key.charAt(0).toUpperCase() + parsed.key.slice(1));
|
|
159
|
+
return [...modifiers, key].map(text => ({
|
|
160
|
+
text,
|
|
161
|
+
square: [...text].length === 1
|
|
162
|
+
}));
|
|
163
|
+
} // A function key (F1-F24) reads as its name.
|
|
164
|
+
|
|
165
|
+
const FUNCTION_KEY = /^f(?:[1-9]|1[0-9]|2[0-4])$/u; // Whether a written value is the notation above rather than text a page
|
|
166
|
+
// already wrote for people (⇧⌘L, «Ctrl K»): every word but the last a
|
|
167
|
+
// modifier, the last one character, a named key or a function key.
|
|
168
|
+
|
|
169
|
+
function isNotation(value) {
|
|
170
|
+
const text = String(value ?? '').trim().toLowerCase();
|
|
171
|
+
if (!text || /\s/u.test(text.replace(/\s*\+\s*/gu, '+'))) return false;
|
|
172
|
+
if (text === '+') return true;
|
|
173
|
+
const words = text.split('+').map(word => word.trim());
|
|
174
|
+
if (words.some(word => !word)) return false;
|
|
175
|
+
const key = words.at(-1) === 'plus' ? '+' : words.at(-1);
|
|
176
|
+
return words.slice(0, -1).every(word => MODIFIERS.includes(word)) && ([...key].length === 1 || key in KEY_CAPS || FUNCTION_KEY.test(key));
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* What a host draws for a `shortcut` value: {keys: [{text, square}], join},
|
|
180
|
+
* the keys in this platform's words and whether they are joined with + (not
|
|
181
|
+
* on an Apple platform, and only between keys). A value that is not the
|
|
182
|
+
* notation -- text a page wrote for people, such as ⇧⌘L -- is one key of
|
|
183
|
+
* that text. Empty: no keys.
|
|
184
|
+
*/
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
function shortcutView(value, apple = isApplePlatform()) {
|
|
188
|
+
const text = String(value ?? '').trim();
|
|
189
|
+
if (!text) return {
|
|
190
|
+
keys: [],
|
|
191
|
+
join: false
|
|
192
|
+
};
|
|
193
|
+
if (!isNotation(text)) return {
|
|
194
|
+
keys: [{
|
|
195
|
+
text,
|
|
196
|
+
square: [...text].length === 1
|
|
197
|
+
}],
|
|
198
|
+
join: false
|
|
199
|
+
};
|
|
200
|
+
const keys = shortcutCaps(parseShortcut(text), apple);
|
|
201
|
+
return {
|
|
202
|
+
keys,
|
|
203
|
+
join: !apple && keys.length > 1
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
/** The value of aria-keyshortcuts (WAI-ARIA 1.2): Meta+K, Control+K, /. */
|
|
207
|
+
|
|
208
|
+
function ariaKeyShortcuts(parsed, apple = isApplePlatform()) {
|
|
209
|
+
if (!parsed) return '';
|
|
210
|
+
const names = [];
|
|
211
|
+
if (parsed.modifiers.has('ctrl') || parsed.modifiers.has('mod') && !apple) names.push('Control');
|
|
212
|
+
if (parsed.modifiers.has('alt')) names.push('Alt');
|
|
213
|
+
if (parsed.modifiers.has('shift')) names.push('Shift');
|
|
214
|
+
if (parsed.modifiers.has('meta') || parsed.modifiers.has('mod') && apple) names.push('Meta');
|
|
215
|
+
const key = KEY_NAMES[parsed.key] ?? (parsed.key === ' ' ? 'Space' : parsed.key.length === 1 ? parsed.key.toUpperCase() : parsed.key);
|
|
216
|
+
return [...names, key === ' ' ? 'Space' : key].join('+');
|
|
217
|
+
} // Whether the event's key is the combination's key: by the character it
|
|
218
|
+
// typed, or by the physical key for a letter, a digit or the punctuation
|
|
219
|
+
// above, so mod+k is heard on a Russian layout too.
|
|
220
|
+
|
|
221
|
+
function sameKey(event, key) {
|
|
222
|
+
const name = KEY_NAMES[key];
|
|
223
|
+
if (name) return event.key === name;
|
|
224
|
+
if (String(event.key).toLowerCase() === key) return true;
|
|
225
|
+
if (/^[a-z]$/u.test(key)) return event.code === `Key${key.toUpperCase()}`;
|
|
226
|
+
if (/^[0-9]$/u.test(key)) return event.code === `Digit${key}`;
|
|
227
|
+
return PUNCTUATION_CODES[key] !== undefined && event.code === PUNCTUATION_CODES[key];
|
|
228
|
+
}
|
|
229
|
+
/** Whether a keydown is the combination. */
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
function matchesShortcut(event, parsed, apple = isApplePlatform()) {
|
|
233
|
+
if (!parsed || !event) return false;
|
|
234
|
+
const wants = {
|
|
235
|
+
ctrl: parsed.modifiers.has('ctrl') || parsed.modifiers.has('mod') && !apple,
|
|
236
|
+
meta: parsed.modifiers.has('meta') || parsed.modifiers.has('mod') && apple,
|
|
237
|
+
alt: parsed.modifiers.has('alt'),
|
|
238
|
+
shift: parsed.modifiers.has('shift')
|
|
239
|
+
};
|
|
240
|
+
if (Boolean(event.ctrlKey) !== wants.ctrl || Boolean(event.metaKey) !== wants.meta || Boolean(event.altKey) !== wants.alt) return false; // Shift is part of typing a punctuation mark on many layouts (? is shift+/):
|
|
241
|
+
// a combination that does not name it does not mind it for punctuation, and
|
|
242
|
+
// minds it for a letter, a digit or a named key.
|
|
243
|
+
|
|
244
|
+
const punctuation = parsed.key.length === 1 && !/^[a-z0-9]$/u.test(parsed.key);
|
|
245
|
+
if (!punctuation && Boolean(event.shiftKey) !== wants.shift) return false;
|
|
246
|
+
if (punctuation && wants.shift && !event.shiftKey) return false;
|
|
247
|
+
return sameKey(event, parsed.key);
|
|
248
|
+
}
|
|
249
|
+
/** A combination with mod, ctrl, alt or meta is a command even in a field. */
|
|
250
|
+
|
|
251
|
+
function isCommandShortcut(parsed) {
|
|
252
|
+
return Boolean(parsed) && ['mod', 'ctrl', 'alt', 'meta'].some(name => parsed.modifiers.has(name));
|
|
253
|
+
}
|
|
254
|
+
/** Whether focus is where a person types: a field, a select or editable text. */
|
|
255
|
+
|
|
256
|
+
function isEditableTarget(target) {
|
|
257
|
+
const element = target instanceof Element ? target : null;
|
|
258
|
+
if (!element) return false;
|
|
259
|
+
if (element.isContentEditable) return true;
|
|
260
|
+
const tag = element.localName;
|
|
261
|
+
if (tag === 'textarea' || tag === 'select') return true;
|
|
262
|
+
if (tag !== 'input') return false;
|
|
263
|
+
const type = (element.getAttribute('type') || 'text').toLowerCase();
|
|
264
|
+
return !['button', 'submit', 'reset', 'checkbox', 'radio', 'range', 'color', 'file', 'image', 'hidden'].includes(type);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/***/ },
|
|
268
|
+
|
|
269
|
+
/***/ "e577837dd70a"
|
|
270
|
+
(module, __webpack_exports__, __webpack_require__) {
|
|
271
|
+
|
|
272
|
+
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
|
273
|
+
__webpack_require__.r(__webpack_exports__);
|
|
274
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
275
|
+
/* harmony export */ calendarDayOffset: () => (/* binding */ calendarDayOffset),
|
|
276
|
+
/* harmony export */ formatDate: () => (/* binding */ formatDate),
|
|
277
|
+
/* harmony export */ knownTimeZone: () => (/* binding */ knownTimeZone),
|
|
278
|
+
/* harmony export */ msUntilNextDay: () => (/* binding */ msUntilNextDay),
|
|
279
|
+
/* harmony export */ timeZoneOffset: () => (/* binding */ timeZoneOffset),
|
|
280
|
+
/* harmony export */ toDate: () => (/* reexport safe */ _format_intl_js__WEBPACK_IMPORTED_MODULE_0__.toDate)
|
|
281
|
+
/* harmony export */ });
|
|
282
|
+
/* harmony import */ var _format_intl_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("15b4e93ff6ed");
|
|
283
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_format_intl_js__WEBPACK_IMPORTED_MODULE_0__]);
|
|
284
|
+
var __webpack_async_dependencies_result__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
|
285
|
+
_format_intl_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_async_dependencies_result__[0];
|
|
286
|
+
// Dates in the page's language: formatDate, the calendar day offset and the
|
|
287
|
+
// next midnight, with no top-level side effects (format-intl.js). The same
|
|
288
|
+
// functions as core/js/format.js and SF.format; relative days and times are
|
|
289
|
+
// format-relative.js, so a bundle that writes a date does not carry them.
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
const DAY_MS = 86400000;
|
|
293
|
+
|
|
294
|
+
function hasDateStyle(style) {
|
|
295
|
+
return style === 'short' || style === 'medium' || style === 'long' || style === 'full';
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* A date, a time or both in the locale.
|
|
299
|
+
*
|
|
300
|
+
* formatDate(at) 3 нояб. 2026 г. / Nov 3, 2026
|
|
301
|
+
* formatDate(at, {date: 'short'}) 03.11.2026 / 11/3/26
|
|
302
|
+
* formatDate(at, {date: 'long'}) 3 ноября 2026 г. / November 3, 2026
|
|
303
|
+
* formatDate(at, {time: 'short'}) 3 нояб. 2026 г., 14:05
|
|
304
|
+
* formatDate(at, {date: null, time: 'short'}) 14:05 / 2:05 PM
|
|
305
|
+
*
|
|
306
|
+
* `date` and `time` are Intl styles (short, medium, long, full); `intl` gives
|
|
307
|
+
* Intl.DateTimeFormat options outright, for a form the styles do not name (a
|
|
308
|
+
* chart's tick, «14:05» with two-digit hours). `timeZone` (an IANA name,
|
|
309
|
+
* Europe/Moscow) writes the moment on that zone's clock instead of the
|
|
310
|
+
* reader's (owner decision C183 (3): a product that knows the person's zone).
|
|
311
|
+
* Anything that is not a date is `gap`, '' by default. A marker after the year
|
|
312
|
+
* («2026 г.», «2026 р.») is held to it by a no-break space, so it never starts
|
|
313
|
+
* a line alone.
|
|
314
|
+
*/
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
function formatDate(value, {
|
|
318
|
+
date = 'medium',
|
|
319
|
+
time = null,
|
|
320
|
+
intl = null,
|
|
321
|
+
timeZone = '',
|
|
322
|
+
gap = '',
|
|
323
|
+
...where
|
|
324
|
+
} = {}) {
|
|
325
|
+
const moment = (0,_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.toDate)(value);
|
|
326
|
+
if (!moment) return gap;
|
|
327
|
+
let options = intl;
|
|
328
|
+
|
|
329
|
+
if (!options) {
|
|
330
|
+
options = {};
|
|
331
|
+
if (hasDateStyle(date)) options.dateStyle = date;
|
|
332
|
+
if (hasDateStyle(time)) options.timeStyle = time;
|
|
333
|
+
if (!options.dateStyle && !options.timeStyle) options.dateStyle = 'medium';
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
if (knownTimeZone(timeZone)) options = { ...options,
|
|
337
|
+
timeZone
|
|
338
|
+
}; // The year keeps its marker («2026 г.» never wraps before «г.»): format-intl.js.
|
|
339
|
+
|
|
340
|
+
return (0,_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.formatDateText)((0,_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.intlFormatter)('DateTimeFormat', (0,_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.formatLocale)(where), options), moment);
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Whether the platform knows an IANA time zone name (Europe/Moscow, UTC). An
|
|
344
|
+
* empty or unknown name is the reader's own zone everywhere here.
|
|
345
|
+
*/
|
|
346
|
+
|
|
347
|
+
function knownTimeZone(timeZone) {
|
|
348
|
+
const name = String(timeZone ?? '').trim();
|
|
349
|
+
if (!name) return false;
|
|
350
|
+
const root = typeof globalThis !== 'undefined' ? globalThis : {};
|
|
351
|
+
if (!(root.__sfTimeZones instanceof Map)) root.__sfTimeZones = new Map();
|
|
352
|
+
if (root.__sfTimeZones.has(name)) return root.__sfTimeZones.get(name);
|
|
353
|
+
let known = true;
|
|
354
|
+
|
|
355
|
+
try {
|
|
356
|
+
new Intl.DateTimeFormat('en', {
|
|
357
|
+
timeZone: name
|
|
358
|
+
});
|
|
359
|
+
} catch {
|
|
360
|
+
known = false;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
if (root.__sfTimeZones.size < 64) root.__sfTimeZones.set(name, known);
|
|
364
|
+
return known;
|
|
365
|
+
} // The calendar date and the clock of a moment in a zone, as numbers: the
|
|
366
|
+
// reader's own when the zone is none.
|
|
367
|
+
|
|
368
|
+
function wallClock(moment, timeZone) {
|
|
369
|
+
if (!knownTimeZone(timeZone)) {
|
|
370
|
+
return {
|
|
371
|
+
year: moment.getFullYear(),
|
|
372
|
+
month: moment.getMonth(),
|
|
373
|
+
day: moment.getDate(),
|
|
374
|
+
hour: moment.getHours(),
|
|
375
|
+
minute: moment.getMinutes(),
|
|
376
|
+
second: moment.getSeconds()
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
const parts = {};
|
|
381
|
+
|
|
382
|
+
for (const part of (0,_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.intlFormatter)('DateTimeFormat', 'en-US', {
|
|
383
|
+
timeZone,
|
|
384
|
+
hourCycle: 'h23',
|
|
385
|
+
year: 'numeric',
|
|
386
|
+
month: 'numeric',
|
|
387
|
+
day: 'numeric',
|
|
388
|
+
hour: 'numeric',
|
|
389
|
+
minute: 'numeric',
|
|
390
|
+
second: 'numeric'
|
|
391
|
+
}).formatToParts(moment)) {
|
|
392
|
+
if (part.type !== 'literal') parts[part.type] = Number(part.value);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
return {
|
|
396
|
+
year: parts.year,
|
|
397
|
+
month: parts.month - 1,
|
|
398
|
+
day: parts.day,
|
|
399
|
+
hour: parts.hour % 24,
|
|
400
|
+
minute: parts.minute,
|
|
401
|
+
second: parts.second
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* The zone's offset from UTC at a moment, in minutes (Moscow +180, New York
|
|
406
|
+
* -300 in winter); the reader's own when the zone is none.
|
|
407
|
+
*/
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
function timeZoneOffset(value, {
|
|
411
|
+
timeZone = ''
|
|
412
|
+
} = {}) {
|
|
413
|
+
const moment = (0,_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.toDate)(value);
|
|
414
|
+
if (!moment) return Number.NaN;
|
|
415
|
+
if (!knownTimeZone(timeZone)) return -moment.getTimezoneOffset();
|
|
416
|
+
const clock = wallClock(moment, timeZone);
|
|
417
|
+
const asUtc = Date.UTC(clock.year, clock.month, clock.day, clock.hour, clock.minute, clock.second);
|
|
418
|
+
return Math.round((asUtc - Math.floor(moment.getTime() / 1000) * 1000) / 60000);
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Calendar days from `now` to the value in the reader's time zone (or
|
|
422
|
+
* `timeZone`'s): 0 today, -1 yesterday, 1 tomorrow; NaN when the value is no
|
|
423
|
+
* date. Counted on calendar dates, not 24-hour spans, so 23:59 yesterday is
|
|
424
|
+
* -1 at 00:01 and a day of a clock change is still one day.
|
|
425
|
+
*/
|
|
426
|
+
|
|
427
|
+
function calendarDayOffset(value, {
|
|
428
|
+
now = new Date(),
|
|
429
|
+
timeZone = ''
|
|
430
|
+
} = {}) {
|
|
431
|
+
const moment = (0,_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.toDate)(value);
|
|
432
|
+
const today = (0,_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.toDate)(now);
|
|
433
|
+
if (!moment || !today) return Number.NaN;
|
|
434
|
+
const at = wallClock(moment, timeZone);
|
|
435
|
+
const from = wallClock(today, timeZone);
|
|
436
|
+
const day = Date.UTC(at.year, at.month, at.day);
|
|
437
|
+
const base = Date.UTC(from.year, from.month, from.day);
|
|
438
|
+
return Math.round((day - base) / DAY_MS);
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* Milliseconds from `now` to the reader's next midnight, when every relative
|
|
442
|
+
* day on the screen moves by one. A component that shows them sets a timer
|
|
443
|
+
* for this long (plus a second's margin, so it wakes in the new day) and
|
|
444
|
+
* draws them again; «сегодня» said yesterday is wrong by morning.
|
|
445
|
+
*/
|
|
446
|
+
|
|
447
|
+
function msUntilNextDay(now = new Date(), {
|
|
448
|
+
timeZone = ''
|
|
449
|
+
} = {}) {
|
|
450
|
+
const today = (0,_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.toDate)(now) ?? new Date();
|
|
451
|
+
|
|
452
|
+
if (!knownTimeZone(timeZone)) {
|
|
453
|
+
const next = new Date(today.getFullYear(), today.getMonth(), today.getDate() + 1);
|
|
454
|
+
return next.getTime() - today.getTime();
|
|
455
|
+
} // In a named zone: the time left on its clock until 24:00, corrected by a
|
|
456
|
+
// change of its offset before then (a clock change at night).
|
|
457
|
+
|
|
458
|
+
|
|
459
|
+
const clock = wallClock(today, timeZone);
|
|
460
|
+
const left = DAY_MS - ((clock.hour * 60 + clock.minute) * 60 + clock.second) * 1000 - today.getMilliseconds();
|
|
461
|
+
const shift = timeZoneOffset(today, {
|
|
462
|
+
timeZone
|
|
463
|
+
}) - timeZoneOffset(new Date(today.getTime() + left), {
|
|
464
|
+
timeZone
|
|
465
|
+
});
|
|
466
|
+
return Math.max(1, left + shift * 60000);
|
|
467
|
+
}
|
|
468
|
+
__webpack_async_result__();
|
|
469
|
+
} catch(e) { __webpack_async_result__(e); } });
|
|
470
|
+
|
|
471
|
+
/***/ },
|
|
472
|
+
|
|
473
|
+
/***/ "c016c43b1452"
|
|
474
|
+
(module, __webpack_exports__, __webpack_require__) {
|
|
475
|
+
|
|
476
|
+
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
|
477
|
+
__webpack_require__.r(__webpack_exports__);
|
|
478
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
479
|
+
/* harmony export */ FILE_SIZE_UNITS: () => (/* binding */ FILE_SIZE_UNITS),
|
|
480
|
+
/* harmony export */ fileSizeUnits: () => (/* binding */ fileSizeUnits),
|
|
481
|
+
/* harmony export */ formatFileSize: () => (/* binding */ formatFileSize)
|
|
482
|
+
/* harmony export */ });
|
|
483
|
+
/* harmony import */ var _format_intl_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("15b4e93ff6ed");
|
|
484
|
+
/* harmony import */ var _lang_file_size_index_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("4294700087dc");
|
|
485
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_format_intl_js__WEBPACK_IMPORTED_MODULE_0__]);
|
|
486
|
+
var __webpack_async_dependencies_result__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
|
487
|
+
_format_intl_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_async_dependencies_result__[0];
|
|
488
|
+
// File sizes in the page's language («1,4 МБ»), with no top-level side
|
|
489
|
+
// effects (format-intl.js). The same functions as core/js/format.js,
|
|
490
|
+
// composition/file-size.mjs and SF.format.fileSize.
|
|
491
|
+
// The four words of a size live in core's language files
|
|
492
|
+
// (core/js/lang/file-size, localization study LC-3): English ships in the
|
|
493
|
+
// bundle; Russian and any other language take the words their language file
|
|
494
|
+
// or a product registers for `sf-file-size` (owner decision C282;
|
|
495
|
+
// SF.language.register('sf-file-size', 'de', {b, kb, mb, gb})), else the
|
|
496
|
+
// English words with its own digits. A component with words of its own passes
|
|
497
|
+
// them as `units`. The registry is read from the shared global the page
|
|
498
|
+
// language keeps (core/js/page-language.js), so this module still runs
|
|
499
|
+
// nothing on load.
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
const UNIT_KEYS = /* @__PURE__ */Object.freeze(['b', 'kb', 'mb', 'gb']);
|
|
503
|
+
|
|
504
|
+
function unitsOf(words) {
|
|
505
|
+
return Object.freeze(UNIT_KEYS.map(key => words[key]));
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
function registeredUnits(code) {
|
|
509
|
+
const words = globalThis.__sfPageLanguage?.registered?.get?.('sf-file-size')?.get?.(code);
|
|
510
|
+
return words && UNIT_KEYS.every(key => typeof words[key] === 'string') ? unitsOf(words) : null;
|
|
511
|
+
} // The built-in languages' units (English; owner decision C282), and `ru` as
|
|
512
|
+
// before for a reader of SF.format.FILE_SIZE_UNITS.ru: the units the ru
|
|
513
|
+
// language file registered, null until it is on the page.
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
function unitTable(words) {
|
|
517
|
+
const table = {};
|
|
518
|
+
|
|
519
|
+
for (const [code, own] of Object.entries(words)) table[code] = unitsOf(own);
|
|
520
|
+
|
|
521
|
+
if (!table.ru) Object.defineProperty(table, 'ru', {
|
|
522
|
+
enumerable: true,
|
|
523
|
+
get: () => registeredUnits('ru')
|
|
524
|
+
});
|
|
525
|
+
return Object.freeze(table);
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
const FILE_SIZE_UNITS = /* @__PURE__ */unitTable(_lang_file_size_index_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]);
|
|
529
|
+
/** The unit words for a locale: registered for it, its own, its language's, else English. */
|
|
530
|
+
|
|
531
|
+
function fileSizeUnits(locale = 'en') {
|
|
532
|
+
const wanted = String(locale || 'en').trim().toLowerCase().replace('_', '-'); // A registry alias takes its pack's words (zh-cn: zh-hans, pt: pt-br;
|
|
533
|
+
// core/lang/index.json aliases, kept on the shared store by core).
|
|
534
|
+
|
|
535
|
+
const pack = code => globalThis.__sfPageLanguage?.packs?.aliases?.[code] ?? code;
|
|
536
|
+
|
|
537
|
+
const base = wanted.split('-')[0];
|
|
538
|
+
|
|
539
|
+
for (const code of [...new Set([wanted, pack(wanted), base, pack(base)])]) {
|
|
540
|
+
const units = registeredUnits(code) ?? (Object.hasOwn(FILE_SIZE_UNITS, code) ? FILE_SIZE_UNITS[code] : null);
|
|
541
|
+
if (units) return units;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
return registeredUnits('en') ?? FILE_SIZE_UNITS.en;
|
|
545
|
+
}
|
|
546
|
+
/**
|
|
547
|
+
* A size as people read it: «512 Б», «2 КБ», «1,4 МБ», «12 GB». Binary steps
|
|
548
|
+
* of 1024; one digit after the point under ten of a unit, none above it or in
|
|
549
|
+
* bytes. Text a host already formatted is returned as it came; anything that
|
|
550
|
+
* is not a size is ''.
|
|
551
|
+
*
|
|
552
|
+
* formatFileSize(size, {node, units?, locale?})
|
|
553
|
+
* formatFileSize(size, units, locale) -- the form composition/file-size.mjs
|
|
554
|
+
* and sf-image-field 1.x published
|
|
555
|
+
*/
|
|
556
|
+
|
|
557
|
+
function formatFileSize(size, options = {}, legacyLocale) {
|
|
558
|
+
const where = Array.isArray(options) ? {
|
|
559
|
+
units: options,
|
|
560
|
+
locale: legacyLocale ?? 'en'
|
|
561
|
+
} : options ?? {};
|
|
562
|
+
if (typeof size === 'string') return size;
|
|
563
|
+
const bytes = Number(size);
|
|
564
|
+
if (size === null || size === undefined || !Number.isFinite(bytes) || bytes < 0) return '';
|
|
565
|
+
const locale = (0,_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.formatLocale)(where);
|
|
566
|
+
const units = where.units?.length ? where.units : fileSizeUnits(locale);
|
|
567
|
+
let amount = bytes;
|
|
568
|
+
let index = 0;
|
|
569
|
+
|
|
570
|
+
while (amount >= 1024 && index < units.length - 1) {
|
|
571
|
+
amount /= 1024;
|
|
572
|
+
index += 1;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
const digits = index === 0 || amount >= 10 ? 0 : 1;
|
|
576
|
+
return `${(0,_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.intlFormatter)('NumberFormat', locale, {
|
|
577
|
+
maximumFractionDigits: digits
|
|
578
|
+
}).format(amount)} ${units[index]}`;
|
|
579
|
+
}
|
|
580
|
+
__webpack_async_result__();
|
|
581
|
+
} catch(e) { __webpack_async_result__(e); } });
|
|
582
|
+
|
|
583
|
+
/***/ },
|
|
584
|
+
|
|
585
|
+
/***/ "15b4e93ff6ed"
|
|
586
|
+
(module, __webpack_exports__, __webpack_require__) {
|
|
587
|
+
|
|
588
|
+
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
|
589
|
+
__webpack_require__.r(__webpack_exports__);
|
|
590
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
591
|
+
/* harmony export */ formatDateText: () => (/* binding */ formatDateText),
|
|
592
|
+
/* harmony export */ formatLocale: () => (/* binding */ formatLocale),
|
|
593
|
+
/* harmony export */ intlFormatter: () => (/* binding */ intlFormatter),
|
|
594
|
+
/* harmony export */ toDate: () => (/* binding */ toDate)
|
|
595
|
+
/* harmony export */ });
|
|
596
|
+
/* harmony import */ var _page_language_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("43090d1c8307");
|
|
597
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_page_language_js__WEBPACK_IMPORTED_MODULE_0__]);
|
|
598
|
+
var __webpack_async_dependencies_result__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
|
599
|
+
_page_language_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_async_dependencies_result__[0];
|
|
600
|
+
/* harmony import */ var _page_language_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_page_language_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
601
|
+
// The part every format module shares (core/js/format.js says what the
|
|
602
|
+
// helpers are): the locale a call formats in, a Date from what a host gives,
|
|
603
|
+
// and the Intl formatters, kept on a global every copy of these modules shares
|
|
604
|
+
// (bundles each carry their own module copy; page-language.js says why).
|
|
605
|
+
//
|
|
606
|
+
// No top-level side effects, here or in format-number.js, format-date.js,
|
|
607
|
+
// format-relative.js and format-file-size.js (ui-chart, 2026-11-05): a bundle
|
|
608
|
+
// that imports one function carries that function and what it calls, nothing
|
|
609
|
+
// else. The global is made on the first format, not on load, and SF.format is
|
|
610
|
+
// published by core's entry (index.js, publishFormat in format.js).
|
|
611
|
+
|
|
612
|
+
/** The locale a call formats in: the one it names, else its node's page language. */
|
|
613
|
+
|
|
614
|
+
function formatLocale({
|
|
615
|
+
locale,
|
|
616
|
+
node
|
|
617
|
+
} = {}) {
|
|
618
|
+
return String(locale || '').trim() || (0,_page_language_js__WEBPACK_IMPORTED_MODULE_0__.pageLocale)(node);
|
|
619
|
+
}
|
|
620
|
+
/** A Date from a Date, a time in milliseconds or a date string; null when it is none. */
|
|
621
|
+
|
|
622
|
+
function toDate(value) {
|
|
623
|
+
if (value === null || value === undefined || value === '') return null;
|
|
624
|
+
const date = value instanceof Date ? new Date(value.getTime()) : new Date(typeof value === 'string' && /^\d+$/u.test(value) ? Number(value) : value);
|
|
625
|
+
return Number.isNaN(date.getTime()) ? null : date;
|
|
626
|
+
} // The formatters every copy shares, made on the first call.
|
|
627
|
+
|
|
628
|
+
function formatterCache() {
|
|
629
|
+
const root = typeof globalThis !== 'undefined' ? globalThis : {};
|
|
630
|
+
if (!root.__sfFormat) root.__sfFormat = {
|
|
631
|
+
formatters: new Map()
|
|
632
|
+
};
|
|
633
|
+
return root.__sfFormat.formatters;
|
|
634
|
+
} // One formatter per kind, locale and options. An unknown locale falls back to
|
|
635
|
+
// the browser's, and options the platform refuses (an unknown unit or
|
|
636
|
+
// currency) to a plain number, so a typo in a page never throws at a reader.
|
|
637
|
+
|
|
638
|
+
|
|
639
|
+
function intlFormatter(kind, locale, options) {
|
|
640
|
+
const key = `${kind}|${locale}|${JSON.stringify(options)}`;
|
|
641
|
+
const cache = formatterCache();
|
|
642
|
+
if (cache.has(key)) return cache.get(key);
|
|
643
|
+
const Make = Intl[kind];
|
|
644
|
+
let made;
|
|
645
|
+
|
|
646
|
+
try {
|
|
647
|
+
made = new Make(locale || undefined, options);
|
|
648
|
+
} catch {
|
|
649
|
+
try {
|
|
650
|
+
made = new Make(undefined, options);
|
|
651
|
+
} catch {
|
|
652
|
+
made = new Make(locale || undefined, kind === 'NumberFormat' ? {
|
|
653
|
+
maximumFractionDigits: 2
|
|
654
|
+
} : {});
|
|
655
|
+
}
|
|
656
|
+
} // A page that formats in many locales does not grow the cache for ever.
|
|
657
|
+
|
|
658
|
+
|
|
659
|
+
if (cache.size >= 256) cache.delete(cache.keys().next().value);
|
|
660
|
+
cache.set(key, made);
|
|
661
|
+
return made;
|
|
662
|
+
} // A date's year keeps the abbreviation that follows it (A4, group build 15):
|
|
663
|
+
// Russian, Ukrainian, Bulgarian, Belarusian, Kazakh, Lithuanian, Macedonian
|
|
664
|
+
// and Armenian write one after the year -- «19 нояб. 2026 г.», «2026 р.»,
|
|
665
|
+
// «2026 m.», «2026 թ.» -- and the platform joins it with an ordinary space, so
|
|
666
|
+
// a narrow cell or a wrapped line printed «2026» at the end of one line and
|
|
667
|
+
// «г.» alone at the start of the next. Only the space before an abbreviation
|
|
668
|
+
// (letters closed by a full stop: г., гг., m.) becomes a no-break space; a word
|
|
669
|
+
// such as English «at» or German «um», a comma, a slash or a time after the
|
|
670
|
+
// year is left as the platform writes it (DEV answer msg-e6758728).
|
|
671
|
+
|
|
672
|
+
/** A DateTimeFormat's text of a moment with the year's marker held to the year. */
|
|
673
|
+
|
|
674
|
+
function formatDateText(formatter, moment) {
|
|
675
|
+
if (typeof formatter?.formatToParts !== 'function') return formatter.format(moment); // A module-level regular expression is a statement a bundler keeps (core-format test): made here.
|
|
676
|
+
|
|
677
|
+
const gap = /^[\s\u00a0\u202f]+(?=\p{L}+\.)/u;
|
|
678
|
+
let text = '';
|
|
679
|
+
let afterYear = false;
|
|
680
|
+
|
|
681
|
+
for (const part of formatter.formatToParts(moment)) {
|
|
682
|
+
text += afterYear && part.type === 'literal' ? part.value.replace(gap, '\u00a0') : part.value;
|
|
683
|
+
afterYear = part.type === 'year';
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
return text;
|
|
687
|
+
}
|
|
688
|
+
__webpack_async_result__();
|
|
689
|
+
} catch(e) { __webpack_async_result__(e); } });
|
|
690
|
+
|
|
691
|
+
/***/ },
|
|
692
|
+
|
|
693
|
+
/***/ "c9ce0852ac73"
|
|
694
|
+
(module, __webpack_exports__, __webpack_require__) {
|
|
695
|
+
|
|
696
|
+
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
|
697
|
+
__webpack_require__.r(__webpack_exports__);
|
|
698
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
699
|
+
/* harmony export */ formatNumber: () => (/* binding */ formatNumber),
|
|
700
|
+
/* harmony export */ numberOptions: () => (/* binding */ numberOptions),
|
|
701
|
+
/* harmony export */ percentSign: () => (/* binding */ percentSign),
|
|
702
|
+
/* harmony export */ percentText: () => (/* binding */ percentText)
|
|
703
|
+
/* harmony export */ });
|
|
704
|
+
/* harmony import */ var _format_intl_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("15b4e93ff6ed");
|
|
705
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_format_intl_js__WEBPACK_IMPORTED_MODULE_0__]);
|
|
706
|
+
var __webpack_async_dependencies_result__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
|
707
|
+
_format_intl_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_async_dependencies_result__[0];
|
|
708
|
+
// Numbers in the page's language by a format word: formatNumber and
|
|
709
|
+
// numberOptions alone, with no top-level side effects (format-intl.js). The
|
|
710
|
+
// same functions as core/js/format.js and SF.format.number; a bundle that
|
|
711
|
+
// formats numbers only imports them from here.
|
|
712
|
+
|
|
713
|
+
/**
|
|
714
|
+
* The Intl options of a number format word (ui-chart's words, kept so a page
|
|
715
|
+
* writes a format as an attribute):
|
|
716
|
+
*
|
|
717
|
+
* number (default) 1 234,5 as many digits as `step` needs, at most 6; 2 without one
|
|
718
|
+
* integer 1 235
|
|
719
|
+
* decimal-<n> n digits after the point, always (0 to 20)
|
|
720
|
+
* share a share 0..1 as 12 % (0.125 is 12,5 %)
|
|
721
|
+
* percent the same share: the charts' word, kept
|
|
722
|
+
* unit-percent a value that already is the percent (12.5 is 12,5 %),
|
|
723
|
+
* as the property type `percent` stores it
|
|
724
|
+
* compact 1,2 тыс. / 1.2K
|
|
725
|
+
* currency-<CODE> 1 234,50 ₽ (an ISO 4217 code)
|
|
726
|
+
* unit-<unit> 45,3 ГБ (an Intl unit: gigabyte, megabit-per-second)
|
|
727
|
+
*
|
|
728
|
+
* Anything else reads as number. Words join with a space: a kind (currency-,
|
|
729
|
+
* unit-, percent) and a precision (integer, decimal-<n>, compact), so
|
|
730
|
+
* «currency-RUB integer» is 1 235 ₽, «currency-RUB decimal-2» 1 234,50 ₽ and
|
|
731
|
+
* «currency-RUB compact» 1,1 млн ₽. The precision wins whatever the order.
|
|
732
|
+
*/
|
|
733
|
+
|
|
734
|
+
function numberOptions(format = 'number', step = 0) {
|
|
735
|
+
const words = String(format || 'number').trim().split(/\s+/u).filter(Boolean);
|
|
736
|
+
|
|
737
|
+
if (words.length > 1) {
|
|
738
|
+
const PRECISION = /^(?:integer|compact|decimal-\d{1,2})$/u;
|
|
739
|
+
const kinds = words.filter(one => !PRECISION.test(one));
|
|
740
|
+
const precision = words.filter(one => PRECISION.test(one));
|
|
741
|
+
return [...kinds, ...precision].reduce((options, one) => ({ ...options,
|
|
742
|
+
...numberOptions(one, step)
|
|
743
|
+
}), {});
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
const word = words[0] ?? 'number';
|
|
747
|
+
if (word === 'integer') return {
|
|
748
|
+
minimumFractionDigits: 0,
|
|
749
|
+
maximumFractionDigits: 0
|
|
750
|
+
}; // Two meanings of «percent» met in the Framework (C294, MP-4): this word
|
|
751
|
+
// multiplies a share by 100, while the property type `percent` holds the
|
|
752
|
+
// percent itself. `share` says which one it is; `percent` stays its alias for
|
|
753
|
+
// the charts that write it, and `unit-percent` is the percent itself.
|
|
754
|
+
|
|
755
|
+
if (word === 'share' || word === 'percent') return {
|
|
756
|
+
style: 'percent',
|
|
757
|
+
maximumFractionDigits: 1
|
|
758
|
+
};
|
|
759
|
+
if (word === 'compact') return {
|
|
760
|
+
notation: 'compact',
|
|
761
|
+
maximumFractionDigits: 1
|
|
762
|
+
};
|
|
763
|
+
const decimal = /^decimal-(\d{1,2})$/u.exec(word);
|
|
764
|
+
|
|
765
|
+
if (decimal) {
|
|
766
|
+
const digits = Math.min(20, Number(decimal[1]));
|
|
767
|
+
return {
|
|
768
|
+
minimumFractionDigits: digits,
|
|
769
|
+
maximumFractionDigits: digits
|
|
770
|
+
};
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
const unit = /^unit-([a-z]+(?:-per-[a-z]+)?)$/u.exec(word);
|
|
774
|
+
if (unit) return {
|
|
775
|
+
style: 'unit',
|
|
776
|
+
unit: unit[1],
|
|
777
|
+
unitDisplay: 'short',
|
|
778
|
+
maximumFractionDigits: 1
|
|
779
|
+
};
|
|
780
|
+
const currency = /^currency-([A-Z]{3})$/u.exec(word);
|
|
781
|
+
if (currency) return {
|
|
782
|
+
style: 'currency',
|
|
783
|
+
currency: currency[1]
|
|
784
|
+
};
|
|
785
|
+
const digits = step > 0 && step < 1 ? Math.min(6, Math.ceil(-Math.log10(step) - 1e-9)) : 2;
|
|
786
|
+
return {
|
|
787
|
+
maximumFractionDigits: digits
|
|
788
|
+
};
|
|
789
|
+
}
|
|
790
|
+
/**
|
|
791
|
+
* A number in the locale by a format word (numberOptions). `grouping: false`
|
|
792
|
+
* writes it without thousands marks («2026»), `step` sets the digits of
|
|
793
|
+
* `number`, and a value that is not a finite number is `gap`, '' by default
|
|
794
|
+
* (a chart passes '—').
|
|
795
|
+
*/
|
|
796
|
+
|
|
797
|
+
function formatNumber(value, format = 'number', {
|
|
798
|
+
step = 0,
|
|
799
|
+
gap = '',
|
|
800
|
+
grouping = true,
|
|
801
|
+
...where
|
|
802
|
+
} = {}) {
|
|
803
|
+
const number = typeof value === 'string' && value.trim() !== '' ? Number(value) : value;
|
|
804
|
+
if (typeof number !== 'number' || !Number.isFinite(number)) return gap;
|
|
805
|
+
const options = numberOptions(format, step);
|
|
806
|
+
if (grouping === false) options.useGrouping = false;
|
|
807
|
+
const text = (0,_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.intlFormatter)('NumberFormat', (0,_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.formatLocale)(where), options).format(number);
|
|
808
|
+
return options.style === 'percent' || options.unit === 'percent' ? percentSign(text) : text;
|
|
809
|
+
}
|
|
810
|
+
/**
|
|
811
|
+
* One spelling of a per cent in every language (owner decision C203 (3), DEV
|
|
812
|
+
* msg-913fd9e4, 2026-11-15): the number, a no-break space (U+00A0) and «%» --
|
|
813
|
+
* «72 %», «12,5 %», and «72 %» in English too, where Intl writes «72%». A
|
|
814
|
+
* language that writes the sign first («%72») keeps its order.
|
|
815
|
+
*/
|
|
816
|
+
|
|
817
|
+
function percentSign(text) {
|
|
818
|
+
// A right-to-left language writes direction marks around the sign («12.5%»
|
|
819
|
+
// in Arabic); they go with the space it had, and the number keeps the mark
|
|
820
|
+
// it starts with (C294).
|
|
821
|
+
return String(text).replace(/[\s\u00a0\u202f\u200e\u200f\u061c]*%[\u200e\u200f\u061c]*$/u, '\u00a0%');
|
|
822
|
+
}
|
|
823
|
+
/**
|
|
824
|
+
* A value that already is a per cent (0..100, «72», «72.5») as the progress
|
|
825
|
+
* family shows and says it (owner decision C203 (3), IM-3): the number in the
|
|
826
|
+
* language of the node's part of the page, as many digits as it has (up to
|
|
827
|
+
* 2), a no-break space and «%» -- «72 %», «72,5 %».
|
|
828
|
+
*/
|
|
829
|
+
|
|
830
|
+
function percentText(value, node) {
|
|
831
|
+
const number = Number(value);
|
|
832
|
+
return percentSign(`${formatNumber(Number.isFinite(number) ? number : 0, 'number', {
|
|
833
|
+
node,
|
|
834
|
+
grouping: false
|
|
835
|
+
})}%`);
|
|
836
|
+
}
|
|
837
|
+
__webpack_async_result__();
|
|
838
|
+
} catch(e) { __webpack_async_result__(e); } });
|
|
839
|
+
|
|
840
|
+
/***/ },
|
|
841
|
+
|
|
842
|
+
/***/ "ee5c3aad2640"
|
|
843
|
+
(module, __webpack_exports__, __webpack_require__) {
|
|
844
|
+
|
|
845
|
+
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
|
846
|
+
__webpack_require__.r(__webpack_exports__);
|
|
847
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
848
|
+
/* harmony export */ formatRelativeDay: () => (/* binding */ formatRelativeDay),
|
|
849
|
+
/* harmony export */ formatRelativeTime: () => (/* binding */ formatRelativeTime),
|
|
850
|
+
/* harmony export */ intlSpeaks: () => (/* binding */ intlSpeaks)
|
|
851
|
+
/* harmony export */ });
|
|
852
|
+
/* harmony import */ var _format_intl_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("15b4e93ff6ed");
|
|
853
|
+
/* harmony import */ var _format_date_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("e577837dd70a");
|
|
854
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_format_intl_js__WEBPACK_IMPORTED_MODULE_0__, _format_date_js__WEBPACK_IMPORTED_MODULE_1__]);
|
|
855
|
+
([_format_intl_js__WEBPACK_IMPORTED_MODULE_0__, _format_date_js__WEBPACK_IMPORTED_MODULE_1__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
|
856
|
+
// Relative days and times in the page's language («вчера», «5 минут назад»),
|
|
857
|
+
// with no top-level side effects (format-intl.js). The same functions as
|
|
858
|
+
// core/js/format.js and SF.format.relativeDay / relativeTime.
|
|
859
|
+
|
|
860
|
+
// The first letter in capitals, by the locale's rule («вчера» → «Вчера»).
|
|
861
|
+
|
|
862
|
+
function capitalise(text, locale) {
|
|
863
|
+
const first = Array.from(text)[0] ?? '';
|
|
864
|
+
return first ? first.toLocaleUpperCase(locale || undefined) + text.slice(first.length) : text;
|
|
865
|
+
} // «сегодня», «вчера», «завтра» are the platform's words, except where the
|
|
866
|
+
// platform has no words of the language: a browser without a language's
|
|
867
|
+
// relative-time data says «yesterday» on a page in it. Then the words come
|
|
868
|
+
// from core's language files (core/js/lang/relative-day, registered as
|
|
869
|
+
// `sf-relative-day`), which a language pack or a product brings
|
|
870
|
+
// (SF.language.register('sf-relative-day', 'de', {today, yesterday,
|
|
871
|
+
// tomorrow})). ru and en are never looked up: every platform speaks them.
|
|
872
|
+
|
|
873
|
+
|
|
874
|
+
const DAY_KEYS = /* @__PURE__ */Object.freeze({
|
|
875
|
+
0: 'today',
|
|
876
|
+
[-1]: 'yesterday',
|
|
877
|
+
1: 'tomorrow'
|
|
878
|
+
});
|
|
879
|
+
/** Whether Intl's relative-time words are those of the locale's language, not a fallback's. */
|
|
880
|
+
|
|
881
|
+
function intlSpeaks(locale) {
|
|
882
|
+
const wanted = String(locale || '').trim().toLowerCase().replace('_', '-').split('-')[0];
|
|
883
|
+
if (!wanted) return true;
|
|
884
|
+
if (wanted === 'en') return true;
|
|
885
|
+
|
|
886
|
+
try {
|
|
887
|
+
const own = (0,_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.intlFormatter)('RelativeTimeFormat', locale, {
|
|
888
|
+
numeric: 'auto'
|
|
889
|
+
});
|
|
890
|
+
if (String(own.resolvedOptions().locale).toLowerCase().split('-')[0] !== wanted) return false; // A platform may answer the locale's name over English data (a trimmed
|
|
891
|
+
// ICU): its «yesterday» is then English's.
|
|
892
|
+
|
|
893
|
+
return own.format(-1, 'day') !== (0,_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.intlFormatter)('RelativeTimeFormat', 'en', {
|
|
894
|
+
numeric: 'auto'
|
|
895
|
+
}).format(-1, 'day');
|
|
896
|
+
} catch {
|
|
897
|
+
return false;
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
function packDayWord(offset, locale) {
|
|
902
|
+
if (intlSpeaks(locale)) return null;
|
|
903
|
+
const words = globalThis.__sfPageLanguage?.registered?.get?.('sf-relative-day');
|
|
904
|
+
const wanted = String(locale || '').trim().toLowerCase().replace('_', '-'); // A registry alias takes its pack's words (zh-cn: zh-hans, pt: pt-br).
|
|
905
|
+
|
|
906
|
+
const pack = code => globalThis.__sfPageLanguage?.packs?.aliases?.[code] ?? code;
|
|
907
|
+
|
|
908
|
+
const base = wanted.split('-')[0];
|
|
909
|
+
|
|
910
|
+
for (const code of [...new Set([wanted, pack(wanted), base, pack(base)])]) {
|
|
911
|
+
const word = words?.get?.(code)?.[DAY_KEYS[offset]];
|
|
912
|
+
if (typeof word === 'string' && word.trim()) return word;
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
return null;
|
|
916
|
+
}
|
|
917
|
+
/**
|
|
918
|
+
* The day a moment fell on, as a list says it: «сегодня», «вчера», «завтра»,
|
|
919
|
+
* the weekday within the last week («понедельник»), else the date («3 ноября»,
|
|
920
|
+
* with the year when it is not this one). The words are the platform's for
|
|
921
|
+
* the locale (Intl.RelativeTimeFormat, numeric auto); a component that ships
|
|
922
|
+
* its own passes them (`today`, `yesterday`, `tomorrow`) and they win.
|
|
923
|
+
* `weekday: false` goes from yesterday straight to the date; `capital: true`
|
|
924
|
+
* starts the word with a capital, as a heading or a divider does.
|
|
925
|
+
*
|
|
926
|
+
* `timeZone` counts the days and writes them on that zone's clock.
|
|
927
|
+
*
|
|
928
|
+
* The answer changes at the reader's midnight: msUntilNextDay (format-date.js)
|
|
929
|
+
* says when.
|
|
930
|
+
*/
|
|
931
|
+
|
|
932
|
+
|
|
933
|
+
function formatRelativeDay(value, {
|
|
934
|
+
now = new Date(),
|
|
935
|
+
today,
|
|
936
|
+
yesterday,
|
|
937
|
+
tomorrow,
|
|
938
|
+
weekday = true,
|
|
939
|
+
capital = false,
|
|
940
|
+
timeZone = '',
|
|
941
|
+
gap = '',
|
|
942
|
+
...where
|
|
943
|
+
} = {}) {
|
|
944
|
+
const moment = (0,_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.toDate)(value);
|
|
945
|
+
if (!moment) return gap;
|
|
946
|
+
const locale = (0,_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.formatLocale)(where);
|
|
947
|
+
const offset = (0,_format_date_js__WEBPACK_IMPORTED_MODULE_1__.calendarDayOffset)(moment, {
|
|
948
|
+
now,
|
|
949
|
+
timeZone
|
|
950
|
+
});
|
|
951
|
+
const zone = (0,_format_date_js__WEBPACK_IMPORTED_MODULE_1__.knownTimeZone)(timeZone) ? {
|
|
952
|
+
timeZone
|
|
953
|
+
} : {};
|
|
954
|
+
const own = {
|
|
955
|
+
0: today,
|
|
956
|
+
[-1]: yesterday,
|
|
957
|
+
1: tomorrow
|
|
958
|
+
}[offset];
|
|
959
|
+
let text;
|
|
960
|
+
|
|
961
|
+
if (own) {
|
|
962
|
+
text = String(own);
|
|
963
|
+
} else if (offset >= -1 && offset <= 1) {
|
|
964
|
+
text = packDayWord(offset, locale) ?? (0,_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.intlFormatter)('RelativeTimeFormat', locale, {
|
|
965
|
+
numeric: 'auto'
|
|
966
|
+
}).format(offset, 'day');
|
|
967
|
+
} else if (weekday && offset < -1 && offset > -7) {
|
|
968
|
+
text = (0,_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.intlFormatter)('DateTimeFormat', locale, {
|
|
969
|
+
weekday: 'long',
|
|
970
|
+
...zone
|
|
971
|
+
}).format(moment);
|
|
972
|
+
} else {
|
|
973
|
+
const year = moment.getFullYear() === (0,_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.toDate)(now).getFullYear() ? {} : {
|
|
974
|
+
year: 'numeric'
|
|
975
|
+
};
|
|
976
|
+
text = (0,_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.formatDateText)((0,_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.intlFormatter)('DateTimeFormat', locale, {
|
|
977
|
+
day: 'numeric',
|
|
978
|
+
month: 'long',
|
|
979
|
+
...year,
|
|
980
|
+
...zone
|
|
981
|
+
}), moment);
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
return capital ? capitalise(text, locale) : text;
|
|
985
|
+
} // The largest unit a span reaches is the one it is said in (mail-letters'
|
|
986
|
+
// steps, 2026-10): 90 seconds is «2 минуты назад», 40 days «в прошлом месяце».
|
|
987
|
+
|
|
988
|
+
const RELATIVE_STEPS = [['year', 31536000], ['month', 2592000], ['week', 604800], ['day', 86400], ['hour', 3600], ['minute', 60]];
|
|
989
|
+
/** «5 минут назад», «через 2 часа»: a moment from `now`, in the locale. */
|
|
990
|
+
|
|
991
|
+
function formatRelativeTime(value, {
|
|
992
|
+
now = new Date(),
|
|
993
|
+
gap = '',
|
|
994
|
+
...where
|
|
995
|
+
} = {}) {
|
|
996
|
+
const moment = (0,_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.toDate)(value);
|
|
997
|
+
const base = (0,_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.toDate)(now);
|
|
998
|
+
if (!moment || !base) return gap;
|
|
999
|
+
const seconds = Math.round((moment.getTime() - base.getTime()) / 1000);
|
|
1000
|
+
const format = (0,_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.intlFormatter)('RelativeTimeFormat', (0,_format_intl_js__WEBPACK_IMPORTED_MODULE_0__.formatLocale)(where), {
|
|
1001
|
+
numeric: 'auto'
|
|
1002
|
+
});
|
|
1003
|
+
|
|
1004
|
+
for (const [unit, size] of RELATIVE_STEPS) {
|
|
1005
|
+
if (Math.abs(seconds) >= size) return format.format(Math.round(seconds / size), unit);
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
return format.format(seconds, 'second');
|
|
1009
|
+
}
|
|
1010
|
+
__webpack_async_result__();
|
|
1011
|
+
} catch(e) { __webpack_async_result__(e); } });
|
|
1012
|
+
|
|
1013
|
+
/***/ },
|
|
1014
|
+
|
|
1015
|
+
/***/ "5b8371b87515"
|
|
1016
|
+
(module, __webpack_exports__, __webpack_require__) {
|
|
1017
|
+
|
|
1018
|
+
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
|
1019
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1020
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1021
|
+
/* harmony export */ FILE_SIZE_UNITS: () => (/* reexport safe */ _format_file_size_js__WEBPACK_IMPORTED_MODULE_4__.FILE_SIZE_UNITS),
|
|
1022
|
+
/* harmony export */ calendarDayOffset: () => (/* reexport safe */ _format_date_js__WEBPACK_IMPORTED_MODULE_1__.calendarDayOffset),
|
|
1023
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
|
|
1024
|
+
/* harmony export */ fileSizeUnits: () => (/* reexport safe */ _format_file_size_js__WEBPACK_IMPORTED_MODULE_4__.fileSizeUnits),
|
|
1025
|
+
/* harmony export */ formatDate: () => (/* reexport safe */ _format_date_js__WEBPACK_IMPORTED_MODULE_1__.formatDate),
|
|
1026
|
+
/* harmony export */ formatFileSize: () => (/* reexport safe */ _format_file_size_js__WEBPACK_IMPORTED_MODULE_4__.formatFileSize),
|
|
1027
|
+
/* harmony export */ formatLocale: () => (/* reexport safe */ _format_intl_js__WEBPACK_IMPORTED_MODULE_0__.formatLocale),
|
|
1028
|
+
/* harmony export */ formatNumber: () => (/* reexport safe */ _format_number_js__WEBPACK_IMPORTED_MODULE_3__.formatNumber),
|
|
1029
|
+
/* harmony export */ formatRelativeDay: () => (/* reexport safe */ _format_relative_js__WEBPACK_IMPORTED_MODULE_2__.formatRelativeDay),
|
|
1030
|
+
/* harmony export */ formatRelativeTime: () => (/* reexport safe */ _format_relative_js__WEBPACK_IMPORTED_MODULE_2__.formatRelativeTime),
|
|
1031
|
+
/* harmony export */ msUntilNextDay: () => (/* reexport safe */ _format_date_js__WEBPACK_IMPORTED_MODULE_1__.msUntilNextDay),
|
|
1032
|
+
/* harmony export */ numberOptions: () => (/* reexport safe */ _format_number_js__WEBPACK_IMPORTED_MODULE_3__.numberOptions),
|
|
1033
|
+
/* harmony export */ publishFormat: () => (/* binding */ publishFormat),
|
|
1034
|
+
/* harmony export */ toDate: () => (/* reexport safe */ _format_intl_js__WEBPACK_IMPORTED_MODULE_0__.toDate)
|
|
1035
|
+
/* harmony export */ });
|
|
1036
|
+
/* harmony import */ var _format_intl_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("15b4e93ff6ed");
|
|
1037
|
+
/* harmony import */ var _format_date_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("e577837dd70a");
|
|
1038
|
+
/* harmony import */ var _format_relative_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("ee5c3aad2640");
|
|
1039
|
+
/* harmony import */ var _format_number_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("c9ce0852ac73");
|
|
1040
|
+
/* harmony import */ var _format_file_size_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("c016c43b1452");
|
|
1041
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_format_intl_js__WEBPACK_IMPORTED_MODULE_0__, _format_date_js__WEBPACK_IMPORTED_MODULE_1__, _format_relative_js__WEBPACK_IMPORTED_MODULE_2__, _format_number_js__WEBPACK_IMPORTED_MODULE_3__, _format_file_size_js__WEBPACK_IMPORTED_MODULE_4__]);
|
|
1042
|
+
([_format_intl_js__WEBPACK_IMPORTED_MODULE_0__, _format_date_js__WEBPACK_IMPORTED_MODULE_1__, _format_relative_js__WEBPACK_IMPORTED_MODULE_2__, _format_number_js__WEBPACK_IMPORTED_MODULE_3__, _format_file_size_js__WEBPACK_IMPORTED_MODULE_4__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
|
1043
|
+
// Dates, days, numbers and file sizes as people read them, in the page's
|
|
1044
|
+
// language (reuse audit 2026-11-02, finding 7). About fourteen components
|
|
1045
|
+
// wrote these themselves -- three relative-day rules (thread-list, chat-window
|
|
1046
|
+
// with its own midnight refresh, mail-letters), file sizes in four places,
|
|
1047
|
+
// numbers in the chart and the quantity -- and they disagreed: «Вчера» in one
|
|
1048
|
+
// list, «вчера» in the next, «1.4MB» beside «1,4 МБ». One rule now, through
|
|
1049
|
+
// Intl only; the most complete copy was ui-chart's chart-core/format.js, whose
|
|
1050
|
+
// number words are kept as they were.
|
|
1051
|
+
//
|
|
1052
|
+
// The locale is the page's (page-language.js pageLocale): an explicit
|
|
1053
|
+
// `locale`, else the language of `node` -- the nearest [lang] above it, the
|
|
1054
|
+
// page's choice, <html lang>, English. Never a fixed ru-RU.
|
|
1055
|
+
//
|
|
1056
|
+
// This module gathers the helpers and the SF.format object; the helpers live
|
|
1057
|
+
// in modules of their own with no top-level side effects (core.runtime 1.28.0;
|
|
1058
|
+
// ui-chart, 2026-11-05), and a bundle imports what it calls from those:
|
|
1059
|
+
//
|
|
1060
|
+
// format-number.js formatNumber, numberOptions
|
|
1061
|
+
// format-date.js formatDate, calendarDayOffset, msUntilNextDay, toDate
|
|
1062
|
+
// format-relative.js formatRelativeDay, formatRelativeTime
|
|
1063
|
+
// format-file-size.js formatFileSize, fileSizeUnits, FILE_SIZE_UNITS
|
|
1064
|
+
// format-intl.js formatLocale, toDate (and the shared Intl formatters)
|
|
1065
|
+
//
|
|
1066
|
+
// Until 1.28.0 this module published SF.format on load, from whichever bundle
|
|
1067
|
+
// ran it first; that kept every helper in every bundle that imported one (each
|
|
1068
|
+
// chart bundle grew by 1.3-1.4 KB gzip). Core's entry publishes it now
|
|
1069
|
+
// (index.js calls publishFormat), and importing this module changes nothing on
|
|
1070
|
+
// the page. Its exports are as they were.
|
|
1071
|
+
|
|
1072
|
+
|
|
1073
|
+
|
|
1074
|
+
|
|
1075
|
+
|
|
1076
|
+
|
|
1077
|
+
const Format = /* @__PURE__ */Object.freeze({
|
|
1078
|
+
locale: _format_intl_js__WEBPACK_IMPORTED_MODULE_0__.formatLocale,
|
|
1079
|
+
date: _format_date_js__WEBPACK_IMPORTED_MODULE_1__.formatDate,
|
|
1080
|
+
relativeDay: _format_relative_js__WEBPACK_IMPORTED_MODULE_2__.formatRelativeDay,
|
|
1081
|
+
relativeTime: _format_relative_js__WEBPACK_IMPORTED_MODULE_2__.formatRelativeTime,
|
|
1082
|
+
dayOffset: _format_date_js__WEBPACK_IMPORTED_MODULE_1__.calendarDayOffset,
|
|
1083
|
+
msUntilNextDay: _format_date_js__WEBPACK_IMPORTED_MODULE_1__.msUntilNextDay,
|
|
1084
|
+
number: _format_number_js__WEBPACK_IMPORTED_MODULE_3__.formatNumber,
|
|
1085
|
+
numberOptions: _format_number_js__WEBPACK_IMPORTED_MODULE_3__.numberOptions,
|
|
1086
|
+
fileSize: _format_file_size_js__WEBPACK_IMPORTED_MODULE_4__.formatFileSize
|
|
1087
|
+
});
|
|
1088
|
+
/**
|
|
1089
|
+
* Publishes SF.format on `root` (the page's global), unless something is there
|
|
1090
|
+
* already: core's entry calls it once; a component bundle never does.
|
|
1091
|
+
*/
|
|
1092
|
+
|
|
1093
|
+
function publishFormat(root = typeof globalThis !== 'undefined' ? globalThis : undefined) {
|
|
1094
|
+
if (!root) return undefined;
|
|
1095
|
+
root.SF = root.SF || {};
|
|
1096
|
+
if (!root.SF.format) root.SF.format = Format;
|
|
1097
|
+
return root.SF.format;
|
|
1098
|
+
}
|
|
1099
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Format);
|
|
1100
|
+
__webpack_async_result__();
|
|
1101
|
+
} catch(e) { __webpack_async_result__(e); } });
|
|
1102
|
+
|
|
1103
|
+
/***/ },
|
|
1104
|
+
|
|
1105
|
+
/***/ "011bf3a66d3b"
|
|
1106
|
+
(module, __webpack_exports__, __webpack_require__) {
|
|
1107
|
+
|
|
1108
|
+
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
|
1109
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1110
|
+
/* harmony import */ var _core_js_smart_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("deb1a4d61565");
|
|
1111
|
+
/* harmony import */ var _core_js_element_manifest__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("5b7d7695b41b");
|
|
1112
|
+
/* harmony import */ var _core_js_page_language__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("43090d1c8307");
|
|
1113
|
+
/* harmony import */ var _core_js_format_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("5b8371b87515");
|
|
1114
|
+
/* harmony import */ var _js_templates_default_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("aa25fa09e943");
|
|
1115
|
+
/* harmony import */ var _component_json__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("985dd3be91cb");
|
|
1116
|
+
/* harmony import */ var _lang_en_json__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("818c1580d0f8");
|
|
1117
|
+
/* harmony import */ var _lang_ru_json__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("f230006d7c67");
|
|
1118
|
+
/* harmony import */ var _component_kbd_js_shortcut__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("151a293c8c90");
|
|
1119
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_core_js_smart_base__WEBPACK_IMPORTED_MODULE_0__, _core_js_element_manifest__WEBPACK_IMPORTED_MODULE_1__, _core_js_page_language__WEBPACK_IMPORTED_MODULE_2__, _core_js_format_js__WEBPACK_IMPORTED_MODULE_3__, _js_templates_default_js__WEBPACK_IMPORTED_MODULE_4__]);
|
|
1120
|
+
([_core_js_smart_base__WEBPACK_IMPORTED_MODULE_0__, _core_js_element_manifest__WEBPACK_IMPORTED_MODULE_1__, _core_js_page_language__WEBPACK_IMPORTED_MODULE_2__, _core_js_format_js__WEBPACK_IMPORTED_MODULE_3__, _js_templates_default_js__WEBPACK_IMPORTED_MODULE_4__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
|
1121
|
+
/* harmony import */ var _core_js_smart_base__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_core_js_smart_base__WEBPACK_IMPORTED_MODULE_0__);
|
|
1122
|
+
/* harmony import */ var _core_js_element_manifest__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_core_js_element_manifest__WEBPACK_IMPORTED_MODULE_1__);
|
|
1123
|
+
/* harmony import */ var _core_js_page_language__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_core_js_page_language__WEBPACK_IMPORTED_MODULE_2__);
|
|
1124
|
+
// sf-mail-letters: the letters of SIMAI Email Editor -- every letter a person
|
|
1125
|
+
// has, with a search by name, an order, and what each row offers: «Открыть»
|
|
1126
|
+
// and, under ⋯, a copy, a rename and a delete. The element holds no letter and
|
|
1127
|
+
// stores nothing: the host passes `letters` and hears what the person chose.
|
|
1128
|
+
//
|
|
1129
|
+
// It came from simai/ui-mail (package/src/smart/mail-letters, 0.1.0, ui-mail
|
|
1130
|
+
// 750be03), the letters page the editor draws in src/ui/app.ts (drawLibrary)
|
|
1131
|
+
// as an element; by the owner's decision D31 (2026-10-29) a product keeps no
|
|
1132
|
+
// component set of its own, so it lives here, under its own name.
|
|
1133
|
+
//
|
|
1134
|
+
// A row says when the letter changed in words -- «5 минут назад» -- from the
|
|
1135
|
+
// `at` of the letter and the page's language, through Intl.RelativeTimeFormat,
|
|
1136
|
+
// and how many blocks it has through Intl.PluralRules (the word blocks-text of
|
|
1137
|
+
// lang/<locale>.json, one form per plural category): «1 блок», «4 блока»,
|
|
1138
|
+
// «7 блоков». The host passes the moment and the count, not the sentence: the
|
|
1139
|
+
// same letter reads right in RU and in EN without the host knowing either.
|
|
1140
|
+
//
|
|
1141
|
+
// From its component.json (standard simai.smart-component 1.4 §3, §4, §8,
|
|
1142
|
+
// §11): the settings are attributes and properties made by
|
|
1143
|
+
// core/js/element-manifest.js, its words are lang/<locale>.json, the actions
|
|
1144
|
+
// answer outcomes.
|
|
1145
|
+
|
|
1146
|
+
|
|
1147
|
+
|
|
1148
|
+
|
|
1149
|
+
|
|
1150
|
+
|
|
1151
|
+
|
|
1152
|
+
|
|
1153
|
+
// A row's context menu (decision C164 (1)(2), defect TL-2): a right click on
|
|
1154
|
+
// the row, the context-menu key and Shift+F10 open the row's ⋯ menu, with the
|
|
1155
|
+
// same list. A right click opens it at the pointer through sf-menu-context's
|
|
1156
|
+
// point anchor (1.18.0: a fixed box of no size, removed when the menu closes).
|
|
1157
|
+
// The core's one SF.menu.open (C184) is not in the pair this is built over;
|
|
1158
|
+
// when it is, openMenu() opens through it and these two helpers go.
|
|
1159
|
+
|
|
1160
|
+
const isMenuKey = event => event?.key === "ContextMenu" || event?.shiftKey === true && event?.key === "F10";
|
|
1161
|
+
|
|
1162
|
+
function pointAnchor(event) {
|
|
1163
|
+
const point = document.createElement("span");
|
|
1164
|
+
point.style.cssText = `position: fixed; left: ${event.clientX}px; top: ${event.clientY}px`;
|
|
1165
|
+
document.body.append(point);
|
|
1166
|
+
return point;
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
const ORDERS = ["changed", "title"];
|
|
1170
|
+
const CHOICES = ["open", "copy", "rename", "delete", "create"];
|
|
1171
|
+
|
|
1172
|
+
const applied = () => ({
|
|
1173
|
+
outcome: "applied"
|
|
1174
|
+
});
|
|
1175
|
+
|
|
1176
|
+
const refused = reason => ({
|
|
1177
|
+
outcome: "refused",
|
|
1178
|
+
reason
|
|
1179
|
+
});
|
|
1180
|
+
|
|
1181
|
+
const MailLettersElement = (0,_core_js_element_manifest__WEBPACK_IMPORTED_MODULE_1__.elementFromManifest)(_component_json__WEBPACK_IMPORTED_MODULE_5__, {
|
|
1182
|
+
base: (_core_js_smart_base__WEBPACK_IMPORTED_MODULE_0___default()),
|
|
1183
|
+
lang: {
|
|
1184
|
+
en: _lang_en_json__WEBPACK_IMPORTED_MODULE_6__,
|
|
1185
|
+
ru: _lang_ru_json__WEBPACK_IMPORTED_MODULE_7__
|
|
1186
|
+
},
|
|
1187
|
+
source: "ru",
|
|
1188
|
+
actions: {
|
|
1189
|
+
search({
|
|
1190
|
+
query
|
|
1191
|
+
} = {}) {
|
|
1192
|
+
this.query = String(query ?? "");
|
|
1193
|
+
return applied();
|
|
1194
|
+
},
|
|
1195
|
+
|
|
1196
|
+
sort({
|
|
1197
|
+
order
|
|
1198
|
+
} = {}) {
|
|
1199
|
+
if (!ORDERS.includes(order)) return refused("unknown");
|
|
1200
|
+
this.order = order;
|
|
1201
|
+
return applied();
|
|
1202
|
+
},
|
|
1203
|
+
|
|
1204
|
+
choose({
|
|
1205
|
+
action,
|
|
1206
|
+
id
|
|
1207
|
+
} = {}) {
|
|
1208
|
+
return this.chooseFor(action, id);
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
}
|
|
1212
|
+
});
|
|
1213
|
+
|
|
1214
|
+
class SfMailLetters extends MailLettersElement {
|
|
1215
|
+
static get props() {
|
|
1216
|
+
return { ...super.props,
|
|
1217
|
+
templateName: {
|
|
1218
|
+
attribute: "template",
|
|
1219
|
+
default: "default"
|
|
1220
|
+
}
|
|
1221
|
+
};
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
constructor() {
|
|
1225
|
+
super(); // A list set as a property before the element was defined is an own
|
|
1226
|
+
// property that would hide the accessor; it is taken through it.
|
|
1227
|
+
|
|
1228
|
+
if (Object.prototype.hasOwnProperty.call(this, "letters")) {
|
|
1229
|
+
const early = this.letters;
|
|
1230
|
+
delete this.letters;
|
|
1231
|
+
this.letters = early;
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
this.menuFor = "";
|
|
1235
|
+
} // [{id, title, at, blocks}]: one row per letter. `at` is a moment (an ISO
|
|
1236
|
+
// string or anything Date reads); the row words it in the page's language.
|
|
1237
|
+
|
|
1238
|
+
|
|
1239
|
+
letterList() {
|
|
1240
|
+
return Array.isArray(this.letters) ? this.letters.filter(letter => letter && typeof letter.id === "string" && letter.id) : [];
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
locale() {
|
|
1244
|
+
return (0,_core_js_page_language__WEBPACK_IMPORTED_MODULE_2__.pageLocale)(this) || "ru";
|
|
1245
|
+
}
|
|
1246
|
+
/**
|
|
1247
|
+
* «7 блоков», «4 блока», «1 блок»: the count in the page's language, the
|
|
1248
|
+
* form picked by Intl.PluralRules. An element that wrote one form for every
|
|
1249
|
+
* number said «4 блоков», which is wrong; the probe holds all three forms.
|
|
1250
|
+
*/
|
|
1251
|
+
|
|
1252
|
+
|
|
1253
|
+
blocksText(count) {
|
|
1254
|
+
if (count === undefined || count === null || count === "" || Number.isNaN(Number(count))) return "";
|
|
1255
|
+
return this.sfWord("blocks-text", {
|
|
1256
|
+
count: Number(count)
|
|
1257
|
+
});
|
|
1258
|
+
}
|
|
1259
|
+
/** «5 минут назад»: the moment in the page's language, or '' when there is none. */
|
|
1260
|
+
// Core's formatRelativeTime: the same steps (the largest unit the moment
|
|
1261
|
+
// fills), numeric "auto", and '' for no moment.
|
|
1262
|
+
|
|
1263
|
+
|
|
1264
|
+
when(at) {
|
|
1265
|
+
return (0,_core_js_format_js__WEBPACK_IMPORTED_MODULE_3__.formatRelativeTime)(at, {
|
|
1266
|
+
locale: this.locale()
|
|
1267
|
+
});
|
|
1268
|
+
}
|
|
1269
|
+
/** The rows the search leaves, in the chosen order. */
|
|
1270
|
+
|
|
1271
|
+
|
|
1272
|
+
shownLetters() {
|
|
1273
|
+
const query = String(this.query ?? "").trim().toLowerCase();
|
|
1274
|
+
const locale = this.locale();
|
|
1275
|
+
const byTitle = this.order === "title";
|
|
1276
|
+
return this.letterList().filter(letter => !query || String(letter.title ?? "").toLowerCase().includes(query)).sort((one, two) => byTitle ? String(one.title ?? "").localeCompare(String(two.title ?? ""), locale) : String(two.at ?? "").localeCompare(String(one.at ?? "")));
|
|
1277
|
+
}
|
|
1278
|
+
/** Say what the person chose: open, copy, rename, delete, or a new letter. */
|
|
1279
|
+
|
|
1280
|
+
|
|
1281
|
+
chooseFor(action, id) {
|
|
1282
|
+
if (!CHOICES.includes(action)) return refused("unknown");
|
|
1283
|
+
|
|
1284
|
+
if (action === "create") {
|
|
1285
|
+
this.sfEmit("create", {});
|
|
1286
|
+
return applied();
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
const letter = this.letterList().find(one => one.id === String(id ?? ""));
|
|
1290
|
+
if (!letter) return refused("unknown"); // The letter open in the editor is not offered to be opened again.
|
|
1291
|
+
|
|
1292
|
+
if (action === "open" && letter.id === String(this.current ?? "")) return refused("current");
|
|
1293
|
+
this.sfEmit(action, action === "delete" ? {
|
|
1294
|
+
ids: [letter.id],
|
|
1295
|
+
id: letter.id
|
|
1296
|
+
} : {
|
|
1297
|
+
id: letter.id
|
|
1298
|
+
});
|
|
1299
|
+
return applied();
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
onOrderChange(event) {
|
|
1303
|
+
const value = event?.detail?.value ?? event?.target?.value; // A change that bubbles from inside the dropdown (its own field) is
|
|
1304
|
+
// not an order.
|
|
1305
|
+
|
|
1306
|
+
if (ORDERS.includes(value) && value !== this.order) this.sort({
|
|
1307
|
+
order: value
|
|
1308
|
+
});
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
menuEntries() {
|
|
1312
|
+
return [{
|
|
1313
|
+
id: "copy",
|
|
1314
|
+
text: this.sfWord("copy-text"),
|
|
1315
|
+
icon: "file_copy"
|
|
1316
|
+
}, {
|
|
1317
|
+
id: "rename",
|
|
1318
|
+
text: this.sfWord("rename-text"),
|
|
1319
|
+
icon: "edit"
|
|
1320
|
+
}, {
|
|
1321
|
+
id: "delete",
|
|
1322
|
+
text: this.sfWord("delete-text"),
|
|
1323
|
+
icon: "delete",
|
|
1324
|
+
danger: true
|
|
1325
|
+
}];
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1328
|
+
get menu() {
|
|
1329
|
+
return this.querySelector(".sf-mail-letters-menu");
|
|
1330
|
+
}
|
|
1331
|
+
/** The ⋯ of a row: one menu, filled for the row it was opened from. */
|
|
1332
|
+
|
|
1333
|
+
|
|
1334
|
+
openMenu(id, anchor) {
|
|
1335
|
+
const menu = this.menu;
|
|
1336
|
+
if (!menu) return refused("unavailable");
|
|
1337
|
+
this.menuFor = String(id);
|
|
1338
|
+
const native = anchor?.querySelector?.("button") ?? anchor; // The Loader brings sf-menu-context when the page is ready (the rule
|
|
1339
|
+
// fetches it lazily); a press before that asks the Loader for it now
|
|
1340
|
+
// (SF.Loader.ensure, defect TL-7) and waits for it.
|
|
1341
|
+
|
|
1342
|
+
Promise.resolve(globalThis.SF?.Loader?.ensure?.(["sf-menu-context"])).catch(() => null).then(() => customElements.whenDefined("sf-menu-context")).then(() => {
|
|
1343
|
+
menu.entries = this.menuEntries();
|
|
1344
|
+
menu.toggleFor(native);
|
|
1345
|
+
});
|
|
1346
|
+
return applied();
|
|
1347
|
+
}
|
|
1348
|
+
/** A right click on a row opens its ⋯ menu at the pointer (C164). */
|
|
1349
|
+
|
|
1350
|
+
|
|
1351
|
+
onRowContextMenu(id, event) {
|
|
1352
|
+
if (event.shiftKey || (0,_component_kbd_js_shortcut__WEBPACK_IMPORTED_MODULE_8__.isEditableTarget)(event.target)) return;
|
|
1353
|
+
const menu = this.menu;
|
|
1354
|
+
if (!menu) return;
|
|
1355
|
+
event.preventDefault();
|
|
1356
|
+
const point = pointAnchor(event);
|
|
1357
|
+
menu.addEventListener("sf-menu-context-closed", () => point.remove(), {
|
|
1358
|
+
once: true
|
|
1359
|
+
});
|
|
1360
|
+
this.openMenu(id, point);
|
|
1361
|
+
}
|
|
1362
|
+
/** The context-menu key or Shift+F10 in a row opens its ⋯ menu at the ⋯ (C164). */
|
|
1363
|
+
|
|
1364
|
+
|
|
1365
|
+
onRowKeydown(id, event) {
|
|
1366
|
+
if (!isMenuKey(event) || (0,_component_kbd_js_shortcut__WEBPACK_IMPORTED_MODULE_8__.isEditableTarget)(event.target)) return;
|
|
1367
|
+
const more = event.currentTarget.querySelector("[data-action=\"more\"]");
|
|
1368
|
+
if (!more) return;
|
|
1369
|
+
event.preventDefault();
|
|
1370
|
+
event.stopPropagation();
|
|
1371
|
+
this.openMenu(id, more);
|
|
1372
|
+
} // The menu answers for the row it was opened from, whatever is redrawn
|
|
1373
|
+
// meanwhile: the id is remembered, not read back out of the markup.
|
|
1374
|
+
|
|
1375
|
+
|
|
1376
|
+
onMenuSelect(detail = {}) {
|
|
1377
|
+
const action = String(detail.id ?? detail.entry?.id ?? "");
|
|
1378
|
+
if (!action || !this.menuFor) return;
|
|
1379
|
+
this.chooseFor(action, this.menuFor);
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
templateContext() {
|
|
1383
|
+
const all = this.letterList();
|
|
1384
|
+
const current = String(this.current ?? "");
|
|
1385
|
+
const letters = this.shownLetters().map(letter => ({ ...letter,
|
|
1386
|
+
when: this.when(letter.at),
|
|
1387
|
+
blocksText: this.blocksText(letter.blocks),
|
|
1388
|
+
isCurrent: letter.id === current,
|
|
1389
|
+
actionsLabel: this.sfWord("actions-label", {
|
|
1390
|
+
vars: {
|
|
1391
|
+
title: String(letter.title ?? "")
|
|
1392
|
+
}
|
|
1393
|
+
})
|
|
1394
|
+
}));
|
|
1395
|
+
const searched = letters.length === 0 && all.length > 0;
|
|
1396
|
+
return {
|
|
1397
|
+
component: this,
|
|
1398
|
+
query: String(this.query ?? ""),
|
|
1399
|
+
order: this.order,
|
|
1400
|
+
letters,
|
|
1401
|
+
// Nothing at all, or nothing for this search: an empty state says which.
|
|
1402
|
+
empty: letters.length === 0 ? searched ? "nothing-found" : "no-data" : null,
|
|
1403
|
+
searchLabel: this.sfWord("search-label"),
|
|
1404
|
+
orderLabel: this.sfWord("order-label"),
|
|
1405
|
+
orderOptions: [{
|
|
1406
|
+
value: "changed",
|
|
1407
|
+
text: this.sfWord("order-changed-text")
|
|
1408
|
+
}, {
|
|
1409
|
+
value: "title",
|
|
1410
|
+
text: this.sfWord("order-title-text")
|
|
1411
|
+
}],
|
|
1412
|
+
openLabel: this.sfWord("open-text"),
|
|
1413
|
+
createLabel: this.sfWord("create-text"),
|
|
1414
|
+
currentLabel: this.sfWord("current-text"),
|
|
1415
|
+
emptyTitle: this.sfWord(searched ? "nothing-found-heading" : "empty-heading"),
|
|
1416
|
+
emptyText: this.sfWord(searched ? "nothing-found-text" : "empty-text"),
|
|
1417
|
+
rootClass: this.getRootClass?.() ?? ""
|
|
1418
|
+
};
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
template() {
|
|
1422
|
+
return (0,_js_templates_default_js__WEBPACK_IMPORTED_MODULE_4__.renderMailLettersTemplate)(this.templateContext());
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
SfMailLetters.define("sf-mail-letters");
|
|
1428
|
+
__webpack_async_result__();
|
|
1429
|
+
} catch(e) { __webpack_async_result__(e); } });
|
|
1430
|
+
|
|
1431
|
+
/***/ },
|
|
1432
|
+
|
|
1433
|
+
/***/ "aa25fa09e943"
|
|
1434
|
+
(module, __webpack_exports__, __webpack_require__) {
|
|
1435
|
+
|
|
1436
|
+
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
|
1437
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1438
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1439
|
+
/* harmony export */ renderMailLettersTemplate: () => (/* binding */ renderMailLettersTemplate)
|
|
1440
|
+
/* harmony export */ });
|
|
1441
|
+
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("2a080a730149");
|
|
1442
|
+
/* harmony import */ var _default_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("410470deaf77");
|
|
1443
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([lit__WEBPACK_IMPORTED_MODULE_0__]);
|
|
1444
|
+
var __webpack_async_dependencies_result__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
|
1445
|
+
lit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_async_dependencies_result__[0];
|
|
1446
|
+
/* harmony import */ var lit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lit__WEBPACK_IMPORTED_MODULE_0__);
|
|
1447
|
+
|
|
1448
|
+
// A row: the name, when it changed and how many blocks, then «Открыть» and ⋯.
|
|
1449
|
+
// The letter open in the editor is marked and says so to a screen reader; it
|
|
1450
|
+
// is not offered to be opened again.
|
|
1451
|
+
|
|
1452
|
+
function renderRow(context, letter) {
|
|
1453
|
+
const summary = [letter.when, letter.blocksText].filter(Boolean).join(" · ");
|
|
1454
|
+
return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`
|
|
1455
|
+
<li class=${["sf-mail-letters-row", letter.isCurrent ? "is-current" : ""].filter(Boolean).join(" ")} data-letter=${letter.id}
|
|
1456
|
+
@contextmenu=${event => context.component.onRowContextMenu(letter.id, event)}
|
|
1457
|
+
@keydown=${event => context.component.onRowKeydown(letter.id, event)}>
|
|
1458
|
+
<span class="sf-mail-letters-words">
|
|
1459
|
+
<span class="sf-mail-letters-title">${letter.title}</span>
|
|
1460
|
+
<span class="sf-mail-letters-summary">${summary}${letter.isCurrent ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)` · <span class="sf-mail-letters-current">${context.currentLabel}</span>` : lit__WEBPACK_IMPORTED_MODULE_0__.nothing}</span>
|
|
1461
|
+
</span>
|
|
1462
|
+
<span class="sf-mail-letters-actions">
|
|
1463
|
+
${letter.isCurrent ? lit__WEBPACK_IMPORTED_MODULE_0__.nothing : (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<sf-button size="1/2" appearance="outline" text=${context.openLabel} data-action="open"
|
|
1464
|
+
@click=${() => context.component.choose({
|
|
1465
|
+
action: "open",
|
|
1466
|
+
id: letter.id
|
|
1467
|
+
})}></sf-button>`}
|
|
1468
|
+
<sf-button-icon size="1/2" appearance="ghost" scheme="on-surface-variant" icon="more_horiz" data-action="more"
|
|
1469
|
+
aria-label=${letter.actionsLabel}
|
|
1470
|
+
@click=${event => context.component.openMenu(letter.id, event.currentTarget)}></sf-button-icon>
|
|
1471
|
+
</span>
|
|
1472
|
+
</li>
|
|
1473
|
+
`;
|
|
1474
|
+
} // The page: the bar (search, order, «Новое письмо»), the rows, the empty state
|
|
1475
|
+
// that says which of the two it is (no letters at all, or none for this
|
|
1476
|
+
// search), and the one ⋯ menu, filled for the row it is opened from. The menu
|
|
1477
|
+
// is printed closed: the first paint is the bar and the rows (§5.4).
|
|
1478
|
+
|
|
1479
|
+
|
|
1480
|
+
function renderMailLettersTemplate(context) {
|
|
1481
|
+
return (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`
|
|
1482
|
+
<div class=${["sf-mail-letters", context.rootClass].filter(Boolean).join(" ")}>
|
|
1483
|
+
<div class="sf-mail-letters-bar">
|
|
1484
|
+
<sf-input class="sf-mail-letters-search" input-type="search" size="1/2" label=${context.searchLabel}
|
|
1485
|
+
value=${context.query}
|
|
1486
|
+
@input=${event => context.component.search({
|
|
1487
|
+
query: event.target?.value ?? event.detail?.value ?? ""
|
|
1488
|
+
})}></sf-input>
|
|
1489
|
+
<sf-dropdown class="sf-mail-letters-order" size="1/2" label=${context.orderLabel} value=${context.order}
|
|
1490
|
+
.options=${context.orderOptions}
|
|
1491
|
+
@change=${event => context.component.onOrderChange(event)}></sf-dropdown>
|
|
1492
|
+
<sf-button class="sf-mail-letters-new" size="1/2" icon-start="add" text=${context.createLabel} data-action="create"
|
|
1493
|
+
@click=${() => context.component.choose({
|
|
1494
|
+
action: "create"
|
|
1495
|
+
})}></sf-button>
|
|
1496
|
+
</div>
|
|
1497
|
+
${context.letters.length ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<ul class="sf-mail-letters-list">${context.letters.map(letter => renderRow(context, letter))}</ul>` : lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
1498
|
+
${context.empty ? (0,lit__WEBPACK_IMPORTED_MODULE_0__.html)`<sf-empty-state class="sf-mail-letters-empty" kind=${context.empty} size="1/2" heading-level="2"
|
|
1499
|
+
heading=${context.emptyTitle} text=${context.emptyText}></sf-empty-state>` : lit__WEBPACK_IMPORTED_MODULE_0__.nothing}
|
|
1500
|
+
<sf-menu-context class="sf-mail-letters-menu" popup
|
|
1501
|
+
@sf-menu-context-select=${event => {
|
|
1502
|
+
event.stopPropagation();
|
|
1503
|
+
context.component.onMenuSelect(event.detail);
|
|
1504
|
+
}}></sf-menu-context>
|
|
1505
|
+
</div>
|
|
1506
|
+
`;
|
|
1507
|
+
}
|
|
1508
|
+
__webpack_async_result__();
|
|
1509
|
+
} catch(e) { __webpack_async_result__(e); } });
|
|
1510
|
+
|
|
1511
|
+
/***/ },
|
|
1512
|
+
|
|
1513
|
+
/***/ "410470deaf77"
|
|
1514
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1515
|
+
|
|
1516
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1517
|
+
// extracted by mini-css-extract-plugin
|
|
1518
|
+
|
|
1519
|
+
|
|
1520
|
+
/***/ },
|
|
1521
|
+
|
|
1522
|
+
/***/ "5b7d7695b41b"
|
|
1523
|
+
(module) {
|
|
1524
|
+
|
|
1525
|
+
module.exports = (globalThis.SF && globalThis.SF.runtimeModule ? globalThis.SF.runtimeModule("element-manifest", 1) : new Promise((resolve, reject) => globalThis.addEventListener("sf-runtime-ready", () => globalThis.SF.runtimeModule("element-manifest", 1).then(resolve, reject), { once: true })));
|
|
1526
|
+
|
|
1527
|
+
/***/ },
|
|
1528
|
+
|
|
1529
|
+
/***/ "2a080a730149"
|
|
1530
|
+
(module) {
|
|
1531
|
+
|
|
1532
|
+
module.exports = (globalThis.SF && globalThis.SF.runtimeModule ? globalThis.SF.runtimeModule("lit", 1) : new Promise((resolve, reject) => globalThis.addEventListener("sf-runtime-ready", () => globalThis.SF.runtimeModule("lit", 1).then(resolve, reject), { once: true })));
|
|
1533
|
+
|
|
1534
|
+
/***/ },
|
|
1535
|
+
|
|
1536
|
+
/***/ "43090d1c8307"
|
|
1537
|
+
(module) {
|
|
1538
|
+
|
|
1539
|
+
module.exports = (globalThis.SF && globalThis.SF.runtimeModule ? globalThis.SF.runtimeModule("page-language", 1) : new Promise((resolve, reject) => globalThis.addEventListener("sf-runtime-ready", () => globalThis.SF.runtimeModule("page-language", 1).then(resolve, reject), { once: true })));
|
|
1540
|
+
|
|
1541
|
+
/***/ },
|
|
1542
|
+
|
|
1543
|
+
/***/ "deb1a4d61565"
|
|
1544
|
+
(module) {
|
|
1545
|
+
|
|
1546
|
+
module.exports = (globalThis.SF && globalThis.SF.runtimeModule ? globalThis.SF.runtimeModule("smart-base", 1) : new Promise((resolve, reject) => globalThis.addEventListener("sf-runtime-ready", () => globalThis.SF.runtimeModule("smart-base", 1).then(resolve, reject), { once: true })));
|
|
1547
|
+
|
|
1548
|
+
/***/ },
|
|
1549
|
+
|
|
1550
|
+
/***/ "4294700087dc"
|
|
1551
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
1552
|
+
|
|
1553
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1554
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1555
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
|
|
1556
|
+
/* harmony export */ files: () => (/* binding */ files)
|
|
1557
|
+
/* harmony export */ });
|
|
1558
|
+
/* harmony import */ var _en_json__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("3694b5e2bf39");
|
|
1559
|
+
// Written by scripts/build-language-packs.mjs from src/core/lang/built-in.json
|
|
1560
|
+
// (owner decision C282); do not edit. The words this bundle carries: the
|
|
1561
|
+
// built-in languages' (en); every other language comes from
|
|
1562
|
+
// a language file (core/lang/<code>.js or its parts).
|
|
1563
|
+
|
|
1564
|
+
|
|
1565
|
+
const files = { en: { runtime: _en_json__WEBPACK_IMPORTED_MODULE_0__.runtime } };
|
|
1566
|
+
|
|
1567
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ en: _en_json__WEBPACK_IMPORTED_MODULE_0__.runtime });
|
|
1568
|
+
|
|
1569
|
+
|
|
1570
|
+
/***/ },
|
|
1571
|
+
|
|
1572
|
+
/***/ "3694b5e2bf39"
|
|
1573
|
+
(module) {
|
|
1574
|
+
|
|
1575
|
+
module.exports = /*#__PURE__*/JSON.parse('{"runtime":{"b":"B","kb":"KB","mb":"MB","gb":"GB"}}');
|
|
1576
|
+
|
|
1577
|
+
/***/ },
|
|
1578
|
+
|
|
1579
|
+
/***/ "985dd3be91cb"
|
|
1580
|
+
(module) {
|
|
1581
|
+
|
|
1582
|
+
module.exports = /*#__PURE__*/JSON.parse('{"id":"smart.mail-letters","tag":"sf-mail-letters","version":"1.1.3","kind":"leaf","settings":{"letters":{"type":"list","default":[],"of":{"id":"id","title":"string","at":{"type":"date","optional":true},"blocks":{"type":"number","integer":true,"min":0,"optional":true}},"entries":{"key":"id","changes":"content"}},"query":{"type":"string","default":""},"order":{"type":"enum","values":["changed","title"],"default":"changed"},"current":{"type":"id","default":""}},"values":{},"events":{"open":{"carries":{"id":"id"}},"copy":{"carries":{"id":"id"},"own-verb":true},"rename":{"carries":{"id":"id"}},"delete":{"carries":{"ids":"list","id":"id"}},"create":{"carries":{}}},"actions":{"search":{"with":{"query":"string"}},"sort":{"with":{"order":{"type":"enum","values":["changed","title"]}}},"choose":{"with":{"action":{"type":"enum","values":["open","copy","rename","delete","create"]},"id":{"type":"id","optional":true}}}},"host-states":{},"css-variables":{}}');
|
|
1583
|
+
|
|
1584
|
+
/***/ },
|
|
1585
|
+
|
|
1586
|
+
/***/ "818c1580d0f8"
|
|
1587
|
+
(module) {
|
|
1588
|
+
|
|
1589
|
+
module.exports = /*#__PURE__*/JSON.parse('{"title":"Emails","runtime":{"actions-label":"Letter actions: {title}","blocks-text":{"one":"{n} block","other":"{n} blocks"},"copy-text":"Copy","create-text":"New email","current-text":"open now","delete-text":"Delete","empty-heading":"No emails yet","empty-text":"Create a new email or open a project from a file.","nothing-found-heading":"Nothing found","nothing-found-text":"No email has that name.","open-text":"Open","order-changed-text":"Changed first","order-label":"Order","order-title-text":"By name","rename-text":"Rename","search-label":"Search by name"},"events":{"copy":{"label":"Copy the email"}}}');
|
|
1590
|
+
|
|
1591
|
+
/***/ },
|
|
1592
|
+
|
|
1593
|
+
/***/ "f230006d7c67"
|
|
1594
|
+
(module) {
|
|
1595
|
+
|
|
1596
|
+
module.exports = /*#__PURE__*/JSON.parse('{"title":"Письма","runtime":{"actions-label":"Действия с письмом: {title}","blocks-text":{"one":"{n} блок","few":"{n} блока","many":"{n} блоков","other":"{n} блока"},"copy-text":"Копия","create-text":"Новое письмо","current-text":"открыто сейчас","delete-text":"Удалить","empty-heading":"Писем пока нет","empty-text":"Создайте новое письмо или откройте проект из файла.","nothing-found-heading":"Ничего не найдено","nothing-found-text":"Нет писем с таким названием.","open-text":"Открыть","order-changed-text":"Сначала изменённые","order-label":"Порядок","order-title-text":"По названию","rename-text":"Переименовать","search-label":"Поиск по названию"},"events":{"copy":{"label":"Сделать копию письма"}}}');
|
|
1597
|
+
|
|
1598
|
+
/***/ }
|
|
1599
|
+
|
|
1600
|
+
/******/ });
|
|
1601
|
+
/************************************************************************/
|
|
1602
|
+
/******/ // The module cache
|
|
1603
|
+
/******/ const __webpack_module_cache__ = {};
|
|
1604
|
+
/******/
|
|
1605
|
+
/******/ // The require function
|
|
1606
|
+
/******/ function __webpack_require__(moduleId) {
|
|
1607
|
+
/******/ // Check if module is in cache
|
|
1608
|
+
/******/ const cachedModule = __webpack_module_cache__[moduleId];
|
|
1609
|
+
/******/ if (cachedModule !== undefined) {
|
|
1610
|
+
/******/ return cachedModule.exports;
|
|
1611
|
+
/******/ }
|
|
1612
|
+
/******/ // Create a new module (and put it into the cache)
|
|
1613
|
+
/******/ const module = __webpack_module_cache__[moduleId] = {
|
|
1614
|
+
/******/ // no module.id needed
|
|
1615
|
+
/******/ // no module.loaded needed
|
|
1616
|
+
/******/ exports: {}
|
|
1617
|
+
/******/ };
|
|
1618
|
+
/******/
|
|
1619
|
+
/******/ // Execute the module function
|
|
1620
|
+
/******/ if (!(moduleId in __webpack_modules__)) {
|
|
1621
|
+
/******/ delete __webpack_module_cache__[moduleId];
|
|
1622
|
+
/******/ const e = new Error("Cannot find module '" + moduleId + "'");
|
|
1623
|
+
/******/ e.code = 'MODULE_NOT_FOUND';
|
|
1624
|
+
/******/ throw e;
|
|
1625
|
+
/******/ }
|
|
1626
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
1627
|
+
/******/
|
|
1628
|
+
/******/ // Return the exports of the module
|
|
1629
|
+
/******/ return module.exports;
|
|
1630
|
+
/******/ }
|
|
1631
|
+
/******/
|
|
1632
|
+
/************************************************************************/
|
|
1633
|
+
/******/ /* webpack/runtime/async module */
|
|
1634
|
+
/******/ (() => {
|
|
1635
|
+
/******/ const hasSymbol = typeof Symbol === "function";
|
|
1636
|
+
/******/ const webpackQueues = hasSymbol ? Symbol("webpack queues") : "__webpack_queues__";
|
|
1637
|
+
/******/ const webpackExports = hasSymbol ? Symbol("webpack exports") : "__webpack_exports__";
|
|
1638
|
+
/******/ const webpackError = hasSymbol ? Symbol("webpack error") : "__webpack_error__";
|
|
1639
|
+
/******/
|
|
1640
|
+
/******/ const resolveQueue = (queue) => {
|
|
1641
|
+
/******/ if(queue?.d < 1) {
|
|
1642
|
+
/******/ queue.d = 1;
|
|
1643
|
+
/******/ queue.forEach((fn) => (fn.r--));
|
|
1644
|
+
/******/ queue.forEach((fn) => (fn.r-- ? fn.r++ : fn()));
|
|
1645
|
+
/******/ }
|
|
1646
|
+
/******/ }
|
|
1647
|
+
/******/ const wrapDeps = (deps) => (deps.map((dep) => {
|
|
1648
|
+
/******/ if(dep !== null && typeof dep === "object") {
|
|
1649
|
+
/******/
|
|
1650
|
+
/******/ if(dep[webpackQueues]) return dep;
|
|
1651
|
+
/******/ if(dep.then) {
|
|
1652
|
+
/******/ const queue = [];
|
|
1653
|
+
/******/ queue.d = 0;
|
|
1654
|
+
/******/ dep.then((r) => {
|
|
1655
|
+
/******/ obj[webpackExports] = r;
|
|
1656
|
+
/******/ resolveQueue(queue);
|
|
1657
|
+
/******/ }, (e) => {
|
|
1658
|
+
/******/ obj[webpackError] = e;
|
|
1659
|
+
/******/ resolveQueue(queue);
|
|
1660
|
+
/******/ });
|
|
1661
|
+
/******/ const obj = {};
|
|
1662
|
+
/******/
|
|
1663
|
+
/******/ obj[webpackQueues] = (fn) => (fn(queue));
|
|
1664
|
+
/******/ return obj;
|
|
1665
|
+
/******/ }
|
|
1666
|
+
/******/ }
|
|
1667
|
+
/******/ const ret = {};
|
|
1668
|
+
/******/ ret[webpackQueues] = x => {};
|
|
1669
|
+
/******/ ret[webpackExports] = dep;
|
|
1670
|
+
/******/ return ret;
|
|
1671
|
+
/******/ }));
|
|
1672
|
+
/******/ __webpack_require__.a = (module, body, hasAwait) => {
|
|
1673
|
+
/******/ let queue;
|
|
1674
|
+
/******/ hasAwait && ((queue = []).d = -1);
|
|
1675
|
+
/******/ const depQueues = new Set();
|
|
1676
|
+
/******/ const exports = module.exports;
|
|
1677
|
+
/******/ let currentDeps;
|
|
1678
|
+
/******/ let outerResolve;
|
|
1679
|
+
/******/ let reject;
|
|
1680
|
+
/******/ const promise = new Promise((resolve, rej) => {
|
|
1681
|
+
/******/ reject = rej;
|
|
1682
|
+
/******/ outerResolve = resolve;
|
|
1683
|
+
/******/ });
|
|
1684
|
+
/******/ promise[webpackExports] = exports;
|
|
1685
|
+
/******/ promise[webpackQueues] = (fn) => (queue && fn(queue), depQueues.forEach(fn), promise["catch"](x => {}));
|
|
1686
|
+
/******/ module.exports = promise;
|
|
1687
|
+
/******/ const handle = (deps) => {
|
|
1688
|
+
/******/ currentDeps = wrapDeps(deps);
|
|
1689
|
+
/******/ let fn;
|
|
1690
|
+
/******/ const getResult = () => (currentDeps.map((d) => {
|
|
1691
|
+
/******/
|
|
1692
|
+
/******/ if(d[webpackError]) throw d[webpackError];
|
|
1693
|
+
/******/ return d[webpackExports];
|
|
1694
|
+
/******/ }))
|
|
1695
|
+
/******/ const promise = new Promise((resolve) => {
|
|
1696
|
+
/******/ fn = () => (resolve(getResult));
|
|
1697
|
+
/******/ fn.r = 0;
|
|
1698
|
+
/******/ const fnQueue = (q) => (q !== queue && !depQueues.has(q) && (depQueues.add(q), q && !q.d && (fn.r++, q.push(fn))));
|
|
1699
|
+
/******/ currentDeps.map((dep) => (dep[webpackQueues](fnQueue)));
|
|
1700
|
+
/******/ });
|
|
1701
|
+
/******/ return fn.r ? promise : getResult();
|
|
1702
|
+
/******/ }
|
|
1703
|
+
/******/ const done = (err) => ((err ? reject(promise[webpackError] = err) : outerResolve(exports)), resolveQueue(queue))
|
|
1704
|
+
/******/ body(handle, done);
|
|
1705
|
+
/******/ queue?.d < 0 && (queue.d = 0);
|
|
1706
|
+
/******/ };
|
|
1707
|
+
/******/ })();
|
|
1708
|
+
/******/
|
|
1709
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
1710
|
+
/******/ (() => {
|
|
1711
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
1712
|
+
/******/ __webpack_require__.n = (module) => {
|
|
1713
|
+
/******/ const getter = module && module.__esModule ?
|
|
1714
|
+
/******/ () => (module['default']) :
|
|
1715
|
+
/******/ () => (module);
|
|
1716
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
|
1717
|
+
/******/ return getter;
|
|
1718
|
+
/******/ };
|
|
1719
|
+
/******/ })();
|
|
1720
|
+
/******/
|
|
1721
|
+
/******/ /* webpack/runtime/define property getters */
|
|
1722
|
+
/******/ (() => {
|
|
1723
|
+
/******/ // define getter/value functions for harmony exports
|
|
1724
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
1725
|
+
/******/ if(Array.isArray(definition)) {
|
|
1726
|
+
/******/ var i = 0;
|
|
1727
|
+
/******/ while(i < definition.length) {
|
|
1728
|
+
/******/ var key = definition[i++];
|
|
1729
|
+
/******/ var binding = definition[i++];
|
|
1730
|
+
/******/ if(!__webpack_require__.o(exports, key)) {
|
|
1731
|
+
/******/ if(binding === 0) {
|
|
1732
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, value: definition[i++] });
|
|
1733
|
+
/******/ } else {
|
|
1734
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: binding });
|
|
1735
|
+
/******/ }
|
|
1736
|
+
/******/ } else if(binding === 0) { i++; }
|
|
1737
|
+
/******/ }
|
|
1738
|
+
/******/ } else {
|
|
1739
|
+
/******/ for(var key in definition) {
|
|
1740
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
1741
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
1742
|
+
/******/ }
|
|
1743
|
+
/******/ }
|
|
1744
|
+
/******/ }
|
|
1745
|
+
/******/ };
|
|
1746
|
+
/******/ })();
|
|
1747
|
+
/******/
|
|
1748
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
1749
|
+
/******/ (() => {
|
|
1750
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
1751
|
+
/******/ })();
|
|
1752
|
+
/******/
|
|
1753
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
1754
|
+
/******/ (() => {
|
|
1755
|
+
/******/ // define __esModule on exports
|
|
1756
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
1757
|
+
/******/ if(Symbol.toStringTag) {
|
|
1758
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
1759
|
+
/******/ }
|
|
1760
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
1761
|
+
/******/ };
|
|
1762
|
+
/******/ })();
|
|
1763
|
+
/******/
|
|
1764
|
+
/************************************************************************/
|
|
1765
|
+
/******/
|
|
1766
|
+
/******/ // startup
|
|
1767
|
+
/******/ // Load entry module and return exports
|
|
1768
|
+
/******/ // This entry module used 'module' so it can't be inlined
|
|
1769
|
+
/******/ let __webpack_exports__ = __webpack_require__("011bf3a66d3b");
|
|
1770
|
+
/******/
|
|
1771
|
+
/******/ })()
|
|
1772
|
+
;
|