react-blockkit 0.3.0 → 0.3.2
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/dist/Block.d.ts.map +1 -1
- package/dist/blocks/AdvancedBlocks.d.ts.map +1 -1
- package/dist/blocks/BasicBlocks.d.ts.map +1 -1
- package/dist/blocks/InteractiveBlocks.d.ts.map +1 -1
- package/dist/elements/Elements.d.ts +1 -1
- package/dist/elements/Elements.d.ts.map +1 -1
- package/dist/icons.d.ts +33 -0
- package/dist/icons.d.ts.map +1 -0
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +0 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1625 -1183
- package/dist/index.js.map +1 -1
- package/dist/styles.css +51 -3
- package/dist/styles.d.ts +1 -1
- package/dist/styles.d.ts.map +1 -1
- package/dist/text/Mrkdwn.d.ts.map +1 -1
- package/dist/text/RichText.d.ts.map +1 -1
- package/dist/text/date.d.ts.map +1 -1
- package/dist/types.d.ts +57 -57
- package/dist/types.d.ts.map +1 -1
- package/dist/validation.d.ts.map +1 -1
- package/docs/parity/icons-alert-info.png +0 -0
- package/docs/parity/icons-card-slack-icon.png +0 -0
- package/docs/parity/icons-context-actions.png +0 -0
- package/docs/parity/icons-data-table-header.png +0 -0
- package/docs/parity/icons-datepicker.png +0 -0
- package/docs/parity/icons-overflow.png +0 -0
- package/docs/parity/icons-pagination.png +0 -0
- package/docs/parity/icons-select-chevron.png +0 -0
- package/docs/slack-style-baseline.md +39 -0
- package/package.json +4 -3
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { createContext as e, createElement as t, useCallback as n, useContext as r, useEffect as i,
|
|
2
|
-
import { Fragment as
|
|
1
|
+
import { createContext as e, createElement as t, useCallback as n, useContext as r, useEffect as i, useId as a, useMemo as o, useRef as s, useState as c } from "react";
|
|
2
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
3
3
|
//#region ../../node_modules/.pnpm/@stylexjs+stylex@0.19.0/node_modules/@stylexjs/stylex/lib/es/stylex.mjs
|
|
4
|
-
var
|
|
5
|
-
function
|
|
6
|
-
if (
|
|
7
|
-
|
|
4
|
+
var f = {}, p;
|
|
5
|
+
function m() {
|
|
6
|
+
if (p) return f;
|
|
7
|
+
p = 1, Object.defineProperty(f, "__esModule", { value: !0 }), f.styleq = void 0;
|
|
8
8
|
var e = /* @__PURE__ */ new WeakMap(), t = "$$css";
|
|
9
9
|
function n(n) {
|
|
10
10
|
var r, i, a;
|
|
@@ -24,35 +24,35 @@ function p() {
|
|
|
24
24
|
var g = l.get(m);
|
|
25
25
|
g != null && (h = g[0], c = g[2], n.push.apply(n, g[1]), l = g[3]);
|
|
26
26
|
} else {
|
|
27
|
-
var
|
|
28
|
-
for (var
|
|
29
|
-
var
|
|
30
|
-
if (
|
|
31
|
-
var
|
|
32
|
-
|
|
27
|
+
var _ = [];
|
|
28
|
+
for (var v in m) {
|
|
29
|
+
var y = m[v];
|
|
30
|
+
if (v === t) {
|
|
31
|
+
var b = m[v];
|
|
32
|
+
b !== !0 && (c = c ? b + "; " + c : b);
|
|
33
33
|
continue;
|
|
34
34
|
}
|
|
35
|
-
typeof
|
|
35
|
+
typeof y == "string" || y === null ? n.includes(v) || (n.push(v), l != null && _.push(v), typeof y == "string" && (h += h ? " " + y : y)) : console.error(`styleq: ${v} typeof ${String(y)} is not "string" or "null".`);
|
|
36
36
|
}
|
|
37
37
|
if (l != null) {
|
|
38
|
-
var
|
|
38
|
+
var x = /* @__PURE__ */ new WeakMap();
|
|
39
39
|
l.set(m, [
|
|
40
40
|
h,
|
|
41
|
-
|
|
41
|
+
_,
|
|
42
42
|
c,
|
|
43
|
-
|
|
44
|
-
]), l =
|
|
43
|
+
x
|
|
44
|
+
]), l = x;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
h && (o = o ? h + " " + o : h);
|
|
48
48
|
} else if (i) s ??= {}, s = Object.assign({}, m, s);
|
|
49
49
|
else {
|
|
50
|
-
var
|
|
51
|
-
for (var
|
|
52
|
-
var
|
|
53
|
-
|
|
50
|
+
var S = null;
|
|
51
|
+
for (var C in m) {
|
|
52
|
+
var ee = m[C];
|
|
53
|
+
ee !== void 0 && (n.includes(C) || (ee != null && (s ??= {}, S ??= {}, S[C] = ee), n.push(C), l = null));
|
|
54
54
|
}
|
|
55
|
-
|
|
55
|
+
S != null && (s = Object.assign(S, s));
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
}
|
|
@@ -63,29 +63,29 @@ function p() {
|
|
|
63
63
|
];
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
var r =
|
|
67
|
-
return r.factory = n,
|
|
66
|
+
var r = f.styleq = n();
|
|
67
|
+
return r.factory = n, f;
|
|
68
68
|
}
|
|
69
|
-
var
|
|
70
|
-
function
|
|
71
|
-
let [t, n, r] =
|
|
69
|
+
var h = /*@__PURE__*/ m();
|
|
70
|
+
function g(...e) {
|
|
71
|
+
let [t, n, r] = h.styleq(e), i = {};
|
|
72
72
|
return t != null && t !== "" && (i.className = t), n != null && Object.keys(n).length > 0 && (i.style = n), r != null && r !== "" && (i["data-style-src"] = r), i;
|
|
73
73
|
}
|
|
74
74
|
Object.freeze({});
|
|
75
75
|
//#endregion
|
|
76
76
|
//#region src/assert-never.ts
|
|
77
|
-
function
|
|
77
|
+
function _(e) {
|
|
78
78
|
throw TypeError(`Unreachable value: ${JSON.stringify(e)}`);
|
|
79
79
|
}
|
|
80
80
|
//#endregion
|
|
81
81
|
//#region src/context.tsx
|
|
82
|
-
var
|
|
82
|
+
var v = {}, y = e({
|
|
83
83
|
onAction: void 0,
|
|
84
|
-
resolvers:
|
|
84
|
+
resolvers: v,
|
|
85
85
|
surface: "message"
|
|
86
86
|
});
|
|
87
|
-
function
|
|
88
|
-
let i =
|
|
87
|
+
function b({ children: e, onAction: t, resolvers: n = v, surface: r = "message" }) {
|
|
88
|
+
let i = o(() => ({
|
|
89
89
|
onAction: t,
|
|
90
90
|
resolvers: n,
|
|
91
91
|
surface: r
|
|
@@ -94,27 +94,329 @@ function v({ children: e, onAction: t, resolvers: n = ee, surface: r = "message"
|
|
|
94
94
|
n,
|
|
95
95
|
r
|
|
96
96
|
]);
|
|
97
|
-
return /* @__PURE__ */
|
|
97
|
+
return /* @__PURE__ */ u(y.Provider, {
|
|
98
98
|
value: i,
|
|
99
99
|
children: e
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
|
-
function
|
|
103
|
-
return r(
|
|
102
|
+
function x() {
|
|
103
|
+
return r(y);
|
|
104
104
|
}
|
|
105
105
|
//#endregion
|
|
106
|
+
//#region src/icons.tsx
|
|
107
|
+
function S({ children: e, fill: t = "none", name: n, size: r }) {
|
|
108
|
+
return /* @__PURE__ */ u("svg", {
|
|
109
|
+
className: "x1lliihq x2lah0s",
|
|
110
|
+
"aria-hidden": "true",
|
|
111
|
+
"data-icon": n,
|
|
112
|
+
fill: t,
|
|
113
|
+
focusable: "false",
|
|
114
|
+
height: r,
|
|
115
|
+
stroke: "currentColor",
|
|
116
|
+
strokeLinecap: "round",
|
|
117
|
+
strokeLinejoin: "round",
|
|
118
|
+
strokeWidth: 2,
|
|
119
|
+
viewBox: "0 0 24 24",
|
|
120
|
+
width: r,
|
|
121
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
122
|
+
children: e
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
function C({ size: e = 16 }) {
|
|
126
|
+
return /* @__PURE__ */ d(S, {
|
|
127
|
+
name: "calendar-days",
|
|
128
|
+
size: e,
|
|
129
|
+
children: [
|
|
130
|
+
/* @__PURE__ */ u("path", { d: "M8 2v4" }),
|
|
131
|
+
/* @__PURE__ */ u("path", { d: "M16 2v4" }),
|
|
132
|
+
/* @__PURE__ */ u("rect", {
|
|
133
|
+
width: "18",
|
|
134
|
+
height: "18",
|
|
135
|
+
x: "3",
|
|
136
|
+
y: "4",
|
|
137
|
+
rx: "2"
|
|
138
|
+
}),
|
|
139
|
+
/* @__PURE__ */ u("path", { d: "M3 10h18" }),
|
|
140
|
+
/* @__PURE__ */ u("path", { d: "M8 14h.01" }),
|
|
141
|
+
/* @__PURE__ */ u("path", { d: "M12 14h.01" }),
|
|
142
|
+
/* @__PURE__ */ u("path", { d: "M16 14h.01" }),
|
|
143
|
+
/* @__PURE__ */ u("path", { d: "M8 18h.01" }),
|
|
144
|
+
/* @__PURE__ */ u("path", { d: "M12 18h.01" }),
|
|
145
|
+
/* @__PURE__ */ u("path", { d: "M16 18h.01" })
|
|
146
|
+
]
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
function ee({ size: e = 16 }) {
|
|
150
|
+
return /* @__PURE__ */ u(S, {
|
|
151
|
+
name: "chevron-down",
|
|
152
|
+
size: e,
|
|
153
|
+
children: /* @__PURE__ */ u("path", { d: "m6 9 6 6 6-6" })
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
function te({ size: e = 16 }) {
|
|
157
|
+
return /* @__PURE__ */ u(S, {
|
|
158
|
+
name: "chevron-left",
|
|
159
|
+
size: e,
|
|
160
|
+
children: /* @__PURE__ */ u("path", { d: "m15 18-6-6 6-6" })
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
function ne({ size: e = 16 }) {
|
|
164
|
+
return /* @__PURE__ */ u(S, {
|
|
165
|
+
name: "chevron-right",
|
|
166
|
+
size: e,
|
|
167
|
+
children: /* @__PURE__ */ u("path", { d: "m9 18 6-6-6-6" })
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
function re({ size: e = 16 }) {
|
|
171
|
+
return /* @__PURE__ */ u(S, {
|
|
172
|
+
name: "circle",
|
|
173
|
+
size: e,
|
|
174
|
+
children: /* @__PURE__ */ u("circle", {
|
|
175
|
+
cx: "12",
|
|
176
|
+
cy: "12",
|
|
177
|
+
r: "10"
|
|
178
|
+
})
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
function ie({ size: e = 16 }) {
|
|
182
|
+
return /* @__PURE__ */ d(S, {
|
|
183
|
+
name: "circle-alert",
|
|
184
|
+
size: e,
|
|
185
|
+
children: [
|
|
186
|
+
/* @__PURE__ */ u("circle", {
|
|
187
|
+
cx: "12",
|
|
188
|
+
cy: "12",
|
|
189
|
+
r: "10"
|
|
190
|
+
}),
|
|
191
|
+
/* @__PURE__ */ u("line", {
|
|
192
|
+
x1: "12",
|
|
193
|
+
x2: "12",
|
|
194
|
+
y1: "8",
|
|
195
|
+
y2: "12"
|
|
196
|
+
}),
|
|
197
|
+
/* @__PURE__ */ u("line", {
|
|
198
|
+
x1: "12",
|
|
199
|
+
x2: "12.01",
|
|
200
|
+
y1: "16",
|
|
201
|
+
y2: "16"
|
|
202
|
+
})
|
|
203
|
+
]
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
function ae({ size: e = 16 }) {
|
|
207
|
+
return /* @__PURE__ */ d(S, {
|
|
208
|
+
name: "circle-check",
|
|
209
|
+
size: e,
|
|
210
|
+
children: [/* @__PURE__ */ u("circle", {
|
|
211
|
+
cx: "12",
|
|
212
|
+
cy: "12",
|
|
213
|
+
r: "10"
|
|
214
|
+
}), /* @__PURE__ */ u("path", { d: "m9 12 2 2 4-4" })]
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
function oe({ size: e = 16 }) {
|
|
218
|
+
return /* @__PURE__ */ d(S, {
|
|
219
|
+
name: "ellipsis",
|
|
220
|
+
size: e,
|
|
221
|
+
children: [
|
|
222
|
+
/* @__PURE__ */ u("circle", {
|
|
223
|
+
cx: "12",
|
|
224
|
+
cy: "12",
|
|
225
|
+
r: "1"
|
|
226
|
+
}),
|
|
227
|
+
/* @__PURE__ */ u("circle", {
|
|
228
|
+
cx: "19",
|
|
229
|
+
cy: "12",
|
|
230
|
+
r: "1"
|
|
231
|
+
}),
|
|
232
|
+
/* @__PURE__ */ u("circle", {
|
|
233
|
+
cx: "5",
|
|
234
|
+
cy: "12",
|
|
235
|
+
r: "1"
|
|
236
|
+
})
|
|
237
|
+
]
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
function se({ size: e = 16 }) {
|
|
241
|
+
return /* @__PURE__ */ d(S, {
|
|
242
|
+
name: "ellipsis-vertical",
|
|
243
|
+
size: e,
|
|
244
|
+
children: [
|
|
245
|
+
/* @__PURE__ */ u("circle", {
|
|
246
|
+
cx: "12",
|
|
247
|
+
cy: "12",
|
|
248
|
+
r: "1"
|
|
249
|
+
}),
|
|
250
|
+
/* @__PURE__ */ u("circle", {
|
|
251
|
+
cx: "12",
|
|
252
|
+
cy: "5",
|
|
253
|
+
r: "1"
|
|
254
|
+
}),
|
|
255
|
+
/* @__PURE__ */ u("circle", {
|
|
256
|
+
cx: "12",
|
|
257
|
+
cy: "19",
|
|
258
|
+
r: "1"
|
|
259
|
+
})
|
|
260
|
+
]
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
function ce({ size: e = 16 }) {
|
|
264
|
+
return /* @__PURE__ */ d(S, {
|
|
265
|
+
name: "expand",
|
|
266
|
+
size: e,
|
|
267
|
+
children: [
|
|
268
|
+
/* @__PURE__ */ u("path", { d: "m15 15 6 6" }),
|
|
269
|
+
/* @__PURE__ */ u("path", { d: "m15 9 6-6" }),
|
|
270
|
+
/* @__PURE__ */ u("path", { d: "M21 16v5h-5" }),
|
|
271
|
+
/* @__PURE__ */ u("path", { d: "M21 8V3h-5" }),
|
|
272
|
+
/* @__PURE__ */ u("path", { d: "M3 16v5h5" }),
|
|
273
|
+
/* @__PURE__ */ u("path", { d: "m3 21 6-6" }),
|
|
274
|
+
/* @__PURE__ */ u("path", { d: "M3 8V3h5" }),
|
|
275
|
+
/* @__PURE__ */ u("path", { d: "M9 9 3 3" })
|
|
276
|
+
]
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
function le({ size: e = 16 }) {
|
|
280
|
+
return /* @__PURE__ */ d(S, {
|
|
281
|
+
name: "image",
|
|
282
|
+
size: e,
|
|
283
|
+
children: [
|
|
284
|
+
/* @__PURE__ */ u("rect", {
|
|
285
|
+
width: "18",
|
|
286
|
+
height: "18",
|
|
287
|
+
x: "3",
|
|
288
|
+
y: "3",
|
|
289
|
+
rx: "2",
|
|
290
|
+
ry: "2"
|
|
291
|
+
}),
|
|
292
|
+
/* @__PURE__ */ u("circle", {
|
|
293
|
+
cx: "9",
|
|
294
|
+
cy: "9",
|
|
295
|
+
r: "2"
|
|
296
|
+
}),
|
|
297
|
+
/* @__PURE__ */ u("path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" })
|
|
298
|
+
]
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
function ue({ size: e = 16 }) {
|
|
302
|
+
return /* @__PURE__ */ d(S, {
|
|
303
|
+
name: "info",
|
|
304
|
+
size: e,
|
|
305
|
+
children: [
|
|
306
|
+
/* @__PURE__ */ u("circle", {
|
|
307
|
+
cx: "12",
|
|
308
|
+
cy: "12",
|
|
309
|
+
r: "10"
|
|
310
|
+
}),
|
|
311
|
+
/* @__PURE__ */ u("path", { d: "M12 16v-4" }),
|
|
312
|
+
/* @__PURE__ */ u("path", { d: "M12 8h.01" })
|
|
313
|
+
]
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
function de({ size: e = 16 }) {
|
|
317
|
+
return /* @__PURE__ */ u(S, {
|
|
318
|
+
name: "loader-circle",
|
|
319
|
+
size: e,
|
|
320
|
+
children: /* @__PURE__ */ u("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
function fe({ size: e = 16 }) {
|
|
324
|
+
return /* @__PURE__ */ u(S, {
|
|
325
|
+
name: "paperclip",
|
|
326
|
+
size: e,
|
|
327
|
+
children: /* @__PURE__ */ u("path", { d: "m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551" })
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
function pe({ size: e = 16 }) {
|
|
331
|
+
return /* @__PURE__ */ u(S, {
|
|
332
|
+
fill: "currentColor",
|
|
333
|
+
name: "play",
|
|
334
|
+
size: e,
|
|
335
|
+
children: /* @__PURE__ */ u("path", { d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z" })
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
function me({ size: e = 16 }) {
|
|
339
|
+
return /* @__PURE__ */ d(S, {
|
|
340
|
+
name: "rocket",
|
|
341
|
+
size: e,
|
|
342
|
+
children: [
|
|
343
|
+
/* @__PURE__ */ u("path", { d: "M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5" }),
|
|
344
|
+
/* @__PURE__ */ u("path", { d: "M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09" }),
|
|
345
|
+
/* @__PURE__ */ u("path", { d: "M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z" }),
|
|
346
|
+
/* @__PURE__ */ u("path", { d: "M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05" })
|
|
347
|
+
]
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
function he({ size: e = 16 }) {
|
|
351
|
+
return /* @__PURE__ */ d(S, {
|
|
352
|
+
name: "search",
|
|
353
|
+
size: e,
|
|
354
|
+
children: [/* @__PURE__ */ u("path", { d: "m21 21-4.34-4.34" }), /* @__PURE__ */ u("circle", {
|
|
355
|
+
cx: "11",
|
|
356
|
+
cy: "11",
|
|
357
|
+
r: "8"
|
|
358
|
+
})]
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
function ge({ size: e = 16 }) {
|
|
362
|
+
return /* @__PURE__ */ d(S, {
|
|
363
|
+
name: "thumbs-down",
|
|
364
|
+
size: e,
|
|
365
|
+
children: [/* @__PURE__ */ u("path", { d: "M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z" }), /* @__PURE__ */ u("path", { d: "M17 14V2" })]
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
function _e({ size: e = 16 }) {
|
|
369
|
+
return /* @__PURE__ */ d(S, {
|
|
370
|
+
name: "thumbs-up",
|
|
371
|
+
size: e,
|
|
372
|
+
children: [/* @__PURE__ */ u("path", { d: "M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z" }), /* @__PURE__ */ u("path", { d: "M7 10v12" })]
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
function ve({ size: e = 16 }) {
|
|
376
|
+
return /* @__PURE__ */ d(S, {
|
|
377
|
+
name: "trash-2",
|
|
378
|
+
size: e,
|
|
379
|
+
children: [
|
|
380
|
+
/* @__PURE__ */ u("path", { d: "M10 11v6" }),
|
|
381
|
+
/* @__PURE__ */ u("path", { d: "M14 11v6" }),
|
|
382
|
+
/* @__PURE__ */ u("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" }),
|
|
383
|
+
/* @__PURE__ */ u("path", { d: "M3 6h18" }),
|
|
384
|
+
/* @__PURE__ */ u("path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })
|
|
385
|
+
]
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
function ye({ size: e = 16 }) {
|
|
389
|
+
return /* @__PURE__ */ d(S, {
|
|
390
|
+
name: "triangle-alert",
|
|
391
|
+
size: e,
|
|
392
|
+
children: [
|
|
393
|
+
/* @__PURE__ */ u("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }),
|
|
394
|
+
/* @__PURE__ */ u("path", { d: "M12 9v4" }),
|
|
395
|
+
/* @__PURE__ */ u("path", { d: "M12 17h.01" })
|
|
396
|
+
]
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
var be = {
|
|
400
|
+
calendar: C,
|
|
401
|
+
ellipsis: oe,
|
|
402
|
+
play: pe,
|
|
403
|
+
rocket: me,
|
|
404
|
+
search: he,
|
|
405
|
+
trash: ve
|
|
406
|
+
};
|
|
407
|
+
//#endregion
|
|
106
408
|
//#region src/runtime.ts
|
|
107
|
-
function
|
|
409
|
+
function w(e) {
|
|
108
410
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
109
411
|
}
|
|
110
|
-
function
|
|
111
|
-
if (
|
|
412
|
+
function T(e) {
|
|
413
|
+
if (w(e)) return typeof e.type == "string" ? e.type : void 0;
|
|
112
414
|
}
|
|
113
|
-
function
|
|
114
|
-
if (
|
|
415
|
+
function xe(e) {
|
|
416
|
+
if (w(e)) return typeof e.block_id == "string" ? e.block_id : void 0;
|
|
115
417
|
}
|
|
116
|
-
function
|
|
117
|
-
if (!
|
|
418
|
+
function E(e, t) {
|
|
419
|
+
if (!w(e)) return `Unsupported ${t}`;
|
|
118
420
|
for (let t of [
|
|
119
421
|
"text",
|
|
120
422
|
"label",
|
|
@@ -125,17 +427,17 @@ function C(e, t) {
|
|
|
125
427
|
let n = e[t];
|
|
126
428
|
if (typeof n == "string" && n.length > 0) return n;
|
|
127
429
|
}
|
|
128
|
-
let n =
|
|
430
|
+
let n = T(e);
|
|
129
431
|
return n === void 0 ? `Unsupported ${t}` : `Unsupported ${t}: ${n}`;
|
|
130
432
|
}
|
|
131
433
|
//#endregion
|
|
132
434
|
//#region src/safe-url.ts
|
|
133
|
-
function
|
|
435
|
+
function D(e) {
|
|
134
436
|
return e !== void 0 && /^(?:https?:|mailto:)/i.test(e) ? e : void 0;
|
|
135
437
|
}
|
|
136
438
|
//#endregion
|
|
137
439
|
//#region src/tokens.stylex.ts
|
|
138
|
-
var
|
|
440
|
+
var Se = {
|
|
139
441
|
surface: "var(--xf210bc)",
|
|
140
442
|
surfaceRaised: "var(--xop8b6t)",
|
|
141
443
|
surfaceSunken: "var(--xajfn77)",
|
|
@@ -206,13 +508,13 @@ var te = {
|
|
|
206
508
|
chartSeriesTint5: "var(--x1nud87m)",
|
|
207
509
|
chartSeriesTint6: "var(--x1t1bkho)",
|
|
208
510
|
__varGroupHash__: "xpd22m1"
|
|
209
|
-
},
|
|
511
|
+
}, Ce = {
|
|
210
512
|
xpd22m1: "x1l73jb5 xpd22m1",
|
|
211
513
|
$$css: !0
|
|
212
|
-
},
|
|
514
|
+
}, we = {
|
|
213
515
|
xpd22m1: "xky7mqn xpd22m1",
|
|
214
516
|
$$css: !0
|
|
215
|
-
},
|
|
517
|
+
}, O = {
|
|
216
518
|
root: {
|
|
217
519
|
kWkggS: "xfs8zev",
|
|
218
520
|
kMwMTN: "xr3bju4",
|
|
@@ -489,6 +791,15 @@ var te = {
|
|
|
489
791
|
kVIFPx: "x19kjcj4",
|
|
490
792
|
$$css: !0
|
|
491
793
|
},
|
|
794
|
+
imagePlaceholder: {
|
|
795
|
+
kGNEyG: "x6s0dn4",
|
|
796
|
+
kWkggS: "x1fatxfb",
|
|
797
|
+
kMwMTN: "xlx0kvv",
|
|
798
|
+
k1xSpc: "x78zum5",
|
|
799
|
+
kjj79g: "xl56j7k",
|
|
800
|
+
kAzted: "x1wxaq2x",
|
|
801
|
+
$$css: !0
|
|
802
|
+
},
|
|
492
803
|
accessoryImage: {
|
|
493
804
|
kaIpWk: "xsqv9me",
|
|
494
805
|
kZKoxP: "x14nwjz3",
|
|
@@ -602,15 +913,20 @@ var te = {
|
|
|
602
913
|
},
|
|
603
914
|
pickerIcon: {
|
|
604
915
|
kMwMTN: "xvuv4jf",
|
|
605
|
-
|
|
606
|
-
|
|
916
|
+
k1xSpc: "x78zum5",
|
|
917
|
+
k87sOh: "xwa60dl",
|
|
918
|
+
kLqNvP: "xrr41r3",
|
|
607
919
|
kVAEAm: "x10l6tqk",
|
|
920
|
+
k3aq6I: "x1cb1t30",
|
|
608
921
|
$$css: !0
|
|
609
922
|
},
|
|
610
923
|
pickerChevron: {
|
|
611
924
|
kMwMTN: "xvuv4jf",
|
|
612
|
-
|
|
925
|
+
k1xSpc: "x78zum5",
|
|
926
|
+
k87sOh: "xwa60dl",
|
|
927
|
+
kt4wiu: "x1jot08o",
|
|
613
928
|
kVAEAm: "x10l6tqk",
|
|
929
|
+
k3aq6I: "x1cb1t30",
|
|
614
930
|
$$css: !0
|
|
615
931
|
},
|
|
616
932
|
iconButton: {
|
|
@@ -619,6 +935,12 @@ var te = {
|
|
|
619
935
|
kg3NbH: "x17hd1w2",
|
|
620
936
|
$$css: !0
|
|
621
937
|
},
|
|
938
|
+
iconSlot: {
|
|
939
|
+
kGNEyG: "x6s0dn4",
|
|
940
|
+
k1xSpc: "x78zum5",
|
|
941
|
+
kmuXW: "x2lah0s",
|
|
942
|
+
$$css: !0
|
|
943
|
+
},
|
|
622
944
|
select: {
|
|
623
945
|
kysU6D: "xjyslct",
|
|
624
946
|
kWkggS: "x1itzlyb",
|
|
@@ -635,6 +957,27 @@ var te = {
|
|
|
635
957
|
kg3NbH: "x1r82r8e",
|
|
636
958
|
$$css: !0
|
|
637
959
|
},
|
|
960
|
+
selectWrap: {
|
|
961
|
+
k1xSpc: "x3nfvp2",
|
|
962
|
+
ks0D6T: "x193iq5w",
|
|
963
|
+
kVAEAm: "x1n2onr6",
|
|
964
|
+
$$css: !0
|
|
965
|
+
},
|
|
966
|
+
selectWithChevron: {
|
|
967
|
+
kwRFfy: "xziim83",
|
|
968
|
+
kzqmXN: "xh8yej3",
|
|
969
|
+
$$css: !0
|
|
970
|
+
},
|
|
971
|
+
selectChevron: {
|
|
972
|
+
kMwMTN: "xr3bju4",
|
|
973
|
+
k1xSpc: "x78zum5",
|
|
974
|
+
k87sOh: "xwa60dl",
|
|
975
|
+
kt4wiu: "x1vikou4",
|
|
976
|
+
kfzvcC: "x47corl",
|
|
977
|
+
kVAEAm: "x10l6tqk",
|
|
978
|
+
k3aq6I: "x1cb1t30",
|
|
979
|
+
$$css: !0
|
|
980
|
+
},
|
|
638
981
|
choiceGroup: {
|
|
639
982
|
ksu8eU: "xng3xce",
|
|
640
983
|
k1xSpc: "x78zum5",
|
|
@@ -802,6 +1145,10 @@ var te = {
|
|
|
802
1145
|
k5xd4v: "x1bhewko",
|
|
803
1146
|
$$css: !0
|
|
804
1147
|
},
|
|
1148
|
+
alertIcon: {
|
|
1149
|
+
kZKoxP: "xcdktbt",
|
|
1150
|
+
$$css: !0
|
|
1151
|
+
},
|
|
805
1152
|
alert: {
|
|
806
1153
|
kGNEyG: "x1cy8zhl",
|
|
807
1154
|
kWkggS: "x1fatxfb",
|
|
@@ -852,6 +1199,13 @@ var te = {
|
|
|
852
1199
|
kg3NbH: "xzgshkr",
|
|
853
1200
|
$$css: !0
|
|
854
1201
|
},
|
|
1202
|
+
containerChevron: {
|
|
1203
|
+
kGNEyG: "x6s0dn4",
|
|
1204
|
+
kMwMTN: "xlx0kvv",
|
|
1205
|
+
k1xSpc: "x78zum5",
|
|
1206
|
+
kmuXW: "x2lah0s",
|
|
1207
|
+
$$css: !0
|
|
1208
|
+
},
|
|
855
1209
|
containerHeaderDivider: {
|
|
856
1210
|
kL6WhQ: "x17fznl5",
|
|
857
1211
|
kfdmCh: "x1q0q8m5",
|
|
@@ -1092,6 +1446,11 @@ var te = {
|
|
|
1092
1446
|
kzqmXN: "x35muul",
|
|
1093
1447
|
$$css: !0
|
|
1094
1448
|
},
|
|
1449
|
+
dataTableFilterIcon: {
|
|
1450
|
+
kMwMTN: "xr3bju4",
|
|
1451
|
+
kZCmMZ: "xty9v0q",
|
|
1452
|
+
$$css: !0
|
|
1453
|
+
},
|
|
1095
1454
|
dataTableFilterInput: {
|
|
1096
1455
|
kWkggS: "xjbqb8w",
|
|
1097
1456
|
ksu8eU: "xng3xce",
|
|
@@ -1253,6 +1612,27 @@ var te = {
|
|
|
1253
1612
|
kg3NbH: "x1r82r8e",
|
|
1254
1613
|
$$css: !0
|
|
1255
1614
|
},
|
|
1615
|
+
videoThumbnail: {
|
|
1616
|
+
k1xSpc: "x1lliihq",
|
|
1617
|
+
kVAEAm: "x1n2onr6",
|
|
1618
|
+
$$css: !0
|
|
1619
|
+
},
|
|
1620
|
+
videoPlayBadge: {
|
|
1621
|
+
kGNEyG: "x6s0dn4",
|
|
1622
|
+
kWkggS: "x1frzhxr",
|
|
1623
|
+
kaIpWk: "x10hpsqq",
|
|
1624
|
+
kMwMTN: "x1f7m26b",
|
|
1625
|
+
k1xSpc: "x78zum5",
|
|
1626
|
+
kZKoxP: "xsdox4t",
|
|
1627
|
+
k87sOh: "xwa60dl",
|
|
1628
|
+
kLqNvP: "xbudbmw",
|
|
1629
|
+
kjj79g: "xl56j7k",
|
|
1630
|
+
kfzvcC: "x47corl",
|
|
1631
|
+
kVAEAm: "x10l6tqk",
|
|
1632
|
+
k3aq6I: "x11lhmoz",
|
|
1633
|
+
kzqmXN: "x1useyqa",
|
|
1634
|
+
$$css: !0
|
|
1635
|
+
},
|
|
1256
1636
|
visuallyHidden: {
|
|
1257
1637
|
kMcinP: "xeh89do",
|
|
1258
1638
|
kz4h6p: "x1hyvwdk",
|
|
@@ -1263,7 +1643,7 @@ var te = {
|
|
|
1263
1643
|
kzqmXN: "x1i1rx1s",
|
|
1264
1644
|
$$css: !0
|
|
1265
1645
|
}
|
|
1266
|
-
},
|
|
1646
|
+
}, k = {
|
|
1267
1647
|
fill1: {
|
|
1268
1648
|
kDwRjp: "xtzl89e",
|
|
1269
1649
|
$$css: !0
|
|
@@ -1432,86 +1812,86 @@ var te = {
|
|
|
1432
1812
|
kDwRjp: "x1mnwzol",
|
|
1433
1813
|
$$css: !0
|
|
1434
1814
|
}
|
|
1435
|
-
},
|
|
1436
|
-
fill:
|
|
1437
|
-
stroke:
|
|
1438
|
-
swatch:
|
|
1439
|
-
tint:
|
|
1440
|
-
},
|
|
1441
|
-
|
|
1815
|
+
}, Te = {
|
|
1816
|
+
fill: k.fill1,
|
|
1817
|
+
stroke: k.stroke1,
|
|
1818
|
+
swatch: k.swatch1,
|
|
1819
|
+
tint: k.tint1
|
|
1820
|
+
}, Ee = [
|
|
1821
|
+
Te,
|
|
1442
1822
|
{
|
|
1443
|
-
fill:
|
|
1444
|
-
stroke:
|
|
1445
|
-
swatch:
|
|
1446
|
-
tint:
|
|
1823
|
+
fill: k.fill2,
|
|
1824
|
+
stroke: k.stroke2,
|
|
1825
|
+
swatch: k.swatch2,
|
|
1826
|
+
tint: k.tint2
|
|
1447
1827
|
},
|
|
1448
1828
|
{
|
|
1449
|
-
fill:
|
|
1450
|
-
stroke:
|
|
1451
|
-
swatch:
|
|
1452
|
-
tint:
|
|
1829
|
+
fill: k.fill3,
|
|
1830
|
+
stroke: k.stroke3,
|
|
1831
|
+
swatch: k.swatch3,
|
|
1832
|
+
tint: k.tint3
|
|
1453
1833
|
},
|
|
1454
1834
|
{
|
|
1455
|
-
fill:
|
|
1456
|
-
stroke:
|
|
1457
|
-
swatch:
|
|
1458
|
-
tint:
|
|
1835
|
+
fill: k.fill4,
|
|
1836
|
+
stroke: k.stroke4,
|
|
1837
|
+
swatch: k.swatch4,
|
|
1838
|
+
tint: k.tint4
|
|
1459
1839
|
},
|
|
1460
1840
|
{
|
|
1461
|
-
fill:
|
|
1462
|
-
stroke:
|
|
1463
|
-
swatch:
|
|
1464
|
-
tint:
|
|
1841
|
+
fill: k.fill5,
|
|
1842
|
+
stroke: k.stroke5,
|
|
1843
|
+
swatch: k.swatch5,
|
|
1844
|
+
tint: k.tint5
|
|
1465
1845
|
},
|
|
1466
1846
|
{
|
|
1467
|
-
fill:
|
|
1468
|
-
stroke:
|
|
1469
|
-
swatch:
|
|
1470
|
-
tint:
|
|
1847
|
+
fill: k.fill6,
|
|
1848
|
+
stroke: k.stroke6,
|
|
1849
|
+
swatch: k.swatch6,
|
|
1850
|
+
tint: k.tint6
|
|
1471
1851
|
},
|
|
1472
1852
|
{
|
|
1473
|
-
fill:
|
|
1474
|
-
stroke:
|
|
1475
|
-
swatch:
|
|
1476
|
-
tint:
|
|
1853
|
+
fill: k.fill7,
|
|
1854
|
+
stroke: k.stroke7,
|
|
1855
|
+
swatch: k.swatch7,
|
|
1856
|
+
tint: k.fill7
|
|
1477
1857
|
},
|
|
1478
1858
|
{
|
|
1479
|
-
fill:
|
|
1480
|
-
stroke:
|
|
1481
|
-
swatch:
|
|
1482
|
-
tint:
|
|
1859
|
+
fill: k.fill8,
|
|
1860
|
+
stroke: k.stroke8,
|
|
1861
|
+
swatch: k.swatch8,
|
|
1862
|
+
tint: k.fill8
|
|
1483
1863
|
},
|
|
1484
1864
|
{
|
|
1485
|
-
fill:
|
|
1486
|
-
stroke:
|
|
1487
|
-
swatch:
|
|
1488
|
-
tint:
|
|
1865
|
+
fill: k.fill9,
|
|
1866
|
+
stroke: k.stroke9,
|
|
1867
|
+
swatch: k.swatch9,
|
|
1868
|
+
tint: k.fill9
|
|
1489
1869
|
},
|
|
1490
1870
|
{
|
|
1491
|
-
fill:
|
|
1492
|
-
stroke:
|
|
1493
|
-
swatch:
|
|
1494
|
-
tint:
|
|
1871
|
+
fill: k.fill10,
|
|
1872
|
+
stroke: k.stroke10,
|
|
1873
|
+
swatch: k.swatch10,
|
|
1874
|
+
tint: k.fill10
|
|
1495
1875
|
},
|
|
1496
1876
|
{
|
|
1497
|
-
fill:
|
|
1498
|
-
stroke:
|
|
1499
|
-
swatch:
|
|
1500
|
-
tint:
|
|
1877
|
+
fill: k.fill11,
|
|
1878
|
+
stroke: k.stroke11,
|
|
1879
|
+
swatch: k.swatch11,
|
|
1880
|
+
tint: k.fill11
|
|
1501
1881
|
},
|
|
1502
1882
|
{
|
|
1503
|
-
fill:
|
|
1504
|
-
stroke:
|
|
1505
|
-
swatch:
|
|
1506
|
-
tint:
|
|
1883
|
+
fill: k.fill12,
|
|
1884
|
+
stroke: k.stroke12,
|
|
1885
|
+
swatch: k.swatch12,
|
|
1886
|
+
tint: k.fill12
|
|
1507
1887
|
}
|
|
1508
1888
|
];
|
|
1509
|
-
function
|
|
1889
|
+
function A(e, t) {
|
|
1510
1890
|
return e === void 0 ? t : t === void 0 || t.length === 0 ? e : `${e} ${t}`;
|
|
1511
1891
|
}
|
|
1512
1892
|
//#endregion
|
|
1513
1893
|
//#region src/text/date.ts
|
|
1514
|
-
var
|
|
1894
|
+
var De = /\{([a-z_]+)\}/g, Oe = [
|
|
1515
1895
|
"January",
|
|
1516
1896
|
"February",
|
|
1517
1897
|
"March",
|
|
@@ -1524,7 +1904,7 @@ var oe = /\{([a-z_]+)\}/g, se = [
|
|
|
1524
1904
|
"October",
|
|
1525
1905
|
"November",
|
|
1526
1906
|
"December"
|
|
1527
|
-
],
|
|
1907
|
+
], ke = [
|
|
1528
1908
|
"Jan",
|
|
1529
1909
|
"Feb",
|
|
1530
1910
|
"Mar",
|
|
@@ -1537,7 +1917,7 @@ var oe = /\{([a-z_]+)\}/g, se = [
|
|
|
1537
1917
|
"Oct",
|
|
1538
1918
|
"Nov",
|
|
1539
1919
|
"Dec"
|
|
1540
|
-
],
|
|
1920
|
+
], Ae = [
|
|
1541
1921
|
"Sunday",
|
|
1542
1922
|
"Monday",
|
|
1543
1923
|
"Tuesday",
|
|
@@ -1546,10 +1926,10 @@ var oe = /\{([a-z_]+)\}/g, se = [
|
|
|
1546
1926
|
"Friday",
|
|
1547
1927
|
"Saturday"
|
|
1548
1928
|
];
|
|
1549
|
-
function
|
|
1929
|
+
function j(e) {
|
|
1550
1930
|
return String(e).padStart(2, "0");
|
|
1551
1931
|
}
|
|
1552
|
-
function
|
|
1932
|
+
function je(e) {
|
|
1553
1933
|
let t = e % 100;
|
|
1554
1934
|
if (t >= 11 && t <= 13) return `${String(e)}th`;
|
|
1555
1935
|
switch (e % 10) {
|
|
@@ -1559,36 +1939,36 @@ function ue(e) {
|
|
|
1559
1939
|
default: return `${String(e)}th`;
|
|
1560
1940
|
}
|
|
1561
1941
|
}
|
|
1562
|
-
function
|
|
1563
|
-
let n = t.getUTCDate(), r =
|
|
1942
|
+
function Me(e, t) {
|
|
1943
|
+
let n = t.getUTCDate(), r = Oe[t.getUTCMonth()] ?? "", i = ke[t.getUTCMonth()] ?? "", a = Ae[t.getUTCDay()] ?? "", o = t.getUTCFullYear();
|
|
1564
1944
|
switch (e) {
|
|
1565
|
-
case "date_num": return `${String(o)}-${
|
|
1566
|
-
case "date_slash": return `${
|
|
1945
|
+
case "date_num": return `${String(o)}-${j(t.getUTCMonth() + 1)}-${j(n)}`;
|
|
1946
|
+
case "date_slash": return `${j(t.getUTCMonth() + 1)}/${j(n)}/${String(o)}`;
|
|
1567
1947
|
case "date_long":
|
|
1568
1948
|
case "date_long_pretty":
|
|
1569
|
-
case "day_divider_pretty": return `${a}, ${r} ${
|
|
1949
|
+
case "day_divider_pretty": return `${a}, ${r} ${je(n)}, ${String(o)}`;
|
|
1570
1950
|
case "date_long_full": return `${r} ${String(n)}, ${String(o)}`;
|
|
1571
1951
|
case "date":
|
|
1572
|
-
case "date_pretty": return `${r} ${
|
|
1952
|
+
case "date_pretty": return `${r} ${je(n)}, ${String(o)}`;
|
|
1573
1953
|
case "date_short":
|
|
1574
1954
|
case "date_short_pretty": return `${i} ${String(n)}, ${String(o)}`;
|
|
1575
|
-
case "time": return `${
|
|
1576
|
-
case "time_secs": return `${
|
|
1955
|
+
case "time": return `${j(t.getUTCHours())}:${j(t.getUTCMinutes())}`;
|
|
1956
|
+
case "time_secs": return `${j(t.getUTCHours())}:${j(t.getUTCMinutes())}:${j(t.getUTCSeconds())}`;
|
|
1577
1957
|
default: return;
|
|
1578
1958
|
}
|
|
1579
1959
|
}
|
|
1580
|
-
function
|
|
1960
|
+
function Ne(e, t, n) {
|
|
1581
1961
|
let r = /* @__PURE__ */ new Date(e * 1e3);
|
|
1582
1962
|
if (!Number.isFinite(e) || Number.isNaN(r.getTime())) return n ?? String(e);
|
|
1583
|
-
let i = !1, a = t.replace(
|
|
1584
|
-
let n =
|
|
1963
|
+
let i = !1, a = t.replace(De, (e, t) => {
|
|
1964
|
+
let n = Me(t, r);
|
|
1585
1965
|
return n === void 0 ? (i = !0, "") : n;
|
|
1586
1966
|
});
|
|
1587
1967
|
return t.length === 0 || i ? n ?? r.toISOString().slice(0, 10) : a;
|
|
1588
1968
|
}
|
|
1589
1969
|
//#endregion
|
|
1590
1970
|
//#region src/text/emoji.ts
|
|
1591
|
-
var
|
|
1971
|
+
var Pe = {
|
|
1592
1972
|
"+1": "👍",
|
|
1593
1973
|
"-1": "👎",
|
|
1594
1974
|
100: "💯",
|
|
@@ -1625,12 +2005,12 @@ var pe = {
|
|
|
1625
2005
|
wink: "😉",
|
|
1626
2006
|
x: "❌",
|
|
1627
2007
|
zap: "⚡"
|
|
1628
|
-
},
|
|
1629
|
-
function
|
|
1630
|
-
return
|
|
2008
|
+
}, Fe = /^[0-9a-f]{1,6}(?:-[0-9a-f]{1,6})*$/i;
|
|
2009
|
+
function Ie(e) {
|
|
2010
|
+
return Pe[e];
|
|
1631
2011
|
}
|
|
1632
|
-
function
|
|
1633
|
-
if (e === void 0 || !
|
|
2012
|
+
function Le(e) {
|
|
2013
|
+
if (e === void 0 || !Fe.test(e)) return;
|
|
1634
2014
|
let t = e.split("-").map((e) => Number.parseInt(e, 16));
|
|
1635
2015
|
if (!t.some((e) => !Number.isFinite(e))) try {
|
|
1636
2016
|
return String.fromCodePoint(...t);
|
|
@@ -1640,7 +2020,7 @@ function ge(e) {
|
|
|
1640
2020
|
}
|
|
1641
2021
|
//#endregion
|
|
1642
2022
|
//#region src/text/RichText.tsx
|
|
1643
|
-
var
|
|
2023
|
+
var Re = {
|
|
1644
2024
|
attachment_mention: !0,
|
|
1645
2025
|
broadcast: !0,
|
|
1646
2026
|
canvas: !0,
|
|
@@ -1663,13 +2043,13 @@ var _e = {
|
|
|
1663
2043
|
usergroup: !0,
|
|
1664
2044
|
work_object_mention: !0,
|
|
1665
2045
|
workflow_mention: !0
|
|
1666
|
-
},
|
|
2046
|
+
}, ze = {
|
|
1667
2047
|
rich_text_list: !0,
|
|
1668
2048
|
rich_text_preformatted: !0,
|
|
1669
2049
|
rich_text_quote: !0,
|
|
1670
2050
|
rich_text_section: !0
|
|
1671
2051
|
};
|
|
1672
|
-
function
|
|
2052
|
+
function Be(e) {
|
|
1673
2053
|
switch (e.type) {
|
|
1674
2054
|
case "broadcast":
|
|
1675
2055
|
case "channel":
|
|
@@ -1694,11 +2074,11 @@ function ye(e) {
|
|
|
1694
2074
|
case "work_object_mention":
|
|
1695
2075
|
case "workflow_mention": return;
|
|
1696
2076
|
}
|
|
1697
|
-
return
|
|
2077
|
+
return _(e);
|
|
1698
2078
|
}
|
|
1699
|
-
function
|
|
1700
|
-
let t =
|
|
1701
|
-
if (t === void 0 || !(t in
|
|
2079
|
+
function Ve(e) {
|
|
2080
|
+
let t = T(e);
|
|
2081
|
+
if (t === void 0 || !(t in Re) || !w(e)) return !1;
|
|
1702
2082
|
switch (t) {
|
|
1703
2083
|
case "text": return typeof e.text == "string";
|
|
1704
2084
|
case "link": return typeof e.url == "string";
|
|
@@ -1713,92 +2093,92 @@ function be(e) {
|
|
|
1713
2093
|
default: return !0;
|
|
1714
2094
|
}
|
|
1715
2095
|
}
|
|
1716
|
-
function
|
|
1717
|
-
let t =
|
|
1718
|
-
return t === void 0 || !(t in
|
|
2096
|
+
function He(e) {
|
|
2097
|
+
let t = T(e);
|
|
2098
|
+
return t === void 0 || !(t in ze) || !w(e) || !Array.isArray(e.elements) ? !1 : t !== "rich_text_list" || e.elements.every((e) => w(e) && e.type === "rich_text_section" && Array.isArray(e.elements));
|
|
1719
2099
|
}
|
|
1720
|
-
function
|
|
2100
|
+
function M(e, t) {
|
|
1721
2101
|
let n = e;
|
|
1722
|
-
return t?.bold === !0 && (n = /* @__PURE__ */
|
|
1723
|
-
...
|
|
2102
|
+
return t?.bold === !0 && (n = /* @__PURE__ */ u("strong", {
|
|
2103
|
+
...g(O.bold),
|
|
1724
2104
|
children: n
|
|
1725
|
-
})), t?.italic === !0 && (n = /* @__PURE__ */
|
|
1726
|
-
...
|
|
2105
|
+
})), t?.italic === !0 && (n = /* @__PURE__ */ u("em", {
|
|
2106
|
+
...g(O.italic),
|
|
1727
2107
|
children: n
|
|
1728
|
-
})), t?.strike === !0 && (n = /* @__PURE__ */
|
|
1729
|
-
...
|
|
2108
|
+
})), t?.strike === !0 && (n = /* @__PURE__ */ u("s", {
|
|
2109
|
+
...g(O.strike),
|
|
1730
2110
|
children: n
|
|
1731
|
-
})), t?.underline === !0 && (n = /* @__PURE__ */
|
|
1732
|
-
...
|
|
2111
|
+
})), t?.underline === !0 && (n = /* @__PURE__ */ u("span", {
|
|
2112
|
+
...g(O.underline),
|
|
1733
2113
|
children: n
|
|
1734
|
-
})), t?.code === !0 && (n = /* @__PURE__ */
|
|
1735
|
-
...
|
|
2114
|
+
})), t?.code === !0 && (n = /* @__PURE__ */ u("code", {
|
|
2115
|
+
...g(O.inlineCode),
|
|
1736
2116
|
children: n
|
|
1737
2117
|
})), n;
|
|
1738
2118
|
}
|
|
1739
|
-
function
|
|
2119
|
+
function Ue(e) {
|
|
1740
2120
|
return e.text ?? e.id ?? e.user_id ?? e.channel_id ?? e.team_id ?? e.file_id ?? e.canvas_id ?? e.record_id ?? e.message_ts ?? e.workflow_id ?? e.type;
|
|
1741
2121
|
}
|
|
1742
|
-
function
|
|
1743
|
-
let { resolvers: t } =
|
|
1744
|
-
if (!
|
|
1745
|
-
...
|
|
1746
|
-
"data-unhandled-rich-text-element":
|
|
1747
|
-
children:
|
|
2122
|
+
function We({ element: e }) {
|
|
2123
|
+
let { resolvers: t } = x();
|
|
2124
|
+
if (!Ve(e)) return /* @__PURE__ */ u("span", {
|
|
2125
|
+
...g(O.reference),
|
|
2126
|
+
"data-unhandled-rich-text-element": T(e) ?? "unknown",
|
|
2127
|
+
children: E(e, "rich text element")
|
|
1748
2128
|
});
|
|
1749
|
-
let n =
|
|
2129
|
+
let n = Be(e);
|
|
1750
2130
|
switch (e.type) {
|
|
1751
|
-
case "text": return
|
|
2131
|
+
case "text": return M(e.text, n);
|
|
1752
2132
|
case "link": {
|
|
1753
|
-
let t =
|
|
1754
|
-
return t === void 0 ?
|
|
1755
|
-
...
|
|
2133
|
+
let t = D(e.url), r = e.text ?? e.url;
|
|
2134
|
+
return t === void 0 ? M(r, n) : /* @__PURE__ */ u("a", {
|
|
2135
|
+
...g(O.link),
|
|
1756
2136
|
href: t,
|
|
1757
2137
|
rel: "noreferrer",
|
|
1758
|
-
children:
|
|
2138
|
+
children: M(r, n)
|
|
1759
2139
|
});
|
|
1760
2140
|
}
|
|
1761
|
-
case "emoji": return /* @__PURE__ */
|
|
2141
|
+
case "emoji": return /* @__PURE__ */ u("span", {
|
|
1762
2142
|
"aria-label": `:${e.name}:`,
|
|
1763
2143
|
role: "img",
|
|
1764
|
-
children:
|
|
2144
|
+
children: M(t.emoji?.(e.name, e.unicode) ?? Le(e.unicode) ?? Ie(e.name) ?? `:${e.name}:`, n)
|
|
1765
2145
|
});
|
|
1766
|
-
case "user": return /* @__PURE__ */
|
|
1767
|
-
...
|
|
1768
|
-
children:
|
|
2146
|
+
case "user": return /* @__PURE__ */ u("span", {
|
|
2147
|
+
...g(O.mention),
|
|
2148
|
+
children: M(/* @__PURE__ */ d(l, { children: ["@", t.user?.(e.user_id) ?? e.user_id] }), n)
|
|
1769
2149
|
});
|
|
1770
|
-
case "usergroup": return /* @__PURE__ */
|
|
1771
|
-
...
|
|
1772
|
-
children:
|
|
2150
|
+
case "usergroup": return /* @__PURE__ */ u("span", {
|
|
2151
|
+
...g(O.mention),
|
|
2152
|
+
children: M(/* @__PURE__ */ d(l, { children: ["@", t.usergroup?.(e.usergroup_id) ?? e.usergroup_id] }), n)
|
|
1773
2153
|
});
|
|
1774
|
-
case "channel": return /* @__PURE__ */
|
|
1775
|
-
...
|
|
1776
|
-
children:
|
|
2154
|
+
case "channel": return /* @__PURE__ */ u("span", {
|
|
2155
|
+
...g(O.mention),
|
|
2156
|
+
children: M(/* @__PURE__ */ d(l, { children: ["#", t.channel?.(e.channel_id) ?? e.channel_id] }), n)
|
|
1777
2157
|
});
|
|
1778
|
-
case "team": return /* @__PURE__ */
|
|
1779
|
-
...
|
|
1780
|
-
children:
|
|
2158
|
+
case "team": return /* @__PURE__ */ u("span", {
|
|
2159
|
+
...g(O.mention),
|
|
2160
|
+
children: M(/* @__PURE__ */ d(l, { children: ["@", t.team?.(e.team_id) ?? e.team_id] }), n)
|
|
1781
2161
|
});
|
|
1782
|
-
case "broadcast": return /* @__PURE__ */
|
|
1783
|
-
...
|
|
1784
|
-
children:
|
|
2162
|
+
case "broadcast": return /* @__PURE__ */ u("span", {
|
|
2163
|
+
...g(O.mention),
|
|
2164
|
+
children: M(`@${e.range}`, n)
|
|
1785
2165
|
});
|
|
1786
2166
|
case "date": {
|
|
1787
|
-
let r = t.date?.(e.timestamp, e.format) ??
|
|
1788
|
-
return i === void 0 ?
|
|
1789
|
-
...
|
|
2167
|
+
let r = t.date?.(e.timestamp, e.format) ?? Ne(e.timestamp, e.format, e.fallback), i = D(e.url);
|
|
2168
|
+
return i === void 0 ? M(r, n) : /* @__PURE__ */ u("a", {
|
|
2169
|
+
...g(O.link),
|
|
1790
2170
|
href: i,
|
|
1791
2171
|
rel: "noreferrer",
|
|
1792
|
-
children:
|
|
2172
|
+
children: M(r, n)
|
|
1793
2173
|
});
|
|
1794
2174
|
}
|
|
1795
|
-
case "color": return /* @__PURE__ */
|
|
1796
|
-
...
|
|
2175
|
+
case "color": return /* @__PURE__ */ d("span", { children: [/* @__PURE__ */ u("span", {
|
|
2176
|
+
...g(O.colorSwatch),
|
|
1797
2177
|
"aria-hidden": "true",
|
|
1798
2178
|
style: { backgroundColor: e.value }
|
|
1799
|
-
}),
|
|
1800
|
-
case "citation": return /* @__PURE__ */
|
|
1801
|
-
...
|
|
2179
|
+
}), M(e.value, n)] });
|
|
2180
|
+
case "citation": return /* @__PURE__ */ d("span", {
|
|
2181
|
+
...g(O.reference),
|
|
1802
2182
|
children: [
|
|
1803
2183
|
"[",
|
|
1804
2184
|
e.index ?? e.text ?? "source",
|
|
@@ -1815,99 +2195,120 @@ function Ce({ element: e }) {
|
|
|
1815
2195
|
case "salesforce_data_field":
|
|
1816
2196
|
case "tag":
|
|
1817
2197
|
case "work_object_mention":
|
|
1818
|
-
case "workflow_mention": return /* @__PURE__ */
|
|
1819
|
-
...
|
|
1820
|
-
children:
|
|
2198
|
+
case "workflow_mention": return /* @__PURE__ */ u("span", {
|
|
2199
|
+
...g(O.reference),
|
|
2200
|
+
children: Ue(e)
|
|
1821
2201
|
});
|
|
1822
2202
|
}
|
|
1823
|
-
return
|
|
1824
|
-
}
|
|
1825
|
-
function
|
|
1826
|
-
let
|
|
1827
|
-
if ((
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
2203
|
+
return _(e);
|
|
2204
|
+
}
|
|
2205
|
+
function Ge({ element: e }) {
|
|
2206
|
+
let { resolvers: t } = x();
|
|
2207
|
+
if (Ve(e)) {
|
|
2208
|
+
switch (e.type) {
|
|
2209
|
+
case "text": return e.text;
|
|
2210
|
+
case "link": return e.text ?? e.url;
|
|
2211
|
+
case "user": return /* @__PURE__ */ d(l, { children: ["@", t.user?.(e.user_id) ?? e.user_id] });
|
|
2212
|
+
case "usergroup": return /* @__PURE__ */ d(l, { children: ["@", t.usergroup?.(e.usergroup_id) ?? e.usergroup_id] });
|
|
2213
|
+
case "channel": return /* @__PURE__ */ d(l, { children: ["#", t.channel?.(e.channel_id) ?? e.channel_id] });
|
|
2214
|
+
case "team": return /* @__PURE__ */ d(l, { children: ["@", t.team?.(e.team_id) ?? e.team_id] });
|
|
2215
|
+
case "broadcast": return `@${e.range}`;
|
|
2216
|
+
case "emoji": return `:${e.name}:`;
|
|
2217
|
+
case "date": return t.date?.(e.timestamp, e.format) ?? Ne(e.timestamp, e.format, e.fallback);
|
|
2218
|
+
case "color": return e.value;
|
|
2219
|
+
case "citation": return `[${e.index ?? e.text ?? "source"}]`;
|
|
2220
|
+
case "attachment_mention":
|
|
2221
|
+
case "canvas":
|
|
2222
|
+
case "canvas_message_unfurl":
|
|
2223
|
+
case "canvas_user_mention":
|
|
2224
|
+
case "file":
|
|
2225
|
+
case "list_record":
|
|
2226
|
+
case "message_mention":
|
|
2227
|
+
case "salesforce_data_field":
|
|
2228
|
+
case "tag":
|
|
2229
|
+
case "work_object_mention":
|
|
2230
|
+
case "workflow_mention": return Ue(e);
|
|
2231
|
+
}
|
|
2232
|
+
return _(e);
|
|
1832
2233
|
}
|
|
1833
|
-
return /* @__PURE__ */
|
|
1834
|
-
...
|
|
1835
|
-
"data-unhandled-rich-text-element":
|
|
1836
|
-
|
|
1837
|
-
}
|
|
2234
|
+
return /* @__PURE__ */ u("span", {
|
|
2235
|
+
...g(O.reference),
|
|
2236
|
+
"data-unhandled-rich-text-element": T(e) ?? "unknown",
|
|
2237
|
+
children: E(e, "rich text element")
|
|
2238
|
+
});
|
|
1838
2239
|
}
|
|
1839
|
-
function
|
|
2240
|
+
function Ke(e) {
|
|
1840
2241
|
let t = e % 3;
|
|
1841
|
-
return t === 1 ?
|
|
2242
|
+
return t === 1 ? O.listOrderedAlpha : t === 2 ? O.listOrderedRoman : O.listOrdered;
|
|
1842
2243
|
}
|
|
1843
|
-
function
|
|
2244
|
+
function qe(e) {
|
|
1844
2245
|
let t = e % 3;
|
|
1845
|
-
return t === 1 ?
|
|
2246
|
+
return t === 1 ? O.listBulletAlternate : t === 2 ? O.listBulletSquare : O.listBullet;
|
|
1846
2247
|
}
|
|
1847
|
-
function
|
|
1848
|
-
if (!
|
|
1849
|
-
...
|
|
1850
|
-
"data-unhandled-rich-text-container":
|
|
1851
|
-
children:
|
|
2248
|
+
function Je({ element: e, path: n }) {
|
|
2249
|
+
if (!He(e)) return /* @__PURE__ */ u("div", {
|
|
2250
|
+
...g(O.unhandled),
|
|
2251
|
+
"data-unhandled-rich-text-container": T(e) ?? "unknown",
|
|
2252
|
+
children: E(e, "rich text container")
|
|
1852
2253
|
});
|
|
1853
2254
|
switch (e.type) {
|
|
1854
|
-
case "rich_text_section": return /* @__PURE__ */
|
|
1855
|
-
...
|
|
2255
|
+
case "rich_text_section": return /* @__PURE__ */ u("div", {
|
|
2256
|
+
...g(O.richSection),
|
|
1856
2257
|
"data-rich-text-section": !0,
|
|
1857
|
-
children: e.elements.map((e, t) => /* @__PURE__ */
|
|
2258
|
+
children: e.elements.map((e, t) => /* @__PURE__ */ u(We, { element: e }, `${T(e) ?? "unknown"}-${String(t)}`))
|
|
1858
2259
|
});
|
|
1859
|
-
case "rich_text_quote": return /* @__PURE__ */
|
|
1860
|
-
...
|
|
2260
|
+
case "rich_text_quote": return /* @__PURE__ */ u("blockquote", {
|
|
2261
|
+
...g(O.quote, e.border === 1 && O.richBorder),
|
|
1861
2262
|
"data-border": e.border ?? 0,
|
|
1862
|
-
children: e.elements.map((e, t) => /* @__PURE__ */
|
|
2263
|
+
children: e.elements.map((e, t) => /* @__PURE__ */ u(We, { element: e }, `${T(e) ?? "unknown"}-${String(t)}`))
|
|
1863
2264
|
});
|
|
1864
|
-
case "rich_text_preformatted": return /* @__PURE__ */
|
|
1865
|
-
...
|
|
2265
|
+
case "rich_text_preformatted": return /* @__PURE__ */ u("pre", {
|
|
2266
|
+
...g(O.pre, e.border === 1 && O.richBorder),
|
|
1866
2267
|
"data-border": e.border ?? 0,
|
|
1867
2268
|
"data-language": e.language,
|
|
1868
|
-
children: e.elements.map((e, t) =>
|
|
2269
|
+
children: e.elements.map((e, t) => /* @__PURE__ */ u(Ge, { element: e }, `${T(e) ?? "unknown"}-${String(t)}`))
|
|
1869
2270
|
});
|
|
1870
2271
|
case "rich_text_list": {
|
|
1871
|
-
let r = Number.isFinite(e.indent) ? Math.trunc(e.indent ?? 0) : 0, i = Math.min(8, Math.max(0, r)), a = Number.isFinite(e.offset) ? Math.trunc(e.offset ?? 0) : 0, o = Math.max(1, a + 1), s = { marginInlineStart: i * 28 }, c = e.style === "ordered" ?
|
|
1872
|
-
...
|
|
2272
|
+
let r = Number.isFinite(e.indent) ? Math.trunc(e.indent ?? 0) : 0, i = Math.min(8, Math.max(0, r)), a = Number.isFinite(e.offset) ? Math.trunc(e.offset ?? 0) : 0, o = Math.max(1, a + 1), s = { marginInlineStart: i * 28 }, c = e.style === "ordered" ? O.listItemOrdered : [O.listItemBullet, qe(i)], l = e.elements.map((e, r) => /* @__PURE__ */ t("li", {
|
|
2273
|
+
...g(c),
|
|
1873
2274
|
key: `${n}.elements[${String(r)}]`
|
|
1874
|
-
}, e.elements.map((e, t) => /* @__PURE__ */
|
|
1875
|
-
return e.style === "ordered" ? /* @__PURE__ */
|
|
1876
|
-
...
|
|
2275
|
+
}, e.elements.map((e, t) => /* @__PURE__ */ u(We, { element: e }, `${T(e) ?? "unknown"}-${String(t)}`))));
|
|
2276
|
+
return e.style === "ordered" ? /* @__PURE__ */ u("ol", {
|
|
2277
|
+
...g(O.list, Ke(i), e.border === 1 && O.richBorder),
|
|
1877
2278
|
"data-border": e.border ?? 0,
|
|
1878
2279
|
"data-indent": i,
|
|
1879
2280
|
start: o,
|
|
1880
2281
|
style: s,
|
|
1881
|
-
children:
|
|
1882
|
-
}) : /* @__PURE__ */
|
|
1883
|
-
...
|
|
2282
|
+
children: l
|
|
2283
|
+
}) : /* @__PURE__ */ u("ul", {
|
|
2284
|
+
...g(O.list, e.border === 1 && O.richBorder),
|
|
1884
2285
|
"data-border": e.border ?? 0,
|
|
1885
2286
|
"data-indent": i,
|
|
1886
2287
|
style: s,
|
|
1887
|
-
children:
|
|
2288
|
+
children: l
|
|
1888
2289
|
});
|
|
1889
2290
|
}
|
|
1890
2291
|
}
|
|
1891
|
-
return
|
|
2292
|
+
return _(e);
|
|
1892
2293
|
}
|
|
1893
|
-
function
|
|
1894
|
-
let r =
|
|
1895
|
-
return /* @__PURE__ */
|
|
2294
|
+
function N({ block: e, className: t, path: n = "block" }) {
|
|
2295
|
+
let r = g(O.richText), i = e, a = w(i) ? i.elements : void 0;
|
|
2296
|
+
return /* @__PURE__ */ u("div", {
|
|
1896
2297
|
...r,
|
|
1897
|
-
className:
|
|
1898
|
-
children: Array.isArray(a) ? a.map((e, t) => /* @__PURE__ */
|
|
2298
|
+
className: A(r.className, t),
|
|
2299
|
+
children: Array.isArray(a) ? a.map((e, t) => /* @__PURE__ */ u(Je, {
|
|
1899
2300
|
element: e,
|
|
1900
2301
|
path: `${n}.elements[${String(t)}]`
|
|
1901
|
-
}, `${
|
|
1902
|
-
...
|
|
2302
|
+
}, `${T(e) ?? "unknown"}-${String(t)}`)) : /* @__PURE__ */ u("div", {
|
|
2303
|
+
...g(O.unhandled),
|
|
1903
2304
|
"data-unhandled-rich-text-block": !0,
|
|
1904
|
-
children:
|
|
2305
|
+
children: E(i, "rich text block")
|
|
1905
2306
|
})
|
|
1906
2307
|
});
|
|
1907
2308
|
}
|
|
1908
2309
|
//#endregion
|
|
1909
2310
|
//#region src/elements/Elements.tsx
|
|
1910
|
-
var
|
|
2311
|
+
var Ye = {
|
|
1911
2312
|
button: !0,
|
|
1912
2313
|
channels_select: !0,
|
|
1913
2314
|
checkboxes: !0,
|
|
@@ -1934,68 +2335,68 @@ var Oe = {
|
|
|
1934
2335
|
users_select: !0,
|
|
1935
2336
|
workflow_button: !0
|
|
1936
2337
|
};
|
|
1937
|
-
function
|
|
1938
|
-
let t =
|
|
1939
|
-
return t !== void 0 && t in
|
|
2338
|
+
function Xe(e) {
|
|
2339
|
+
let t = T(e);
|
|
2340
|
+
return t !== void 0 && t in Ye;
|
|
1940
2341
|
}
|
|
1941
|
-
function
|
|
1942
|
-
if (!
|
|
2342
|
+
function Ze(e) {
|
|
2343
|
+
if (!w(e)) return;
|
|
1943
2344
|
if ("image_url" in e) return typeof e.image_url == "string" ? e.image_url : void 0;
|
|
1944
2345
|
let t = e.slack_file;
|
|
1945
|
-
if (
|
|
2346
|
+
if (w(t) && typeof t.url == "string") return t.url;
|
|
1946
2347
|
}
|
|
1947
|
-
function
|
|
1948
|
-
return
|
|
2348
|
+
function Qe(e) {
|
|
2349
|
+
return w(e) && typeof e.text == "string";
|
|
1949
2350
|
}
|
|
1950
|
-
function
|
|
2351
|
+
function $e(e) {
|
|
1951
2352
|
return e === void 0 || typeof e == "string";
|
|
1952
2353
|
}
|
|
1953
|
-
function
|
|
1954
|
-
return
|
|
2354
|
+
function et(e) {
|
|
2355
|
+
return w(e) && Qe(e.text) && $e(e.value) && (e.description === void 0 || Qe(e.description));
|
|
1955
2356
|
}
|
|
1956
|
-
function
|
|
1957
|
-
return Array.isArray(e) && e.every(
|
|
2357
|
+
function tt(e) {
|
|
2358
|
+
return Array.isArray(e) && e.every(et);
|
|
1958
2359
|
}
|
|
1959
|
-
function
|
|
2360
|
+
function nt(e) {
|
|
1960
2361
|
return Array.isArray(e) && e.every((e) => typeof e == "string");
|
|
1961
2362
|
}
|
|
1962
|
-
function
|
|
1963
|
-
return
|
|
2363
|
+
function rt(e) {
|
|
2364
|
+
return w(e) && Qe(e.text);
|
|
1964
2365
|
}
|
|
1965
|
-
function
|
|
1966
|
-
return !
|
|
2366
|
+
function it(e) {
|
|
2367
|
+
return !w(e) || !tt(e.options) ? !1 : T(e) === "checkboxes" ? e.initial_options === void 0 || tt(e.initial_options) : e.initial_option === void 0 || et(e.initial_option);
|
|
1967
2368
|
}
|
|
1968
|
-
function
|
|
1969
|
-
return e.placeholder === void 0 ||
|
|
2369
|
+
function at(e) {
|
|
2370
|
+
return e.placeholder === void 0 || Qe(e.placeholder);
|
|
1970
2371
|
}
|
|
1971
|
-
function
|
|
2372
|
+
function ot(e) {
|
|
1972
2373
|
let t = e.option_groups;
|
|
1973
|
-
return (e.options === void 0 ||
|
|
1974
|
-
}
|
|
1975
|
-
function
|
|
1976
|
-
if (!
|
|
1977
|
-
switch (
|
|
1978
|
-
case "static_select": return
|
|
1979
|
-
case "multi_static_select": return
|
|
1980
|
-
case "external_select": return e.initial_option === void 0 ||
|
|
1981
|
-
case "multi_external_select": return e.initial_options === void 0 ||
|
|
1982
|
-
case "users_select": return
|
|
1983
|
-
case "multi_users_select": return e.initial_users === void 0 ||
|
|
1984
|
-
case "channels_select": return
|
|
1985
|
-
case "multi_channels_select": return e.initial_channels === void 0 ||
|
|
1986
|
-
case "conversations_select": return
|
|
1987
|
-
case "multi_conversations_select": return e.initial_conversations === void 0 ||
|
|
2374
|
+
return (e.options === void 0 || tt(e.options)) && (t === void 0 || Array.isArray(t) && t.every((e) => w(e) && tt(e.options)));
|
|
2375
|
+
}
|
|
2376
|
+
function st(e) {
|
|
2377
|
+
if (!w(e) || !at(e)) return !1;
|
|
2378
|
+
switch (T(e) ?? "") {
|
|
2379
|
+
case "static_select": return ot(e) && (e.initial_option === void 0 || et(e.initial_option));
|
|
2380
|
+
case "multi_static_select": return ot(e) && (e.initial_options === void 0 || tt(e.initial_options));
|
|
2381
|
+
case "external_select": return e.initial_option === void 0 || et(e.initial_option);
|
|
2382
|
+
case "multi_external_select": return e.initial_options === void 0 || tt(e.initial_options);
|
|
2383
|
+
case "users_select": return $e(e.initial_user);
|
|
2384
|
+
case "multi_users_select": return e.initial_users === void 0 || nt(e.initial_users);
|
|
2385
|
+
case "channels_select": return $e(e.initial_channel);
|
|
2386
|
+
case "multi_channels_select": return e.initial_channels === void 0 || nt(e.initial_channels);
|
|
2387
|
+
case "conversations_select": return $e(e.initial_conversation);
|
|
2388
|
+
case "multi_conversations_select": return e.initial_conversations === void 0 || nt(e.initial_conversations);
|
|
1988
2389
|
default: return !1;
|
|
1989
2390
|
}
|
|
1990
2391
|
}
|
|
1991
|
-
function
|
|
1992
|
-
if (!
|
|
1993
|
-
switch (
|
|
2392
|
+
function ct(e) {
|
|
2393
|
+
if (!w(e)) return !1;
|
|
2394
|
+
switch (T(e) ?? "") {
|
|
1994
2395
|
case "plain_text_input":
|
|
1995
2396
|
case "email_text_input":
|
|
1996
2397
|
case "url_text_input":
|
|
1997
|
-
case "number_input": return
|
|
1998
|
-
case "datepicker": return
|
|
2398
|
+
case "number_input": return at(e);
|
|
2399
|
+
case "datepicker": return $e(e.initial_date);
|
|
1999
2400
|
case "file_input": return e.filetypes === void 0 || Array.isArray(e.filetypes);
|
|
2000
2401
|
case "datetimepicker":
|
|
2001
2402
|
case "timepicker":
|
|
@@ -2003,71 +2404,76 @@ function Be(e) {
|
|
|
2003
2404
|
default: return !1;
|
|
2004
2405
|
}
|
|
2005
2406
|
}
|
|
2006
|
-
function
|
|
2007
|
-
let n =
|
|
2008
|
-
return /* @__PURE__ */
|
|
2407
|
+
function P({ className: e, element: t }) {
|
|
2408
|
+
let n = g(O.unhandled);
|
|
2409
|
+
return /* @__PURE__ */ u("span", {
|
|
2009
2410
|
...n,
|
|
2010
|
-
className:
|
|
2011
|
-
"data-unhandled-element":
|
|
2012
|
-
children:
|
|
2411
|
+
className: A(n.className, e),
|
|
2412
|
+
"data-unhandled-element": T(t) ?? "unknown",
|
|
2413
|
+
children: E(t, "Block Kit element")
|
|
2013
2414
|
});
|
|
2014
2415
|
}
|
|
2015
|
-
function
|
|
2016
|
-
let r =
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
"
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2416
|
+
function F({ className: e, element: t, variant: n }) {
|
|
2417
|
+
let r = g(O.image, n === "accessory" && O.accessoryImage, n === "cardHero" && O.cardHero, n === "cardIcon" && O.cardIcon, n === "context" && O.contextImage), i = t, a = w(i) && typeof i.alt_text == "string" ? i.alt_text : E(i, "image"), o = Ze(t);
|
|
2418
|
+
if (o === void 0) {
|
|
2419
|
+
let t = g(O.image, O.imagePlaceholder, n === "accessory" && O.accessoryImage, n === "cardHero" && O.cardHero, n === "cardIcon" && O.cardIcon, n === "context" && O.contextImage);
|
|
2420
|
+
return /* @__PURE__ */ u("div", {
|
|
2421
|
+
...t,
|
|
2422
|
+
"aria-label": a,
|
|
2423
|
+
className: A(t.className, e),
|
|
2424
|
+
role: "img",
|
|
2425
|
+
children: /* @__PURE__ */ u(le, { size: n === "context" ? 14 : 28 })
|
|
2426
|
+
});
|
|
2427
|
+
}
|
|
2428
|
+
return /* @__PURE__ */ u("img", {
|
|
2023
2429
|
...r,
|
|
2024
2430
|
alt: a,
|
|
2025
|
-
className:
|
|
2431
|
+
className: A(r.className, e),
|
|
2026
2432
|
src: o
|
|
2027
2433
|
});
|
|
2028
2434
|
}
|
|
2029
|
-
function
|
|
2030
|
-
let { onAction: r } =
|
|
2031
|
-
if (!
|
|
2435
|
+
function lt({ blockId: e, className: t, element: n }) {
|
|
2436
|
+
let { onAction: r } = x();
|
|
2437
|
+
if (!rt(n)) return /* @__PURE__ */ u(P, {
|
|
2032
2438
|
className: t,
|
|
2033
2439
|
element: n
|
|
2034
2440
|
});
|
|
2035
|
-
let i =
|
|
2441
|
+
let i = g(O.button, n.style === "primary" && O.buttonPrimary, n.style === "danger" && O.buttonDanger), a = () => {
|
|
2036
2442
|
n.action_id !== void 0 && r?.({
|
|
2037
2443
|
actionId: n.action_id,
|
|
2038
2444
|
type: n.type,
|
|
2039
2445
|
...e === void 0 ? {} : { blockId: e },
|
|
2040
2446
|
...n.value === void 0 ? {} : { value: n.value }
|
|
2041
2447
|
});
|
|
2042
|
-
}, o =
|
|
2043
|
-
return o === void 0 ? /* @__PURE__ */
|
|
2448
|
+
}, o = D(n.url);
|
|
2449
|
+
return o === void 0 ? /* @__PURE__ */ u("button", {
|
|
2044
2450
|
...i,
|
|
2045
2451
|
"aria-label": n.accessibility_label,
|
|
2046
|
-
className:
|
|
2452
|
+
className: A(i.className, t),
|
|
2047
2453
|
onClick: a,
|
|
2048
2454
|
type: "button",
|
|
2049
2455
|
children: n.text.text
|
|
2050
|
-
}) : /* @__PURE__ */
|
|
2456
|
+
}) : /* @__PURE__ */ u("a", {
|
|
2051
2457
|
...i,
|
|
2052
2458
|
"aria-label": n.accessibility_label,
|
|
2053
|
-
className:
|
|
2459
|
+
className: A(i.className, t),
|
|
2054
2460
|
href: o,
|
|
2055
2461
|
onClick: a,
|
|
2056
2462
|
rel: "noreferrer",
|
|
2057
2463
|
children: n.text.text
|
|
2058
2464
|
});
|
|
2059
2465
|
}
|
|
2060
|
-
function
|
|
2061
|
-
let { onAction: r } =
|
|
2062
|
-
if (!
|
|
2466
|
+
function ut({ blockId: e, className: t, element: n }) {
|
|
2467
|
+
let { onAction: r } = x();
|
|
2468
|
+
if (!w(n)) return /* @__PURE__ */ u(P, {
|
|
2063
2469
|
className: t,
|
|
2064
2470
|
element: n
|
|
2065
2471
|
});
|
|
2066
|
-
let i =
|
|
2067
|
-
return /* @__PURE__ */
|
|
2472
|
+
let i = g(O.button, O.overflowButton);
|
|
2473
|
+
return /* @__PURE__ */ u("button", {
|
|
2068
2474
|
...i,
|
|
2069
2475
|
"aria-label": "More options",
|
|
2070
|
-
className:
|
|
2476
|
+
className: A(i.className, t),
|
|
2071
2477
|
onClick: () => {
|
|
2072
2478
|
n.action_id !== void 0 && r?.({
|
|
2073
2479
|
actionId: n.action_id,
|
|
@@ -2076,34 +2482,34 @@ function He({ blockId: e, className: t, element: n }) {
|
|
|
2076
2482
|
});
|
|
2077
2483
|
},
|
|
2078
2484
|
type: "button",
|
|
2079
|
-
children:
|
|
2485
|
+
children: /* @__PURE__ */ u(oe, { size: 16 })
|
|
2080
2486
|
});
|
|
2081
2487
|
}
|
|
2082
|
-
function
|
|
2488
|
+
function dt(e, t) {
|
|
2083
2489
|
return e.value ?? `${e.text.text}-${String(t)}`;
|
|
2084
2490
|
}
|
|
2085
|
-
function
|
|
2491
|
+
function ft(e, t) {
|
|
2086
2492
|
return t?.some((t) => t.value === e.value && t.text.text === e.text.text) ?? !1;
|
|
2087
2493
|
}
|
|
2088
|
-
function
|
|
2089
|
-
let { onAction: i } =
|
|
2090
|
-
if (!
|
|
2494
|
+
function pt({ blockId: e, className: n, element: r }) {
|
|
2495
|
+
let { onAction: i } = x(), o = a();
|
|
2496
|
+
if (!it(r)) return /* @__PURE__ */ u(P, {
|
|
2091
2497
|
className: n,
|
|
2092
2498
|
element: r
|
|
2093
2499
|
});
|
|
2094
|
-
let
|
|
2095
|
-
return /* @__PURE__ */
|
|
2096
|
-
...
|
|
2097
|
-
className:
|
|
2500
|
+
let s = g(O.choiceGroup), c = r.type === "checkboxes" ? r.initial_options : r.initial_option === void 0 ? void 0 : [r.initial_option];
|
|
2501
|
+
return /* @__PURE__ */ u("fieldset", {
|
|
2502
|
+
...s,
|
|
2503
|
+
className: A(s.className, n),
|
|
2098
2504
|
"data-element-type": r.type,
|
|
2099
2505
|
children: r.options.map((n, a) => {
|
|
2100
|
-
let s =
|
|
2506
|
+
let s = dt(n, a);
|
|
2101
2507
|
return /* @__PURE__ */ t("label", {
|
|
2102
|
-
...
|
|
2508
|
+
...g(O.choice),
|
|
2103
2509
|
key: s
|
|
2104
|
-
}, /* @__PURE__ */
|
|
2105
|
-
defaultChecked:
|
|
2106
|
-
name:
|
|
2510
|
+
}, /* @__PURE__ */ u("input", {
|
|
2511
|
+
defaultChecked: ft(n, c),
|
|
2512
|
+
name: o,
|
|
2107
2513
|
onChange: (t) => {
|
|
2108
2514
|
if (r.action_id !== void 0) {
|
|
2109
2515
|
let n = r.type === "checkboxes" ? Array.from(t.currentTarget.closest("fieldset")?.querySelectorAll("input[type=\"checkbox\"]:checked") ?? [], (e) => e.value) : void 0;
|
|
@@ -2117,50 +2523,50 @@ function Ge({ blockId: e, className: n, element: r }) {
|
|
|
2117
2523
|
},
|
|
2118
2524
|
type: r.type === "checkboxes" ? "checkbox" : "radio",
|
|
2119
2525
|
value: s
|
|
2120
|
-
}), /* @__PURE__ */
|
|
2121
|
-
...
|
|
2526
|
+
}), /* @__PURE__ */ d("span", { children: [n.text.text, n.description === void 0 ? null : /* @__PURE__ */ d("span", {
|
|
2527
|
+
...g(O.smallText),
|
|
2122
2528
|
children: [" ", n.description.text]
|
|
2123
2529
|
})] }));
|
|
2124
2530
|
})
|
|
2125
2531
|
});
|
|
2126
2532
|
}
|
|
2127
|
-
function
|
|
2533
|
+
function mt(e) {
|
|
2128
2534
|
return e.options === void 0 ? e.option_groups?.flatMap((e) => e.options) ?? [] : e.options;
|
|
2129
2535
|
}
|
|
2130
|
-
function
|
|
2536
|
+
function ht(e) {
|
|
2131
2537
|
return e.map((e, t) => ({
|
|
2132
2538
|
label: e.text.text,
|
|
2133
|
-
value:
|
|
2539
|
+
value: dt(e, t)
|
|
2134
2540
|
}));
|
|
2135
2541
|
}
|
|
2136
|
-
function
|
|
2542
|
+
function gt(e) {
|
|
2137
2543
|
return e.map((e) => ({
|
|
2138
2544
|
label: e,
|
|
2139
2545
|
value: e
|
|
2140
2546
|
}));
|
|
2141
2547
|
}
|
|
2142
|
-
function
|
|
2548
|
+
function _t(e) {
|
|
2143
2549
|
switch (e.type) {
|
|
2144
2550
|
case "static_select":
|
|
2145
|
-
case "multi_static_select": return
|
|
2146
|
-
case "external_select": return e.initial_option === void 0 ? [] :
|
|
2147
|
-
case "multi_external_select": return
|
|
2148
|
-
case "users_select": return
|
|
2149
|
-
case "multi_users_select": return
|
|
2150
|
-
case "channels_select": return
|
|
2151
|
-
case "multi_channels_select": return
|
|
2152
|
-
case "conversations_select": return
|
|
2153
|
-
case "multi_conversations_select": return
|
|
2551
|
+
case "multi_static_select": return ht(mt(e));
|
|
2552
|
+
case "external_select": return e.initial_option === void 0 ? [] : ht([e.initial_option]);
|
|
2553
|
+
case "multi_external_select": return ht(e.initial_options ?? []);
|
|
2554
|
+
case "users_select": return gt(e.initial_user === void 0 ? [] : [e.initial_user]);
|
|
2555
|
+
case "multi_users_select": return gt(e.initial_users ?? []);
|
|
2556
|
+
case "channels_select": return gt(e.initial_channel === void 0 ? [] : [e.initial_channel]);
|
|
2557
|
+
case "multi_channels_select": return gt(e.initial_channels ?? []);
|
|
2558
|
+
case "conversations_select": return gt(e.initial_conversation === void 0 ? [] : [e.initial_conversation]);
|
|
2559
|
+
case "multi_conversations_select": return gt(e.initial_conversations ?? []);
|
|
2154
2560
|
}
|
|
2155
|
-
return
|
|
2561
|
+
return _(e);
|
|
2156
2562
|
}
|
|
2157
|
-
function
|
|
2158
|
-
return e.flatMap((e, n) =>
|
|
2563
|
+
function vt(e, t) {
|
|
2564
|
+
return e.flatMap((e, n) => ft(e, t) ? [dt(e, n)] : []);
|
|
2159
2565
|
}
|
|
2160
|
-
function
|
|
2566
|
+
function yt(e, t) {
|
|
2161
2567
|
switch (e.type) {
|
|
2162
|
-
case "static_select": return
|
|
2163
|
-
case "multi_static_select": return
|
|
2568
|
+
case "static_select": return vt(mt(e), e.initial_option === void 0 ? void 0 : [e.initial_option]);
|
|
2569
|
+
case "multi_static_select": return vt(mt(e), e.initial_options);
|
|
2164
2570
|
case "external_select":
|
|
2165
2571
|
case "multi_external_select":
|
|
2166
2572
|
case "users_select":
|
|
@@ -2170,9 +2576,9 @@ function Ze(e, t) {
|
|
|
2170
2576
|
case "conversations_select":
|
|
2171
2577
|
case "multi_conversations_select": return t.map((e) => e.value);
|
|
2172
2578
|
}
|
|
2173
|
-
return
|
|
2579
|
+
return _(e);
|
|
2174
2580
|
}
|
|
2175
|
-
function
|
|
2581
|
+
function bt(e) {
|
|
2176
2582
|
if ("placeholder" in e && e.placeholder !== void 0) return e.placeholder.text;
|
|
2177
2583
|
switch (e.type) {
|
|
2178
2584
|
case "users_select":
|
|
@@ -2186,15 +2592,15 @@ function Qe(e) {
|
|
|
2186
2592
|
case "multi_static_select":
|
|
2187
2593
|
case "static_select": return "Select an option";
|
|
2188
2594
|
}
|
|
2189
|
-
return
|
|
2595
|
+
return _(e);
|
|
2190
2596
|
}
|
|
2191
|
-
function
|
|
2192
|
-
let { onAction: r } =
|
|
2193
|
-
if (!
|
|
2597
|
+
function xt({ blockId: e, className: t, element: n }) {
|
|
2598
|
+
let { onAction: r } = x();
|
|
2599
|
+
if (!st(n)) return /* @__PURE__ */ u(P, {
|
|
2194
2600
|
className: t,
|
|
2195
2601
|
element: n
|
|
2196
2602
|
});
|
|
2197
|
-
let i =
|
|
2603
|
+
let i = g(O.select), a = n.type.startsWith("multi_"), o = _t(n), s = yt(n, o), c = (t) => {
|
|
2198
2604
|
if (n.action_id !== void 0) {
|
|
2199
2605
|
let i = Array.from(t.currentTarget.selectedOptions, (e) => e.value);
|
|
2200
2606
|
r?.({
|
|
@@ -2204,51 +2610,67 @@ function $e({ blockId: e, className: t, element: n }) {
|
|
|
2204
2610
|
...a ? { values: i } : { value: t.currentTarget.value }
|
|
2205
2611
|
});
|
|
2206
2612
|
}
|
|
2207
|
-
}
|
|
2208
|
-
|
|
2613
|
+
}, f = /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("option", {
|
|
2614
|
+
disabled: !0,
|
|
2615
|
+
value: "",
|
|
2616
|
+
children: bt(n)
|
|
2617
|
+
}), o.length === 0 ? /* @__PURE__ */ u("option", {
|
|
2618
|
+
value: "preview",
|
|
2619
|
+
children: "Preview option"
|
|
2620
|
+
}) : o.map((e) => /* @__PURE__ */ u("option", {
|
|
2621
|
+
value: e.value,
|
|
2622
|
+
children: e.label
|
|
2623
|
+
}, e.value))] });
|
|
2624
|
+
if (a) return /* @__PURE__ */ u("select", {
|
|
2209
2625
|
...i,
|
|
2210
|
-
"aria-label":
|
|
2211
|
-
className:
|
|
2212
|
-
defaultValue:
|
|
2213
|
-
multiple:
|
|
2626
|
+
"aria-label": bt(n),
|
|
2627
|
+
className: A(i.className, t),
|
|
2628
|
+
defaultValue: s,
|
|
2629
|
+
multiple: !0,
|
|
2214
2630
|
onChange: c,
|
|
2215
|
-
children:
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2631
|
+
children: f
|
|
2632
|
+
});
|
|
2633
|
+
let p = g(O.selectWrap);
|
|
2634
|
+
return /* @__PURE__ */ d("span", {
|
|
2635
|
+
...p,
|
|
2636
|
+
className: A(p.className, t),
|
|
2637
|
+
children: [/* @__PURE__ */ u("select", {
|
|
2638
|
+
...g(O.select, O.selectWithChevron),
|
|
2639
|
+
"aria-label": bt(n),
|
|
2640
|
+
defaultValue: s[0] ?? "",
|
|
2641
|
+
onChange: c,
|
|
2642
|
+
children: f
|
|
2643
|
+
}), /* @__PURE__ */ u("span", {
|
|
2644
|
+
...g(O.selectChevron),
|
|
2645
|
+
"aria-hidden": "true",
|
|
2646
|
+
children: /* @__PURE__ */ u(ee, { size: 16 })
|
|
2647
|
+
})]
|
|
2226
2648
|
});
|
|
2227
2649
|
}
|
|
2228
|
-
function
|
|
2650
|
+
function St(e) {
|
|
2229
2651
|
return String(e).padStart(2, "0");
|
|
2230
2652
|
}
|
|
2231
|
-
function
|
|
2232
|
-
return `${String(e.getFullYear())}-${
|
|
2653
|
+
function Ct(e) {
|
|
2654
|
+
return `${String(e.getFullYear())}-${St(e.getMonth() + 1)}-${St(e.getDate())}`;
|
|
2233
2655
|
}
|
|
2234
|
-
function
|
|
2656
|
+
function wt(e) {
|
|
2235
2657
|
if (e === void 0) return "Select a date";
|
|
2236
|
-
if (e ===
|
|
2658
|
+
if (e === Ct(/* @__PURE__ */ new Date())) return "Today";
|
|
2237
2659
|
let [t = "", n = "", r = ""] = e.split("-");
|
|
2238
2660
|
return `${n}/${r}/${t}`;
|
|
2239
2661
|
}
|
|
2240
|
-
function
|
|
2662
|
+
function Tt(e) {
|
|
2241
2663
|
if (e === void 0) return;
|
|
2242
2664
|
let t = /* @__PURE__ */ new Date(e * 1e3);
|
|
2243
|
-
if (!Number.isNaN(t.getTime())) return `${String(t.getFullYear())}-${
|
|
2665
|
+
if (!Number.isNaN(t.getTime())) return `${String(t.getFullYear())}-${St(t.getMonth() + 1)}-${St(t.getDate())}T${St(t.getHours())}:${St(t.getMinutes())}`;
|
|
2244
2666
|
}
|
|
2245
|
-
function
|
|
2246
|
-
let { onAction: i } =
|
|
2247
|
-
if (!
|
|
2667
|
+
function Et({ blockId: e, className: t, element: n, path: r = "element" }) {
|
|
2668
|
+
let { onAction: i } = x();
|
|
2669
|
+
if (!ct(n)) return /* @__PURE__ */ u(P, {
|
|
2248
2670
|
className: t,
|
|
2249
2671
|
element: n
|
|
2250
2672
|
});
|
|
2251
|
-
let a =
|
|
2673
|
+
let a = g(O.input), o = (t) => {
|
|
2252
2674
|
n.action_id !== void 0 && i?.({
|
|
2253
2675
|
actionId: n.action_id,
|
|
2254
2676
|
type: n.type,
|
|
@@ -2259,18 +2681,18 @@ function it({ blockId: e, className: t, element: n, path: r = "element" }) {
|
|
|
2259
2681
|
o(e.currentTarget.value);
|
|
2260
2682
|
};
|
|
2261
2683
|
switch (n.type) {
|
|
2262
|
-
case "plain_text_input": return n.multiline === !0 ? /* @__PURE__ */
|
|
2684
|
+
case "plain_text_input": return n.multiline === !0 ? /* @__PURE__ */ u("textarea", {
|
|
2263
2685
|
...a,
|
|
2264
|
-
className:
|
|
2686
|
+
className: A(a.className, t),
|
|
2265
2687
|
defaultValue: n.initial_value,
|
|
2266
2688
|
maxLength: n.max_length,
|
|
2267
2689
|
minLength: n.min_length,
|
|
2268
2690
|
onChange: s,
|
|
2269
2691
|
placeholder: n.placeholder?.text,
|
|
2270
2692
|
rows: 4
|
|
2271
|
-
}) : /* @__PURE__ */
|
|
2693
|
+
}) : /* @__PURE__ */ u("input", {
|
|
2272
2694
|
...a,
|
|
2273
|
-
className:
|
|
2695
|
+
className: A(a.className, t),
|
|
2274
2696
|
defaultValue: n.initial_value,
|
|
2275
2697
|
maxLength: n.max_length,
|
|
2276
2698
|
minLength: n.min_length,
|
|
@@ -2278,25 +2700,25 @@ function it({ blockId: e, className: t, element: n, path: r = "element" }) {
|
|
|
2278
2700
|
placeholder: n.placeholder?.text,
|
|
2279
2701
|
type: "text"
|
|
2280
2702
|
});
|
|
2281
|
-
case "email_text_input": return /* @__PURE__ */
|
|
2703
|
+
case "email_text_input": return /* @__PURE__ */ u("input", {
|
|
2282
2704
|
...a,
|
|
2283
|
-
className:
|
|
2705
|
+
className: A(a.className, t),
|
|
2284
2706
|
defaultValue: n.initial_value,
|
|
2285
2707
|
onChange: s,
|
|
2286
2708
|
placeholder: n.placeholder?.text,
|
|
2287
2709
|
type: "email"
|
|
2288
2710
|
});
|
|
2289
|
-
case "url_text_input": return /* @__PURE__ */
|
|
2711
|
+
case "url_text_input": return /* @__PURE__ */ u("input", {
|
|
2290
2712
|
...a,
|
|
2291
|
-
className:
|
|
2713
|
+
className: A(a.className, t),
|
|
2292
2714
|
defaultValue: n.initial_value,
|
|
2293
2715
|
onChange: s,
|
|
2294
2716
|
placeholder: n.placeholder?.text,
|
|
2295
2717
|
type: "url"
|
|
2296
2718
|
});
|
|
2297
|
-
case "number_input": return /* @__PURE__ */
|
|
2719
|
+
case "number_input": return /* @__PURE__ */ u("input", {
|
|
2298
2720
|
...a,
|
|
2299
|
-
className:
|
|
2721
|
+
className: A(a.className, t),
|
|
2300
2722
|
defaultValue: n.initial_value,
|
|
2301
2723
|
max: n.max_value,
|
|
2302
2724
|
min: n.min_value,
|
|
@@ -2306,93 +2728,93 @@ function it({ blockId: e, className: t, element: n, path: r = "element" }) {
|
|
|
2306
2728
|
type: "number"
|
|
2307
2729
|
});
|
|
2308
2730
|
case "datepicker": {
|
|
2309
|
-
let e =
|
|
2310
|
-
return /* @__PURE__ */
|
|
2731
|
+
let e = g(O.button, O.picker);
|
|
2732
|
+
return /* @__PURE__ */ d("button", {
|
|
2311
2733
|
...e,
|
|
2312
2734
|
"aria-label": "Date",
|
|
2313
|
-
className:
|
|
2735
|
+
className: A(e.className, t),
|
|
2314
2736
|
onClick: () => {
|
|
2315
2737
|
o(n.initial_date ?? "");
|
|
2316
2738
|
},
|
|
2317
2739
|
type: "button",
|
|
2318
2740
|
children: [
|
|
2319
|
-
/* @__PURE__ */
|
|
2320
|
-
...
|
|
2741
|
+
/* @__PURE__ */ u("span", {
|
|
2742
|
+
...g(O.pickerIcon),
|
|
2321
2743
|
"aria-hidden": "true",
|
|
2322
|
-
children:
|
|
2744
|
+
children: /* @__PURE__ */ u(C, { size: 16 })
|
|
2323
2745
|
}),
|
|
2324
|
-
|
|
2325
|
-
/* @__PURE__ */
|
|
2326
|
-
...
|
|
2746
|
+
wt(n.initial_date),
|
|
2747
|
+
/* @__PURE__ */ u("span", {
|
|
2748
|
+
...g(O.pickerChevron),
|
|
2327
2749
|
"aria-hidden": "true",
|
|
2328
|
-
children:
|
|
2750
|
+
children: /* @__PURE__ */ u(ee, { size: 16 })
|
|
2329
2751
|
})
|
|
2330
2752
|
]
|
|
2331
2753
|
});
|
|
2332
2754
|
}
|
|
2333
|
-
case "datetimepicker": return /* @__PURE__ */
|
|
2755
|
+
case "datetimepicker": return /* @__PURE__ */ u("input", {
|
|
2334
2756
|
...a,
|
|
2335
|
-
className:
|
|
2336
|
-
defaultValue:
|
|
2757
|
+
className: A(a.className, t),
|
|
2758
|
+
defaultValue: Tt(n.initial_date_time),
|
|
2337
2759
|
onChange: s,
|
|
2338
2760
|
type: "datetime-local"
|
|
2339
2761
|
});
|
|
2340
|
-
case "timepicker": return /* @__PURE__ */
|
|
2762
|
+
case "timepicker": return /* @__PURE__ */ u("input", {
|
|
2341
2763
|
...a,
|
|
2342
|
-
className:
|
|
2764
|
+
className: A(a.className, t),
|
|
2343
2765
|
defaultValue: n.initial_time,
|
|
2344
2766
|
onChange: s,
|
|
2345
2767
|
type: "time"
|
|
2346
2768
|
});
|
|
2347
|
-
case "file_input": return /* @__PURE__ */
|
|
2769
|
+
case "file_input": return /* @__PURE__ */ u("input", {
|
|
2348
2770
|
...a,
|
|
2349
2771
|
accept: n.filetypes?.map((e) => `.${e}`).join(","),
|
|
2350
|
-
className:
|
|
2772
|
+
className: A(a.className, t),
|
|
2351
2773
|
multiple: (n.max_files ?? 10) > 1,
|
|
2352
2774
|
onChange: (e) => {
|
|
2353
2775
|
o(e.currentTarget.files?.[0]?.name ?? "");
|
|
2354
2776
|
},
|
|
2355
2777
|
type: "file"
|
|
2356
2778
|
});
|
|
2357
|
-
case "rich_text_input": return /* @__PURE__ */
|
|
2779
|
+
case "rich_text_input": return /* @__PURE__ */ u("div", {
|
|
2358
2780
|
...a,
|
|
2359
|
-
className:
|
|
2781
|
+
className: A(a.className, t),
|
|
2360
2782
|
contentEditable: !0,
|
|
2361
2783
|
onInput: (e) => {
|
|
2362
2784
|
o(e.currentTarget.textContent ?? "");
|
|
2363
2785
|
},
|
|
2364
2786
|
role: "textbox",
|
|
2365
2787
|
suppressContentEditableWarning: !0,
|
|
2366
|
-
children: n.initial_value === void 0 ? null : /* @__PURE__ */
|
|
2788
|
+
children: n.initial_value === void 0 ? null : /* @__PURE__ */ u(N, {
|
|
2367
2789
|
block: n.initial_value,
|
|
2368
2790
|
path: `${r}.initial_value`
|
|
2369
2791
|
})
|
|
2370
2792
|
});
|
|
2371
2793
|
}
|
|
2372
|
-
return
|
|
2794
|
+
return _(n);
|
|
2373
2795
|
}
|
|
2374
|
-
function
|
|
2375
|
-
if (!
|
|
2796
|
+
function Dt({ blockId: e, className: t, element: n, path: r = "element" }) {
|
|
2797
|
+
if (!Xe(n)) return /* @__PURE__ */ u(P, {
|
|
2376
2798
|
className: t,
|
|
2377
2799
|
element: n
|
|
2378
2800
|
});
|
|
2379
|
-
if (n.type === "image") return /* @__PURE__ */
|
|
2801
|
+
if (n.type === "image") return /* @__PURE__ */ u(F, {
|
|
2380
2802
|
className: t,
|
|
2381
2803
|
element: n
|
|
2382
2804
|
});
|
|
2383
2805
|
switch (n.type) {
|
|
2384
|
-
case "button": return /* @__PURE__ */
|
|
2806
|
+
case "button": return /* @__PURE__ */ u(lt, {
|
|
2385
2807
|
blockId: e,
|
|
2386
2808
|
className: t,
|
|
2387
2809
|
element: n
|
|
2388
2810
|
});
|
|
2389
2811
|
case "checkboxes":
|
|
2390
|
-
case "radio_buttons": return /* @__PURE__ */
|
|
2812
|
+
case "radio_buttons": return /* @__PURE__ */ u(pt, {
|
|
2391
2813
|
blockId: e,
|
|
2392
2814
|
className: t,
|
|
2393
2815
|
element: n
|
|
2394
2816
|
});
|
|
2395
|
-
case "overflow": return /* @__PURE__ */
|
|
2817
|
+
case "overflow": return /* @__PURE__ */ u(ut, {
|
|
2396
2818
|
blockId: e,
|
|
2397
2819
|
className: t,
|
|
2398
2820
|
element: n
|
|
@@ -2406,7 +2828,7 @@ function at({ blockId: e, className: t, element: n, path: r = "element" }) {
|
|
|
2406
2828
|
case "multi_static_select":
|
|
2407
2829
|
case "multi_users_select":
|
|
2408
2830
|
case "static_select":
|
|
2409
|
-
case "users_select": return /* @__PURE__ */
|
|
2831
|
+
case "users_select": return /* @__PURE__ */ u(xt, {
|
|
2410
2832
|
blockId: e,
|
|
2411
2833
|
className: t,
|
|
2412
2834
|
element: n
|
|
@@ -2419,47 +2841,51 @@ function at({ blockId: e, className: t, element: n, path: r = "element" }) {
|
|
|
2419
2841
|
case "plain_text_input":
|
|
2420
2842
|
case "rich_text_input":
|
|
2421
2843
|
case "timepicker":
|
|
2422
|
-
case "url_text_input": return /* @__PURE__ */
|
|
2844
|
+
case "url_text_input": return /* @__PURE__ */ u(Et, {
|
|
2423
2845
|
blockId: e,
|
|
2424
2846
|
className: t,
|
|
2425
2847
|
element: n,
|
|
2426
2848
|
path: r
|
|
2427
2849
|
});
|
|
2428
2850
|
case "workflow_button": {
|
|
2429
|
-
if (!
|
|
2851
|
+
if (!rt(n)) return /* @__PURE__ */ u(P, {
|
|
2430
2852
|
className: t,
|
|
2431
2853
|
element: n
|
|
2432
2854
|
});
|
|
2433
|
-
let e =
|
|
2434
|
-
return /* @__PURE__ */
|
|
2855
|
+
let e = g(O.button);
|
|
2856
|
+
return /* @__PURE__ */ u("button", {
|
|
2435
2857
|
...e,
|
|
2436
|
-
className:
|
|
2858
|
+
className: A(e.className, t),
|
|
2437
2859
|
type: "button",
|
|
2438
2860
|
children: n.text.text
|
|
2439
2861
|
});
|
|
2440
2862
|
}
|
|
2441
2863
|
}
|
|
2442
|
-
return
|
|
2864
|
+
return _(n);
|
|
2443
2865
|
}
|
|
2444
2866
|
//#endregion
|
|
2445
2867
|
//#region src/text/Mrkdwn.tsx
|
|
2446
|
-
var
|
|
2868
|
+
var Ot = /* @__PURE__ */ new Set([
|
|
2447
2869
|
"*",
|
|
2448
2870
|
"_",
|
|
2449
2871
|
"~",
|
|
2450
2872
|
"`",
|
|
2451
2873
|
"<",
|
|
2452
2874
|
":"
|
|
2453
|
-
]),
|
|
2454
|
-
function
|
|
2875
|
+
]), kt = /^[a-z0-9_+-]{1,64}$/, At = /[A-Za-z0-9]/;
|
|
2876
|
+
function jt(e) {
|
|
2455
2877
|
return e.replaceAll("<", "<").replaceAll(">", ">").replaceAll("&", "&");
|
|
2456
2878
|
}
|
|
2457
|
-
function
|
|
2458
|
-
let t =
|
|
2459
|
-
if (t.startsWith("@"))
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2879
|
+
function Mt(e) {
|
|
2880
|
+
let t = jt(e);
|
|
2881
|
+
if (t.startsWith("@")) {
|
|
2882
|
+
let [e = "", n] = t.slice(1).split("|", 2);
|
|
2883
|
+
return {
|
|
2884
|
+
id: e,
|
|
2885
|
+
kind: "user",
|
|
2886
|
+
...n === void 0 ? {} : { fallback: n }
|
|
2887
|
+
};
|
|
2888
|
+
}
|
|
2463
2889
|
if (t.startsWith("#")) {
|
|
2464
2890
|
let [e = "", n] = t.slice(1).split("|", 2);
|
|
2465
2891
|
return {
|
|
@@ -2486,10 +2912,13 @@ function ut(e) {
|
|
|
2486
2912
|
...a === void 0 ? {} : { href: a }
|
|
2487
2913
|
};
|
|
2488
2914
|
}
|
|
2489
|
-
if (t
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2915
|
+
if (t.startsWith("!")) {
|
|
2916
|
+
let [e = ""] = t.slice(1).split("|", 2);
|
|
2917
|
+
if (e === "here" || e === "channel" || e === "everyone") return {
|
|
2918
|
+
kind: "broadcast",
|
|
2919
|
+
range: e
|
|
2920
|
+
};
|
|
2921
|
+
}
|
|
2493
2922
|
let n = t.indexOf("|");
|
|
2494
2923
|
if (n >= 0) return {
|
|
2495
2924
|
href: t.slice(0, n),
|
|
@@ -2502,14 +2931,14 @@ function ut(e) {
|
|
|
2502
2931
|
label: t
|
|
2503
2932
|
};
|
|
2504
2933
|
}
|
|
2505
|
-
function
|
|
2506
|
-
for (let n = t; n < e.length; n += 1) if (
|
|
2934
|
+
function Nt(e, t) {
|
|
2935
|
+
for (let n = t; n < e.length; n += 1) if (Ot.has(e[n] ?? "")) return n;
|
|
2507
2936
|
return e.length;
|
|
2508
2937
|
}
|
|
2509
|
-
function
|
|
2938
|
+
function Pt(e, t) {
|
|
2510
2939
|
if (t > 16) return [{
|
|
2511
2940
|
kind: "text",
|
|
2512
|
-
value:
|
|
2941
|
+
value: jt(e)
|
|
2513
2942
|
}];
|
|
2514
2943
|
let n = [], r = 0;
|
|
2515
2944
|
for (; r < e.length;) {
|
|
@@ -2518,7 +2947,7 @@ function ft(e, t) {
|
|
|
2518
2947
|
if (t >= 0) {
|
|
2519
2948
|
n.push({
|
|
2520
2949
|
kind: "code_block",
|
|
2521
|
-
value:
|
|
2950
|
+
value: jt(e.slice(r + 3, t))
|
|
2522
2951
|
}), r = t + 3;
|
|
2523
2952
|
continue;
|
|
2524
2953
|
}
|
|
@@ -2529,7 +2958,7 @@ function ft(e, t) {
|
|
|
2529
2958
|
if (t > r + 1) {
|
|
2530
2959
|
n.push({
|
|
2531
2960
|
kind: "code",
|
|
2532
|
-
value:
|
|
2961
|
+
value: jt(e.slice(r + 1, t))
|
|
2533
2962
|
}), r = t + 1;
|
|
2534
2963
|
continue;
|
|
2535
2964
|
}
|
|
@@ -2539,7 +2968,7 @@ function ft(e, t) {
|
|
|
2539
2968
|
if (a > r + 1) {
|
|
2540
2969
|
let o = i === "*" ? "bold" : i === "_" ? "italic" : "strike";
|
|
2541
2970
|
n.push({
|
|
2542
|
-
children:
|
|
2971
|
+
children: Pt(e.slice(r + 1, a), t + 1),
|
|
2543
2972
|
kind: o
|
|
2544
2973
|
}), r = a + 1;
|
|
2545
2974
|
continue;
|
|
@@ -2548,7 +2977,7 @@ function ft(e, t) {
|
|
|
2548
2977
|
if (i === "<") {
|
|
2549
2978
|
let t = e.indexOf(">", r + 1);
|
|
2550
2979
|
if (t >= 0) {
|
|
2551
|
-
let i =
|
|
2980
|
+
let i = Mt(e.slice(r + 1, t));
|
|
2552
2981
|
if (i !== void 0) {
|
|
2553
2982
|
n.push(i), r = t + 1;
|
|
2554
2983
|
continue;
|
|
@@ -2556,8 +2985,8 @@ function ft(e, t) {
|
|
|
2556
2985
|
}
|
|
2557
2986
|
}
|
|
2558
2987
|
if (i === ":") {
|
|
2559
|
-
let t = e.indexOf(":", r + 1), i = t < 0 ? "" : e.slice(r + 1, t), a = r === 0 || !
|
|
2560
|
-
if (t > r + 1 && a && o &&
|
|
2988
|
+
let t = e.indexOf(":", r + 1), i = t < 0 ? "" : e.slice(r + 1, t), a = r === 0 || !At.test(e[r - 1] ?? ""), o = t < 0 || t + 1 >= e.length || !At.test(e[t + 1] ?? "");
|
|
2989
|
+
if (t > r + 1 && a && o && kt.test(i)) {
|
|
2561
2990
|
n.push({
|
|
2562
2991
|
kind: "emoji",
|
|
2563
2992
|
name: i
|
|
@@ -2565,124 +2994,124 @@ function ft(e, t) {
|
|
|
2565
2994
|
continue;
|
|
2566
2995
|
}
|
|
2567
2996
|
}
|
|
2568
|
-
let a =
|
|
2997
|
+
let a = Nt(e, r + 1);
|
|
2569
2998
|
n.push({
|
|
2570
2999
|
kind: "text",
|
|
2571
|
-
value:
|
|
3000
|
+
value: jt(e.slice(r, a))
|
|
2572
3001
|
}), r = a;
|
|
2573
3002
|
}
|
|
2574
3003
|
return n;
|
|
2575
3004
|
}
|
|
2576
|
-
function
|
|
2577
|
-
return
|
|
3005
|
+
function Ft(e) {
|
|
3006
|
+
return Pt(e, 0);
|
|
2578
3007
|
}
|
|
2579
|
-
function
|
|
2580
|
-
let { resolvers: t } =
|
|
3008
|
+
function It({ token: e }) {
|
|
3009
|
+
let { resolvers: t } = x();
|
|
2581
3010
|
switch (e.kind) {
|
|
2582
3011
|
case "text": return e.value;
|
|
2583
|
-
case "bold": return /* @__PURE__ */
|
|
2584
|
-
...
|
|
2585
|
-
children: e.children.map((e, t) => /* @__PURE__ */
|
|
3012
|
+
case "bold": return /* @__PURE__ */ u("strong", {
|
|
3013
|
+
...g(O.bold),
|
|
3014
|
+
children: e.children.map((e, t) => /* @__PURE__ */ u(It, { token: e }, `${e.kind}-${String(t)}`))
|
|
2586
3015
|
});
|
|
2587
|
-
case "italic": return /* @__PURE__ */
|
|
2588
|
-
...
|
|
2589
|
-
children: e.children.map((e, t) => /* @__PURE__ */
|
|
3016
|
+
case "italic": return /* @__PURE__ */ u("em", {
|
|
3017
|
+
...g(O.italic),
|
|
3018
|
+
children: e.children.map((e, t) => /* @__PURE__ */ u(It, { token: e }, `${e.kind}-${String(t)}`))
|
|
2590
3019
|
});
|
|
2591
|
-
case "strike": return /* @__PURE__ */
|
|
2592
|
-
...
|
|
2593
|
-
children: e.children.map((e, t) => /* @__PURE__ */
|
|
3020
|
+
case "strike": return /* @__PURE__ */ u("s", {
|
|
3021
|
+
...g(O.strike),
|
|
3022
|
+
children: e.children.map((e, t) => /* @__PURE__ */ u(It, { token: e }, `${e.kind}-${String(t)}`))
|
|
2594
3023
|
});
|
|
2595
|
-
case "code": return /* @__PURE__ */
|
|
2596
|
-
...
|
|
3024
|
+
case "code": return /* @__PURE__ */ u("code", {
|
|
3025
|
+
...g(O.inlineCode),
|
|
2597
3026
|
children: e.value
|
|
2598
3027
|
});
|
|
2599
|
-
case "code_block": return /* @__PURE__ */
|
|
2600
|
-
...
|
|
3028
|
+
case "code_block": return /* @__PURE__ */ u("pre", {
|
|
3029
|
+
...g(O.pre),
|
|
2601
3030
|
children: e.value
|
|
2602
3031
|
});
|
|
2603
|
-
case "emoji": return /* @__PURE__ */
|
|
3032
|
+
case "emoji": return /* @__PURE__ */ u("span", {
|
|
2604
3033
|
"aria-label": `:${e.name}:`,
|
|
2605
3034
|
role: "img",
|
|
2606
|
-
children: t.emoji?.(e.name) ??
|
|
3035
|
+
children: t.emoji?.(e.name) ?? Ie(e.name) ?? `:${e.name}:`
|
|
2607
3036
|
});
|
|
2608
3037
|
case "link": {
|
|
2609
|
-
let t =
|
|
2610
|
-
return t === void 0 ? e.label : /* @__PURE__ */
|
|
2611
|
-
...
|
|
3038
|
+
let t = D(e.href);
|
|
3039
|
+
return t === void 0 ? e.label : /* @__PURE__ */ u("a", {
|
|
3040
|
+
...g(O.link),
|
|
2612
3041
|
href: t,
|
|
2613
3042
|
rel: "noreferrer",
|
|
2614
3043
|
children: e.label
|
|
2615
3044
|
});
|
|
2616
3045
|
}
|
|
2617
|
-
case "user": return /* @__PURE__ */
|
|
2618
|
-
...
|
|
2619
|
-
children: ["@", t.user?.(e.id) ?? e.id]
|
|
3046
|
+
case "user": return /* @__PURE__ */ d("span", {
|
|
3047
|
+
...g(O.mention),
|
|
3048
|
+
children: ["@", t.user?.(e.id) ?? e.fallback ?? e.id]
|
|
2620
3049
|
});
|
|
2621
|
-
case "channel": return /* @__PURE__ */
|
|
2622
|
-
...
|
|
3050
|
+
case "channel": return /* @__PURE__ */ d("span", {
|
|
3051
|
+
...g(O.mention),
|
|
2623
3052
|
children: ["#", t.channel?.(e.id) ?? e.fallback ?? e.id]
|
|
2624
3053
|
});
|
|
2625
|
-
case "usergroup": return /* @__PURE__ */
|
|
2626
|
-
...
|
|
3054
|
+
case "usergroup": return /* @__PURE__ */ d("span", {
|
|
3055
|
+
...g(O.mention),
|
|
2627
3056
|
children: ["@", t.usergroup?.(e.id) ?? e.fallback ?? e.id]
|
|
2628
3057
|
});
|
|
2629
|
-
case "team": return /* @__PURE__ */
|
|
2630
|
-
...
|
|
3058
|
+
case "team": return /* @__PURE__ */ d("span", {
|
|
3059
|
+
...g(O.mention),
|
|
2631
3060
|
children: ["@", t.team?.(e.id) ?? e.id]
|
|
2632
3061
|
});
|
|
2633
|
-
case "broadcast": return /* @__PURE__ */
|
|
2634
|
-
...
|
|
3062
|
+
case "broadcast": return /* @__PURE__ */ d("span", {
|
|
3063
|
+
...g(O.mention),
|
|
2635
3064
|
children: ["@", e.range]
|
|
2636
3065
|
});
|
|
2637
3066
|
case "date": {
|
|
2638
|
-
let n = Number(e.id), r = Number.isFinite(n) ? t.date?.(n, e.format ?? "") ??
|
|
2639
|
-
return i === void 0 ? r : /* @__PURE__ */
|
|
2640
|
-
...
|
|
3067
|
+
let n = Number(e.id), r = Number.isFinite(n) ? t.date?.(n, e.format ?? "") ?? Ne(n, e.format ?? "", e.fallback) : e.fallback ?? e.id, i = D(e.href);
|
|
3068
|
+
return i === void 0 ? r : /* @__PURE__ */ u("a", {
|
|
3069
|
+
...g(O.link),
|
|
2641
3070
|
href: i,
|
|
2642
3071
|
rel: "noreferrer",
|
|
2643
3072
|
children: r
|
|
2644
3073
|
});
|
|
2645
3074
|
}
|
|
2646
3075
|
}
|
|
2647
|
-
return
|
|
3076
|
+
return _(e);
|
|
2648
3077
|
}
|
|
2649
|
-
function
|
|
2650
|
-
let n =
|
|
2651
|
-
return /* @__PURE__ */
|
|
3078
|
+
function I({ className: e, text: t }) {
|
|
3079
|
+
let n = g(O.text);
|
|
3080
|
+
return /* @__PURE__ */ u("div", {
|
|
2652
3081
|
...n,
|
|
2653
|
-
className:
|
|
2654
|
-
children:
|
|
3082
|
+
className: A(n.className, e),
|
|
3083
|
+
children: Ft(t).map((e, t) => /* @__PURE__ */ u(It, { token: e }, `${e.kind}-${String(t)}`))
|
|
2655
3084
|
});
|
|
2656
3085
|
}
|
|
2657
3086
|
//#endregion
|
|
2658
3087
|
//#region src/text/Text.tsx
|
|
2659
|
-
function
|
|
2660
|
-
let n = t, r =
|
|
2661
|
-
if (
|
|
3088
|
+
function L({ className: e, text: t }) {
|
|
3089
|
+
let n = t, r = w(n) && typeof n.text == "string" ? n.text : E(n, "text");
|
|
3090
|
+
if (T(n) === "mrkdwn") return /* @__PURE__ */ u(I, {
|
|
2662
3091
|
className: e,
|
|
2663
3092
|
text: r
|
|
2664
3093
|
});
|
|
2665
|
-
let i =
|
|
2666
|
-
return /* @__PURE__ */
|
|
3094
|
+
let i = g(O.text);
|
|
3095
|
+
return /* @__PURE__ */ u("div", {
|
|
2667
3096
|
...i,
|
|
2668
|
-
className:
|
|
3097
|
+
className: A(i.className, e),
|
|
2669
3098
|
children: r
|
|
2670
3099
|
});
|
|
2671
3100
|
}
|
|
2672
3101
|
//#endregion
|
|
2673
3102
|
//#region src/text/Markdown.tsx
|
|
2674
|
-
function
|
|
3103
|
+
function Lt(e) {
|
|
2675
3104
|
let t = e.trim();
|
|
2676
3105
|
return t === "---" || t === "***" || t === "___";
|
|
2677
3106
|
}
|
|
2678
|
-
function
|
|
3107
|
+
function Rt(e) {
|
|
2679
3108
|
let t = e.trim().replace(/^\|/, "").replace(/\|$/, "").split("|");
|
|
2680
3109
|
return t.length > 0 && t.every((e) => /^:?-{3,}:?$/.test(e.trim()));
|
|
2681
3110
|
}
|
|
2682
|
-
function
|
|
3111
|
+
function zt(e) {
|
|
2683
3112
|
return e.trim().replace(/^\|/, "").replace(/\|$/, "").split("|").map((e) => e.trim());
|
|
2684
3113
|
}
|
|
2685
|
-
function
|
|
3114
|
+
function Bt(e) {
|
|
2686
3115
|
let t = /^\s*[-*+]\s+\[([ xX])\]\s+(.+)$/.exec(e);
|
|
2687
3116
|
if (t !== null) return {
|
|
2688
3117
|
checked: (t[1] ?? "").toLowerCase() === "x",
|
|
@@ -2703,7 +3132,7 @@ function vt(e) {
|
|
|
2703
3132
|
text: r[1] ?? ""
|
|
2704
3133
|
};
|
|
2705
3134
|
}
|
|
2706
|
-
function
|
|
3135
|
+
function Vt(e) {
|
|
2707
3136
|
let t = e.split("\n"), n = [], r = 0;
|
|
2708
3137
|
for (; r < t.length;) {
|
|
2709
3138
|
let e = t[r] ?? "";
|
|
@@ -2721,9 +3150,9 @@ function yt(e) {
|
|
|
2721
3150
|
});
|
|
2722
3151
|
continue;
|
|
2723
3152
|
}
|
|
2724
|
-
if (e.includes("|") && r + 1 < t.length &&
|
|
2725
|
-
let i =
|
|
2726
|
-
for (r += 2; r < t.length && (t[r] ?? "").includes("|");) a.push(
|
|
3153
|
+
if (e.includes("|") && r + 1 < t.length && Rt(t[r + 1] ?? "")) {
|
|
3154
|
+
let i = zt(e), a = [];
|
|
3155
|
+
for (r += 2; r < t.length && (t[r] ?? "").includes("|");) a.push(zt(t[r] ?? "")), r += 1;
|
|
2727
3156
|
n.push({
|
|
2728
3157
|
headers: i,
|
|
2729
3158
|
kind: "table",
|
|
@@ -2731,7 +3160,7 @@ function yt(e) {
|
|
|
2731
3160
|
});
|
|
2732
3161
|
continue;
|
|
2733
3162
|
}
|
|
2734
|
-
if (
|
|
3163
|
+
if (Lt(e)) {
|
|
2735
3164
|
n.push({ kind: "divider" }), r += 1;
|
|
2736
3165
|
continue;
|
|
2737
3166
|
}
|
|
@@ -2744,11 +3173,11 @@ function yt(e) {
|
|
|
2744
3173
|
}), r += 1;
|
|
2745
3174
|
continue;
|
|
2746
3175
|
}
|
|
2747
|
-
let a =
|
|
3176
|
+
let a = Bt(e);
|
|
2748
3177
|
if (a !== void 0) {
|
|
2749
3178
|
let e = [a];
|
|
2750
3179
|
for (r += 1; r < t.length;) {
|
|
2751
|
-
let n =
|
|
3180
|
+
let n = Bt(t[r] ?? "");
|
|
2752
3181
|
if (n === void 0 || n.ordered !== a.ordered) break;
|
|
2753
3182
|
e.push(n), r += 1;
|
|
2754
3183
|
}
|
|
@@ -2771,7 +3200,7 @@ function yt(e) {
|
|
|
2771
3200
|
let o = [e];
|
|
2772
3201
|
for (r += 1; r < t.length && (t[r] ?? "").trim().length > 0;) {
|
|
2773
3202
|
let e = t[r] ?? "";
|
|
2774
|
-
if (e.trimStart().startsWith("```") ||
|
|
3203
|
+
if (e.trimStart().startsWith("```") || Lt(e) || /^(#{1,6})\s+/.test(e) || Bt(e) !== void 0 || e.trimStart().startsWith(">")) break;
|
|
2775
3204
|
o.push(e), r += 1;
|
|
2776
3205
|
}
|
|
2777
3206
|
n.push({
|
|
@@ -2781,240 +3210,248 @@ function yt(e) {
|
|
|
2781
3210
|
}
|
|
2782
3211
|
return n;
|
|
2783
3212
|
}
|
|
2784
|
-
function
|
|
3213
|
+
function Ht(e) {
|
|
2785
3214
|
return e.replace(/\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)/g, "<$2|$1>").replaceAll("**", "*").replaceAll("__", "*").replaceAll("~~", "~");
|
|
2786
3215
|
}
|
|
2787
|
-
function
|
|
2788
|
-
return e <= 1 ?
|
|
3216
|
+
function Ut(e) {
|
|
3217
|
+
return e <= 1 ? O.heading1 : e === 2 ? O.heading2 : e === 3 ? O.heading3 : O.heading4;
|
|
2789
3218
|
}
|
|
2790
|
-
function
|
|
3219
|
+
function Wt({ token: e }) {
|
|
2791
3220
|
switch (e.kind) {
|
|
2792
|
-
case "paragraph": return /* @__PURE__ */
|
|
2793
|
-
case "quote": return /* @__PURE__ */
|
|
2794
|
-
...
|
|
2795
|
-
children: /* @__PURE__ */
|
|
3221
|
+
case "paragraph": return /* @__PURE__ */ u(I, { text: Ht(e.text) });
|
|
3222
|
+
case "quote": return /* @__PURE__ */ u("blockquote", {
|
|
3223
|
+
...g(O.quote),
|
|
3224
|
+
children: /* @__PURE__ */ u(I, { text: Ht(e.text) })
|
|
2796
3225
|
});
|
|
2797
|
-
case "heading": return /* @__PURE__ */
|
|
2798
|
-
...
|
|
2799
|
-
children: /* @__PURE__ */
|
|
3226
|
+
case "heading": return /* @__PURE__ */ u("div", {
|
|
3227
|
+
...g(O.heading, Ut(e.level)),
|
|
3228
|
+
children: /* @__PURE__ */ u(I, { text: Ht(e.text) })
|
|
2800
3229
|
});
|
|
2801
|
-
case "divider": return /* @__PURE__ */
|
|
2802
|
-
case "code": return /* @__PURE__ */
|
|
2803
|
-
...
|
|
3230
|
+
case "divider": return /* @__PURE__ */ u("hr", { ...g(O.divider) });
|
|
3231
|
+
case "code": return /* @__PURE__ */ u("pre", {
|
|
3232
|
+
...g(O.pre),
|
|
2804
3233
|
"data-language": e.language,
|
|
2805
3234
|
children: e.text
|
|
2806
3235
|
});
|
|
2807
3236
|
case "list": {
|
|
2808
|
-
let n = e.ordered ?
|
|
2809
|
-
...
|
|
3237
|
+
let n = e.ordered ? O.listItemOrdered : [O.listItemBullet, O.listBullet], r = e.items.map((e, r) => /* @__PURE__ */ t("li", {
|
|
3238
|
+
...g(n),
|
|
2810
3239
|
key: `${e.text}-${String(r)}`
|
|
2811
|
-
}, e.task ? /* @__PURE__ */
|
|
3240
|
+
}, e.task ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("input", {
|
|
2812
3241
|
checked: e.checked,
|
|
2813
3242
|
disabled: !0,
|
|
2814
3243
|
readOnly: !0,
|
|
2815
3244
|
type: "checkbox"
|
|
2816
|
-
}), " "] }) : null, /* @__PURE__ */
|
|
2817
|
-
return e.ordered ? /* @__PURE__ */
|
|
2818
|
-
...
|
|
3245
|
+
}), " "] }) : null, /* @__PURE__ */ u(I, { text: Ht(e.text) })));
|
|
3246
|
+
return e.ordered ? /* @__PURE__ */ u("ol", {
|
|
3247
|
+
...g(O.list, O.listOrdered),
|
|
2819
3248
|
children: r
|
|
2820
|
-
}) : /* @__PURE__ */
|
|
2821
|
-
...
|
|
3249
|
+
}) : /* @__PURE__ */ u("ul", {
|
|
3250
|
+
...g(O.list),
|
|
2822
3251
|
children: r
|
|
2823
3252
|
});
|
|
2824
3253
|
}
|
|
2825
|
-
case "table": return /* @__PURE__ */
|
|
2826
|
-
...
|
|
2827
|
-
children: /* @__PURE__ */
|
|
2828
|
-
...
|
|
2829
|
-
children: [/* @__PURE__ */
|
|
2830
|
-
...
|
|
3254
|
+
case "table": return /* @__PURE__ */ u("div", {
|
|
3255
|
+
...g(O.tableScroller),
|
|
3256
|
+
children: /* @__PURE__ */ d("table", {
|
|
3257
|
+
...g(O.table),
|
|
3258
|
+
children: [/* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: e.headers.map((e, n) => /* @__PURE__ */ t("th", {
|
|
3259
|
+
...g(O.tableCell, O.tableHeader, n === 0 && O.tableCellFirstColumn),
|
|
2831
3260
|
key: `${e}-${String(n)}`,
|
|
2832
3261
|
scope: "col"
|
|
2833
|
-
}, /* @__PURE__ */
|
|
2834
|
-
...
|
|
3262
|
+
}, /* @__PURE__ */ u(I, { text: Ht(e) }))) }) }), /* @__PURE__ */ u("tbody", { children: e.rows.map((e, n) => /* @__PURE__ */ u("tr", { children: e.map((e, n) => /* @__PURE__ */ t("td", {
|
|
3263
|
+
...g(O.tableCell, n === 0 && O.tableCellFirstColumn),
|
|
2835
3264
|
key: `${e}-${String(n)}`
|
|
2836
|
-
}, /* @__PURE__ */
|
|
3265
|
+
}, /* @__PURE__ */ u(I, { text: Ht(e) }))) }, `row-${String(n)}`)) })]
|
|
2837
3266
|
})
|
|
2838
3267
|
});
|
|
2839
3268
|
}
|
|
2840
|
-
return
|
|
3269
|
+
return _(e);
|
|
2841
3270
|
}
|
|
2842
|
-
function
|
|
2843
|
-
return /* @__PURE__ */
|
|
2844
|
-
...
|
|
2845
|
-
children:
|
|
3271
|
+
function Gt({ markdown: e }) {
|
|
3272
|
+
return /* @__PURE__ */ u("div", {
|
|
3273
|
+
...g(O.markdown),
|
|
3274
|
+
children: Vt(e).map((e, t) => /* @__PURE__ */ u(Wt, { token: e }, `${e.kind}-${String(t)}`))
|
|
2846
3275
|
});
|
|
2847
3276
|
}
|
|
2848
3277
|
//#endregion
|
|
2849
3278
|
//#region src/blocks/BasicBlocks.tsx
|
|
2850
|
-
function
|
|
2851
|
-
return
|
|
3279
|
+
function Kt(e) {
|
|
3280
|
+
return w(e) && e.type === "image";
|
|
2852
3281
|
}
|
|
2853
|
-
function
|
|
2854
|
-
let i =
|
|
2855
|
-
return /* @__PURE__ */
|
|
3282
|
+
function R({ blockId: e, blockType: t, children: n, className: r }) {
|
|
3283
|
+
let i = g(O.block);
|
|
3284
|
+
return /* @__PURE__ */ u("div", {
|
|
2856
3285
|
...i,
|
|
2857
|
-
className:
|
|
3286
|
+
className: A(i.className, r),
|
|
2858
3287
|
"data-block-id": e,
|
|
2859
3288
|
"data-block-type": t,
|
|
2860
3289
|
children: n
|
|
2861
3290
|
});
|
|
2862
3291
|
}
|
|
2863
|
-
function
|
|
3292
|
+
function qt({ block: e, className: t, path: n = "block" }) {
|
|
2864
3293
|
let r = e.accessory, i = Array.isArray(e.fields) ? e.fields : void 0;
|
|
2865
|
-
return /* @__PURE__ */
|
|
3294
|
+
return /* @__PURE__ */ u(R, {
|
|
2866
3295
|
blockId: e.block_id,
|
|
2867
3296
|
blockType: e.type,
|
|
2868
3297
|
className: t,
|
|
2869
|
-
children: /* @__PURE__ */
|
|
2870
|
-
...
|
|
2871
|
-
children: [/* @__PURE__ */
|
|
2872
|
-
...
|
|
2873
|
-
children: [e.text === void 0 ? null : /* @__PURE__ */
|
|
2874
|
-
...
|
|
2875
|
-
children: i.map((e, t) => /* @__PURE__ */
|
|
3298
|
+
children: /* @__PURE__ */ d("div", {
|
|
3299
|
+
...g(O.section),
|
|
3300
|
+
children: [/* @__PURE__ */ d("div", {
|
|
3301
|
+
...g(O.sectionContent),
|
|
3302
|
+
children: [e.text === void 0 ? null : /* @__PURE__ */ u(L, { text: e.text }), i === void 0 ? null : /* @__PURE__ */ u("div", {
|
|
3303
|
+
...g(O.fields),
|
|
3304
|
+
children: i.map((e, t) => /* @__PURE__ */ u(L, { text: e }, `${T(e) ?? "unknown"}-${String(t)}`))
|
|
2876
3305
|
})]
|
|
2877
|
-
}), r === void 0 ? null :
|
|
2878
|
-
...
|
|
2879
|
-
children: /* @__PURE__ */
|
|
3306
|
+
}), r === void 0 ? null : Kt(r) ? /* @__PURE__ */ u("div", {
|
|
3307
|
+
...g(O.accessory),
|
|
3308
|
+
children: /* @__PURE__ */ u(F, {
|
|
2880
3309
|
element: r,
|
|
2881
3310
|
variant: "accessory"
|
|
2882
3311
|
})
|
|
2883
|
-
}) : /* @__PURE__ */
|
|
3312
|
+
}) : /* @__PURE__ */ u(Dt, {
|
|
2884
3313
|
blockId: e.block_id,
|
|
2885
|
-
className:
|
|
3314
|
+
className: g(O.accessory).className,
|
|
2886
3315
|
element: e.accessory,
|
|
2887
3316
|
path: `${n}.accessory`
|
|
2888
3317
|
})]
|
|
2889
3318
|
})
|
|
2890
3319
|
});
|
|
2891
3320
|
}
|
|
2892
|
-
function
|
|
2893
|
-
let n = e.level === void 0 ? void 0 : Math.trunc(e.level), r = n === void 0 || Number.isNaN(n) ? void 0 : Math.min(4, Math.max(1, n)), i = e.text, a =
|
|
3321
|
+
function Jt({ block: e, className: t }) {
|
|
3322
|
+
let n = e.level === void 0 ? void 0 : Math.trunc(e.level), r = n === void 0 || Number.isNaN(n) ? void 0 : Math.min(4, Math.max(1, n)), i = e.text, a = w(i) && typeof i.text == "string" ? i.text : E(e, "header"), o = g(O.heading, r === 1 && O.heading1, (r === void 0 || r === 2) && O.heading2, r === 3 && O.heading3, r === 4 && O.heading4), s = u(r === 1 ? "h1" : r === 3 ? "h3" : r === 4 ? "h4" : "h2", {
|
|
2894
3323
|
...o,
|
|
2895
3324
|
children: a
|
|
2896
3325
|
});
|
|
2897
|
-
return /* @__PURE__ */
|
|
3326
|
+
return /* @__PURE__ */ u(R, {
|
|
2898
3327
|
blockId: e.block_id,
|
|
2899
3328
|
blockType: e.type,
|
|
2900
3329
|
className: t,
|
|
2901
3330
|
children: s
|
|
2902
3331
|
});
|
|
2903
3332
|
}
|
|
2904
|
-
function
|
|
2905
|
-
return /* @__PURE__ */
|
|
3333
|
+
function Yt({ block: e, className: t }) {
|
|
3334
|
+
return /* @__PURE__ */ u(R, {
|
|
2906
3335
|
blockId: e.block_id,
|
|
2907
3336
|
blockType: e.type,
|
|
2908
3337
|
className: t,
|
|
2909
|
-
children: /* @__PURE__ */
|
|
3338
|
+
children: /* @__PURE__ */ u("hr", { ...g(O.divider) })
|
|
2910
3339
|
});
|
|
2911
3340
|
}
|
|
2912
|
-
function
|
|
2913
|
-
return /* @__PURE__ */
|
|
3341
|
+
function Xt({ block: e, className: t }) {
|
|
3342
|
+
return /* @__PURE__ */ d(R, {
|
|
2914
3343
|
blockId: e.block_id,
|
|
2915
3344
|
blockType: e.type,
|
|
2916
3345
|
className: t,
|
|
2917
|
-
children: [/* @__PURE__ */
|
|
2918
|
-
className:
|
|
3346
|
+
children: [/* @__PURE__ */ u(F, { element: e }), e.title === void 0 ? null : /* @__PURE__ */ u(L, {
|
|
3347
|
+
className: g(O.smallText).className,
|
|
2919
3348
|
text: e.title
|
|
2920
3349
|
})]
|
|
2921
3350
|
});
|
|
2922
3351
|
}
|
|
2923
|
-
function
|
|
2924
|
-
return
|
|
3352
|
+
function Zt(e) {
|
|
3353
|
+
return w(e) && (e.type === "mrkdwn" || e.type === "plain_text") && typeof e.text == "string";
|
|
2925
3354
|
}
|
|
2926
|
-
function
|
|
3355
|
+
function Qt({ block: e, className: n }) {
|
|
2927
3356
|
let r = e.elements;
|
|
2928
|
-
return /* @__PURE__ */
|
|
3357
|
+
return /* @__PURE__ */ u(R, {
|
|
2929
3358
|
blockId: e.block_id,
|
|
2930
3359
|
blockType: e.type,
|
|
2931
3360
|
className: n,
|
|
2932
|
-
children: /* @__PURE__ */
|
|
2933
|
-
...
|
|
2934
|
-
children: Array.isArray(r) ? r.map((e, n) =>
|
|
3361
|
+
children: /* @__PURE__ */ u("div", {
|
|
3362
|
+
...g(O.context),
|
|
3363
|
+
children: Array.isArray(r) ? r.map((e, n) => Kt(e) ? /* @__PURE__ */ u(F, {
|
|
2935
3364
|
element: e,
|
|
2936
3365
|
variant: "context"
|
|
2937
|
-
}, `${e.type}-${String(n)}`) :
|
|
2938
|
-
...
|
|
3366
|
+
}, `${e.type}-${String(n)}`) : Zt(e) ? /* @__PURE__ */ t("div", {
|
|
3367
|
+
...g(O.contextElement),
|
|
2939
3368
|
key: `${e.type}-${String(n)}`
|
|
2940
|
-
}, /* @__PURE__ */
|
|
2941
|
-
className:
|
|
3369
|
+
}, /* @__PURE__ */ u(L, {
|
|
3370
|
+
className: g(O.contextText).className,
|
|
2942
3371
|
text: e
|
|
2943
3372
|
})) : /* @__PURE__ */ t("span", {
|
|
2944
|
-
...
|
|
2945
|
-
"data-unhandled-element":
|
|
3373
|
+
...g(O.unhandled),
|
|
3374
|
+
"data-unhandled-element": T(e) ?? "unknown",
|
|
2946
3375
|
key: `unhandled-${String(n)}`
|
|
2947
|
-
},
|
|
2948
|
-
...
|
|
3376
|
+
}, E(e, "context element"))) : /* @__PURE__ */ u("span", {
|
|
3377
|
+
...g(O.unhandled),
|
|
2949
3378
|
"data-unhandled-element": "context",
|
|
2950
|
-
children:
|
|
3379
|
+
children: E(e, "context block")
|
|
2951
3380
|
})
|
|
2952
3381
|
})
|
|
2953
3382
|
});
|
|
2954
3383
|
}
|
|
2955
|
-
function
|
|
2956
|
-
return /* @__PURE__ */
|
|
3384
|
+
function $t({ block: e, className: t, path: n = "block" }) {
|
|
3385
|
+
return /* @__PURE__ */ u(R, {
|
|
2957
3386
|
blockId: e.block_id,
|
|
2958
3387
|
blockType: e.type,
|
|
2959
3388
|
className: t,
|
|
2960
|
-
children: /* @__PURE__ */
|
|
3389
|
+
children: /* @__PURE__ */ u(N, {
|
|
2961
3390
|
block: e,
|
|
2962
3391
|
path: n
|
|
2963
3392
|
})
|
|
2964
3393
|
});
|
|
2965
3394
|
}
|
|
2966
|
-
function
|
|
2967
|
-
let n = typeof e.text == "string" ? e.text :
|
|
2968
|
-
return /* @__PURE__ */
|
|
3395
|
+
function en({ block: e, className: t }) {
|
|
3396
|
+
let n = typeof e.text == "string" ? e.text : E(e, "markdown block");
|
|
3397
|
+
return /* @__PURE__ */ u(R, {
|
|
2969
3398
|
blockId: e.block_id,
|
|
2970
3399
|
blockType: e.type,
|
|
2971
3400
|
className: t,
|
|
2972
|
-
children: /* @__PURE__ */
|
|
3401
|
+
children: /* @__PURE__ */ u(Gt, { markdown: n })
|
|
2973
3402
|
});
|
|
2974
3403
|
}
|
|
2975
|
-
function
|
|
2976
|
-
return /* @__PURE__ */
|
|
3404
|
+
function tn({ block: e, className: t }) {
|
|
3405
|
+
return /* @__PURE__ */ u(R, {
|
|
2977
3406
|
blockId: e.block_id,
|
|
2978
3407
|
blockType: e.type,
|
|
2979
3408
|
className: t,
|
|
2980
|
-
children: /* @__PURE__ */
|
|
2981
|
-
...
|
|
2982
|
-
children: [/* @__PURE__ */
|
|
3409
|
+
children: /* @__PURE__ */ d("div", {
|
|
3410
|
+
...g(O.file),
|
|
3411
|
+
children: [/* @__PURE__ */ u("span", {
|
|
3412
|
+
...g(O.iconSlot),
|
|
2983
3413
|
"aria-hidden": "true",
|
|
2984
|
-
children:
|
|
2985
|
-
}), /* @__PURE__ */
|
|
2986
|
-
...
|
|
3414
|
+
children: /* @__PURE__ */ u(fe, { size: 20 })
|
|
3415
|
+
}), /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("strong", { children: "Remote file" }), /* @__PURE__ */ u("div", {
|
|
3416
|
+
...g(O.smallText),
|
|
2987
3417
|
children: e.external_id
|
|
2988
3418
|
})] })]
|
|
2989
3419
|
})
|
|
2990
3420
|
});
|
|
2991
3421
|
}
|
|
2992
|
-
function
|
|
2993
|
-
let n =
|
|
2994
|
-
...
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
3422
|
+
function nn({ block: e, className: t }) {
|
|
3423
|
+
let n = D(typeof e.title_url == "string" ? e.title_url : typeof e.video_url == "string" ? e.video_url : void 0), r = e.title, i = w(r) && typeof r.text == "string" ? r.text : E(e, "video"), a = e.description, o = w(a) && typeof a.text == "string" ? a.text : void 0, s = typeof e.alt_text == "string" ? e.alt_text : E(e, "video"), c = typeof e.thumbnail_url == "string" ? e.thumbnail_url : void 0, f = /* @__PURE__ */ d(l, { children: [c === void 0 ? null : /* @__PURE__ */ d("span", {
|
|
3424
|
+
...g(O.videoThumbnail),
|
|
3425
|
+
children: [/* @__PURE__ */ u("img", {
|
|
3426
|
+
...g(O.image, O.cardHero),
|
|
3427
|
+
alt: s,
|
|
3428
|
+
src: c
|
|
3429
|
+
}), /* @__PURE__ */ u("span", {
|
|
3430
|
+
...g(O.videoPlayBadge),
|
|
3431
|
+
"aria-hidden": "true",
|
|
3432
|
+
children: /* @__PURE__ */ u(pe, { size: 20 })
|
|
3433
|
+
})]
|
|
3434
|
+
}), /* @__PURE__ */ d("div", {
|
|
3435
|
+
...g(O.cardContent),
|
|
2999
3436
|
children: [
|
|
3000
|
-
/* @__PURE__ */
|
|
3437
|
+
/* @__PURE__ */ u("strong", { children: i }),
|
|
3001
3438
|
o,
|
|
3002
|
-
typeof e.provider_name == "string" ? /* @__PURE__ */
|
|
3003
|
-
...
|
|
3439
|
+
typeof e.provider_name == "string" ? /* @__PURE__ */ u("span", {
|
|
3440
|
+
...g(O.smallText),
|
|
3004
3441
|
children: e.provider_name
|
|
3005
3442
|
}) : null
|
|
3006
3443
|
]
|
|
3007
3444
|
})] });
|
|
3008
|
-
return /* @__PURE__ */
|
|
3445
|
+
return /* @__PURE__ */ u(R, {
|
|
3009
3446
|
blockId: e.block_id,
|
|
3010
3447
|
blockType: e.type,
|
|
3011
3448
|
className: t,
|
|
3012
|
-
children: n === void 0 ? /* @__PURE__ */
|
|
3013
|
-
...
|
|
3449
|
+
children: n === void 0 ? /* @__PURE__ */ u("div", {
|
|
3450
|
+
...g(O.card),
|
|
3014
3451
|
"aria-label": s,
|
|
3015
3452
|
children: f
|
|
3016
|
-
}) : /* @__PURE__ */
|
|
3017
|
-
...
|
|
3453
|
+
}) : /* @__PURE__ */ u("a", {
|
|
3454
|
+
...g(O.card),
|
|
3018
3455
|
"aria-label": s,
|
|
3019
3456
|
href: n,
|
|
3020
3457
|
rel: "noreferrer",
|
|
@@ -3024,58 +3461,58 @@ function Nt({ block: e, className: t }) {
|
|
|
3024
3461
|
}
|
|
3025
3462
|
//#endregion
|
|
3026
3463
|
//#region src/blocks/AdvancedBlocks.tsx
|
|
3027
|
-
function
|
|
3028
|
-
let c =
|
|
3029
|
-
if (!
|
|
3464
|
+
function rn({ align: e = "left", cell: t, className: n, firstColumn: r = !1, header: i = !1, path: a = "cell", scope: o = "col", wrapped: s = !1 }) {
|
|
3465
|
+
let c = g(O.tableCell, i && O.tableHeader, r && O.tableCellFirstColumn, s && O.tableCellWrapped), l;
|
|
3466
|
+
if (!w(t)) l = E(t, "table cell");
|
|
3030
3467
|
else switch (t.type) {
|
|
3031
3468
|
case "rich_text":
|
|
3032
|
-
|
|
3469
|
+
l = /* @__PURE__ */ u(N, {
|
|
3033
3470
|
block: t,
|
|
3034
3471
|
path: a
|
|
3035
3472
|
});
|
|
3036
3473
|
break;
|
|
3037
3474
|
case "raw_number":
|
|
3038
|
-
|
|
3475
|
+
l = t.text ?? String(t.value);
|
|
3039
3476
|
break;
|
|
3040
3477
|
case "raw_text":
|
|
3041
|
-
|
|
3478
|
+
l = t.text;
|
|
3042
3479
|
break;
|
|
3043
|
-
default:
|
|
3480
|
+
default: l = E(t, "table cell");
|
|
3044
3481
|
}
|
|
3045
|
-
return i ? /* @__PURE__ */
|
|
3482
|
+
return i ? /* @__PURE__ */ u("th", {
|
|
3046
3483
|
...c,
|
|
3047
|
-
className:
|
|
3484
|
+
className: A(c.className, n),
|
|
3048
3485
|
scope: o,
|
|
3049
3486
|
style: { textAlign: e },
|
|
3050
|
-
children:
|
|
3051
|
-
}) : /* @__PURE__ */
|
|
3487
|
+
children: l
|
|
3488
|
+
}) : /* @__PURE__ */ u("td", {
|
|
3052
3489
|
...c,
|
|
3053
|
-
className:
|
|
3490
|
+
className: A(c.className, n),
|
|
3054
3491
|
style: { textAlign: e },
|
|
3055
|
-
children:
|
|
3492
|
+
children: l
|
|
3056
3493
|
});
|
|
3057
3494
|
}
|
|
3058
|
-
function
|
|
3495
|
+
function an(e) {
|
|
3059
3496
|
return Array.isArray(e);
|
|
3060
3497
|
}
|
|
3061
|
-
function
|
|
3062
|
-
let r = Array.isArray(e.rows) ? e.rows.filter(
|
|
3063
|
-
return /* @__PURE__ */
|
|
3498
|
+
function on({ block: e, className: t, path: n = "block" }) {
|
|
3499
|
+
let r = Array.isArray(e.rows) ? e.rows.filter(an) : [], i = e.column_settings;
|
|
3500
|
+
return /* @__PURE__ */ u(R, {
|
|
3064
3501
|
blockId: e.block_id,
|
|
3065
3502
|
blockType: e.type,
|
|
3066
3503
|
className: t,
|
|
3067
|
-
children: /* @__PURE__ */
|
|
3068
|
-
...
|
|
3069
|
-
children: /* @__PURE__ */
|
|
3070
|
-
...
|
|
3071
|
-
children: [/* @__PURE__ */
|
|
3504
|
+
children: /* @__PURE__ */ u("div", {
|
|
3505
|
+
...g(O.tableScroller),
|
|
3506
|
+
children: /* @__PURE__ */ d("table", {
|
|
3507
|
+
...g(O.table),
|
|
3508
|
+
children: [/* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: (r[0] ?? []).map((e, t) => /* @__PURE__ */ u(rn, {
|
|
3072
3509
|
align: i?.[t]?.align,
|
|
3073
3510
|
cell: e,
|
|
3074
3511
|
firstColumn: t === 0,
|
|
3075
3512
|
header: !0,
|
|
3076
3513
|
path: `${n}.rows[0][${String(t)}]`,
|
|
3077
3514
|
wrapped: i?.[t]?.is_wrapped
|
|
3078
|
-
}, `header-${String(t)}`)) }) }), /* @__PURE__ */
|
|
3515
|
+
}, `header-${String(t)}`)) }) }), /* @__PURE__ */ u("tbody", { children: r.slice(1).map((e, t) => /* @__PURE__ */ u("tr", { children: e.map((e, r) => /* @__PURE__ */ u(rn, {
|
|
3079
3516
|
align: i?.[r]?.align,
|
|
3080
3517
|
cell: e,
|
|
3081
3518
|
firstColumn: r === 0,
|
|
@@ -3086,21 +3523,21 @@ function It({ block: e, className: t, path: n = "block" }) {
|
|
|
3086
3523
|
})
|
|
3087
3524
|
});
|
|
3088
3525
|
}
|
|
3089
|
-
function
|
|
3090
|
-
if (!
|
|
3526
|
+
function sn({ cell: e, path: t }) {
|
|
3527
|
+
if (!w(e)) return E(e, "table cell");
|
|
3091
3528
|
switch (e.type) {
|
|
3092
|
-
case "rich_text": return /* @__PURE__ */
|
|
3529
|
+
case "rich_text": return /* @__PURE__ */ u(N, {
|
|
3093
3530
|
block: e,
|
|
3094
3531
|
path: t
|
|
3095
3532
|
});
|
|
3096
3533
|
case "raw_number": return e.text ?? String(e.value);
|
|
3097
3534
|
case "raw_text": return e.text;
|
|
3098
|
-
default: return
|
|
3535
|
+
default: return E(e, "table cell");
|
|
3099
3536
|
}
|
|
3100
3537
|
}
|
|
3101
|
-
function
|
|
3538
|
+
function cn(e) {
|
|
3102
3539
|
let t = e;
|
|
3103
|
-
if (!
|
|
3540
|
+
if (!w(t)) return "";
|
|
3104
3541
|
if (e.type === "raw_text") {
|
|
3105
3542
|
let e = t.text;
|
|
3106
3543
|
return typeof e == "string" ? e : "";
|
|
@@ -3117,128 +3554,117 @@ function Rt(e) {
|
|
|
3117
3554
|
}
|
|
3118
3555
|
return "";
|
|
3119
3556
|
}
|
|
3120
|
-
function
|
|
3121
|
-
let i = e.page_size ?? 5, a = Number.isFinite(i) && i > 0 ? Math.max(1, Math.trunc(i)) : 5, o = Array.isArray(e.rows) ? e.rows.filter(
|
|
3122
|
-
return /* @__PURE__ */
|
|
3557
|
+
function ln({ block: e, className: n, path: r = "block" }) {
|
|
3558
|
+
let i = e.page_size ?? 5, a = Number.isFinite(i) && i > 0 ? Math.max(1, Math.trunc(i)) : 5, o = Array.isArray(e.rows) ? e.rows.filter(an) : [], s = e.row_header_column_index ?? 0, l = typeof e.caption == "string" ? e.caption : void 0, [f, p] = c(0), [m, h] = c(""), _ = o[0] ?? [], v = m.trim().toLowerCase(), y = v === "" ? o.slice(1) : o.slice(1).filter((e) => e.some((e) => cn(e).toLowerCase().includes(v))), b = Math.max(1, Math.ceil(y.length / a)), x = Math.min(f, b - 1), S = y.slice(x * a, (x + 1) * a), C = S.length - 1;
|
|
3559
|
+
return /* @__PURE__ */ u(R, {
|
|
3123
3560
|
blockId: e.block_id,
|
|
3124
3561
|
blockType: e.type,
|
|
3125
3562
|
className: n,
|
|
3126
|
-
children: /* @__PURE__ */
|
|
3127
|
-
...
|
|
3128
|
-
children: [/* @__PURE__ */
|
|
3129
|
-
...
|
|
3563
|
+
children: /* @__PURE__ */ d("div", {
|
|
3564
|
+
...g(O.dataTable),
|
|
3565
|
+
children: [/* @__PURE__ */ d("div", {
|
|
3566
|
+
...g(O.dataTableHeaderBar),
|
|
3130
3567
|
children: [
|
|
3131
|
-
/* @__PURE__ */ l("span", {
|
|
3132
|
-
...h(T.dataTableTitle),
|
|
3133
|
-
children: d
|
|
3134
|
-
}),
|
|
3135
3568
|
/* @__PURE__ */ u("span", {
|
|
3136
|
-
...
|
|
3137
|
-
children:
|
|
3569
|
+
...g(O.dataTableTitle),
|
|
3570
|
+
children: l
|
|
3571
|
+
}),
|
|
3572
|
+
/* @__PURE__ */ d("span", {
|
|
3573
|
+
...g(O.dataTableFilter),
|
|
3574
|
+
children: [/* @__PURE__ */ u("span", {
|
|
3575
|
+
...g(O.dataTableFilterIcon),
|
|
3138
3576
|
"aria-hidden": "true",
|
|
3139
|
-
children:
|
|
3140
|
-
}), /* @__PURE__ */
|
|
3141
|
-
...
|
|
3142
|
-
"aria-label":
|
|
3577
|
+
children: /* @__PURE__ */ u(he, { size: 13 })
|
|
3578
|
+
}), /* @__PURE__ */ u("input", {
|
|
3579
|
+
...g(O.dataTableFilterInput),
|
|
3580
|
+
"aria-label": l === void 0 ? "Filter table" : `Filter ${l}`,
|
|
3143
3581
|
onChange: (e) => {
|
|
3144
|
-
|
|
3582
|
+
h(e.target.value), p(0);
|
|
3145
3583
|
},
|
|
3146
3584
|
placeholder: "Filter table...",
|
|
3147
3585
|
type: "text",
|
|
3148
3586
|
value: m
|
|
3149
3587
|
})]
|
|
3150
3588
|
}),
|
|
3151
|
-
/* @__PURE__ */
|
|
3152
|
-
...
|
|
3153
|
-
"aria-label":
|
|
3589
|
+
/* @__PURE__ */ u("button", {
|
|
3590
|
+
...g(O.dataTableIconButton),
|
|
3591
|
+
"aria-label": l === void 0 ? "Expand table" : `View ${l}`,
|
|
3154
3592
|
type: "button",
|
|
3155
|
-
children: /* @__PURE__ */
|
|
3156
|
-
"aria-hidden": "true",
|
|
3157
|
-
children: "⤢"
|
|
3158
|
-
})
|
|
3593
|
+
children: /* @__PURE__ */ u(ce, { size: 18 })
|
|
3159
3594
|
}),
|
|
3160
|
-
/* @__PURE__ */
|
|
3161
|
-
...
|
|
3595
|
+
/* @__PURE__ */ u("button", {
|
|
3596
|
+
...g(O.dataTableIconButton),
|
|
3162
3597
|
"aria-label": "More actions",
|
|
3163
3598
|
type: "button",
|
|
3164
|
-
children: /* @__PURE__ */
|
|
3165
|
-
"aria-hidden": "true",
|
|
3166
|
-
children: "⋮"
|
|
3167
|
-
})
|
|
3599
|
+
children: /* @__PURE__ */ u(se, { size: 16 })
|
|
3168
3600
|
})
|
|
3169
3601
|
]
|
|
3170
|
-
}), /* @__PURE__ */
|
|
3171
|
-
...
|
|
3172
|
-
children: [/* @__PURE__ */
|
|
3173
|
-
...
|
|
3602
|
+
}), /* @__PURE__ */ d("div", {
|
|
3603
|
+
...g(O.dataTableBand, b <= 1 && O.dataTableBandUnpaginated),
|
|
3604
|
+
children: [/* @__PURE__ */ d("table", {
|
|
3605
|
+
...g(O.dataTableTable),
|
|
3174
3606
|
children: [
|
|
3175
|
-
|
|
3176
|
-
...
|
|
3177
|
-
children:
|
|
3607
|
+
l === void 0 ? null : /* @__PURE__ */ u("caption", {
|
|
3608
|
+
...g(O.visuallyHidden),
|
|
3609
|
+
children: l
|
|
3178
3610
|
}),
|
|
3179
|
-
/* @__PURE__ */
|
|
3180
|
-
...
|
|
3611
|
+
/* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: _.map((e, n) => /* @__PURE__ */ t("th", {
|
|
3612
|
+
...g(O.dataTableTh),
|
|
3181
3613
|
key: `header-${String(n)}`,
|
|
3182
3614
|
scope: "col"
|
|
3183
|
-
}, /* @__PURE__ */
|
|
3615
|
+
}, /* @__PURE__ */ u(sn, {
|
|
3184
3616
|
cell: e,
|
|
3185
3617
|
path: `${r}.rows[0][${String(n)}]`
|
|
3186
3618
|
}))) }) }),
|
|
3187
|
-
/* @__PURE__ */
|
|
3188
|
-
let i =
|
|
3189
|
-
return /* @__PURE__ */
|
|
3190
|
-
let
|
|
3619
|
+
/* @__PURE__ */ u("tbody", { children: S.map((e, n) => {
|
|
3620
|
+
let i = x * a + n + 1, o = e.length - 1;
|
|
3621
|
+
return /* @__PURE__ */ u("tr", { children: e.map((e, a) => {
|
|
3622
|
+
let c = g(O.dataTableTd, n === 0 && a === 0 && O.dataTableRadiusTopStart, n === 0 && a === o && O.dataTableRadiusTopEnd, n === C && a === 0 && O.dataTableRadiusBottomStart, n === C && a === o && O.dataTableRadiusBottomEnd), l = /* @__PURE__ */ u(sn, {
|
|
3191
3623
|
cell: e,
|
|
3192
3624
|
path: `${r}.rows[${String(i)}][${String(a)}]`
|
|
3193
3625
|
});
|
|
3194
|
-
return a ===
|
|
3195
|
-
...
|
|
3626
|
+
return a === s ? /* @__PURE__ */ t("th", {
|
|
3627
|
+
...c,
|
|
3196
3628
|
key: `cell-${String(a)}`,
|
|
3197
3629
|
scope: "row"
|
|
3198
|
-
},
|
|
3199
|
-
...
|
|
3630
|
+
}, l) : /* @__PURE__ */ t("td", {
|
|
3631
|
+
...c,
|
|
3200
3632
|
key: `cell-${String(a)}`
|
|
3201
|
-
},
|
|
3633
|
+
}, l);
|
|
3202
3634
|
}) }, `row-${String(i)}`);
|
|
3203
3635
|
}) })
|
|
3204
3636
|
]
|
|
3205
|
-
}),
|
|
3206
|
-
...
|
|
3637
|
+
}), b <= 1 ? null : /* @__PURE__ */ d("div", {
|
|
3638
|
+
...g(O.dataTablePagination),
|
|
3207
3639
|
children: [
|
|
3208
|
-
/* @__PURE__ */
|
|
3209
|
-
...
|
|
3640
|
+
/* @__PURE__ */ u("button", {
|
|
3641
|
+
...g(O.dataTablePageChevron),
|
|
3210
3642
|
"aria-label": "Previous",
|
|
3211
|
-
disabled:
|
|
3643
|
+
disabled: x === 0,
|
|
3212
3644
|
onClick: () => {
|
|
3213
3645
|
p((e) => Math.max(0, e - 1));
|
|
3214
3646
|
},
|
|
3215
3647
|
type: "button",
|
|
3216
|
-
children: /* @__PURE__ */
|
|
3217
|
-
"aria-hidden": "true",
|
|
3218
|
-
children: "‹"
|
|
3219
|
-
})
|
|
3648
|
+
children: /* @__PURE__ */ u(te, { size: 14 })
|
|
3220
3649
|
}),
|
|
3221
|
-
Array.from({ length:
|
|
3222
|
-
...
|
|
3223
|
-
"aria-current": n ===
|
|
3650
|
+
Array.from({ length: b }, (e, n) => /* @__PURE__ */ t("button", {
|
|
3651
|
+
...g(O.dataTablePageButton, n === x && O.dataTablePageButtonActive),
|
|
3652
|
+
"aria-current": n === x ? "page" : void 0,
|
|
3224
3653
|
key: `page-${String(n)}`,
|
|
3225
3654
|
onClick: () => {
|
|
3226
3655
|
p(n);
|
|
3227
3656
|
},
|
|
3228
3657
|
type: "button"
|
|
3229
3658
|
}, n + 1)),
|
|
3230
|
-
/* @__PURE__ */
|
|
3231
|
-
...
|
|
3659
|
+
/* @__PURE__ */ u("button", {
|
|
3660
|
+
...g(O.dataTablePageChevron),
|
|
3232
3661
|
"aria-label": "Next",
|
|
3233
|
-
disabled:
|
|
3662
|
+
disabled: x === b - 1,
|
|
3234
3663
|
onClick: () => {
|
|
3235
|
-
p((e) => Math.min(
|
|
3664
|
+
p((e) => Math.min(b - 1, e + 1));
|
|
3236
3665
|
},
|
|
3237
3666
|
type: "button",
|
|
3238
|
-
children: /* @__PURE__ */
|
|
3239
|
-
"aria-hidden": "true",
|
|
3240
|
-
children: "›"
|
|
3241
|
-
})
|
|
3667
|
+
children: /* @__PURE__ */ u(ne, { size: 14 })
|
|
3242
3668
|
})
|
|
3243
3669
|
]
|
|
3244
3670
|
})]
|
|
@@ -3246,135 +3672,143 @@ function zt({ block: e, className: n, path: r = "block" }) {
|
|
|
3246
3672
|
})
|
|
3247
3673
|
});
|
|
3248
3674
|
}
|
|
3249
|
-
function
|
|
3675
|
+
function un({ name: e }) {
|
|
3676
|
+
let t = typeof e == "string" ? be[e] : void 0;
|
|
3677
|
+
return /* @__PURE__ */ u("span", {
|
|
3678
|
+
...g(O.iconSlot),
|
|
3679
|
+
"aria-hidden": "true",
|
|
3680
|
+
"data-slack-icon": typeof e == "string" ? e : "unknown",
|
|
3681
|
+
children: u(t === void 0 ? le : t, { size: 24 })
|
|
3682
|
+
});
|
|
3683
|
+
}
|
|
3684
|
+
function dn({ block: e, className: t }) {
|
|
3250
3685
|
let n = Array.isArray(e.actions) ? e.actions : void 0;
|
|
3251
|
-
return /* @__PURE__ */
|
|
3686
|
+
return /* @__PURE__ */ u(R, {
|
|
3252
3687
|
blockId: e.block_id,
|
|
3253
3688
|
blockType: e.type,
|
|
3254
3689
|
className: t,
|
|
3255
|
-
children: /* @__PURE__ */
|
|
3256
|
-
...
|
|
3690
|
+
children: /* @__PURE__ */ d("div", {
|
|
3691
|
+
...g(O.card),
|
|
3257
3692
|
children: [
|
|
3258
|
-
e.hero_image === void 0 ? null : /* @__PURE__ */
|
|
3693
|
+
e.hero_image === void 0 ? null : /* @__PURE__ */ u(F, {
|
|
3259
3694
|
element: e.hero_image,
|
|
3260
3695
|
variant: "cardHero"
|
|
3261
3696
|
}),
|
|
3262
|
-
/* @__PURE__ */
|
|
3263
|
-
...
|
|
3697
|
+
/* @__PURE__ */ d("div", {
|
|
3698
|
+
...g(O.cardContent),
|
|
3264
3699
|
children: [
|
|
3265
|
-
e.icon === void 0 && e.slack_icon === void 0 && e.title === void 0 && e.subtitle === void 0 ? null : /* @__PURE__ */
|
|
3266
|
-
...
|
|
3267
|
-
children: [e.icon === void 0 ? e.slack_icon === void 0 ? null : /* @__PURE__ */
|
|
3268
|
-
"aria-hidden": "true",
|
|
3269
|
-
children: "◆"
|
|
3270
|
-
}) : /* @__PURE__ */ l(N, {
|
|
3700
|
+
e.icon === void 0 && e.slack_icon === void 0 && e.title === void 0 && e.subtitle === void 0 ? null : /* @__PURE__ */ d("div", {
|
|
3701
|
+
...g(O.cardHeading),
|
|
3702
|
+
children: [e.icon === void 0 ? e.slack_icon === void 0 ? null : /* @__PURE__ */ u(un, { name: w(e.slack_icon) ? e.slack_icon.name : void 0 }) : /* @__PURE__ */ u(F, {
|
|
3271
3703
|
element: e.icon,
|
|
3272
3704
|
variant: "cardIcon"
|
|
3273
|
-
}), /* @__PURE__ */
|
|
3274
|
-
className:
|
|
3705
|
+
}), /* @__PURE__ */ d("div", { children: [e.title === void 0 ? null : /* @__PURE__ */ u(L, {
|
|
3706
|
+
className: g(O.cardTitle).className,
|
|
3275
3707
|
text: e.title
|
|
3276
|
-
}), e.subtitle === void 0 ? null : /* @__PURE__ */
|
|
3277
|
-
className:
|
|
3708
|
+
}), e.subtitle === void 0 ? null : /* @__PURE__ */ u(L, {
|
|
3709
|
+
className: g(O.smallText).className,
|
|
3278
3710
|
text: e.subtitle
|
|
3279
3711
|
})] })]
|
|
3280
3712
|
}),
|
|
3281
|
-
e.body === void 0 ? null : /* @__PURE__ */
|
|
3282
|
-
e.subtext === void 0 ? null : /* @__PURE__ */
|
|
3283
|
-
className:
|
|
3713
|
+
e.body === void 0 ? null : /* @__PURE__ */ u(L, { text: e.body }),
|
|
3714
|
+
e.subtext === void 0 ? null : /* @__PURE__ */ u(L, {
|
|
3715
|
+
className: g(O.smallText).className,
|
|
3284
3716
|
text: e.subtext
|
|
3285
3717
|
})
|
|
3286
3718
|
]
|
|
3287
3719
|
}),
|
|
3288
|
-
n === void 0 ? null : /* @__PURE__ */
|
|
3289
|
-
...
|
|
3290
|
-
children: n.map((t, n) => /* @__PURE__ */
|
|
3720
|
+
n === void 0 ? null : /* @__PURE__ */ u("div", {
|
|
3721
|
+
...g(O.cardActions),
|
|
3722
|
+
children: n.map((t, n) => /* @__PURE__ */ u(lt, {
|
|
3291
3723
|
blockId: e.block_id,
|
|
3292
3724
|
element: t
|
|
3293
|
-
}, `${
|
|
3725
|
+
}, `${w(t) && typeof t.action_id == "string" ? t.action_id : "button"}-${String(n)}`))
|
|
3294
3726
|
})
|
|
3295
3727
|
]
|
|
3296
3728
|
})
|
|
3297
3729
|
});
|
|
3298
3730
|
}
|
|
3299
|
-
function
|
|
3300
|
-
return
|
|
3731
|
+
function fn(e) {
|
|
3732
|
+
return w(e) && e.type === "card";
|
|
3301
3733
|
}
|
|
3302
|
-
function
|
|
3734
|
+
function pn({ block: e, className: n, path: r = "block" }) {
|
|
3303
3735
|
let i = e.elements;
|
|
3304
|
-
return /* @__PURE__ */
|
|
3736
|
+
return /* @__PURE__ */ u(R, {
|
|
3305
3737
|
blockId: e.block_id,
|
|
3306
3738
|
blockType: e.type,
|
|
3307
3739
|
className: n,
|
|
3308
|
-
children: /* @__PURE__ */
|
|
3309
|
-
...
|
|
3310
|
-
children: Array.isArray(i) ? i.map((e, n) =>
|
|
3740
|
+
children: /* @__PURE__ */ u("div", {
|
|
3741
|
+
...g(O.carousel),
|
|
3742
|
+
children: Array.isArray(i) ? i.map((e, n) => fn(e) ? /* @__PURE__ */ u(dn, {
|
|
3311
3743
|
block: e,
|
|
3312
|
-
className:
|
|
3744
|
+
className: g(O.carouselCard).className,
|
|
3313
3745
|
path: `${r}.elements[${String(n)}]`
|
|
3314
|
-
}, `${
|
|
3315
|
-
...
|
|
3746
|
+
}, `${xe(e) ?? "card"}-${String(n)}`) : /* @__PURE__ */ t("div", {
|
|
3747
|
+
...g(O.unhandled),
|
|
3316
3748
|
"data-unhandled-block": !0,
|
|
3317
3749
|
key: `unknown-${String(n)}`
|
|
3318
|
-
},
|
|
3750
|
+
}, E(e, "carousel card"))) : null
|
|
3319
3751
|
})
|
|
3320
3752
|
});
|
|
3321
3753
|
}
|
|
3322
|
-
function
|
|
3754
|
+
function mn({ block: e, className: t }) {
|
|
3323
3755
|
let n = e.level ?? "default";
|
|
3324
|
-
return /* @__PURE__ */
|
|
3756
|
+
return /* @__PURE__ */ u(R, {
|
|
3325
3757
|
blockId: e.block_id,
|
|
3326
3758
|
blockType: e.type,
|
|
3327
3759
|
className: t,
|
|
3328
|
-
children: /* @__PURE__ */
|
|
3329
|
-
...
|
|
3330
|
-
children: [/* @__PURE__ */
|
|
3760
|
+
children: /* @__PURE__ */ d("div", {
|
|
3761
|
+
...g(O.alert, n === "info" && O.alertInfo, n === "warning" && O.alertWarning, n === "error" && O.alertError, n === "success" && O.alertSuccess),
|
|
3762
|
+
children: [/* @__PURE__ */ u("span", {
|
|
3763
|
+
...g(O.iconSlot, O.alertIcon),
|
|
3331
3764
|
"aria-hidden": "true",
|
|
3332
|
-
children: n === "warning"
|
|
3333
|
-
}), /* @__PURE__ */
|
|
3765
|
+
children: u(n === "warning" || n === "error" ? ye : n === "success" ? ae : ue, { size: 20 })
|
|
3766
|
+
}), /* @__PURE__ */ u(L, { text: e.text })]
|
|
3334
3767
|
})
|
|
3335
3768
|
});
|
|
3336
3769
|
}
|
|
3337
|
-
function
|
|
3338
|
-
let i = e.sources, a = typeof e.status == "string" ? e.status : "unknown", o = typeof e.title == "string" ? e.title :
|
|
3339
|
-
return /* @__PURE__ */
|
|
3770
|
+
function hn({ block: e, className: n, path: r = "block" }) {
|
|
3771
|
+
let i = e.sources, a = typeof e.status == "string" ? e.status : "unknown", o = typeof e.title == "string" ? e.title : E(e, "task");
|
|
3772
|
+
return /* @__PURE__ */ u(R, {
|
|
3340
3773
|
blockId: e.block_id,
|
|
3341
3774
|
blockType: e.type,
|
|
3342
3775
|
className: n,
|
|
3343
|
-
children: /* @__PURE__ */
|
|
3344
|
-
...
|
|
3776
|
+
children: /* @__PURE__ */ d("div", {
|
|
3777
|
+
...g(O.task),
|
|
3345
3778
|
children: [
|
|
3346
|
-
/* @__PURE__ */
|
|
3347
|
-
...
|
|
3779
|
+
/* @__PURE__ */ d("div", {
|
|
3780
|
+
...g(O.taskHeading),
|
|
3348
3781
|
children: [
|
|
3349
|
-
/* @__PURE__ */
|
|
3782
|
+
/* @__PURE__ */ u("span", {
|
|
3783
|
+
...g(O.iconSlot),
|
|
3350
3784
|
"aria-hidden": "true",
|
|
3351
|
-
children: a === "complete" ?
|
|
3785
|
+
children: u(a === "complete" ? ae : a === "error" ? ie : a === "in_progress" ? de : re, { size: 16 })
|
|
3352
3786
|
}),
|
|
3353
|
-
/* @__PURE__ */
|
|
3354
|
-
/* @__PURE__ */
|
|
3355
|
-
...
|
|
3787
|
+
/* @__PURE__ */ u("span", { children: o }),
|
|
3788
|
+
/* @__PURE__ */ u("span", {
|
|
3789
|
+
...g(O.taskStatus),
|
|
3356
3790
|
children: a
|
|
3357
3791
|
})
|
|
3358
3792
|
]
|
|
3359
3793
|
}),
|
|
3360
|
-
e.details === void 0 ? null : /* @__PURE__ */
|
|
3794
|
+
e.details === void 0 ? null : /* @__PURE__ */ u(N, {
|
|
3361
3795
|
block: e.details,
|
|
3362
3796
|
path: `${r}.details`
|
|
3363
3797
|
}),
|
|
3364
|
-
e.output === void 0 ? null : /* @__PURE__ */
|
|
3798
|
+
e.output === void 0 ? null : /* @__PURE__ */ u(N, {
|
|
3365
3799
|
block: e.output,
|
|
3366
3800
|
path: `${r}.output`
|
|
3367
3801
|
}),
|
|
3368
|
-
Array.isArray(i) ? /* @__PURE__ */
|
|
3369
|
-
...
|
|
3802
|
+
Array.isArray(i) ? /* @__PURE__ */ u("div", {
|
|
3803
|
+
...g(O.context),
|
|
3370
3804
|
children: i.map((e, n) => {
|
|
3371
|
-
if (!
|
|
3372
|
-
...
|
|
3805
|
+
if (!w(e)) return /* @__PURE__ */ t("span", {
|
|
3806
|
+
...g(O.unhandled),
|
|
3373
3807
|
key: `unknown-${String(n)}`
|
|
3374
|
-
},
|
|
3375
|
-
let r =
|
|
3376
|
-
return r === void 0 ? /* @__PURE__ */
|
|
3377
|
-
...
|
|
3808
|
+
}, E(e, "task source"));
|
|
3809
|
+
let r = D(typeof e.url == "string" ? e.url : void 0), i = typeof e.text == "string" ? e.text : E(e, "task source"), a = `${typeof e.url == "string" ? e.url : `source-${String(n)}`}-${String(n)}`;
|
|
3810
|
+
return r === void 0 ? /* @__PURE__ */ u("span", { children: i }, a) : /* @__PURE__ */ t("a", {
|
|
3811
|
+
...g(O.link),
|
|
3378
3812
|
href: r,
|
|
3379
3813
|
key: a,
|
|
3380
3814
|
rel: "noreferrer"
|
|
@@ -3385,31 +3819,31 @@ function Wt({ block: e, className: n, path: r = "block" }) {
|
|
|
3385
3819
|
})
|
|
3386
3820
|
});
|
|
3387
3821
|
}
|
|
3388
|
-
function
|
|
3389
|
-
return
|
|
3822
|
+
function gn(e) {
|
|
3823
|
+
return w(e) && e.type === "task_card";
|
|
3390
3824
|
}
|
|
3391
|
-
function
|
|
3392
|
-
let i = e.tasks, a = typeof e.title == "string" ? e.title :
|
|
3393
|
-
return /* @__PURE__ */
|
|
3825
|
+
function _n({ block: e, className: n, path: r = "block" }) {
|
|
3826
|
+
let i = e.tasks, a = typeof e.title == "string" ? e.title : E(e, "plan");
|
|
3827
|
+
return /* @__PURE__ */ u(R, {
|
|
3394
3828
|
blockId: e.block_id,
|
|
3395
3829
|
blockType: e.type,
|
|
3396
3830
|
className: n,
|
|
3397
|
-
children: /* @__PURE__ */
|
|
3398
|
-
...
|
|
3399
|
-
children: [/* @__PURE__ */
|
|
3831
|
+
children: /* @__PURE__ */ d("div", {
|
|
3832
|
+
...g(O.plan),
|
|
3833
|
+
children: [/* @__PURE__ */ u("strong", { children: a }), Array.isArray(i) ? i.map((e, n) => gn(e) ? /* @__PURE__ */ u(hn, {
|
|
3400
3834
|
block: e,
|
|
3401
3835
|
path: `${r}.tasks[${String(n)}]`
|
|
3402
3836
|
}, `${typeof e.task_id == "string" ? e.task_id : "task"}-${String(n)}`) : /* @__PURE__ */ t("div", {
|
|
3403
|
-
...
|
|
3837
|
+
...g(O.unhandled),
|
|
3404
3838
|
"data-unhandled-block": !0,
|
|
3405
3839
|
key: `unknown-${String(n)}`
|
|
3406
|
-
},
|
|
3840
|
+
}, E(e, "plan task"))) : null]
|
|
3407
3841
|
})
|
|
3408
3842
|
});
|
|
3409
3843
|
}
|
|
3410
3844
|
//#endregion
|
|
3411
3845
|
//#region src/constants.ts
|
|
3412
|
-
var
|
|
3846
|
+
var vn = 3e3, yn = 3e3, bn = 2e3, xn = 3e3, Sn = 2e3, Cn = 2e3, wn = 12e3, Tn = 3e3, En = 2e3, Dn = 1e4, On = 2e4, kn = [
|
|
3413
3847
|
"actions",
|
|
3414
3848
|
"alert",
|
|
3415
3849
|
"card",
|
|
@@ -3431,9 +3865,9 @@ var qt = 3e3, Jt = 3e3, Yt = 2e3, Xt = 3e3, Zt = 2e3, Qt = 2e3, $t = 12e3, en =
|
|
|
3431
3865
|
"table",
|
|
3432
3866
|
"task_card",
|
|
3433
3867
|
"video"
|
|
3434
|
-
],
|
|
3435
|
-
function
|
|
3436
|
-
let [e, t] =
|
|
3868
|
+
], An = 554;
|
|
3869
|
+
function jn() {
|
|
3870
|
+
let [e, t] = c(An + 26), r = s(void 0), a = n((e) => {
|
|
3437
3871
|
if (r.current?.disconnect(), r.current = void 0, e === null) return;
|
|
3438
3872
|
let n = () => {
|
|
3439
3873
|
let n = e.getBoundingClientRect().width;
|
|
@@ -3448,22 +3882,22 @@ function sn() {
|
|
|
3448
3882
|
width: e
|
|
3449
3883
|
};
|
|
3450
3884
|
}
|
|
3451
|
-
function
|
|
3885
|
+
function Mn(e, t) {
|
|
3452
3886
|
let n = e / Math.max(1, t), r = 10 ** Math.floor(Math.log10(n)), i = n / r;
|
|
3453
3887
|
return i >= Math.sqrt(50) ? r * 10 : i >= Math.sqrt(10) ? r * 5 : i >= Math.SQRT2 ? r * 2 : r;
|
|
3454
3888
|
}
|
|
3455
|
-
function
|
|
3456
|
-
let n = Math.min(0, e), r = t > n ? t : n + 1, i =
|
|
3889
|
+
function Nn(e, t) {
|
|
3890
|
+
let n = Math.min(0, e), r = t > n ? t : n + 1, i = Mn(r - n, 4), a = Math.floor(n / i), o = Math.ceil(r / i), s = [];
|
|
3457
3891
|
for (let e = a; e <= o; e += 1) s.push(e * i);
|
|
3458
3892
|
return s;
|
|
3459
3893
|
}
|
|
3460
|
-
function
|
|
3894
|
+
function Pn(e) {
|
|
3461
3895
|
return Math.ceil(e - .5) + .5;
|
|
3462
3896
|
}
|
|
3463
|
-
function
|
|
3897
|
+
function Fn(e, t) {
|
|
3464
3898
|
let n = 0, r = 0;
|
|
3465
3899
|
for (let e of t) n = Math.min(n, e), r = Math.max(r, e);
|
|
3466
|
-
let i =
|
|
3900
|
+
let i = Nn(n, r), a = i[0] ?? 0, o = (i[i.length - 1] ?? 1) - a || 1;
|
|
3467
3901
|
return {
|
|
3468
3902
|
plotLeft: 74,
|
|
3469
3903
|
plotRight: e,
|
|
@@ -3472,14 +3906,14 @@ function dn(e, t) {
|
|
|
3472
3906
|
y: (e) => 334 - (e - a) / o * 325
|
|
3473
3907
|
};
|
|
3474
3908
|
}
|
|
3475
|
-
function
|
|
3476
|
-
return
|
|
3909
|
+
function In(e) {
|
|
3910
|
+
return Ee[e % Ee.length] ?? Te;
|
|
3477
3911
|
}
|
|
3478
|
-
function
|
|
3912
|
+
function Ln(e, t) {
|
|
3479
3913
|
let n = new Map(e.data.map((e) => [e.label, e]));
|
|
3480
3914
|
return t.map((e) => n.get(e));
|
|
3481
3915
|
}
|
|
3482
|
-
function
|
|
3916
|
+
function Rn(e, t, n, r) {
|
|
3483
3917
|
let i = Math.min(4, t / 2, Math.abs(r - n)), a = e, o = e + t;
|
|
3484
3918
|
return [
|
|
3485
3919
|
`M${String(a + i)} ${String(n)}`,
|
|
@@ -3492,7 +3926,7 @@ function mn(e, t, n, r) {
|
|
|
3492
3926
|
"Z"
|
|
3493
3927
|
].join("");
|
|
3494
3928
|
}
|
|
3495
|
-
function
|
|
3929
|
+
function zn(e) {
|
|
3496
3930
|
if (e.length === 0) return "";
|
|
3497
3931
|
let t = e[0];
|
|
3498
3932
|
if (t === void 0) return "";
|
|
@@ -3519,18 +3953,18 @@ function hn(e) {
|
|
|
3519
3953
|
}
|
|
3520
3954
|
return r.join("");
|
|
3521
3955
|
}
|
|
3522
|
-
function
|
|
3956
|
+
function Bn({ geometry: e }) {
|
|
3523
3957
|
let { plotLeft: n, plotRight: r, ticks: i, y: a } = e;
|
|
3524
|
-
return /* @__PURE__ */
|
|
3525
|
-
let i =
|
|
3958
|
+
return /* @__PURE__ */ d(l, { children: [i.map((e) => {
|
|
3959
|
+
let i = Pn(a(e));
|
|
3526
3960
|
return /* @__PURE__ */ t("path", {
|
|
3527
|
-
...
|
|
3961
|
+
...g(O.chartGridline),
|
|
3528
3962
|
d: `M${String(n)} ${String(i)}L${String(r)} ${String(i)}`,
|
|
3529
3963
|
fill: "none",
|
|
3530
3964
|
key: `grid-${String(e)}`
|
|
3531
3965
|
});
|
|
3532
3966
|
}), i.map((e) => /* @__PURE__ */ t("text", {
|
|
3533
|
-
...
|
|
3967
|
+
...g(O.chartTickText),
|
|
3534
3968
|
dy: "0.32em",
|
|
3535
3969
|
key: `tick-${String(e)}`,
|
|
3536
3970
|
textAnchor: "end",
|
|
@@ -3538,35 +3972,35 @@ function gn({ geometry: e }) {
|
|
|
3538
3972
|
y: a(e)
|
|
3539
3973
|
}, e))] });
|
|
3540
3974
|
}
|
|
3541
|
-
function
|
|
3542
|
-
return /* @__PURE__ */ l
|
|
3543
|
-
...
|
|
3975
|
+
function Vn({ categories: e, tickX: n }) {
|
|
3976
|
+
return /* @__PURE__ */ u(l, { children: e.map((e, r) => /* @__PURE__ */ t("text", {
|
|
3977
|
+
...g(O.chartTickText),
|
|
3544
3978
|
key: `${e}-${String(r)}`,
|
|
3545
3979
|
textAnchor: "middle",
|
|
3546
3980
|
x: n(r),
|
|
3547
3981
|
y: 351
|
|
3548
3982
|
}, e)) });
|
|
3549
3983
|
}
|
|
3550
|
-
function
|
|
3984
|
+
function Hn(e, t) {
|
|
3551
3985
|
let n = e * Math.min(.155, Math.max(.075, .175 - .02 * t));
|
|
3552
3986
|
return {
|
|
3553
3987
|
barWidth: (e - 2 * n) / (1.1 * t - .1),
|
|
3554
3988
|
outer: n
|
|
3555
3989
|
};
|
|
3556
3990
|
}
|
|
3557
|
-
function
|
|
3991
|
+
function Un({ chart: e, svgWidth: n, title: r }) {
|
|
3558
3992
|
let i = e.axis_config.categories, a = e.series.map((e) => ({
|
|
3559
|
-
points:
|
|
3993
|
+
points: Ln(e, i),
|
|
3560
3994
|
series: e
|
|
3561
|
-
})), o =
|
|
3995
|
+
})), o = Fn(n, a.flatMap(({ points: e }) => e.flatMap((e) => e === void 0 ? [] : [e.value]))), { plotLeft: s, plotRight: c, y: l } = o, f, p;
|
|
3562
3996
|
if (e.type === "bar") {
|
|
3563
|
-
let n = (c - s) / Math.max(1, i.length), { barWidth: r, outer: o } =
|
|
3997
|
+
let n = (c - s) / Math.max(1, i.length), { barWidth: r, outer: o } = Hn(n, Math.max(1, e.series.length));
|
|
3564
3998
|
p = (e) => s + n * (e + .5), f = a.map(({ points: e, series: i }, a) => e.map((e, c) => {
|
|
3565
3999
|
if (e === void 0) return null;
|
|
3566
|
-
let
|
|
4000
|
+
let u = s + c * n + o + 1.1 * r * a;
|
|
3567
4001
|
return /* @__PURE__ */ t("path", {
|
|
3568
|
-
...
|
|
3569
|
-
d:
|
|
4002
|
+
...g(In(a).fill),
|
|
4003
|
+
d: Rn(u, r, l(e.value), 334),
|
|
3570
4004
|
"data-category": e.label,
|
|
3571
4005
|
"data-series": i.name,
|
|
3572
4006
|
key: `${i.name}-${String(a)}-${e.label}-${String(c)}`
|
|
@@ -3577,48 +4011,48 @@ function yn({ chart: e, svgWidth: n, title: r }) {
|
|
|
3577
4011
|
p = n, f = a.map(({ points: t, series: r }, i) => {
|
|
3578
4012
|
let a = t.flatMap((e, t) => e === void 0 ? [] : [{
|
|
3579
4013
|
x: n(t),
|
|
3580
|
-
y:
|
|
3581
|
-
}]), o =
|
|
4014
|
+
y: l(e.value)
|
|
4015
|
+
}]), o = zn(a);
|
|
3582
4016
|
if (o === "") return null;
|
|
3583
4017
|
let s = a[a.length - 1], c = a[0];
|
|
3584
|
-
return /* @__PURE__ */
|
|
3585
|
-
...
|
|
4018
|
+
return /* @__PURE__ */ d("g", { children: [e.type === "area" && c !== void 0 && s !== void 0 ? /* @__PURE__ */ u("path", {
|
|
4019
|
+
...g(In(i).tint, O.chartAreaFill, i >= 6 && O.chartAreaFallbackFill),
|
|
3586
4020
|
d: `${o}L${String(s.x)} 334L${String(c.x)} 334Z`,
|
|
3587
4021
|
"data-series-area": r.name
|
|
3588
|
-
}) : null, /* @__PURE__ */
|
|
3589
|
-
...
|
|
4022
|
+
}) : null, /* @__PURE__ */ u("path", {
|
|
4023
|
+
...g(In(i).stroke, O.chartLinePath),
|
|
3590
4024
|
d: o,
|
|
3591
4025
|
"data-series": r.name,
|
|
3592
4026
|
fill: "none"
|
|
3593
4027
|
})] }, `${r.name}-${String(i)}`);
|
|
3594
4028
|
});
|
|
3595
4029
|
}
|
|
3596
|
-
return /* @__PURE__ */
|
|
3597
|
-
...
|
|
4030
|
+
return /* @__PURE__ */ d("svg", {
|
|
4031
|
+
...g(O.chartSvg),
|
|
3598
4032
|
"aria-label": r,
|
|
3599
4033
|
height: 360,
|
|
3600
4034
|
role: "img",
|
|
3601
4035
|
width: n,
|
|
3602
4036
|
children: [
|
|
3603
|
-
/* @__PURE__ */
|
|
4037
|
+
/* @__PURE__ */ u(Bn, { geometry: o }),
|
|
3604
4038
|
f,
|
|
3605
|
-
/* @__PURE__ */
|
|
4039
|
+
/* @__PURE__ */ u(Vn, {
|
|
3606
4040
|
categories: i,
|
|
3607
4041
|
tickX: p
|
|
3608
4042
|
})
|
|
3609
4043
|
]
|
|
3610
4044
|
});
|
|
3611
4045
|
}
|
|
3612
|
-
function
|
|
4046
|
+
function Wn(e, t, n, r) {
|
|
3613
4047
|
return {
|
|
3614
4048
|
x: e + n * Math.sin(r),
|
|
3615
4049
|
y: t - n * Math.cos(r)
|
|
3616
4050
|
};
|
|
3617
4051
|
}
|
|
3618
|
-
function
|
|
4052
|
+
function Gn({ chart: e, svgWidth: n, title: r }) {
|
|
3619
4053
|
let i = e.segments.map((e) => Number.isFinite(e.value) ? Math.max(0, e.value) : 0), a = i.reduce((e, t) => e + t, 0);
|
|
3620
|
-
if (a <= 0) return /* @__PURE__ */
|
|
3621
|
-
...
|
|
4054
|
+
if (a <= 0) return /* @__PURE__ */ u("div", {
|
|
4055
|
+
...g(O.unhandled),
|
|
3622
4056
|
"aria-label": `${r}: no chart data`,
|
|
3623
4057
|
"data-empty-chart": !0,
|
|
3624
4058
|
role: "img",
|
|
@@ -3627,16 +4061,16 @@ function xn({ chart: e, svgWidth: n, title: r }) {
|
|
|
3627
4061
|
let o = n / 2, s = 0, c = e.segments.map((e, n) => {
|
|
3628
4062
|
let r = (i[n] ?? 0) / a, c = s * 2 * Math.PI;
|
|
3629
4063
|
s += r;
|
|
3630
|
-
let l = s * 2 * Math.PI, u =
|
|
4064
|
+
let l = s * 2 * Math.PI, u = Wn(o, 180, 144, c), d = Wn(o, 180, 144, l), f = +(l - c > Math.PI), p = r >= 1 ? `M${String(o)} 36A144 144 0 1 1 ${String(o)} 324A144 144 0 1 1 ${String(o)} 36Z` : `M${String(u.x)} ${String(u.y)}A144 144 0 ${String(f)} 1 ${String(d.x)} ${String(d.y)}L${String(o)} 180Z`;
|
|
3631
4065
|
return r <= 0 ? null : /* @__PURE__ */ t("path", {
|
|
3632
|
-
...
|
|
4066
|
+
...g(In(n).fill, O.pieSlice),
|
|
3633
4067
|
d: p,
|
|
3634
4068
|
"data-segment": e.label,
|
|
3635
4069
|
key: `${e.label}-${String(n)}`
|
|
3636
4070
|
});
|
|
3637
4071
|
});
|
|
3638
|
-
return /* @__PURE__ */
|
|
3639
|
-
...
|
|
4072
|
+
return /* @__PURE__ */ u("svg", {
|
|
4073
|
+
...g(O.chartSvg),
|
|
3640
4074
|
"aria-label": r,
|
|
3641
4075
|
height: 360,
|
|
3642
4076
|
role: "img",
|
|
@@ -3644,84 +4078,84 @@ function xn({ chart: e, svgWidth: n, title: r }) {
|
|
|
3644
4078
|
children: c
|
|
3645
4079
|
});
|
|
3646
4080
|
}
|
|
3647
|
-
var
|
|
4081
|
+
var Kn = {
|
|
3648
4082
|
area: !0,
|
|
3649
4083
|
bar: !0,
|
|
3650
4084
|
line: !0
|
|
3651
4085
|
};
|
|
3652
|
-
function
|
|
3653
|
-
return
|
|
4086
|
+
function qn(e) {
|
|
4087
|
+
return w(e) && typeof e.label == "string" && typeof e.value == "number" && Number.isFinite(e.value);
|
|
3654
4088
|
}
|
|
3655
|
-
function
|
|
3656
|
-
return
|
|
4089
|
+
function Jn(e) {
|
|
4090
|
+
return w(e) && typeof e.label == "string" && typeof e.value == "number" && Number.isFinite(e.value);
|
|
3657
4091
|
}
|
|
3658
|
-
function
|
|
3659
|
-
return
|
|
4092
|
+
function Yn(e) {
|
|
4093
|
+
return w(e) && typeof e.name == "string" && Array.isArray(e.data) && e.data.every(Jn);
|
|
3660
4094
|
}
|
|
3661
|
-
function
|
|
3662
|
-
return
|
|
4095
|
+
function Xn(e) {
|
|
4096
|
+
return w(e) && e.type === "pie" && Array.isArray(e.segments) && e.segments.every(qn);
|
|
3663
4097
|
}
|
|
3664
|
-
function
|
|
3665
|
-
if (!
|
|
4098
|
+
function Zn(e) {
|
|
4099
|
+
if (!w(e)) return !1;
|
|
3666
4100
|
let t = e.type;
|
|
3667
|
-
if (typeof t != "string" || !(t in
|
|
4101
|
+
if (typeof t != "string" || !(t in Kn)) return !1;
|
|
3668
4102
|
let n = e.axis_config;
|
|
3669
|
-
return Array.isArray(e.series) && e.series.every(
|
|
3670
|
-
}
|
|
3671
|
-
function
|
|
3672
|
-
let r = e.chart, i = typeof e.title == "string" ? e.title :
|
|
3673
|
-
|
|
3674
|
-
...
|
|
3675
|
-
"data-unhandled-chart-type":
|
|
3676
|
-
children:
|
|
3677
|
-
}), p = []) : (f = /* @__PURE__ */
|
|
4103
|
+
return Array.isArray(e.series) && e.series.every(Yn) && w(n) && Array.isArray(n.categories) && n.categories.every((e) => typeof e == "string");
|
|
4104
|
+
}
|
|
4105
|
+
function Qn({ block: e, className: n }) {
|
|
4106
|
+
let r = e.chart, i = typeof e.title == "string" ? e.title : E(e, "chart"), { ref: a, width: o } = jn(), s = Math.min(624, Math.max(400, o)) - 26, c = Zn(r) ? r : void 0, l = c === void 0 && Xn(r) ? r : void 0, f, p;
|
|
4107
|
+
l === void 0 ? c === void 0 ? (f = /* @__PURE__ */ u("div", {
|
|
4108
|
+
...g(O.unhandled),
|
|
4109
|
+
"data-unhandled-chart-type": T(r) ?? "unknown",
|
|
4110
|
+
children: E(r, "chart")
|
|
4111
|
+
}), p = []) : (f = /* @__PURE__ */ u(Un, {
|
|
3678
4112
|
chart: c,
|
|
3679
4113
|
svgWidth: s,
|
|
3680
4114
|
title: i
|
|
3681
|
-
}), p = c.series.map((e) => e.name)) : (f = /* @__PURE__ */
|
|
3682
|
-
chart:
|
|
4115
|
+
}), p = c.series.map((e) => e.name)) : (f = /* @__PURE__ */ u(Gn, {
|
|
4116
|
+
chart: l,
|
|
3683
4117
|
svgWidth: s,
|
|
3684
4118
|
title: i
|
|
3685
|
-
}), p =
|
|
3686
|
-
let m = c?.axis_config.x_label,
|
|
3687
|
-
return /* @__PURE__ */
|
|
4119
|
+
}), p = l.segments.map((e) => e.label));
|
|
4120
|
+
let m = c?.axis_config.x_label, h = c?.axis_config.y_label;
|
|
4121
|
+
return /* @__PURE__ */ u(R, {
|
|
3688
4122
|
blockId: e.block_id,
|
|
3689
4123
|
blockType: e.type,
|
|
3690
4124
|
className: n,
|
|
3691
|
-
children: /* @__PURE__ */
|
|
3692
|
-
...
|
|
3693
|
-
children: /* @__PURE__ */
|
|
3694
|
-
...
|
|
4125
|
+
children: /* @__PURE__ */ u("div", {
|
|
4126
|
+
...g(O.chartScroller),
|
|
4127
|
+
children: /* @__PURE__ */ u("div", {
|
|
4128
|
+
...g(O.chartCard),
|
|
3695
4129
|
ref: a,
|
|
3696
|
-
children: /* @__PURE__ */
|
|
3697
|
-
...
|
|
3698
|
-
children: [/* @__PURE__ */
|
|
3699
|
-
...
|
|
4130
|
+
children: /* @__PURE__ */ d("div", {
|
|
4131
|
+
...g(O.chartContent),
|
|
4132
|
+
children: [/* @__PURE__ */ u("h3", {
|
|
4133
|
+
...g(O.chartTitle),
|
|
3700
4134
|
children: i
|
|
3701
|
-
}), /* @__PURE__ */
|
|
3702
|
-
...
|
|
4135
|
+
}), /* @__PURE__ */ d("div", {
|
|
4136
|
+
...g(O.chartPlotArea),
|
|
3703
4137
|
children: [
|
|
3704
|
-
/* @__PURE__ */
|
|
3705
|
-
...
|
|
3706
|
-
children: [f,
|
|
3707
|
-
...
|
|
3708
|
-
children: /* @__PURE__ */
|
|
3709
|
-
...
|
|
3710
|
-
children:
|
|
4138
|
+
/* @__PURE__ */ d("div", {
|
|
4139
|
+
...g(O.chartCanvas),
|
|
4140
|
+
children: [f, h === void 0 ? null : /* @__PURE__ */ u("div", {
|
|
4141
|
+
...g(O.chartYAxisLabel),
|
|
4142
|
+
children: /* @__PURE__ */ u("span", {
|
|
4143
|
+
...g(O.chartYAxisLabelText),
|
|
4144
|
+
children: h
|
|
3711
4145
|
})
|
|
3712
4146
|
})]
|
|
3713
4147
|
}),
|
|
3714
|
-
c === void 0 ? null : /* @__PURE__ */
|
|
3715
|
-
...
|
|
4148
|
+
c === void 0 ? null : /* @__PURE__ */ u("div", {
|
|
4149
|
+
...g(O.chartXAxisLabel),
|
|
3716
4150
|
children: m
|
|
3717
4151
|
}),
|
|
3718
|
-
p.length === 0 ? null : /* @__PURE__ */
|
|
3719
|
-
...
|
|
4152
|
+
p.length === 0 ? null : /* @__PURE__ */ u("div", {
|
|
4153
|
+
...g(O.chartLegend, c !== void 0 && O.chartLegendCartesian),
|
|
3720
4154
|
children: p.map((e, n) => /* @__PURE__ */ t("span", {
|
|
3721
|
-
...
|
|
4155
|
+
...g(O.chartLegendItem),
|
|
3722
4156
|
key: `${e}-${String(n)}`
|
|
3723
|
-
}, /* @__PURE__ */
|
|
3724
|
-
...
|
|
4157
|
+
}, /* @__PURE__ */ u("span", {
|
|
4158
|
+
...g(O.chartLegendSwatch, In(n).swatch),
|
|
3725
4159
|
"aria-hidden": "true"
|
|
3726
4160
|
}), e))
|
|
3727
4161
|
})
|
|
@@ -3734,254 +4168,260 @@ function On({ block: e, className: n }) {
|
|
|
3734
4168
|
}
|
|
3735
4169
|
//#endregion
|
|
3736
4170
|
//#region src/blocks/InteractiveBlocks.tsx
|
|
3737
|
-
function
|
|
3738
|
-
return
|
|
4171
|
+
function $n(e) {
|
|
4172
|
+
return w(e) && w(e.text) && typeof e.text.text == "string";
|
|
3739
4173
|
}
|
|
3740
|
-
function
|
|
3741
|
-
return
|
|
4174
|
+
function er(e) {
|
|
4175
|
+
return w(e) && e.type === "feedback_buttons" && $n(e.positive_button) && $n(e.negative_button);
|
|
3742
4176
|
}
|
|
3743
|
-
function
|
|
3744
|
-
return
|
|
4177
|
+
function tr(e) {
|
|
4178
|
+
return w(e) && e.type === "icon_button" && $n(e);
|
|
3745
4179
|
}
|
|
3746
|
-
function
|
|
3747
|
-
let r =
|
|
3748
|
-
return /* @__PURE__ */
|
|
4180
|
+
function nr({ block: e, className: t, path: n = "block" }) {
|
|
4181
|
+
let r = g(O.block, O.actions), i = Array.isArray(e.elements) ? e.elements : [];
|
|
4182
|
+
return /* @__PURE__ */ u("div", {
|
|
3749
4183
|
...r,
|
|
3750
|
-
className:
|
|
4184
|
+
className: A(r.className, t),
|
|
3751
4185
|
"data-block-id": e.block_id,
|
|
3752
4186
|
"data-block-type": e.type,
|
|
3753
|
-
children: i.map((t, r) => /* @__PURE__ */
|
|
4187
|
+
children: i.map((t, r) => /* @__PURE__ */ u(Dt, {
|
|
3754
4188
|
blockId: e.block_id,
|
|
3755
4189
|
element: t,
|
|
3756
4190
|
path: `${n}.elements[${String(r)}]`
|
|
3757
|
-
}, `${
|
|
4191
|
+
}, `${T(t) ?? "unknown"}-${w(t) && typeof t.action_id == "string" ? t.action_id : "action"}-${String(r)}`))
|
|
3758
4192
|
});
|
|
3759
4193
|
}
|
|
3760
|
-
function
|
|
3761
|
-
let r =
|
|
3762
|
-
return /* @__PURE__ */
|
|
4194
|
+
function rr({ block: e, className: t, path: n = "block" }) {
|
|
4195
|
+
let r = g(O.block, O.inputBlock), i = e.label;
|
|
4196
|
+
return /* @__PURE__ */ d("div", {
|
|
3763
4197
|
...r,
|
|
3764
|
-
className:
|
|
4198
|
+
className: A(r.className, t),
|
|
3765
4199
|
"data-block-id": e.block_id,
|
|
3766
4200
|
"data-block-type": e.type,
|
|
3767
4201
|
children: [
|
|
3768
|
-
/* @__PURE__ */
|
|
3769
|
-
...
|
|
3770
|
-
children: [
|
|
3771
|
-
...
|
|
4202
|
+
/* @__PURE__ */ d("div", {
|
|
4203
|
+
...g(O.inputLabel),
|
|
4204
|
+
children: [w(i) && typeof i.text == "string" ? i.text : E(i, "input label"), e.optional === !0 ? null : /* @__PURE__ */ u("span", {
|
|
4205
|
+
...g(O.required),
|
|
3772
4206
|
"aria-hidden": "true",
|
|
3773
4207
|
children: "*"
|
|
3774
4208
|
})]
|
|
3775
4209
|
}),
|
|
3776
|
-
/* @__PURE__ */
|
|
4210
|
+
/* @__PURE__ */ u(Dt, {
|
|
3777
4211
|
blockId: e.block_id,
|
|
3778
4212
|
element: e.element,
|
|
3779
4213
|
path: `${n}.element`
|
|
3780
4214
|
}),
|
|
3781
|
-
e.hint === void 0 ? null : /* @__PURE__ */
|
|
3782
|
-
...
|
|
3783
|
-
children:
|
|
4215
|
+
e.hint === void 0 ? null : /* @__PURE__ */ u("div", {
|
|
4216
|
+
...g(O.smallText),
|
|
4217
|
+
children: w(e.hint) && typeof e.hint.text == "string" ? e.hint.text : E(e.hint, "input hint")
|
|
3784
4218
|
})
|
|
3785
4219
|
]
|
|
3786
4220
|
});
|
|
3787
4221
|
}
|
|
3788
|
-
function
|
|
4222
|
+
function ir(e, t) {
|
|
3789
4223
|
return t === "positive" ? e.positive_button.text.text : e.negative_button.text.text;
|
|
3790
4224
|
}
|
|
3791
|
-
function
|
|
3792
|
-
let { onAction: r } =
|
|
3793
|
-
return /* @__PURE__ */
|
|
4225
|
+
function ar({ block: e, className: n }) {
|
|
4226
|
+
let { onAction: r } = x(), i = g(O.block, O.actions), a = e.elements;
|
|
4227
|
+
return /* @__PURE__ */ u("div", {
|
|
3794
4228
|
...i,
|
|
3795
|
-
className:
|
|
4229
|
+
className: A(i.className, n),
|
|
3796
4230
|
"data-block-id": e.block_id,
|
|
3797
4231
|
"data-block-type": e.type,
|
|
3798
|
-
children: Array.isArray(a) ? a.map((n, i) =>
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
n.action_id
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
4232
|
+
children: Array.isArray(a) ? a.map((n, i) => {
|
|
4233
|
+
if (tr(n)) {
|
|
4234
|
+
let a = g(O.button, O.iconButton), o = be[n.icon];
|
|
4235
|
+
return /* @__PURE__ */ t("button", {
|
|
4236
|
+
...a,
|
|
4237
|
+
"aria-label": n.accessibility_label ?? n.text.text,
|
|
4238
|
+
key: `${n.type}-${n.action_id ?? "button"}-${String(i)}`,
|
|
4239
|
+
onClick: () => {
|
|
4240
|
+
n.action_id !== void 0 && r?.({
|
|
4241
|
+
actionId: n.action_id,
|
|
4242
|
+
type: n.type,
|
|
4243
|
+
...e.block_id === void 0 ? {} : { blockId: e.block_id },
|
|
4244
|
+
...n.value === void 0 ? {} : { value: n.value }
|
|
4245
|
+
});
|
|
4246
|
+
},
|
|
4247
|
+
title: n.text.text,
|
|
4248
|
+
type: "button"
|
|
4249
|
+
}, o === void 0 ? n.icon : /* @__PURE__ */ u(o, { size: 16 }));
|
|
4250
|
+
}
|
|
4251
|
+
return er(n) ? /* @__PURE__ */ t("div", {
|
|
4252
|
+
...g(O.actions),
|
|
4253
|
+
key: `${n.type}-${n.action_id ?? "feedback"}-${String(i)}`
|
|
4254
|
+
}, /* @__PURE__ */ u("button", {
|
|
4255
|
+
...g(O.button, O.iconButton),
|
|
4256
|
+
"aria-label": ir(n, "positive"),
|
|
4257
|
+
onClick: () => {
|
|
4258
|
+
n.action_id !== void 0 && r?.({
|
|
4259
|
+
actionId: n.action_id,
|
|
4260
|
+
type: n.type,
|
|
4261
|
+
value: n.positive_button.value,
|
|
4262
|
+
...e.block_id === void 0 ? {} : { blockId: e.block_id }
|
|
4263
|
+
});
|
|
4264
|
+
},
|
|
4265
|
+
type: "button",
|
|
4266
|
+
children: /* @__PURE__ */ u(_e, { size: 16 })
|
|
4267
|
+
}), /* @__PURE__ */ u("button", {
|
|
4268
|
+
...g(O.button, O.iconButton),
|
|
4269
|
+
"aria-label": ir(n, "negative"),
|
|
4270
|
+
onClick: () => {
|
|
4271
|
+
n.action_id !== void 0 && r?.({
|
|
4272
|
+
actionId: n.action_id,
|
|
4273
|
+
type: n.type,
|
|
4274
|
+
value: n.negative_button.value,
|
|
4275
|
+
...e.block_id === void 0 ? {} : { blockId: e.block_id }
|
|
4276
|
+
});
|
|
4277
|
+
},
|
|
4278
|
+
type: "button",
|
|
4279
|
+
children: /* @__PURE__ */ u(ge, { size: 16 })
|
|
4280
|
+
})) : /* @__PURE__ */ t("div", {
|
|
4281
|
+
...g(O.unhandled),
|
|
4282
|
+
"data-unhandled-element": T(n) ?? "unknown",
|
|
4283
|
+
key: `unhandled-${String(i)}`
|
|
4284
|
+
}, E(n, "context action"));
|
|
4285
|
+
}) : /* @__PURE__ */ u("div", {
|
|
4286
|
+
...g(O.unhandled),
|
|
3847
4287
|
"data-unhandled-element": "context_actions",
|
|
3848
|
-
children:
|
|
4288
|
+
children: E(e, "context actions block")
|
|
3849
4289
|
})
|
|
3850
4290
|
});
|
|
3851
4291
|
}
|
|
3852
4292
|
//#endregion
|
|
3853
4293
|
//#region src/Block.tsx
|
|
3854
|
-
var
|
|
3855
|
-
function
|
|
3856
|
-
let t =
|
|
3857
|
-
return t !== void 0 &&
|
|
3858
|
-
}
|
|
3859
|
-
function
|
|
3860
|
-
let r =
|
|
3861
|
-
if (!
|
|
3862
|
-
let n =
|
|
3863
|
-
return /* @__PURE__ */
|
|
4294
|
+
var or = new Set(kn);
|
|
4295
|
+
function sr(e) {
|
|
4296
|
+
let t = T(e);
|
|
4297
|
+
return t !== void 0 && or.has(t);
|
|
4298
|
+
}
|
|
4299
|
+
function cr({ block: e, className: t, path: n = "block" }) {
|
|
4300
|
+
let r = T(e);
|
|
4301
|
+
if (!sr(e)) {
|
|
4302
|
+
let n = g(O.block, O.unhandled);
|
|
4303
|
+
return /* @__PURE__ */ u("div", {
|
|
3864
4304
|
...n,
|
|
3865
|
-
className:
|
|
4305
|
+
className: A(n.className, t),
|
|
3866
4306
|
"data-block-type": r ?? "unknown",
|
|
3867
4307
|
"data-unhandled-block": !0,
|
|
3868
4308
|
role: "note",
|
|
3869
|
-
children:
|
|
4309
|
+
children: E(e, "Slack block")
|
|
3870
4310
|
});
|
|
3871
4311
|
}
|
|
3872
4312
|
switch (e.type) {
|
|
3873
|
-
case "actions": return /* @__PURE__ */
|
|
4313
|
+
case "actions": return /* @__PURE__ */ u(nr, {
|
|
3874
4314
|
block: e,
|
|
3875
4315
|
className: t,
|
|
3876
4316
|
path: n
|
|
3877
4317
|
});
|
|
3878
|
-
case "alert": return /* @__PURE__ */
|
|
4318
|
+
case "alert": return /* @__PURE__ */ u(mn, {
|
|
3879
4319
|
block: e,
|
|
3880
4320
|
className: t,
|
|
3881
4321
|
path: n
|
|
3882
4322
|
});
|
|
3883
|
-
case "card": return /* @__PURE__ */
|
|
4323
|
+
case "card": return /* @__PURE__ */ u(dn, {
|
|
3884
4324
|
block: e,
|
|
3885
4325
|
className: t,
|
|
3886
4326
|
path: n
|
|
3887
4327
|
});
|
|
3888
|
-
case "carousel": return /* @__PURE__ */
|
|
4328
|
+
case "carousel": return /* @__PURE__ */ u(pn, {
|
|
3889
4329
|
block: e,
|
|
3890
4330
|
className: t,
|
|
3891
4331
|
path: n
|
|
3892
4332
|
});
|
|
3893
|
-
case "container": return /* @__PURE__ */
|
|
4333
|
+
case "container": return /* @__PURE__ */ u(mr, {
|
|
3894
4334
|
block: e,
|
|
3895
4335
|
className: t,
|
|
3896
4336
|
path: n
|
|
3897
4337
|
});
|
|
3898
|
-
case "context": return /* @__PURE__ */
|
|
4338
|
+
case "context": return /* @__PURE__ */ u(Qt, {
|
|
3899
4339
|
block: e,
|
|
3900
4340
|
className: t,
|
|
3901
4341
|
path: n
|
|
3902
4342
|
});
|
|
3903
|
-
case "context_actions": return /* @__PURE__ */
|
|
4343
|
+
case "context_actions": return /* @__PURE__ */ u(ar, {
|
|
3904
4344
|
block: e,
|
|
3905
4345
|
className: t,
|
|
3906
4346
|
path: n
|
|
3907
4347
|
});
|
|
3908
|
-
case "data_table": return /* @__PURE__ */
|
|
4348
|
+
case "data_table": return /* @__PURE__ */ u(ln, {
|
|
3909
4349
|
block: e,
|
|
3910
4350
|
className: t,
|
|
3911
4351
|
path: n
|
|
3912
4352
|
});
|
|
3913
|
-
case "data_visualization": return /* @__PURE__ */
|
|
4353
|
+
case "data_visualization": return /* @__PURE__ */ u(Qn, {
|
|
3914
4354
|
block: e,
|
|
3915
4355
|
className: t,
|
|
3916
4356
|
path: n
|
|
3917
4357
|
});
|
|
3918
|
-
case "divider": return /* @__PURE__ */
|
|
4358
|
+
case "divider": return /* @__PURE__ */ u(Yt, {
|
|
3919
4359
|
block: e,
|
|
3920
4360
|
className: t,
|
|
3921
4361
|
path: n
|
|
3922
4362
|
});
|
|
3923
|
-
case "file": return /* @__PURE__ */
|
|
4363
|
+
case "file": return /* @__PURE__ */ u(tn, {
|
|
3924
4364
|
block: e,
|
|
3925
4365
|
className: t,
|
|
3926
4366
|
path: n
|
|
3927
4367
|
});
|
|
3928
|
-
case "header": return /* @__PURE__ */
|
|
4368
|
+
case "header": return /* @__PURE__ */ u(Jt, {
|
|
3929
4369
|
block: e,
|
|
3930
4370
|
className: t,
|
|
3931
4371
|
path: n
|
|
3932
4372
|
});
|
|
3933
|
-
case "image": return /* @__PURE__ */
|
|
4373
|
+
case "image": return /* @__PURE__ */ u(Xt, {
|
|
3934
4374
|
block: e,
|
|
3935
4375
|
className: t,
|
|
3936
4376
|
path: n
|
|
3937
4377
|
});
|
|
3938
|
-
case "input": return /* @__PURE__ */
|
|
4378
|
+
case "input": return /* @__PURE__ */ u(rr, {
|
|
3939
4379
|
block: e,
|
|
3940
4380
|
className: t,
|
|
3941
4381
|
path: n
|
|
3942
4382
|
});
|
|
3943
|
-
case "markdown": return /* @__PURE__ */
|
|
4383
|
+
case "markdown": return /* @__PURE__ */ u(en, {
|
|
3944
4384
|
block: e,
|
|
3945
4385
|
className: t,
|
|
3946
4386
|
path: n
|
|
3947
4387
|
});
|
|
3948
|
-
case "plan": return /* @__PURE__ */
|
|
4388
|
+
case "plan": return /* @__PURE__ */ u(_n, {
|
|
3949
4389
|
block: e,
|
|
3950
4390
|
className: t,
|
|
3951
4391
|
path: n
|
|
3952
4392
|
});
|
|
3953
|
-
case "rich_text": return /* @__PURE__ */
|
|
4393
|
+
case "rich_text": return /* @__PURE__ */ u($t, {
|
|
3954
4394
|
block: e,
|
|
3955
4395
|
className: t,
|
|
3956
4396
|
path: n
|
|
3957
4397
|
});
|
|
3958
|
-
case "section": return /* @__PURE__ */
|
|
4398
|
+
case "section": return /* @__PURE__ */ u(qt, {
|
|
3959
4399
|
block: e,
|
|
3960
4400
|
className: t,
|
|
3961
4401
|
path: n
|
|
3962
4402
|
});
|
|
3963
|
-
case "table": return /* @__PURE__ */
|
|
4403
|
+
case "table": return /* @__PURE__ */ u(on, {
|
|
3964
4404
|
block: e,
|
|
3965
4405
|
className: t,
|
|
3966
4406
|
path: n
|
|
3967
4407
|
});
|
|
3968
|
-
case "task_card": return /* @__PURE__ */
|
|
4408
|
+
case "task_card": return /* @__PURE__ */ u(hn, {
|
|
3969
4409
|
block: e,
|
|
3970
4410
|
className: t,
|
|
3971
4411
|
path: n
|
|
3972
4412
|
});
|
|
3973
|
-
case "video": return /* @__PURE__ */
|
|
4413
|
+
case "video": return /* @__PURE__ */ u(nn, {
|
|
3974
4414
|
block: e,
|
|
3975
4415
|
className: t,
|
|
3976
4416
|
path: n
|
|
3977
4417
|
});
|
|
3978
|
-
default: return
|
|
4418
|
+
default: return _(e);
|
|
3979
4419
|
}
|
|
3980
4420
|
}
|
|
3981
|
-
function
|
|
3982
|
-
return /* @__PURE__ */
|
|
4421
|
+
function lr(e) {
|
|
4422
|
+
return /* @__PURE__ */ u(cr, { ...e });
|
|
3983
4423
|
}
|
|
3984
|
-
var
|
|
4424
|
+
var ur = {
|
|
3985
4425
|
actions: !0,
|
|
3986
4426
|
context: !0,
|
|
3987
4427
|
divider: !0,
|
|
@@ -3994,65 +4434,70 @@ var Bn = {
|
|
|
3994
4434
|
table: !0,
|
|
3995
4435
|
video: !0
|
|
3996
4436
|
};
|
|
3997
|
-
function
|
|
3998
|
-
let t =
|
|
3999
|
-
return t !== void 0 && t in
|
|
4437
|
+
function dr(e) {
|
|
4438
|
+
let t = T(e);
|
|
4439
|
+
return t !== void 0 && t in ur;
|
|
4000
4440
|
}
|
|
4001
|
-
function
|
|
4441
|
+
function fr({ block: e, path: t }) {
|
|
4002
4442
|
let n = e.title, r = e.subtitle;
|
|
4003
|
-
return /* @__PURE__ */
|
|
4443
|
+
return /* @__PURE__ */ d(l, { children: [e.icon === void 0 ? null : /* @__PURE__ */ u(F, {
|
|
4004
4444
|
element: e.icon,
|
|
4005
4445
|
variant: "cardIcon"
|
|
4006
|
-
}), /* @__PURE__ */
|
|
4446
|
+
}), /* @__PURE__ */ d("div", { children: [e.rich_text_title === void 0 ? e.title === void 0 ? null : /* @__PURE__ */ u("strong", { children: w(n) && typeof n.text == "string" ? n.text : E(n, "container title") }) : /* @__PURE__ */ u(N, {
|
|
4007
4447
|
block: e.rich_text_title,
|
|
4008
4448
|
path: `${t}.rich_text_title`
|
|
4009
|
-
}), e.subtitle === void 0 ? null : /* @__PURE__ */
|
|
4010
|
-
...
|
|
4011
|
-
children:
|
|
4449
|
+
}), e.subtitle === void 0 ? null : /* @__PURE__ */ u("div", {
|
|
4450
|
+
...g(O.smallText),
|
|
4451
|
+
children: w(r) && typeof r.text == "string" ? r.text : E(r, "container subtitle")
|
|
4012
4452
|
})] })] });
|
|
4013
4453
|
}
|
|
4014
|
-
function
|
|
4454
|
+
function pr({ block: e, path: n }) {
|
|
4015
4455
|
let r = e.child_blocks;
|
|
4016
|
-
return /* @__PURE__ */
|
|
4017
|
-
...
|
|
4018
|
-
children: Array.isArray(r) ? r.map((e, r) =>
|
|
4456
|
+
return /* @__PURE__ */ u("div", {
|
|
4457
|
+
...g(O.containerBody),
|
|
4458
|
+
children: Array.isArray(r) ? r.map((e, r) => dr(e) ? /* @__PURE__ */ u(cr, {
|
|
4019
4459
|
block: e,
|
|
4020
4460
|
path: `${n}.child_blocks[${String(r)}]`
|
|
4021
|
-
}, `${
|
|
4022
|
-
...
|
|
4023
|
-
"data-block-type":
|
|
4461
|
+
}, `${T(e) ?? "unknown"}-${xe(e) ?? "block"}-${String(r)}`) : /* @__PURE__ */ t("div", {
|
|
4462
|
+
...g(O.unhandled),
|
|
4463
|
+
"data-block-type": T(e) ?? "unknown",
|
|
4024
4464
|
"data-unhandled-block": !0,
|
|
4025
4465
|
key: `unknown-${String(r)}`
|
|
4026
|
-
},
|
|
4466
|
+
}, E(e, "Slack block"))) : null
|
|
4027
4467
|
});
|
|
4028
4468
|
}
|
|
4029
|
-
function
|
|
4030
|
-
return /* @__PURE__ */
|
|
4469
|
+
function mr({ block: e, className: t, path: n = "block" }) {
|
|
4470
|
+
return /* @__PURE__ */ u(R, {
|
|
4031
4471
|
blockId: e.block_id,
|
|
4032
4472
|
blockType: e.type,
|
|
4033
4473
|
className: t,
|
|
4034
|
-
children: e.is_collapsible === !0 ? /* @__PURE__ */
|
|
4035
|
-
...
|
|
4474
|
+
children: e.is_collapsible === !0 ? /* @__PURE__ */ d("details", {
|
|
4475
|
+
...g(O.container),
|
|
4036
4476
|
open: e.default_collapsed !== !0,
|
|
4037
|
-
children: [/* @__PURE__ */
|
|
4038
|
-
...
|
|
4039
|
-
children: /* @__PURE__ */
|
|
4477
|
+
children: [/* @__PURE__ */ d("summary", {
|
|
4478
|
+
...g(O.containerHeader, e.has_header_divider === !0 && O.containerHeaderDivider),
|
|
4479
|
+
children: [/* @__PURE__ */ u("span", {
|
|
4480
|
+
...g(O.containerChevron),
|
|
4481
|
+
"aria-hidden": "true",
|
|
4482
|
+
"data-container-chevron": !0,
|
|
4483
|
+
children: /* @__PURE__ */ u(ne, { size: 16 })
|
|
4484
|
+
}), /* @__PURE__ */ u(fr, {
|
|
4040
4485
|
block: e,
|
|
4041
4486
|
path: n
|
|
4042
|
-
})
|
|
4043
|
-
}), /* @__PURE__ */
|
|
4487
|
+
})]
|
|
4488
|
+
}), /* @__PURE__ */ u(pr, {
|
|
4044
4489
|
block: e,
|
|
4045
4490
|
path: n
|
|
4046
4491
|
})]
|
|
4047
|
-
}) : /* @__PURE__ */
|
|
4048
|
-
...
|
|
4049
|
-
children: [/* @__PURE__ */
|
|
4050
|
-
...
|
|
4051
|
-
children: /* @__PURE__ */
|
|
4492
|
+
}) : /* @__PURE__ */ d("div", {
|
|
4493
|
+
...g(O.container),
|
|
4494
|
+
children: [/* @__PURE__ */ u("div", {
|
|
4495
|
+
...g(O.containerHeader, e.has_header_divider === !0 && O.containerHeaderDivider),
|
|
4496
|
+
children: /* @__PURE__ */ u(fr, {
|
|
4052
4497
|
block: e,
|
|
4053
4498
|
path: n
|
|
4054
4499
|
})
|
|
4055
|
-
}), /* @__PURE__ */
|
|
4500
|
+
}), /* @__PURE__ */ u(pr, {
|
|
4056
4501
|
block: e,
|
|
4057
4502
|
path: n
|
|
4058
4503
|
})]
|
|
@@ -4061,7 +4506,7 @@ function Wn({ block: e, className: t, path: n = "block" }) {
|
|
|
4061
4506
|
}
|
|
4062
4507
|
//#endregion
|
|
4063
4508
|
//#region src/errors.ts
|
|
4064
|
-
var
|
|
4509
|
+
var hr = class extends Error {
|
|
4065
4510
|
code;
|
|
4066
4511
|
path;
|
|
4067
4512
|
name;
|
|
@@ -4071,12 +4516,12 @@ var Gn = class extends Error {
|
|
|
4071
4516
|
};
|
|
4072
4517
|
//#endregion
|
|
4073
4518
|
//#region src/BlockKit.tsx
|
|
4074
|
-
function
|
|
4519
|
+
function gr(e) {
|
|
4075
4520
|
let t = e;
|
|
4076
4521
|
if (typeof e == "string") try {
|
|
4077
4522
|
t = JSON.parse(e);
|
|
4078
4523
|
} catch {
|
|
4079
|
-
throw new
|
|
4524
|
+
throw new hr("data: expected valid JSON", {
|
|
4080
4525
|
code: "invalid_json",
|
|
4081
4526
|
path: "data"
|
|
4082
4527
|
});
|
|
@@ -4084,7 +4529,7 @@ function Kn(e) {
|
|
|
4084
4529
|
return Array.isArray(t) ? {
|
|
4085
4530
|
blockListPath: "data",
|
|
4086
4531
|
blocks: t
|
|
4087
|
-
} :
|
|
4532
|
+
} : w(t) && Array.isArray(t.blocks) ? {
|
|
4088
4533
|
blockListPath: "data.blocks",
|
|
4089
4534
|
blocks: t.blocks
|
|
4090
4535
|
} : {
|
|
@@ -4092,40 +4537,40 @@ function Kn(e) {
|
|
|
4092
4537
|
blocks: [t]
|
|
4093
4538
|
};
|
|
4094
4539
|
}
|
|
4095
|
-
function
|
|
4096
|
-
let c =
|
|
4097
|
-
return /* @__PURE__ */
|
|
4540
|
+
function _r({ "aria-label": e = "Slack Block Kit preview", className: t, data: n, onAction: r, resolvers: i, surface: a = "message", theme: s = "light" }) {
|
|
4541
|
+
let c = o(() => gr(n), [n]), l = g(s === "dark" ? we : Ce, O.root, s === "dark" ? O.rootDark : O.rootLight);
|
|
4542
|
+
return /* @__PURE__ */ u(b, {
|
|
4098
4543
|
onAction: r,
|
|
4099
4544
|
resolvers: i,
|
|
4100
|
-
surface:
|
|
4101
|
-
children: /* @__PURE__ */
|
|
4102
|
-
...
|
|
4545
|
+
surface: a,
|
|
4546
|
+
children: /* @__PURE__ */ u("div", {
|
|
4547
|
+
...l,
|
|
4103
4548
|
"aria-label": e,
|
|
4104
|
-
className:
|
|
4549
|
+
className: A(l.className, t),
|
|
4105
4550
|
"data-block-kit-root": !0,
|
|
4106
|
-
"data-surface":
|
|
4551
|
+
"data-surface": a,
|
|
4107
4552
|
"data-theme": s,
|
|
4108
4553
|
role: "article",
|
|
4109
|
-
children: c.blocks.map((e, t) => /* @__PURE__ */
|
|
4554
|
+
children: c.blocks.map((e, t) => /* @__PURE__ */ u(cr, {
|
|
4110
4555
|
block: e,
|
|
4111
4556
|
path: `${c.blockListPath}[${String(t)}]`
|
|
4112
|
-
}, `${
|
|
4557
|
+
}, `${T(e) ?? "unknown"}-${xe(e) ?? "block"}-${String(t)}`))
|
|
4113
4558
|
})
|
|
4114
4559
|
});
|
|
4115
4560
|
}
|
|
4116
4561
|
//#endregion
|
|
4117
4562
|
//#region src/validation.ts
|
|
4118
|
-
function
|
|
4119
|
-
throw new
|
|
4563
|
+
function vr(e, t, n) {
|
|
4564
|
+
throw new hr(n, {
|
|
4120
4565
|
code: e,
|
|
4121
4566
|
path: t
|
|
4122
4567
|
});
|
|
4123
4568
|
}
|
|
4124
4569
|
function z(e, t, n, r) {
|
|
4125
|
-
e ||
|
|
4570
|
+
e || vr(t, n, r);
|
|
4126
4571
|
}
|
|
4127
4572
|
function B(e, t) {
|
|
4128
|
-
z(
|
|
4573
|
+
z(w(e), "invalid_type", t, "expected an object");
|
|
4129
4574
|
}
|
|
4130
4575
|
function V(e, t) {
|
|
4131
4576
|
z(Array.isArray(e), "invalid_type", t, "expected an array");
|
|
@@ -4151,67 +4596,67 @@ function q(e, t, n) {
|
|
|
4151
4596
|
function J(e, t) {
|
|
4152
4597
|
H(e.type, `${t}.type`), U(e.block_id, `${t}.block_id`, { max: 255 });
|
|
4153
4598
|
}
|
|
4154
|
-
function Y(e, t, n =
|
|
4599
|
+
function Y(e, t, n = vn) {
|
|
4155
4600
|
B(e, t), q(e.type, ["plain_text", "mrkdwn"], `${t}.type`), H(e.text, `${t}.text`, { max: n }), e.type === "plain_text" ? (G(e.emoji, `${t}.emoji`), z(e.verbatim === void 0, "invalid_value", `${t}.verbatim`, "verbatim is only legal on mrkdwn text")) : (G(e.verbatim, `${t}.verbatim`), z(e.emoji === void 0, "invalid_value", `${t}.emoji`, "emoji is only legal on plain_text"));
|
|
4156
4601
|
}
|
|
4157
|
-
function
|
|
4602
|
+
function yr(e, t = "text", n = vn) {
|
|
4158
4603
|
Y(e, t, n);
|
|
4159
4604
|
}
|
|
4160
|
-
function X(e, t, n =
|
|
4161
|
-
Y(e, t, n), z(
|
|
4605
|
+
function X(e, t, n = vn) {
|
|
4606
|
+
Y(e, t, n), z(w(e) && e.type === "plain_text", "invalid_value", `${t}.type`, "expected \"plain_text\"");
|
|
4162
4607
|
}
|
|
4163
|
-
function
|
|
4608
|
+
function br(e, t) {
|
|
4164
4609
|
B(e, t);
|
|
4165
4610
|
let n = e.id !== void 0, r = e.url !== void 0;
|
|
4166
|
-
z(n !== r, "invalid_value", t, "must contain exactly one of id or url"), n && H(e.id, `${t}.id`), r && H(e.url, `${t}.url`, { max:
|
|
4611
|
+
z(n !== r, "invalid_value", t, "must contain exactly one of id or url"), n && H(e.id, `${t}.id`), r && H(e.url, `${t}.url`, { max: xn });
|
|
4167
4612
|
}
|
|
4168
4613
|
function Z(e, t) {
|
|
4169
|
-
B(e, t), K(e, "image", t), H(e.alt_text, `${t}.alt_text`, { max:
|
|
4614
|
+
B(e, t), K(e, "image", t), H(e.alt_text, `${t}.alt_text`, { max: Sn });
|
|
4170
4615
|
let n = e.image_url !== void 0, r = e.slack_file !== void 0;
|
|
4171
|
-
z(n !== r, "invalid_value", t, "must contain exactly one of image_url or slack_file"), n && H(e.image_url, `${t}.image_url`, { max:
|
|
4616
|
+
z(n !== r, "invalid_value", t, "must contain exactly one of image_url or slack_file"), n && H(e.image_url, `${t}.image_url`, { max: xn }), r && br(e.slack_file, `${t}.slack_file`);
|
|
4172
4617
|
}
|
|
4173
|
-
function
|
|
4618
|
+
function xr(e, t = "element") {
|
|
4174
4619
|
Z(e, t);
|
|
4175
4620
|
}
|
|
4176
|
-
function
|
|
4177
|
-
B(e, t), Y(e.text, `${t}.text`, 75), U(e.value, `${t}.value`, { max: 75 }), U(e.url, `${t}.url`, { max:
|
|
4621
|
+
function Sr(e, t) {
|
|
4622
|
+
B(e, t), Y(e.text, `${t}.text`, 75), U(e.value, `${t}.value`, { max: 75 }), U(e.url, `${t}.url`, { max: Tn }), e.description !== void 0 && X(e.description, `${t}.description`, 75);
|
|
4178
4623
|
}
|
|
4179
|
-
function
|
|
4624
|
+
function Cr(e, t, n) {
|
|
4180
4625
|
V(e, t), z(e.length > 0, "missing_field", t, "must contain at least one option"), z(e.length <= n, "limit_exceeded", t, `must contain at most ${String(n)} options`), e.forEach((e, n) => {
|
|
4181
|
-
|
|
4626
|
+
Sr(e, `${t}[${String(n)}]`);
|
|
4182
4627
|
});
|
|
4183
4628
|
}
|
|
4184
|
-
function
|
|
4629
|
+
function wr(e, t) {
|
|
4185
4630
|
U(e.action_id, `${t}.action_id`, { max: 255 });
|
|
4186
4631
|
}
|
|
4187
|
-
function
|
|
4632
|
+
function Tr(e, t) {
|
|
4188
4633
|
e.placeholder !== void 0 && X(e.placeholder, `${t}.placeholder`, 150);
|
|
4189
4634
|
}
|
|
4190
|
-
function
|
|
4191
|
-
B(e, t), K(e, "button", t),
|
|
4635
|
+
function Er(e, t) {
|
|
4636
|
+
B(e, t), K(e, "button", t), wr(e, t), X(e.text, `${t}.text`, 75), U(e.url, `${t}.url`, { max: Tn }), U(e.value, `${t}.value`, { max: En }), U(e.accessibility_label, `${t}.accessibility_label`, { max: 75 }), e.style !== void 0 && q(e.style, ["primary", "danger"], `${t}.style`);
|
|
4192
4637
|
}
|
|
4193
|
-
function
|
|
4638
|
+
function Dr(e, t) {
|
|
4194
4639
|
let n = e.options !== void 0, r = e.option_groups !== void 0;
|
|
4195
|
-
z(n !== r, "invalid_value", t, "must contain exactly one of options or option_groups"), n &&
|
|
4640
|
+
z(n !== r, "invalid_value", t, "must contain exactly one of options or option_groups"), n && Cr(e.options, `${t}.options`, 100), r && (V(e.option_groups, `${t}.option_groups`), z(e.option_groups.length <= 100, "limit_exceeded", `${t}.option_groups`, "must contain at most 100 groups"), e.option_groups.forEach((e, n) => {
|
|
4196
4641
|
let r = `${t}.option_groups[${String(n)}]`;
|
|
4197
|
-
B(e, r), X(e.label, `${r}.label`, 75),
|
|
4642
|
+
B(e, r), X(e.label, `${r}.label`, 75), Cr(e.options, `${r}.options`, 100);
|
|
4198
4643
|
}));
|
|
4199
4644
|
}
|
|
4200
|
-
function
|
|
4201
|
-
switch (B(e, t), H(e.type, `${t}.type`),
|
|
4645
|
+
function Or(e, t) {
|
|
4646
|
+
switch (B(e, t), H(e.type, `${t}.type`), wr(e, t), Tr(e, t), e.type) {
|
|
4202
4647
|
case "button":
|
|
4203
|
-
|
|
4648
|
+
Er(e, t);
|
|
4204
4649
|
return;
|
|
4205
4650
|
case "checkboxes":
|
|
4206
4651
|
case "radio_buttons":
|
|
4207
|
-
|
|
4652
|
+
Cr(e.options, `${t}.options`, 10);
|
|
4208
4653
|
return;
|
|
4209
4654
|
case "overflow":
|
|
4210
|
-
|
|
4655
|
+
Cr(e.options, `${t}.options`, 5);
|
|
4211
4656
|
return;
|
|
4212
4657
|
case "static_select":
|
|
4213
4658
|
case "multi_static_select":
|
|
4214
|
-
|
|
4659
|
+
Dr(e, t);
|
|
4215
4660
|
return;
|
|
4216
4661
|
case "external_select":
|
|
4217
4662
|
case "multi_external_select":
|
|
@@ -4257,13 +4702,13 @@ function rr(e, t) {
|
|
|
4257
4702
|
case "workflow_button":
|
|
4258
4703
|
X(e.text, `${t}.text`, 75), B(e.workflow, `${t}.workflow`), B(e.workflow.trigger, `${t}.workflow.trigger`), H(e.workflow.trigger.url, `${t}.workflow.trigger.url`);
|
|
4259
4704
|
return;
|
|
4260
|
-
default:
|
|
4705
|
+
default: vr("unsupported_element", `${t}.type`, `unsupported element "${e.type}"`);
|
|
4261
4706
|
}
|
|
4262
4707
|
}
|
|
4263
|
-
function
|
|
4264
|
-
|
|
4708
|
+
function kr(e, t = "element") {
|
|
4709
|
+
Or(e, t);
|
|
4265
4710
|
}
|
|
4266
|
-
function
|
|
4711
|
+
function Ar(e, t) {
|
|
4267
4712
|
if (e !== void 0) {
|
|
4268
4713
|
B(e, t);
|
|
4269
4714
|
for (let n of [
|
|
@@ -4275,8 +4720,8 @@ function ar(e, t) {
|
|
|
4275
4720
|
]) G(e[n], `${t}.${n}`);
|
|
4276
4721
|
}
|
|
4277
4722
|
}
|
|
4278
|
-
function
|
|
4279
|
-
switch (B(e, t), H(e.type, `${t}.type`),
|
|
4723
|
+
function jr(e, t) {
|
|
4724
|
+
switch (B(e, t), H(e.type, `${t}.type`), Ar(e.style, `${t}.style`), e.type) {
|
|
4280
4725
|
case "text":
|
|
4281
4726
|
H(e.text, `${t}.text`, { allowEmpty: !0 });
|
|
4282
4727
|
return;
|
|
@@ -4330,12 +4775,12 @@ function or(e, t) {
|
|
|
4330
4775
|
case "workflow_mention":
|
|
4331
4776
|
z(Object.keys(e).length > 1, "missing_field", t, `${e.type} must contain its reference fields`);
|
|
4332
4777
|
return;
|
|
4333
|
-
default:
|
|
4778
|
+
default: vr("unsupported_element", `${t}.type`, `unsupported rich text element "${e.type}"`);
|
|
4334
4779
|
}
|
|
4335
4780
|
}
|
|
4336
|
-
function
|
|
4781
|
+
function Mr(e, t) {
|
|
4337
4782
|
V(e, t), e.forEach((e, n) => {
|
|
4338
|
-
|
|
4783
|
+
jr(e, `${t}[${String(n)}]`);
|
|
4339
4784
|
});
|
|
4340
4785
|
}
|
|
4341
4786
|
function Q(e, t) {
|
|
@@ -4344,7 +4789,7 @@ function Q(e, t) {
|
|
|
4344
4789
|
switch (B(e, r), H(e.type, `${r}.type`), e.type) {
|
|
4345
4790
|
case "rich_text_section":
|
|
4346
4791
|
case "rich_text_quote":
|
|
4347
|
-
|
|
4792
|
+
Mr(e.elements, `${r}.elements`);
|
|
4348
4793
|
return;
|
|
4349
4794
|
case "rich_text_list":
|
|
4350
4795
|
q(e.style, ["bullet", "ordered"], `${r}.style`), e.indent !== void 0 && W(e.indent, `${r}.indent`, {
|
|
@@ -4356,28 +4801,25 @@ function Q(e, t) {
|
|
|
4356
4801
|
min: 0
|
|
4357
4802
|
}), V(e.elements, `${r}.elements`), e.elements.forEach((e, t) => {
|
|
4358
4803
|
let n = `${r}.elements[${String(t)}]`;
|
|
4359
|
-
B(e, n), K(e, "rich_text_section", n),
|
|
4804
|
+
B(e, n), K(e, "rich_text_section", n), Mr(e.elements, `${n}.elements`);
|
|
4360
4805
|
});
|
|
4361
4806
|
return;
|
|
4362
4807
|
case "rich_text_preformatted":
|
|
4363
|
-
|
|
4364
|
-
let n = `${r}.elements[${String(t)}]`;
|
|
4365
|
-
or(e, n), B(e, n), z(e.type === "text" || e.type === "link", "invalid_value", `${n}.type`, "preformatted text only accepts text or link elements");
|
|
4366
|
-
}), U(e.language, `${r}.language`);
|
|
4808
|
+
Mr(e.elements, `${r}.elements`), U(e.language, `${r}.language`);
|
|
4367
4809
|
return;
|
|
4368
|
-
default:
|
|
4810
|
+
default: vr("unsupported_element", `${r}.type`, `unsupported rich text container "${e.type}"`);
|
|
4369
4811
|
}
|
|
4370
4812
|
});
|
|
4371
4813
|
}
|
|
4372
|
-
function
|
|
4814
|
+
function Nr(e, t = "block") {
|
|
4373
4815
|
Q(e, t);
|
|
4374
4816
|
}
|
|
4375
|
-
function
|
|
4817
|
+
function Pr(e, t) {
|
|
4376
4818
|
B(e, t), K(e, "section", t), J(e, t);
|
|
4377
4819
|
let n = e.text !== void 0, r = e.fields !== void 0;
|
|
4378
|
-
z(n || r, "missing_field", t, "requires text or fields"), n && Y(e.text, `${t}.text`,
|
|
4379
|
-
Y(e, `${t}.fields[${String(n)}]`,
|
|
4380
|
-
})), e.accessory !== void 0 && (B(e.accessory, `${t}.accessory`), e.accessory.type === "image" ? Z(e.accessory, `${t}.accessory`) : (
|
|
4820
|
+
z(n || r, "missing_field", t, "requires text or fields"), n && Y(e.text, `${t}.text`, yn), r && (V(e.fields, `${t}.fields`), z(e.fields.length > 0 && e.fields.length <= 10, "limit_exceeded", `${t}.fields`, "must contain 1–10 text objects"), e.fields.forEach((e, n) => {
|
|
4821
|
+
Y(e, `${t}.fields[${String(n)}]`, bn);
|
|
4822
|
+
})), e.accessory !== void 0 && (B(e.accessory, `${t}.accessory`), e.accessory.type === "image" ? Z(e.accessory, `${t}.accessory`) : (Or(e.accessory, `${t}.accessory`), z(![
|
|
4381
4823
|
"datetimepicker",
|
|
4382
4824
|
"file_input",
|
|
4383
4825
|
"plain_text_input",
|
|
@@ -4387,26 +4829,26 @@ function lr(e, t) {
|
|
|
4387
4829
|
"rich_text_input"
|
|
4388
4830
|
].includes(String(e.accessory.type)), "invalid_value", `${t}.accessory.type`, "element is not legal as a section accessory"))), G(e.expand, `${t}.expand`);
|
|
4389
4831
|
}
|
|
4390
|
-
function
|
|
4832
|
+
function Fr(e, t) {
|
|
4391
4833
|
B(e, t), K(e, "header", t), J(e, t), X(e.text, `${t}.text`, 150), e.level !== void 0 && W(e.level, `${t}.level`, {
|
|
4392
4834
|
integer: !0,
|
|
4393
4835
|
min: 1,
|
|
4394
4836
|
max: 4
|
|
4395
4837
|
});
|
|
4396
4838
|
}
|
|
4397
|
-
function
|
|
4398
|
-
Z(e, t), B(e, t), J(e, t), e.title !== void 0 && X(e.title, `${t}.title`,
|
|
4839
|
+
function Ir(e, t) {
|
|
4840
|
+
Z(e, t), B(e, t), J(e, t), e.title !== void 0 && X(e.title, `${t}.title`, Cn);
|
|
4399
4841
|
}
|
|
4400
|
-
function
|
|
4842
|
+
function Lr(e, t) {
|
|
4401
4843
|
B(e, t), K(e, "context", t), J(e, t), V(e.elements, `${t}.elements`), z(e.elements.length > 0 && e.elements.length <= 10, "limit_exceeded", `${t}.elements`, "must contain 1–10 elements"), e.elements.forEach((e, n) => {
|
|
4402
4844
|
let r = `${t}.elements[${String(n)}]`;
|
|
4403
4845
|
B(e, r), e.type === "image" ? Z(e, r) : Y(e, r);
|
|
4404
4846
|
});
|
|
4405
4847
|
}
|
|
4406
|
-
function
|
|
4848
|
+
function Rr(e, t) {
|
|
4407
4849
|
B(e, t), K(e, "actions", t), J(e, t), V(e.elements, `${t}.elements`), z(e.elements.length > 0 && e.elements.length <= 25, "limit_exceeded", `${t}.elements`, "must contain 1–25 elements"), e.elements.forEach((e, n) => {
|
|
4408
4850
|
let r = `${t}.elements[${String(n)}]`;
|
|
4409
|
-
|
|
4851
|
+
Or(e, r), B(e, r), z([
|
|
4410
4852
|
"button",
|
|
4411
4853
|
"checkboxes",
|
|
4412
4854
|
"datepicker",
|
|
@@ -4429,8 +4871,8 @@ function pr(e, t) {
|
|
|
4429
4871
|
].includes(String(e.type)), "invalid_value", `${r}.type`, "element is not legal inside an actions block");
|
|
4430
4872
|
});
|
|
4431
4873
|
}
|
|
4432
|
-
function
|
|
4433
|
-
B(e, t), K(e, "input", t), J(e, t), X(e.label, `${t}.label`, 2e3), e.hint !== void 0 && X(e.hint, `${t}.hint`, 2e3), G(e.optional, `${t}.optional`), G(e.dispatch_action, `${t}.dispatch_action`),
|
|
4874
|
+
function zr(e, t) {
|
|
4875
|
+
B(e, t), K(e, "input", t), J(e, t), X(e.label, `${t}.label`, 2e3), e.hint !== void 0 && X(e.hint, `${t}.hint`, 2e3), G(e.optional, `${t}.optional`), G(e.dispatch_action, `${t}.dispatch_action`), Or(e.element, `${t}.element`), B(e.element, `${t}.element`), z(![
|
|
4434
4876
|
"button",
|
|
4435
4877
|
"overflow",
|
|
4436
4878
|
"workflow_button",
|
|
@@ -4438,18 +4880,18 @@ function mr(e, t) {
|
|
|
4438
4880
|
"feedback_buttons"
|
|
4439
4881
|
].includes(String(e.element.type)), "invalid_value", `${t}.element.type`, "element is not legal inside an input block"), z(!(e.dispatch_action === !0 && e.element.type === "file_input"), "invalid_value", `${t}.dispatch_action`, "dispatch_action is incompatible with file_input");
|
|
4440
4882
|
}
|
|
4441
|
-
function
|
|
4442
|
-
if (!
|
|
4883
|
+
function Br(e) {
|
|
4884
|
+
if (!w(e)) return 0;
|
|
4443
4885
|
if (e.type === "raw_text") return typeof e.text == "string" ? e.text.length : 0;
|
|
4444
4886
|
if (e.type === "raw_number") return typeof e.text == "string" ? e.text.length : typeof e.value == "number" ? String(e.value).length : 0;
|
|
4445
4887
|
if (e.type === "rich_text" && Array.isArray(e.elements)) {
|
|
4446
4888
|
let t = 0;
|
|
4447
|
-
for (let n of e.elements) if (!(!
|
|
4889
|
+
for (let n of e.elements) if (!(!w(n) || !Array.isArray(n.elements))) for (let e of n.elements) w(e) && (typeof e.text == "string" ? t += e.text.length : typeof e.url == "string" && (t += e.url.length));
|
|
4448
4890
|
return t;
|
|
4449
4891
|
}
|
|
4450
4892
|
return 0;
|
|
4451
4893
|
}
|
|
4452
|
-
function
|
|
4894
|
+
function Vr(e, t, n) {
|
|
4453
4895
|
switch (B(e, t), H(e.type, `${t}.type`), e.type) {
|
|
4454
4896
|
case "raw_text":
|
|
4455
4897
|
H(e.text, `${t}.text`);
|
|
@@ -4460,21 +4902,21 @@ function gr(e, t, n) {
|
|
|
4460
4902
|
case "rich_text":
|
|
4461
4903
|
z(n, "invalid_value", t, "rich_text is not legal in this row"), Q(e, t);
|
|
4462
4904
|
return;
|
|
4463
|
-
default:
|
|
4905
|
+
default: vr("invalid_value", `${t}.type`, `unsupported table cell "${e.type}"`);
|
|
4464
4906
|
}
|
|
4465
4907
|
}
|
|
4466
|
-
function
|
|
4908
|
+
function Hr(e, t, n, r, i) {
|
|
4467
4909
|
V(e, t), z(e.length > 0, "missing_field", t, "must contain at least one row"), z(e.length <= n, "limit_exceeded", t, `must contain at most ${String(n)} rows`);
|
|
4468
4910
|
let a, o = 0;
|
|
4469
4911
|
return e.forEach((e, n) => {
|
|
4470
4912
|
let r = `${t}[${String(n)}]`;
|
|
4471
4913
|
V(e, r), z(e.length > 0 && e.length <= 20, "limit_exceeded", r, "must contain 1–20 cells"), a === void 0 ? a = e.length : z(e.length === a, "invalid_value", r, "all table rows must contain the same number of cells"), e.forEach((e, t) => {
|
|
4472
|
-
|
|
4914
|
+
Vr(e, `${r}[${String(t)}]`, i || n !== 0), o += Br(e);
|
|
4473
4915
|
});
|
|
4474
4916
|
}), z(o <= r, "limit_exceeded", t, `cell content must contain at most ${String(r)} characters`), a ?? 0;
|
|
4475
4917
|
}
|
|
4476
|
-
function
|
|
4477
|
-
B(e, t), K(e, "table", t), J(e, t),
|
|
4918
|
+
function Ur(e, t) {
|
|
4919
|
+
B(e, t), K(e, "table", t), J(e, t), Hr(e.rows, `${t}.rows`, 100, Dn, !0), e.column_settings !== void 0 && (V(e.column_settings, `${t}.column_settings`), z(e.column_settings.length <= 20, "limit_exceeded", `${t}.column_settings`, "must contain at most 20 entries"), e.column_settings.forEach((e, n) => {
|
|
4478
4920
|
if (e === null) return;
|
|
4479
4921
|
let r = `${t}.column_settings[${String(n)}]`;
|
|
4480
4922
|
B(e, r), e.align !== void 0 && q(e.align, [
|
|
@@ -4484,9 +4926,9 @@ function vr(e, t) {
|
|
|
4484
4926
|
], `${r}.align`), G(e.is_wrapped, `${r}.is_wrapped`);
|
|
4485
4927
|
}));
|
|
4486
4928
|
}
|
|
4487
|
-
function
|
|
4929
|
+
function Wr(e, t) {
|
|
4488
4930
|
B(e, t), K(e, "data_table", t), J(e, t), H(e.caption, `${t}.caption`);
|
|
4489
|
-
let n =
|
|
4931
|
+
let n = Hr(e.rows, `${t}.rows`, 201, On, !1);
|
|
4490
4932
|
V(e.rows, `${t}.rows`), z(e.rows.length >= 2, "invalid_value", `${t}.rows`, "requires a header row and at least one data row"), e.page_size !== void 0 && W(e.page_size, `${t}.page_size`, {
|
|
4491
4933
|
integer: !0,
|
|
4492
4934
|
min: 1,
|
|
@@ -4497,7 +4939,7 @@ function yr(e, t) {
|
|
|
4497
4939
|
max: n - 1
|
|
4498
4940
|
});
|
|
4499
4941
|
}
|
|
4500
|
-
function
|
|
4942
|
+
function Gr(e, t) {
|
|
4501
4943
|
if (B(e, t), K(e, "data_visualization", t), J(e, t), H(e.title, `${t}.title`, { max: 50 }), B(e.chart, `${t}.chart`), H(e.chart.type, `${t}.chart.type`), e.chart.type === "pie") {
|
|
4502
4944
|
V(e.chart.segments, `${t}.chart.segments`), z(e.chart.segments.length > 0 && e.chart.segments.length <= 12, "limit_exceeded", `${t}.chart.segments`, "must contain 1–12 segments"), e.chart.segments.forEach((e, n) => {
|
|
4503
4945
|
let r = `${t}.chart.segments[${String(n)}]`;
|
|
@@ -4526,20 +4968,20 @@ function br(e, t) {
|
|
|
4526
4968
|
});
|
|
4527
4969
|
});
|
|
4528
4970
|
}
|
|
4529
|
-
function
|
|
4971
|
+
function Kr(e, t) {
|
|
4530
4972
|
B(e, t), K(e, "card", t), J(e, t), z(e.hero_image !== void 0 || e.title !== void 0 || e.actions !== void 0 || e.body !== void 0, "missing_field", t, "requires at least one of hero_image, title, actions, or body"), e.hero_image !== void 0 && Z(e.hero_image, `${t}.hero_image`), e.icon !== void 0 && Z(e.icon, `${t}.icon`), z(!(e.icon !== void 0 && e.slack_icon !== void 0), "invalid_value", t, "icon and slack_icon are mutually exclusive"), e.slack_icon !== void 0 && (B(e.slack_icon, `${t}.slack_icon`), K(e.slack_icon, "icon", `${t}.slack_icon`), H(e.slack_icon.name, `${t}.slack_icon.name`));
|
|
4531
4973
|
for (let n of ["title", "subtitle"]) e[n] !== void 0 && Y(e[n], `${t}.${n}`, 150);
|
|
4532
4974
|
for (let n of ["body", "subtext"]) e[n] !== void 0 && Y(e[n], `${t}.${n}`, 200);
|
|
4533
4975
|
e.actions !== void 0 && (V(e.actions, `${t}.actions`), z(e.actions.length > 0 && e.actions.length <= 3, "limit_exceeded", `${t}.actions`, "must contain 1–3 buttons"), e.actions.forEach((e, n) => {
|
|
4534
|
-
|
|
4976
|
+
Er(e, `${t}.actions[${String(n)}]`);
|
|
4535
4977
|
}));
|
|
4536
4978
|
}
|
|
4537
|
-
function
|
|
4979
|
+
function qr(e, t) {
|
|
4538
4980
|
B(e, t), K(e, "carousel", t), J(e, t), V(e.elements, `${t}.elements`), z(e.elements.length > 0 && e.elements.length <= 10, "limit_exceeded", `${t}.elements`, "must contain 1–10 cards"), e.elements.forEach((e, n) => {
|
|
4539
|
-
|
|
4981
|
+
Kr(e, `${t}.elements[${String(n)}]`);
|
|
4540
4982
|
});
|
|
4541
4983
|
}
|
|
4542
|
-
function
|
|
4984
|
+
function Jr(e, t, n) {
|
|
4543
4985
|
B(e, n), K(e, "alert", n), J(e, n), z(t === "modal", "surface_mismatch", n, "alert blocks are only legal on modal surfaces"), Y(e.text, `${n}.text`, 200), e.level !== void 0 && q(e.level, [
|
|
4544
4986
|
"default",
|
|
4545
4987
|
"info",
|
|
@@ -4548,21 +4990,21 @@ function Cr(e, t, n) {
|
|
|
4548
4990
|
"success"
|
|
4549
4991
|
], `${n}.level`);
|
|
4550
4992
|
}
|
|
4551
|
-
function
|
|
4993
|
+
function Yr(e, t) {
|
|
4552
4994
|
B(e, t), K(e, "context_actions", t), J(e, t), V(e.elements, `${t}.elements`), z(e.elements.length > 0 && e.elements.length <= 5, "limit_exceeded", `${t}.elements`, "must contain 1–5 elements"), e.elements.forEach((e, n) => {
|
|
4553
4995
|
let r = `${t}.elements[${String(n)}]`;
|
|
4554
|
-
if (B(e, r),
|
|
4555
|
-
q(e.icon, ["trash"], `${r}.icon`), X(e.text, `${r}.text`, 75), U(e.value, `${r}.value`, { max:
|
|
4996
|
+
if (B(e, r), wr(e, r), e.type === "icon_button") {
|
|
4997
|
+
q(e.icon, ["trash"], `${r}.icon`), X(e.text, `${r}.text`, 75), U(e.value, `${r}.value`, { max: En });
|
|
4556
4998
|
return;
|
|
4557
4999
|
}
|
|
4558
5000
|
z(e.type === "feedback_buttons", "unsupported_element", `${r}.type`, "context_actions only accepts icon_button or feedback_buttons");
|
|
4559
5001
|
for (let t of ["positive_button", "negative_button"]) {
|
|
4560
5002
|
let n = `${r}.${t}`;
|
|
4561
|
-
B(e[t], n), X(e[t].text, `${n}.text`, 75), H(e[t].value, `${n}.value`, { max:
|
|
5003
|
+
B(e[t], n), X(e[t].text, `${n}.text`, 75), H(e[t].value, `${n}.value`, { max: En });
|
|
4562
5004
|
}
|
|
4563
5005
|
});
|
|
4564
5006
|
}
|
|
4565
|
-
function
|
|
5007
|
+
function Xr(e, t) {
|
|
4566
5008
|
B(e, t), K(e, "task_card", t), J(e, t), H(e.task_id, `${t}.task_id`), H(e.title, `${t}.title`), q(e.status, [
|
|
4567
5009
|
"pending",
|
|
4568
5010
|
"in_progress",
|
|
@@ -4573,12 +5015,12 @@ function Tr(e, t) {
|
|
|
4573
5015
|
B(e, r), K(e, "url", r), H(e.url, `${r}.url`), H(e.text, `${r}.text`);
|
|
4574
5016
|
}));
|
|
4575
5017
|
}
|
|
4576
|
-
function
|
|
5018
|
+
function Zr(e, t) {
|
|
4577
5019
|
B(e, t), K(e, "plan", t), J(e, t), H(e.title, `${t}.title`), e.tasks !== void 0 && (V(e.tasks, `${t}.tasks`), e.tasks.forEach((e, n) => {
|
|
4578
|
-
|
|
5020
|
+
Xr(e, `${t}.tasks[${String(n)}]`);
|
|
4579
5021
|
}));
|
|
4580
5022
|
}
|
|
4581
|
-
function
|
|
5023
|
+
function Qr(e, t) {
|
|
4582
5024
|
B(e, t), K(e, "container", t), J(e, t), z(e.title !== void 0 || e.rich_text_title !== void 0, "missing_field", t, "requires title or rich_text_title"), e.title !== void 0 && X(e.title, `${t}.title`, 150), e.rich_text_title !== void 0 && Q(e.rich_text_title, `${t}.rich_text_title`), e.subtitle !== void 0 && X(e.subtitle, `${t}.subtitle`, 150), e.icon !== void 0 && Z(e.icon, `${t}.icon`), e.width !== void 0 && q(e.width, [
|
|
4583
5025
|
"narrow",
|
|
4584
5026
|
"standard",
|
|
@@ -4600,122 +5042,122 @@ function Dr(e, t) {
|
|
|
4600
5042
|
];
|
|
4601
5043
|
e.child_blocks.forEach((e, r) => {
|
|
4602
5044
|
let i = `${t}.child_blocks[${String(r)}]`;
|
|
4603
|
-
B(e, i), H(e.type, `${i}.type`), z(n.includes(e.type), "invalid_value", `${i}.type`, `"${e.type}" is not legal inside a container`),
|
|
5045
|
+
B(e, i), H(e.type, `${i}.type`), z(n.includes(e.type), "invalid_value", `${i}.type`, `"${e.type}" is not legal inside a container`), ti(e, "message", i);
|
|
4604
5046
|
});
|
|
4605
5047
|
}
|
|
4606
|
-
function
|
|
5048
|
+
function $r(e, t) {
|
|
4607
5049
|
B(e, t), K(e, "file", t), J(e, t), z(e.source === "remote", "invalid_value", `${t}.source`, "expected \"remote\""), H(e.external_id, `${t}.external_id`);
|
|
4608
5050
|
}
|
|
4609
|
-
function
|
|
4610
|
-
B(e, t), K(e, "video", t), J(e, t), H(e.video_url, `${t}.video_url`), H(e.thumbnail_url, `${t}.thumbnail_url`), H(e.alt_text, `${t}.alt_text`, { max:
|
|
5051
|
+
function ei(e, t) {
|
|
5052
|
+
B(e, t), K(e, "video", t), J(e, t), H(e.video_url, `${t}.video_url`), H(e.thumbnail_url, `${t}.thumbnail_url`), H(e.alt_text, `${t}.alt_text`, { max: Sn }), X(e.title, `${t}.title`, 199), e.description !== void 0 && X(e.description, `${t}.description`, 199), U(e.author_name, `${t}.author_name`, { max: 49 });
|
|
4611
5053
|
}
|
|
4612
5054
|
function $(e, t, n) {
|
|
4613
5055
|
z(e === "message", "surface_mismatch", t, `${n} blocks are only documented for message surfaces`);
|
|
4614
5056
|
}
|
|
4615
|
-
function
|
|
5057
|
+
function ti(e, t = "message", n = "block") {
|
|
4616
5058
|
switch (B(e, n), J(e, n), e.type) {
|
|
4617
5059
|
case "actions":
|
|
4618
|
-
|
|
5060
|
+
Rr(e, n);
|
|
4619
5061
|
return;
|
|
4620
5062
|
case "alert":
|
|
4621
|
-
|
|
5063
|
+
Jr(e, t, n);
|
|
4622
5064
|
return;
|
|
4623
5065
|
case "card":
|
|
4624
|
-
$(t, n, e.type),
|
|
5066
|
+
$(t, n, e.type), Kr(e, n);
|
|
4625
5067
|
return;
|
|
4626
5068
|
case "carousel":
|
|
4627
|
-
$(t, n, e.type),
|
|
5069
|
+
$(t, n, e.type), qr(e, n);
|
|
4628
5070
|
return;
|
|
4629
5071
|
case "container":
|
|
4630
|
-
$(t, n, e.type),
|
|
5072
|
+
$(t, n, e.type), Qr(e, n);
|
|
4631
5073
|
return;
|
|
4632
5074
|
case "context":
|
|
4633
|
-
|
|
5075
|
+
Lr(e, n);
|
|
4634
5076
|
return;
|
|
4635
5077
|
case "context_actions":
|
|
4636
|
-
$(t, n, e.type),
|
|
5078
|
+
$(t, n, e.type), Yr(e, n);
|
|
4637
5079
|
return;
|
|
4638
5080
|
case "data_table":
|
|
4639
|
-
$(t, n, e.type),
|
|
5081
|
+
$(t, n, e.type), Wr(e, n);
|
|
4640
5082
|
return;
|
|
4641
5083
|
case "data_visualization":
|
|
4642
|
-
$(t, n, e.type),
|
|
5084
|
+
$(t, n, e.type), Gr(e, n);
|
|
4643
5085
|
return;
|
|
4644
5086
|
case "divider":
|
|
4645
5087
|
K(e, "divider", n);
|
|
4646
5088
|
return;
|
|
4647
5089
|
case "file":
|
|
4648
|
-
$(t, n, e.type),
|
|
5090
|
+
$(t, n, e.type), $r(e, n);
|
|
4649
5091
|
return;
|
|
4650
5092
|
case "header":
|
|
4651
|
-
|
|
5093
|
+
Fr(e, n);
|
|
4652
5094
|
return;
|
|
4653
5095
|
case "image":
|
|
4654
|
-
|
|
5096
|
+
Ir(e, n);
|
|
4655
5097
|
return;
|
|
4656
5098
|
case "input":
|
|
4657
|
-
|
|
5099
|
+
zr(e, n);
|
|
4658
5100
|
return;
|
|
4659
5101
|
case "markdown":
|
|
4660
|
-
$(t, n, e.type), H(e.text, `${n}.text`, { max:
|
|
5102
|
+
$(t, n, e.type), H(e.text, `${n}.text`, { max: wn });
|
|
4661
5103
|
return;
|
|
4662
5104
|
case "plan":
|
|
4663
|
-
$(t, n, e.type),
|
|
5105
|
+
$(t, n, e.type), Zr(e, n);
|
|
4664
5106
|
return;
|
|
4665
5107
|
case "rich_text":
|
|
4666
5108
|
Q(e, n);
|
|
4667
5109
|
return;
|
|
4668
5110
|
case "section":
|
|
4669
|
-
|
|
5111
|
+
Pr(e, n);
|
|
4670
5112
|
return;
|
|
4671
5113
|
case "table":
|
|
4672
|
-
$(t, n, e.type),
|
|
5114
|
+
$(t, n, e.type), Ur(e, n);
|
|
4673
5115
|
return;
|
|
4674
5116
|
case "task_card":
|
|
4675
|
-
$(t, n, e.type),
|
|
5117
|
+
$(t, n, e.type), Xr(e, n);
|
|
4676
5118
|
return;
|
|
4677
5119
|
case "video":
|
|
4678
|
-
|
|
5120
|
+
ei(e, n);
|
|
4679
5121
|
return;
|
|
4680
|
-
default:
|
|
5122
|
+
default: vr("unsupported_block", `${n}.type`, `unsupported block "${String(e.type)}"`);
|
|
4681
5123
|
}
|
|
4682
5124
|
}
|
|
4683
|
-
function
|
|
4684
|
-
|
|
5125
|
+
function ni(e, t, n = "message", r = "block") {
|
|
5126
|
+
ti(e, n, r), z(e.type === t, "invalid_value", `${r}.type`, `expected "${t}"`);
|
|
4685
5127
|
}
|
|
4686
|
-
function
|
|
5128
|
+
function ri(e, t) {
|
|
4687
5129
|
return Array.isArray(e) ? e : (B(e, t), V(e.blocks, `${t}.blocks`), e.blocks);
|
|
4688
5130
|
}
|
|
4689
|
-
function
|
|
4690
|
-
let r = Array.isArray(e) ? n : `${n}.blocks`, i =
|
|
5131
|
+
function ii(e, t = "message", n = "data") {
|
|
5132
|
+
let r = Array.isArray(e) ? n : `${n}.blocks`, i = ri(e, n), a = t === "message" ? 50 : 100;
|
|
4691
5133
|
z(i.length <= a, "limit_exceeded", r, `${t} surfaces accept at most ${String(a)} blocks`);
|
|
4692
5134
|
let o = 0, s = 0, c = 0, l = /* @__PURE__ */ new Set();
|
|
4693
5135
|
i.forEach((e, n) => {
|
|
4694
5136
|
let i = `${r}[${String(n)}]`;
|
|
4695
|
-
if (
|
|
4696
|
-
else if (e.type === "table") for (let t of e.rows) for (let e of t) s +=
|
|
4697
|
-
else if (e.type === "data_table") for (let t of e.rows) for (let e of t) c +=
|
|
4698
|
-
}), z(o <=
|
|
5137
|
+
if (ti(e, t, i), e.block_id !== void 0 && (z(!l.has(e.block_id), "duplicate_id", `${i}.block_id`, `"${e.block_id}" is already used in this payload`), l.add(e.block_id)), e.type === "markdown") o += e.text.length;
|
|
5138
|
+
else if (e.type === "table") for (let t of e.rows) for (let e of t) s += Br(e);
|
|
5139
|
+
else if (e.type === "data_table") for (let t of e.rows) for (let e of t) c += Br(e);
|
|
5140
|
+
}), z(o <= wn, "limit_exceeded", r, `markdown blocks exceed the cumulative ${String(wn)} character limit`), z(s <= Dn, "limit_exceeded", r, `table cells exceed the cumulative ${String(Dn)} character limit`), z(c <= On, "limit_exceeded", r, `data_table cells exceed the cumulative ${String(On)} character limit`);
|
|
4699
5141
|
}
|
|
4700
|
-
function
|
|
5142
|
+
function ai(e, t = "message") {
|
|
4701
5143
|
let n = e;
|
|
4702
5144
|
if (typeof e == "string") try {
|
|
4703
5145
|
n = JSON.parse(e);
|
|
4704
5146
|
} catch {
|
|
4705
|
-
throw new
|
|
5147
|
+
throw new hr("expected valid JSON", {
|
|
4706
5148
|
code: "invalid_json",
|
|
4707
5149
|
path: "data"
|
|
4708
5150
|
});
|
|
4709
5151
|
}
|
|
4710
|
-
return
|
|
5152
|
+
return ii(n, t), n;
|
|
4711
5153
|
}
|
|
4712
|
-
function
|
|
4713
|
-
return
|
|
5154
|
+
function oi(e) {
|
|
5155
|
+
return si(e) ? e.blocks : e;
|
|
4714
5156
|
}
|
|
4715
|
-
function
|
|
5157
|
+
function si(e) {
|
|
4716
5158
|
return !Array.isArray(e);
|
|
4717
5159
|
}
|
|
4718
5160
|
//#endregion
|
|
4719
|
-
export {
|
|
5161
|
+
export { nr as ActionsBlock, mn as AlertBlock, lr as Block, _r as BlockKit, hr as BlockKitInvariantError, b as BlockKitProvider, lt as ButtonElement, dn as CardBlock, pn as CarouselBlock, pt as ChoiceGroup, mr as ContainerBlock, ar as ContextActionsBlock, Qt as ContextBlock, ln as DataTableBlock, Qn as DataVisualizationBlock, Yt as DividerBlock, tn as FileBlock, Jt as HeaderBlock, Xt as ImageBlock, F as ImageElement, rr as InputBlock, Et as InputElement, Dt as InteractiveElement, Gt as Markdown, en as MarkdownBlock, I as Mrkdwn, ut as OverflowElement, _n as PlanBlock, N as RichText, $t as RichTextBlock, qt as SectionBlock, xt as SelectElement, on as TableBlock, rn as TableCell, hn as TaskCardBlock, L as Text, nn as VideoBlock, ii as assertBlockKitData, ni as assertBlockType, xr as assertImageElementData, kr as assertInteractiveElementData, ti as assertRenderableBlock, Nr as assertRichTextBlockData, yr as assertTextObjectData, oi as blocksOf, we as darkTheme, Ce as lightTheme, ai as parseBlockKitData, Vt as tokenizeMarkdown, Ft as tokenizeMrkdwn, Se as tokens, x as useBlockKitContext };
|
|
4720
5162
|
|
|
4721
5163
|
//# sourceMappingURL=index.js.map
|