@wix/himalaya-cli 0.1477.0 → 0.1478.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +751 -540
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/component-reference.json +6 -53
- package/guides/component-reference.md +4 -16
- package/package.json +2 -2
package/dist/cli.mjs
CHANGED
|
@@ -653,12 +653,12 @@ function validateDataResources(data, app) {
|
|
|
653
653
|
}
|
|
654
654
|
return issues;
|
|
655
655
|
}
|
|
656
|
-
function scopePrefix(
|
|
657
|
-
return `himi/data/${encodeURIComponent(
|
|
656
|
+
function scopePrefix(scope2) {
|
|
657
|
+
return `himi/data/${encodeURIComponent(scope2.app)}/${encodeURIComponent(scope2.siteId)}/${scope2.environment}/`;
|
|
658
658
|
}
|
|
659
|
-
function kvResourceKey(
|
|
659
|
+
function kvResourceKey(scope2, store) {
|
|
660
660
|
if (!KV_NAME.test(store)) throw new Error(`KV store name must be lowercase kebab-case: ${JSON.stringify(store)}`);
|
|
661
|
-
return `${scopePrefix(
|
|
661
|
+
return `${scopePrefix(scope2)}kv/${encodeURIComponent(store)}`;
|
|
662
662
|
}
|
|
663
663
|
var WIX_COLLECTION_ID_MAX_LENGTH, SAFE_APP_ID, KV_NAME;
|
|
664
664
|
var init_ownership2 = __esm({
|
|
@@ -2956,8 +2956,8 @@ function currentGitUntrackedHash(contentDir2) {
|
|
|
2956
2956
|
const absolute = realpathSync.native(unresolved);
|
|
2957
2957
|
const root = repoRoot(absolute);
|
|
2958
2958
|
if (!root) return sourceTreeHash(absolute);
|
|
2959
|
-
const
|
|
2960
|
-
const listed = execFileSync2("git", ["-C", root, "ls-files", "--others", "--exclude-standard", "-z", "--",
|
|
2959
|
+
const scope2 = relative(root, absolute) || ".";
|
|
2960
|
+
const listed = execFileSync2("git", ["-C", root, "ls-files", "--others", "--exclude-standard", "-z", "--", scope2], {
|
|
2961
2961
|
encoding: "utf8",
|
|
2962
2962
|
maxBuffer: GIT_HASH_MAX_BUFFER
|
|
2963
2963
|
});
|
|
@@ -5064,8 +5064,8 @@ function tsExtResolvePlugin() {
|
|
|
5064
5064
|
}
|
|
5065
5065
|
};
|
|
5066
5066
|
}
|
|
5067
|
-
function importMetaUrlPlugin({ scope } = {}) {
|
|
5068
|
-
const scopes =
|
|
5067
|
+
function importMetaUrlPlugin({ scope: scope2 } = {}) {
|
|
5068
|
+
const scopes = scope2 ? [.../* @__PURE__ */ new Set([realpathOrSelf(scope2), resolve8(scope2)])] : [];
|
|
5069
5069
|
const inScope = (p2) => scopes.some((r3) => p2 === r3 || p2.startsWith(r3 + sep3));
|
|
5070
5070
|
return {
|
|
5071
5071
|
name: "himalaya-import-meta-url",
|
|
@@ -8127,7 +8127,6 @@ function resolveTranslation(value, catalog3, sourceCatalog) {
|
|
|
8127
8127
|
var BINDING_SIGILS, BINDING_SIGIL_RE, TRANSLATION_PREFIX, TRANSLATION_KEY_RE;
|
|
8128
8128
|
var init_bindings = __esm({
|
|
8129
8129
|
"../../core/ts/src/bindings.ts"() {
|
|
8130
|
-
"use strict";
|
|
8131
8130
|
BINDING_SIGILS = ["service", "flag", "item", "t"];
|
|
8132
8131
|
BINDING_SIGIL_RE = new RegExp(
|
|
8133
8132
|
`^\\$(?:${BINDING_SIGILS.filter((s2) => s2 !== "t").join("|")})\\b|^\\$t:`
|
|
@@ -11296,10 +11295,10 @@ function makeInert() {
|
|
|
11296
11295
|
function withWorkerConsole(base, capture, now) {
|
|
11297
11296
|
if (!capture) return freshNoopWorkerConsole();
|
|
11298
11297
|
const sinkBase = { ...base, __himalayaSink: true };
|
|
11299
|
-
const
|
|
11298
|
+
const scope2 = { console: sinkBase };
|
|
11300
11299
|
try {
|
|
11301
11300
|
new Function("globalThis", "console", "__himalaya_console_frames", "__himalaya_console_now", WORKER_CONSOLE_SOURCE)(
|
|
11302
|
-
|
|
11301
|
+
scope2,
|
|
11303
11302
|
sinkBase,
|
|
11304
11303
|
BUNDLE_FILENAME,
|
|
11305
11304
|
now
|
|
@@ -11325,7 +11324,7 @@ function withWorkerConsole(base, capture, now) {
|
|
|
11325
11324
|
])
|
|
11326
11325
|
);
|
|
11327
11326
|
}
|
|
11328
|
-
return
|
|
11327
|
+
return scope2.console;
|
|
11329
11328
|
}
|
|
11330
11329
|
function pinnedNow(clock) {
|
|
11331
11330
|
return clock === void 0 ? void 0 : () => Number(clock);
|
|
@@ -16167,9 +16166,9 @@ function ensureUmbrella(contentDir2, globalPath = globalUmbrella()) {
|
|
|
16167
16166
|
if (umbrellaInstalled(contentDir2)) return true;
|
|
16168
16167
|
if (!globalPath) return false;
|
|
16169
16168
|
try {
|
|
16170
|
-
const
|
|
16171
|
-
mkdirSync8(
|
|
16172
|
-
const link = join16(
|
|
16169
|
+
const scope2 = join16(contentDir2, "node_modules", "@wix");
|
|
16170
|
+
mkdirSync8(scope2, { recursive: true });
|
|
16171
|
+
const link = join16(scope2, "himalaya");
|
|
16173
16172
|
if (!existsSync16(link)) symlinkSync(globalPath, link, "dir");
|
|
16174
16173
|
return existsSync16(join16(link, "package.json"));
|
|
16175
16174
|
} catch {
|
|
@@ -20694,6 +20693,20 @@ function hexToRgb2(hex2) {
|
|
|
20694
20693
|
const int2 = parseInt(h2, 16);
|
|
20695
20694
|
return [int2 >> 16 & 255, int2 >> 8 & 255, int2 & 255];
|
|
20696
20695
|
}
|
|
20696
|
+
function activityRingTrack(color, tint, opts = {}) {
|
|
20697
|
+
return color("surfaceTertiary", translucent(tint, ACTIVITY_RING_TRACK_ALPHA, opts.cssMix === true));
|
|
20698
|
+
}
|
|
20699
|
+
function translucent(color, alpha2, cssMix) {
|
|
20700
|
+
const c2 = color.trim();
|
|
20701
|
+
if (c2.startsWith("#")) return rgba(c2, alpha2);
|
|
20702
|
+
const m2 = /^rgba?\(\s*([\d.]+)\s*[,\s]\s*([\d.]+)\s*[,\s]\s*([\d.]+)\s*(?:[,/]\s*([\d.]+)(%?)\s*)?\)$/i.exec(c2);
|
|
20703
|
+
if (m2) {
|
|
20704
|
+
const own5 = m2[4] === void 0 ? 1 : Number(m2[4]) / (m2[5] === "%" ? 100 : 1);
|
|
20705
|
+
const a2 = Math.round(Math.max(0, Math.min(1, own5)) * alpha2 * 1e3) / 1e3;
|
|
20706
|
+
return `rgba(${Number(m2[1])}, ${Number(m2[2])}, ${Number(m2[3])}, ${a2})`;
|
|
20707
|
+
}
|
|
20708
|
+
return cssMix ? `color-mix(in srgb, ${c2} ${Math.round(alpha2 * 100)}%, transparent)` : `rgba(128, 128, 128, ${alpha2})`;
|
|
20709
|
+
}
|
|
20697
20710
|
function rgba(color, alpha2) {
|
|
20698
20711
|
let h2 = color.trim().replace(/^#/, "");
|
|
20699
20712
|
let own5 = 1;
|
|
@@ -21050,7 +21063,7 @@ function makeTokenResolvers(source, scheme, idiom = WEB_IDIOM_CONTEXT) {
|
|
|
21050
21063
|
scheme
|
|
21051
21064
|
};
|
|
21052
21065
|
}
|
|
21053
|
-
var REM_ROOT_PX, pxToRem, DEFAULT_FONT_STACK, SYSTEM_FONT_STACK, SERIF_FAMILY_RE, SPRING_MIN_RESPONSE, SPRING_MAX_RESPONSE, SPRING_MIN_DAMPING, SPRING_MAX_DAMPING, clampTo, finite, SPRING_SETTLE_TOLERANCE, SPRING_MAX_SECS, springCurves, WEB_IDIOM_CONTEXT;
|
|
21066
|
+
var REM_ROOT_PX, pxToRem, DEFAULT_FONT_STACK, SYSTEM_FONT_STACK, SERIF_FAMILY_RE, ACTIVITY_RING_TRACK_ALPHA, SPRING_MIN_RESPONSE, SPRING_MAX_RESPONSE, SPRING_MIN_DAMPING, SPRING_MAX_DAMPING, clampTo, finite, SPRING_SETTLE_TOLERANCE, SPRING_MAX_SECS, springCurves, WEB_IDIOM_CONTEXT;
|
|
21054
21067
|
var init_tokens2 = __esm({
|
|
21055
21068
|
"../../core/web-renderer/src/tokens.ts"() {
|
|
21056
21069
|
init_idiom();
|
|
@@ -21061,6 +21074,7 @@ var init_tokens2 = __esm({
|
|
|
21061
21074
|
DEFAULT_FONT_STACK = '"Wix Madefor Text", system-ui';
|
|
21062
21075
|
SYSTEM_FONT_STACK = 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';
|
|
21063
21076
|
SERIF_FAMILY_RE = /\b(georgia|times|garamond|palatino|baskerville|didot|charter|bodoni|caslon|cambria|constantia|rockwell|playfair|merriweather|lora|literata|spectral|serif)\b/i;
|
|
21077
|
+
ACTIVITY_RING_TRACK_ALPHA = 0.2;
|
|
21064
21078
|
SPRING_MIN_RESPONSE = 0.05;
|
|
21065
21079
|
SPRING_MAX_RESPONSE = 10;
|
|
21066
21080
|
SPRING_MIN_DAMPING = 0.1;
|
|
@@ -36473,9 +36487,9 @@ function parseTarget(target) {
|
|
|
36473
36487
|
async function handleWixGateway(gw, app, adminUrl, req, res, wixClientId) {
|
|
36474
36488
|
const url = req.url ?? "";
|
|
36475
36489
|
const path2 = url.split("?")[0];
|
|
36476
|
-
const
|
|
36477
|
-
if (!
|
|
36478
|
-
const suffix = path2.slice(
|
|
36490
|
+
const scope2 = path2.startsWith("/__dev/wix/") ? "wix" : path2.startsWith("/__dev/net/") ? "net" : null;
|
|
36491
|
+
if (!scope2) return false;
|
|
36492
|
+
const suffix = path2.slice(scope2 === "wix" ? "/__dev/wix/".length : "/__dev/net/".length);
|
|
36479
36493
|
const method = (req.method ?? "GET").toUpperCase();
|
|
36480
36494
|
if (suffix === "events" && method === "GET") {
|
|
36481
36495
|
res.writeHead(200, {
|
|
@@ -36529,7 +36543,7 @@ data: ${JSON.stringify({ mode: gw.mode })}
|
|
|
36529
36543
|
return json(res, 400, { error: "invalid_json" }), true;
|
|
36530
36544
|
}
|
|
36531
36545
|
}
|
|
36532
|
-
if (
|
|
36546
|
+
if (scope2 === "wix" && suffix === "frog" && method === "POST") {
|
|
36533
36547
|
const body = await readBody(req).catch(() => "");
|
|
36534
36548
|
recordWixTraffic(gw, app, adminUrl, {
|
|
36535
36549
|
ts: Date.now(),
|
|
@@ -36579,7 +36593,7 @@ data: ${JSON.stringify({ mode: gw.mode })}
|
|
|
36579
36593
|
return json(res, 200, { mode: gw.mode, rows: gw.traffic.slice(-limit) }), true;
|
|
36580
36594
|
}
|
|
36581
36595
|
if (suffix === "proxy") {
|
|
36582
|
-
const hdr = (n2) => req.headers[`x-himalaya-${
|
|
36596
|
+
const hdr = (n2) => req.headers[`x-himalaya-${scope2}-${n2}`] ?? "";
|
|
36583
36597
|
const target = hdr("target");
|
|
36584
36598
|
const upstreamMethod = (hdr("method") || method).toUpperCase();
|
|
36585
36599
|
const capability = hdr("capability") || void 0;
|
|
@@ -36672,7 +36686,7 @@ data: ${JSON.stringify({ mode: gw.mode })}
|
|
|
36672
36686
|
status = 0;
|
|
36673
36687
|
respText = JSON.stringify({ gatewayError: String(e2?.message ?? e2) });
|
|
36674
36688
|
}
|
|
36675
|
-
if (
|
|
36689
|
+
if (scope2 === "wix" && (status === 401 || status === 403)) {
|
|
36676
36690
|
try {
|
|
36677
36691
|
const vt2 = await mintVisitor(wixClientId ?? WIX_DEV_CLIENT_ID);
|
|
36678
36692
|
const retryHeaders = {};
|
|
@@ -38745,10 +38759,10 @@ function buildOpenApi(descriptors) {
|
|
|
38745
38759
|
} : { "200": { description: "ok" } };
|
|
38746
38760
|
paths[p2] = { [method]: { summary: summary2, responses } };
|
|
38747
38761
|
}
|
|
38748
|
-
for (const
|
|
38749
|
-
paths[`/__dev/${
|
|
38750
|
-
get: { summary: `Get ${
|
|
38751
|
-
put: { summary: `Replace ${
|
|
38762
|
+
for (const scope2 of ["net", "wix"]) {
|
|
38763
|
+
paths[`/__dev/${scope2}/rules`] = {
|
|
38764
|
+
get: { summary: `Get ${scope2} gateway rules.`, responses: { "200": { description: "rules" } } },
|
|
38765
|
+
put: { summary: `Replace ${scope2} gateway rules.`, responses: { "200": { description: "ok" }, "400": { description: "invalid_json" } } }
|
|
38752
38766
|
};
|
|
38753
38767
|
}
|
|
38754
38768
|
return {
|
|
@@ -39761,8 +39775,8 @@ var init_bindings2 = __esm({
|
|
|
39761
39775
|
const arr2 = local ? ctx.itemScope?.[itemsPath.slice("$item.".length)] : bound;
|
|
39762
39776
|
const items = Array.isArray(arr2) ? arr2 : [];
|
|
39763
39777
|
return /* @__PURE__ */ jsx3(Fragment, { children: items.map((item, i2) => {
|
|
39764
|
-
const
|
|
39765
|
-
const itemCtx = { ...ctx, itemScope:
|
|
39778
|
+
const scope2 = item && typeof item === "object" ? { ...item, __index: i2 } : { value: item, __index: i2 };
|
|
39779
|
+
const itemCtx = { ...ctx, itemScope: scope2 };
|
|
39766
39780
|
const key3 = item?.id ?? i2;
|
|
39767
39781
|
return /* @__PURE__ */ jsx3(React2.Fragment, { children: renderRow(template, itemCtx) }, String(key3));
|
|
39768
39782
|
}) });
|
|
@@ -39770,6 +39784,25 @@ var init_bindings2 = __esm({
|
|
|
39770
39784
|
}
|
|
39771
39785
|
});
|
|
39772
39786
|
|
|
39787
|
+
// ../../core/web-renderer/src/snackbarTiming.ts
|
|
39788
|
+
function snackbarAutoHideMs(durationMs) {
|
|
39789
|
+
const ms2 = typeof durationMs === "number" && Number.isFinite(durationMs) ? durationMs : SNACKBAR_DEFAULT_DURATION_MS;
|
|
39790
|
+
return ms2 > 0 ? ms2 : void 0;
|
|
39791
|
+
}
|
|
39792
|
+
function snackbarIdentity(props) {
|
|
39793
|
+
return JSON.stringify(
|
|
39794
|
+
[props.message ?? null, props.severity ?? null, props.action ?? null, props.actionLabel ?? null, props.durationMs ?? null],
|
|
39795
|
+
(_key, value) => value && typeof value === "object" && !Array.isArray(value) ? Object.fromEntries(Object.keys(value).sort().map((key3) => [key3, value[key3]])) : value
|
|
39796
|
+
);
|
|
39797
|
+
}
|
|
39798
|
+
var SNACKBAR_DEFAULT_DURATION_MS, SNACKBAR_FADE_MS;
|
|
39799
|
+
var init_snackbarTiming = __esm({
|
|
39800
|
+
"../../core/web-renderer/src/snackbarTiming.ts"() {
|
|
39801
|
+
SNACKBAR_DEFAULT_DURATION_MS = 4e3;
|
|
39802
|
+
SNACKBAR_FADE_MS = 200;
|
|
39803
|
+
}
|
|
39804
|
+
});
|
|
39805
|
+
|
|
39773
39806
|
// ../../core/web-renderer/src/formBag.ts
|
|
39774
39807
|
import React3 from "react";
|
|
39775
39808
|
function hasContributed(bag, fieldId) {
|
|
@@ -41443,8 +41476,97 @@ var init_mediaFieldUpload = __esm({
|
|
|
41443
41476
|
}
|
|
41444
41477
|
});
|
|
41445
41478
|
|
|
41446
|
-
// ../../core/web-renderer/src/a11y/
|
|
41479
|
+
// ../../core/web-renderer/src/a11y/radioGroups.ts
|
|
41480
|
+
function createRadioGroups() {
|
|
41481
|
+
const owners = /* @__PURE__ */ new Map();
|
|
41482
|
+
const members = /* @__PURE__ */ new Map();
|
|
41483
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
41484
|
+
let seq = 0;
|
|
41485
|
+
const emit = () => {
|
|
41486
|
+
for (const l2 of [...listeners]) l2();
|
|
41487
|
+
};
|
|
41488
|
+
return {
|
|
41489
|
+
/** A fresh member identity — per mounted radio, not per component id (rows of one bound
|
|
41490
|
+
* template share an id and must each be their own member). */
|
|
41491
|
+
newMember() {
|
|
41492
|
+
seq += 1;
|
|
41493
|
+
return `radio-${seq}`;
|
|
41494
|
+
},
|
|
41495
|
+
owner(group) {
|
|
41496
|
+
return owners.get(group);
|
|
41497
|
+
},
|
|
41498
|
+
select(group, member) {
|
|
41499
|
+
if (owners.get(group) === member) return;
|
|
41500
|
+
owners.set(group, member);
|
|
41501
|
+
emit();
|
|
41502
|
+
},
|
|
41503
|
+
/** A mount may seed an empty group, but never replaces a live choice. */
|
|
41504
|
+
claimInitial(group, member, value) {
|
|
41505
|
+
if (value && owners.get(group) === void 0) this.select(group, member);
|
|
41506
|
+
},
|
|
41507
|
+
join(group) {
|
|
41508
|
+
members.set(group, (members.get(group) ?? 0) + 1);
|
|
41509
|
+
},
|
|
41510
|
+
/** `member` leaves `group`. The group's choice is forgotten when the departing member IS the
|
|
41511
|
+
* chosen radio (an owner that no longer exists would leave the group stuck — no live member
|
|
41512
|
+
* could ever be chosen again without a tap), or when no member is left. */
|
|
41513
|
+
leave(group, member) {
|
|
41514
|
+
const left = (members.get(group) ?? 1) - 1;
|
|
41515
|
+
if (left > 0) members.set(group, left);
|
|
41516
|
+
else members.delete(group);
|
|
41517
|
+
if ((left <= 0 || owners.get(group) === member) && owners.delete(group)) emit();
|
|
41518
|
+
},
|
|
41519
|
+
/** The DESCRIPTOR (or worker) moved `member`'s value — not a press. Turning true takes the
|
|
41520
|
+
* group's choice; turning false while it holds the choice releases it. Without this a choice
|
|
41521
|
+
* the worker moved elsewhere stayed with the old radio, and a group-mate that remounted
|
|
41522
|
+
* selected was turned off by it. Called on CHANGES only: a radio mounting is not a change,
|
|
41523
|
+
* so a lazy row scrolling back in cannot steal a choice made by a tap since. */
|
|
41524
|
+
adopt(group, member, value) {
|
|
41525
|
+
if (value) {
|
|
41526
|
+
this.select(group, member);
|
|
41527
|
+
return;
|
|
41528
|
+
}
|
|
41529
|
+
if (owners.get(group) === member && owners.delete(group)) emit();
|
|
41530
|
+
},
|
|
41531
|
+
subscribe(l2) {
|
|
41532
|
+
listeners.add(l2);
|
|
41533
|
+
return () => {
|
|
41534
|
+
listeners.delete(l2);
|
|
41535
|
+
};
|
|
41536
|
+
},
|
|
41537
|
+
/** True when `member` must turn off: its group has a chosen radio and it is another one. */
|
|
41538
|
+
deselects(owner, member) {
|
|
41539
|
+
return owner != null && owner !== member;
|
|
41540
|
+
},
|
|
41541
|
+
/** Tests only — forget every group. */
|
|
41542
|
+
reset() {
|
|
41543
|
+
owners.clear();
|
|
41544
|
+
members.clear();
|
|
41545
|
+
}
|
|
41546
|
+
};
|
|
41547
|
+
}
|
|
41548
|
+
var radioGroups;
|
|
41549
|
+
var init_radioGroups = __esm({
|
|
41550
|
+
"../../core/web-renderer/src/a11y/radioGroups.ts"() {
|
|
41551
|
+
radioGroups = createRadioGroups();
|
|
41552
|
+
}
|
|
41553
|
+
});
|
|
41554
|
+
|
|
41555
|
+
// ../../core/web-renderer/src/a11y/radioGroupScope.tsx
|
|
41447
41556
|
import React6 from "react";
|
|
41557
|
+
var scope, RadioGroupScope, useRadioGroups;
|
|
41558
|
+
var init_radioGroupScope = __esm({
|
|
41559
|
+
"../../core/web-renderer/src/a11y/radioGroupScope.tsx"() {
|
|
41560
|
+
"use strict";
|
|
41561
|
+
init_radioGroups();
|
|
41562
|
+
scope = React6.createContext(radioGroups);
|
|
41563
|
+
RadioGroupScope = scope.Provider;
|
|
41564
|
+
useRadioGroups = () => React6.useContext(scope);
|
|
41565
|
+
}
|
|
41566
|
+
});
|
|
41567
|
+
|
|
41568
|
+
// ../../core/web-renderer/src/a11y/controls.tsx
|
|
41569
|
+
import React7 from "react";
|
|
41448
41570
|
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
41449
41571
|
function labelText(label3, ctx) {
|
|
41450
41572
|
if (typeof label3 === "string" && isBinding(label3)) {
|
|
@@ -41453,6 +41575,10 @@ function labelText(label3, ctx) {
|
|
|
41453
41575
|
}
|
|
41454
41576
|
return asText2(label3);
|
|
41455
41577
|
}
|
|
41578
|
+
function sliderShouldEmit(lastEmit, now, debounceMs) {
|
|
41579
|
+
if (typeof debounceMs !== "number" || !(debounceMs > 0)) return false;
|
|
41580
|
+
return lastEmit === void 0 || now - lastEmit >= debounceMs;
|
|
41581
|
+
}
|
|
41456
41582
|
function resolveRowAction(action, ctx) {
|
|
41457
41583
|
const resolved2 = resolveItemDeep(action, ctx);
|
|
41458
41584
|
if (!resolved2 || typeof resolved2 !== "object" || Array.isArray(resolved2)) return resolved2;
|
|
@@ -41473,6 +41599,7 @@ var init_controls = __esm({
|
|
|
41473
41599
|
init_bindings2();
|
|
41474
41600
|
init_icons();
|
|
41475
41601
|
init_formBag();
|
|
41602
|
+
init_radioGroupScope();
|
|
41476
41603
|
init_form_bag();
|
|
41477
41604
|
useResolvedId = (v2, ctx) => {
|
|
41478
41605
|
const r3 = useResolvedScalar(typeof v2 === "string" ? v2 : void 0, ctx);
|
|
@@ -41484,25 +41611,25 @@ var init_controls = __esm({
|
|
|
41484
41611
|
const C2 = ctx.color;
|
|
41485
41612
|
const bound = useResolvedScalar(props.valuePath, ctx);
|
|
41486
41613
|
const resolved2 = ctx.empty ? false : props.valuePath != null ? encodeToggleFieldValue(bound) === "true" : encodeToggleFieldValue(props.value, props.on === true) === "true";
|
|
41487
|
-
const bag =
|
|
41614
|
+
const bag = React7.useContext(FormValuesContext);
|
|
41488
41615
|
const fieldId = props.__formFieldId;
|
|
41489
41616
|
const inForm = Boolean(bag && fieldId);
|
|
41490
|
-
const [formOn, setFormOn] =
|
|
41491
|
-
const touchedField =
|
|
41492
|
-
|
|
41617
|
+
const [formOn, setFormOn] = React7.useState(null);
|
|
41618
|
+
const touchedField = React7.useRef(void 0);
|
|
41619
|
+
React7.useEffect(() => {
|
|
41493
41620
|
if (bag && fieldId && touchedField.current === fieldId) bag.set(fieldId, encodeToggleFieldValue(resolved2));
|
|
41494
41621
|
setFormOn(null);
|
|
41495
41622
|
}, [resolved2]);
|
|
41496
41623
|
const toggleServiceBound = typeof props.valuePath === "string" && props.valuePath.startsWith("$service:");
|
|
41497
41624
|
const toggleReady = !toggleServiceBound || bound !== void 0;
|
|
41498
|
-
|
|
41625
|
+
React7.useEffect(() => {
|
|
41499
41626
|
if (!bag || !fieldId) return;
|
|
41500
41627
|
if (!toggleReady && !hasContributed(bag, fieldId)) return;
|
|
41501
41628
|
bag.set(fieldId, encodeToggleFieldValue(resolved2));
|
|
41502
41629
|
}, [toggleReady, resolved2, fieldId, bag]);
|
|
41503
41630
|
const on4 = inForm && touchedField.current === fieldId && formOn !== null ? formOn : resolved2;
|
|
41504
41631
|
const ruleKey = props.validation ? JSON.stringify(props.validation) : "";
|
|
41505
|
-
|
|
41632
|
+
React7.useEffect(() => {
|
|
41506
41633
|
if (!bag || !fieldId) return;
|
|
41507
41634
|
bag.register(fieldId, props.validation);
|
|
41508
41635
|
return () => bag.unregister(fieldId);
|
|
@@ -41562,21 +41689,26 @@ var init_controls = __esm({
|
|
|
41562
41689
|
const tint = C2(props.tint ?? "accentPrimary", "#116DFF");
|
|
41563
41690
|
const step = typeof props.step === "number" && props.step > 0 ? props.step : (max - min) / 100 || 0.01;
|
|
41564
41691
|
const range = props.range === true && typeof props.upperValue === "number";
|
|
41565
|
-
const [val, setVal] =
|
|
41566
|
-
|
|
41692
|
+
const [val, setVal] = React7.useState(bound);
|
|
41693
|
+
const latestValue = React7.useRef(bound);
|
|
41694
|
+
const dragging = React7.useRef(false);
|
|
41695
|
+
React7.useEffect(() => {
|
|
41696
|
+
if (dragging.current) return;
|
|
41697
|
+
latestValue.current = bound;
|
|
41567
41698
|
setVal(bound);
|
|
41568
41699
|
}, [bound]);
|
|
41569
|
-
const
|
|
41700
|
+
const lastEmit = React7.useRef(void 0);
|
|
41570
41701
|
const canFire = !!(ctx.onAction && props.onChange && !props.disabled);
|
|
41571
41702
|
const commit = (nv) => {
|
|
41703
|
+
latestValue.current = nv;
|
|
41572
41704
|
setVal(nv);
|
|
41573
41705
|
if (!canFire) return;
|
|
41574
41706
|
const act = resolveRowAction(props.onChange, ctx);
|
|
41575
41707
|
ctx.onAction({ ...act, args: { ...act.args ?? {}, value: nv } });
|
|
41576
41708
|
};
|
|
41577
41709
|
const clampPct = (n2) => max > min ? Math.max(0, Math.min(1, (n2 - min) / (max - min))) : 0;
|
|
41578
|
-
const [pair, setPair] =
|
|
41579
|
-
|
|
41710
|
+
const [pair, setPair] = React7.useState(() => [Math.min(bound, props.upperValue ?? bound), Math.max(bound, props.upperValue ?? bound)]);
|
|
41711
|
+
React7.useEffect(() => {
|
|
41580
41712
|
if (range) setPair([Math.min(bound, props.upperValue), Math.max(bound, props.upperValue)]);
|
|
41581
41713
|
}, [range, bound, props.upperValue]);
|
|
41582
41714
|
if (range) {
|
|
@@ -41673,17 +41805,33 @@ var init_controls = __esm({
|
|
|
41673
41805
|
if (nv === void 0) return;
|
|
41674
41806
|
dragging.current = true;
|
|
41675
41807
|
e2.currentTarget.setPointerCapture?.(e2.pointerId);
|
|
41808
|
+
latestValue.current = nv;
|
|
41676
41809
|
setVal(nv);
|
|
41677
41810
|
};
|
|
41678
41811
|
const onPointerMove = (e2) => {
|
|
41679
41812
|
if (!dragging.current) return;
|
|
41680
41813
|
const nv = valueAt(e2);
|
|
41681
|
-
if (nv
|
|
41814
|
+
if (nv === void 0) return;
|
|
41815
|
+
latestValue.current = nv;
|
|
41816
|
+
setVal(nv);
|
|
41817
|
+
const now = Date.now();
|
|
41818
|
+
if (canFire && sliderShouldEmit(lastEmit.current, now, props.debounceMs)) {
|
|
41819
|
+
lastEmit.current = now;
|
|
41820
|
+
const act = resolveRowAction(props.onChange, ctx);
|
|
41821
|
+
ctx.onAction({ ...act, args: { ...act.args ?? {}, value: nv } });
|
|
41822
|
+
}
|
|
41682
41823
|
};
|
|
41683
41824
|
const onPointerUp = (e2) => {
|
|
41684
41825
|
if (!dragging.current) return;
|
|
41685
41826
|
dragging.current = false;
|
|
41686
|
-
|
|
41827
|
+
lastEmit.current = void 0;
|
|
41828
|
+
commit(valueAt(e2) ?? latestValue.current);
|
|
41829
|
+
};
|
|
41830
|
+
const endDragWithoutRelease = () => {
|
|
41831
|
+
if (!dragging.current) return;
|
|
41832
|
+
dragging.current = false;
|
|
41833
|
+
lastEmit.current = void 0;
|
|
41834
|
+
commit(latestValue.current);
|
|
41687
41835
|
};
|
|
41688
41836
|
return /* @__PURE__ */ jsx7("div", { ...{ [A11Y_PART]: "root" }, style: { width: "100%", padding: "12px 9px", boxSizing: "border-box", opacity: props.disabled ? 0.5 : 1, ...wrap }, children: /* @__PURE__ */ jsx7(
|
|
41689
41837
|
"div",
|
|
@@ -41701,6 +41849,8 @@ var init_controls = __esm({
|
|
|
41701
41849
|
onPointerDown,
|
|
41702
41850
|
onPointerMove,
|
|
41703
41851
|
onPointerUp,
|
|
41852
|
+
onPointerCancel: endDragWithoutRelease,
|
|
41853
|
+
onLostPointerCapture: endDragWithoutRelease,
|
|
41704
41854
|
style: { position: "relative", height: 18, display: "flex", alignItems: "center", outlineOffset: 4, cursor: props.disabled ? "default" : "pointer", touchAction: "pan-y" },
|
|
41705
41855
|
children: /* @__PURE__ */ jsxs4("div", { style: { position: "relative", height: 4, width: "100%", borderRadius: 999, background: C2("surfaceTertiary", "#e3e6ea") }, children: [
|
|
41706
41856
|
/* @__PURE__ */ jsx7("div", { style: { position: "absolute", left: 0, width: `${pct * 100}%`, top: 0, bottom: 0, borderRadius: 999, background: tint } }),
|
|
@@ -41710,17 +41860,53 @@ var init_controls = __esm({
|
|
|
41710
41860
|
) });
|
|
41711
41861
|
};
|
|
41712
41862
|
A11ySelectionControl = ({ props, ctx, wrap }) => {
|
|
41863
|
+
const radioGroups2 = useRadioGroups();
|
|
41713
41864
|
const C2 = ctx.color;
|
|
41714
41865
|
const isRadio = props.kind === "radio";
|
|
41715
41866
|
const boundValue = useResolvedScalar(props.valuePath, ctx);
|
|
41716
41867
|
const raw = props.valuePath != null ? boundValue : props.value;
|
|
41717
|
-
const
|
|
41868
|
+
const groupId = isRadio && typeof props.groupId === "string" && props.groupId !== "" ? props.groupId : void 0;
|
|
41869
|
+
const [local, setLocal] = React7.useState(void 0);
|
|
41870
|
+
React7.useEffect(() => {
|
|
41871
|
+
setLocal(void 0);
|
|
41872
|
+
}, [raw, radioGroups2, groupId]);
|
|
41873
|
+
const localValue2 = local?.registry === radioGroups2 && local.groupId === groupId ? local.value : void 0;
|
|
41874
|
+
const on4 = ctx.empty ? false : localValue2 ?? raw === true;
|
|
41875
|
+
const member = React7.useMemo(() => radioGroups2.newMember(), [radioGroups2]);
|
|
41876
|
+
const owner = React7.useSyncExternalStore(
|
|
41877
|
+
radioGroups2.subscribe,
|
|
41878
|
+
() => groupId ? radioGroups2.owner(groupId) : void 0,
|
|
41879
|
+
() => void 0
|
|
41880
|
+
);
|
|
41881
|
+
React7.useEffect(() => {
|
|
41882
|
+
if (!groupId) return;
|
|
41883
|
+
radioGroups2.join(groupId);
|
|
41884
|
+
return () => radioGroups2.leave(groupId, member);
|
|
41885
|
+
}, [radioGroups2, groupId, member]);
|
|
41886
|
+
const seenRaw = React7.useRef(null);
|
|
41887
|
+
React7.useEffect(() => {
|
|
41888
|
+
const prev = seenRaw.current;
|
|
41889
|
+
seenRaw.current = { raw, groupId, registry: radioGroups2 };
|
|
41890
|
+
if (!groupId) return;
|
|
41891
|
+
if (prev === null || prev.groupId !== groupId || prev.registry !== radioGroups2) {
|
|
41892
|
+
radioGroups2.claimInitial(groupId, member, raw === true);
|
|
41893
|
+
} else if (prev.raw !== raw) {
|
|
41894
|
+
radioGroups2.adopt(groupId, member, raw === true);
|
|
41895
|
+
}
|
|
41896
|
+
}, [radioGroups2, raw, groupId, member]);
|
|
41897
|
+
React7.useEffect(() => {
|
|
41898
|
+
if (groupId && radioGroups2.deselects(radioGroups2.owner(groupId), member)) setLocal({ value: false, registry: radioGroups2, groupId });
|
|
41899
|
+
}, [radioGroups2, owner, member, groupId]);
|
|
41718
41900
|
const accent = C2("accentPrimary", "#116DFF");
|
|
41719
41901
|
const fire = ctx.onAction && props.onChange && !props.disabled ? (e2) => {
|
|
41720
41902
|
e2?.stopPropagation?.();
|
|
41721
41903
|
const act = resolveRowAction(props.onChange, ctx);
|
|
41722
41904
|
const next = isRadio ? true : !on4;
|
|
41723
|
-
|
|
41905
|
+
if (isRadio) {
|
|
41906
|
+
setLocal({ value: true, registry: radioGroups2, groupId });
|
|
41907
|
+
if (groupId) radioGroups2.select(groupId, member);
|
|
41908
|
+
}
|
|
41909
|
+
ctx.onAction({ ...act, args: { ...act.args ?? {}, value: next, ...groupId ? { groupId } : {} } });
|
|
41724
41910
|
} : void 0;
|
|
41725
41911
|
const indeterminate = !isRadio && props.indeterminate === true && !on4;
|
|
41726
41912
|
const marked = on4 || indeterminate;
|
|
@@ -41780,8 +41966,8 @@ var init_controls = __esm({
|
|
|
41780
41966
|
const selectedId = useResolvedId(props.selectedId, ctx);
|
|
41781
41967
|
const tabs = Array.isArray(boundTabs) && boundTabs.length ? boundTabs : Array.isArray(props.tabs) ? props.tabs : [];
|
|
41782
41968
|
const pages2 = props.style === "swipe" ? props.swipePages : void 0;
|
|
41783
|
-
const [local, setLocal] =
|
|
41784
|
-
|
|
41969
|
+
const [local, setLocal] = React7.useState(void 0);
|
|
41970
|
+
React7.useEffect(() => {
|
|
41785
41971
|
setLocal(void 0);
|
|
41786
41972
|
}, [selectedId]);
|
|
41787
41973
|
const current = local != null && tabs.some((t2) => t2.id === local) ? local : selectedId;
|
|
@@ -41801,15 +41987,15 @@ var init_controls = __esm({
|
|
|
41801
41987
|
e2.preventDefault();
|
|
41802
41988
|
if (ni2 !== selIdx) select2(ni2);
|
|
41803
41989
|
};
|
|
41804
|
-
const pagerRef =
|
|
41805
|
-
const settle =
|
|
41806
|
-
|
|
41990
|
+
const pagerRef = React7.useRef(null);
|
|
41991
|
+
const settle = React7.useRef(void 0);
|
|
41992
|
+
React7.useEffect(() => {
|
|
41807
41993
|
const el2 = pagerRef.current;
|
|
41808
41994
|
if (!el2 || !el2.clientWidth) return;
|
|
41809
41995
|
const x2 = selIdx * el2.clientWidth;
|
|
41810
41996
|
if (Math.abs(el2.scrollLeft - x2) > 1) el2.scrollTo?.({ left: x2, behavior: "smooth" });
|
|
41811
41997
|
}, [selIdx, pages2]);
|
|
41812
|
-
|
|
41998
|
+
React7.useEffect(() => () => clearTimeout(settle.current), []);
|
|
41813
41999
|
const onPagerScroll = () => {
|
|
41814
42000
|
clearTimeout(settle.current);
|
|
41815
42001
|
settle.current = setTimeout(() => {
|
|
@@ -41920,7 +42106,7 @@ var init_controls = __esm({
|
|
|
41920
42106
|
const expanded = useResolvedScalar(props.expandedPath ?? props.expanded, ctx);
|
|
41921
42107
|
const open = expanded === true;
|
|
41922
42108
|
const fire = ctx.onAction && props.onToggle ? () => ctx.onAction(resolveRowAction(props.onToggle, ctx)) : void 0;
|
|
41923
|
-
const regionId =
|
|
42109
|
+
const regionId = React7.useMemo(() => `himi-disclosure-${++disclosureSeq}`, []);
|
|
41924
42110
|
return /* @__PURE__ */ jsxs4("div", { style: { width: "100%", ...wrap }, children: [
|
|
41925
42111
|
/* @__PURE__ */ jsxs4(
|
|
41926
42112
|
"button",
|
|
@@ -41939,7 +42125,7 @@ var init_controls = __esm({
|
|
|
41939
42125
|
]
|
|
41940
42126
|
}
|
|
41941
42127
|
),
|
|
41942
|
-
/* @__PURE__ */ jsx7("div", { id: regionId, role: "region", hidden: !open, style: open ? { padding: "2px 2px 8px 24px" } : void 0, children: open && (Array.isArray(props.content) ? props.content.map((c2, i2) => /* @__PURE__ */ jsx7(
|
|
42128
|
+
/* @__PURE__ */ jsx7("div", { id: regionId, role: "region", hidden: !open, style: open ? { padding: "2px 2px 8px 24px" } : void 0, children: open && (Array.isArray(props.content) ? props.content.map((c2, i2) => /* @__PURE__ */ jsx7(React7.Fragment, { children: renderChild(c2) }, c2?.id ?? i2)) : renderChild(props.content)) })
|
|
41943
42129
|
] });
|
|
41944
42130
|
};
|
|
41945
42131
|
}
|
|
@@ -42016,10 +42202,10 @@ function sync() {
|
|
|
42016
42202
|
const all = live();
|
|
42017
42203
|
if (!all.length) return;
|
|
42018
42204
|
const levels = /* @__PURE__ */ new Set();
|
|
42019
|
-
for (const
|
|
42020
|
-
const top = topOf(all.filter((l2) => l2.scope ===
|
|
42205
|
+
for (const scope2 of new Set(all.map((l2) => l2.scope))) {
|
|
42206
|
+
const top = topOf(all.filter((l2) => l2.scope === scope2), all);
|
|
42021
42207
|
let node = top.el;
|
|
42022
|
-
while (node !==
|
|
42208
|
+
while (node !== scope2 && node.parentElement) {
|
|
42023
42209
|
const parent = node.parentElement;
|
|
42024
42210
|
levels.add(parent);
|
|
42025
42211
|
for (const sibling of Array.from(parent.children)) {
|
|
@@ -43053,7 +43239,7 @@ var init_rich_text_field = __esm({
|
|
|
43053
43239
|
});
|
|
43054
43240
|
|
|
43055
43241
|
// ../../core/web-renderer/src/richContent.tsx
|
|
43056
|
-
import
|
|
43242
|
+
import React9 from "react";
|
|
43057
43243
|
import { Fragment as Fragment3, jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
43058
43244
|
function richContentFollow(ctx, onLink) {
|
|
43059
43245
|
return (url) => {
|
|
@@ -43158,7 +43344,7 @@ function Block({ b: b2, env, depth }) {
|
|
|
43158
43344
|
minHeight: b2.spans.length ? void 0 : "1.5em"
|
|
43159
43345
|
}, children: /* @__PURE__ */ jsx9(Spans, { spans: b2.spans, env }) });
|
|
43160
43346
|
case "heading":
|
|
43161
|
-
return
|
|
43347
|
+
return React9.createElement(
|
|
43162
43348
|
`h${b2.level}`,
|
|
43163
43349
|
{ ...tid(env, b2.id, b2.kind), style: textStyle(ctx, RICH_CONTENT_HEADING_TOKENS[b2.level - 1], text9) },
|
|
43164
43350
|
/* @__PURE__ */ jsx9(Spans, { spans: b2.spans, env })
|
|
@@ -123974,7 +124160,7 @@ __export(pdfDocument_exports, {
|
|
|
123974
124160
|
PdfDocument: () => PdfDocument,
|
|
123975
124161
|
destroyPdfDocumentLoad: () => destroyPdfDocumentLoad
|
|
123976
124162
|
});
|
|
123977
|
-
import
|
|
124163
|
+
import React10 from "react";
|
|
123978
124164
|
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
123979
124165
|
async function loadPdfDocument(src, ownerDocument) {
|
|
123980
124166
|
const [pdfjs, pdfWorkerAsset] = await Promise.all([
|
|
@@ -123993,18 +124179,18 @@ async function destroyPdfDocumentLoad(loading) {
|
|
|
123993
124179
|
}
|
|
123994
124180
|
}
|
|
123995
124181
|
function PdfDocument({ src, nativeSrc, title, height, startPage, zoomPercent, style, onPageCount, onFallback, loadDocument = loadPdfDocument }) {
|
|
123996
|
-
const [pages2, setPages] =
|
|
123997
|
-
const [failedRequest, setFailedRequest] =
|
|
124182
|
+
const [pages2, setPages] = React10.useState(0);
|
|
124183
|
+
const [failedRequest, setFailedRequest] = React10.useState(null);
|
|
123998
124184
|
const request = JSON.stringify([src, zoomPercent]);
|
|
123999
124185
|
const failed3 = failedRequest === request;
|
|
124000
|
-
const containerRef =
|
|
124001
|
-
const frameRef =
|
|
124002
|
-
const startPageRef =
|
|
124186
|
+
const containerRef = React10.useRef(null);
|
|
124187
|
+
const frameRef = React10.useRef(null);
|
|
124188
|
+
const startPageRef = React10.useRef(startPage);
|
|
124003
124189
|
startPageRef.current = startPage;
|
|
124004
|
-
|
|
124190
|
+
React10.useEffect(() => {
|
|
124005
124191
|
if (failed3) onFallback?.();
|
|
124006
124192
|
}, [failed3, onFallback]);
|
|
124007
|
-
|
|
124193
|
+
React10.useEffect(() => {
|
|
124008
124194
|
const frame2 = frameRef.current;
|
|
124009
124195
|
const page = Math.min(pages2, Math.max(1, Math.floor(startPage ?? 1) || 1));
|
|
124010
124196
|
const canvas = pages2 ? containerRef.current?.querySelector(`[data-pdf-page="${page}"]`) : null;
|
|
@@ -124013,7 +124199,7 @@ function PdfDocument({ src, nativeSrc, title, height, startPage, zoomPercent, st
|
|
|
124013
124199
|
const scale = frame2.offsetHeight > 0 && box.height > 0 ? box.height / frame2.offsetHeight : 1;
|
|
124014
124200
|
frame2.scrollTop += (canvas.getBoundingClientRect().top - box.top) / scale;
|
|
124015
124201
|
}, [startPage, pages2]);
|
|
124016
|
-
|
|
124202
|
+
React10.useEffect(() => {
|
|
124017
124203
|
let live3 = true;
|
|
124018
124204
|
let loading;
|
|
124019
124205
|
const container = containerRef.current;
|
|
@@ -124075,7 +124261,7 @@ var init_pdfDocument = __esm({
|
|
|
124075
124261
|
});
|
|
124076
124262
|
|
|
124077
124263
|
// ../../core/web-renderer/src/renderNode.tsx
|
|
124078
|
-
import
|
|
124264
|
+
import React11 from "react";
|
|
124079
124265
|
import { createPortal } from "react-dom";
|
|
124080
124266
|
import { Fragment as Fragment4, jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
124081
124267
|
function boundTokenName(path2, fallback, ctx) {
|
|
@@ -124167,8 +124353,8 @@ function isNumericLike(s2) {
|
|
|
124167
124353
|
return NUMERIC_TEXT.test(s2.trim());
|
|
124168
124354
|
}
|
|
124169
124355
|
function useValueSwap(value, enabled) {
|
|
124170
|
-
const prev =
|
|
124171
|
-
const gen =
|
|
124356
|
+
const prev = React11.useRef(value);
|
|
124357
|
+
const gen = React11.useRef(0);
|
|
124172
124358
|
if (prev.current !== value) {
|
|
124173
124359
|
if (enabled && prev.current !== void 0 && value !== void 0) gen.current += 1;
|
|
124174
124360
|
prev.current = value;
|
|
@@ -124236,9 +124422,9 @@ function revealOnFocusStyle(C2) {
|
|
|
124236
124422
|
};
|
|
124237
124423
|
}
|
|
124238
124424
|
function FormFieldLabelIdScope({ render, fieldKey, ...extras }) {
|
|
124239
|
-
const id =
|
|
124425
|
+
const id = React11.useId().replace(/[^A-Za-z0-9_-]/g, "");
|
|
124240
124426
|
const el2 = render(`${fieldKey ? `${fieldKey}-` : ""}auto-${id}`);
|
|
124241
|
-
return Object.keys(extras).length ?
|
|
124427
|
+
return Object.keys(extras).length ? React11.cloneElement(el2, extras) : el2;
|
|
124242
124428
|
}
|
|
124243
124429
|
function formFieldA11y(props) {
|
|
124244
124430
|
const labelledBy = props.__labelledBy;
|
|
@@ -124862,9 +125048,9 @@ function sectionSlot(raw) {
|
|
|
124862
125048
|
}
|
|
124863
125049
|
}
|
|
124864
125050
|
function useLoadingTiming(target, graceMs, floorMs) {
|
|
124865
|
-
const [shown2, setShown] =
|
|
124866
|
-
const loadingSince =
|
|
124867
|
-
|
|
125051
|
+
const [shown2, setShown] = React11.useState(() => target === "loading" && graceMs > 0 ? "pending" : target);
|
|
125052
|
+
const loadingSince = React11.useRef(shown2 === "loading" ? Date.now() : null);
|
|
125053
|
+
React11.useEffect(() => {
|
|
124868
125054
|
if (target === shown2) return void 0;
|
|
124869
125055
|
if (target === "loading") {
|
|
124870
125056
|
if (graceMs <= 0) {
|
|
@@ -124903,8 +125089,8 @@ function autoGrowBox(contentHeight, lineHeight, verticalPadding, maxLines) {
|
|
|
124903
125089
|
function PreviewMenuOverlay({ label: label3, dialogRef, preview, ctx, onClose, anchorHost, children }) {
|
|
124904
125090
|
const host = anchorHost?.closest(`[${MODAL_SCOPE_ATTR}]`) ?? (typeof document !== "undefined" ? document.body : null);
|
|
124905
125091
|
const reduce = ctx.reduceMotion();
|
|
124906
|
-
const [shown2, setShown] =
|
|
124907
|
-
|
|
125092
|
+
const [shown2, setShown] = React11.useState(reduce);
|
|
125093
|
+
React11.useEffect(() => {
|
|
124908
125094
|
if (reduce || typeof requestAnimationFrame !== "function") {
|
|
124909
125095
|
setShown(true);
|
|
124910
125096
|
return;
|
|
@@ -124913,7 +125099,7 @@ function PreviewMenuOverlay({ label: label3, dialogRef, preview, ctx, onClose, a
|
|
|
124913
125099
|
return () => cancelAnimationFrame(raf);
|
|
124914
125100
|
}, [reduce]);
|
|
124915
125101
|
const inScope = host != null && host !== host.ownerDocument.body;
|
|
124916
|
-
const previewCtx =
|
|
125102
|
+
const previewCtx = React11.useMemo(() => ctx.onAction ? { ...ctx, onAction: (a2) => {
|
|
124917
125103
|
onClose();
|
|
124918
125104
|
ctx.onAction(a2);
|
|
124919
125105
|
} } : ctx, [ctx, onClose]);
|
|
@@ -124980,7 +125166,7 @@ function youtubeId(item) {
|
|
|
124980
125166
|
}
|
|
124981
125167
|
}
|
|
124982
125168
|
function useResolvedMediaItems(items, ctx) {
|
|
124983
|
-
const paths =
|
|
125169
|
+
const paths = React11.useMemo(() => {
|
|
124984
125170
|
const set = /* @__PURE__ */ new Set();
|
|
124985
125171
|
for (const it2 of items) {
|
|
124986
125172
|
if (!it2 || typeof it2 !== "object") continue;
|
|
@@ -124992,17 +125178,17 @@ function useResolvedMediaItems(items, ctx) {
|
|
|
124992
125178
|
return [...set];
|
|
124993
125179
|
}, [items]);
|
|
124994
125180
|
const key3 = paths.join("\0");
|
|
124995
|
-
const [values, setValues] =
|
|
125181
|
+
const [values, setValues] = React11.useState(() => {
|
|
124996
125182
|
const seed2 = {};
|
|
124997
125183
|
if (ctx.provider) for (const p2 of paths) seed2[p2] = ctx.provider.value(p2);
|
|
124998
125184
|
return seed2;
|
|
124999
125185
|
});
|
|
125000
|
-
|
|
125186
|
+
React11.useEffect(() => {
|
|
125001
125187
|
if (!ctx.provider || paths.length === 0) return;
|
|
125002
125188
|
const unsubs = paths.map((p2) => ctx.provider.subscribe(p2, (v2) => setValues((prev) => prev[p2] === v2 ? prev : { ...prev, [p2]: v2 })));
|
|
125003
125189
|
return () => unsubs.forEach((u2) => u2());
|
|
125004
125190
|
}, [ctx.provider, key3]);
|
|
125005
|
-
return
|
|
125191
|
+
return React11.useMemo(() => items.map((it2) => {
|
|
125006
125192
|
if (!it2 || typeof it2 !== "object") return it2;
|
|
125007
125193
|
let out2 = null;
|
|
125008
125194
|
for (const f2 of MEDIA_ITEM_BINDABLE) {
|
|
@@ -125030,8 +125216,8 @@ function sourceZoomPercent(fragment) {
|
|
|
125030
125216
|
return Number.isFinite(zoom) && zoom > 0 ? zoom : void 0;
|
|
125031
125217
|
}
|
|
125032
125218
|
function cloneWithKids(el2, props, kids3) {
|
|
125033
|
-
if (kids3 === el2.props.children) return
|
|
125034
|
-
return
|
|
125219
|
+
if (kids3 === el2.props.children) return React11.cloneElement(el2, props);
|
|
125220
|
+
return React11.cloneElement(el2, props, ...Array.isArray(kids3) ? kids3 : [kids3]);
|
|
125035
125221
|
}
|
|
125036
125222
|
function editA11yParts(node, edit) {
|
|
125037
125223
|
if (Array.isArray(node)) {
|
|
@@ -125043,7 +125229,7 @@ function editA11yParts(node, edit) {
|
|
|
125043
125229
|
});
|
|
125044
125230
|
return changed ? out2 : node;
|
|
125045
125231
|
}
|
|
125046
|
-
if (!
|
|
125232
|
+
if (!React11.isValidElement(node) || typeof node.type !== "string") return node;
|
|
125047
125233
|
const own5 = node.props;
|
|
125048
125234
|
if (own5["data-component-id"] != null) return node;
|
|
125049
125235
|
const part3 = own5[A11Y_PART];
|
|
@@ -125087,8 +125273,8 @@ function isNativeInteractiveElement(el2) {
|
|
|
125087
125273
|
return typeof el2.type === "string" && (["button", "input", "select", "textarea"].includes(el2.type) || el2.type === "a" && typeof props.href === "string");
|
|
125088
125274
|
}
|
|
125089
125275
|
function hasInteractiveReactDescendant(el2) {
|
|
125090
|
-
return
|
|
125091
|
-
if (!
|
|
125276
|
+
return React11.Children.toArray(el2.props.children).some((child) => {
|
|
125277
|
+
if (!React11.isValidElement(child)) return false;
|
|
125092
125278
|
if (isNativeInteractiveElement(child)) return true;
|
|
125093
125279
|
const props = child.props;
|
|
125094
125280
|
if (typeof child.type === "string" && typeof props.role === "string" && INTERACTIVE_ROLES.has(props.role)) return true;
|
|
@@ -125164,8 +125350,8 @@ function trackActivatorName(activator) {
|
|
|
125164
125350
|
activatorNameObservers.set(activator, observer);
|
|
125165
125351
|
}
|
|
125166
125352
|
function TapActivator({ label: label3, state, tabIndex = 0, role = "button", hint, initialFocus }) {
|
|
125167
|
-
const ref =
|
|
125168
|
-
const hintId = `hm-tap-hint${
|
|
125353
|
+
const ref = React11.useRef(null);
|
|
125354
|
+
const hintId = `hm-tap-hint${React11.useId()}`;
|
|
125169
125355
|
useIsomorphicLayoutEffect(() => {
|
|
125170
125356
|
const el2 = ref.current;
|
|
125171
125357
|
if (!el2 || label3) return;
|
|
@@ -125204,9 +125390,9 @@ function TapActivator({ label: label3, state, tabIndex = 0, role = "button", hin
|
|
|
125204
125390
|
function withExtras(name, render) {
|
|
125205
125391
|
const Wrapped = ({ props, ctx, wrap, nodeId, gap, ...pass }) => {
|
|
125206
125392
|
const el2 = render({ props, ctx, wrap, nodeId, gap, nodeExtras: pass });
|
|
125207
|
-
if (!
|
|
125393
|
+
if (!React11.isValidElement(el2)) return /* @__PURE__ */ jsx11(Fragment4, { children: el2 });
|
|
125208
125394
|
if (el2.props[NODE_EXTRAS_TARGET] === "bottom-drawer-panel") {
|
|
125209
|
-
return
|
|
125395
|
+
return React11.cloneElement(el2, { [NODE_EXTRAS_TARGET]: void 0 });
|
|
125210
125396
|
}
|
|
125211
125397
|
const additive = addIntrinsicPadding(el2.props.style, wrap ?? {});
|
|
125212
125398
|
const inferredDecorative = el2.props[INFERRED_DECORATIVE] === true;
|
|
@@ -125226,7 +125412,7 @@ function withExtras(name, render) {
|
|
|
125226
125412
|
}, hasA11yParts ? editA11yParts(kids3, a11yPartEdit({}, false, () => {
|
|
125227
125413
|
})) : kids3));
|
|
125228
125414
|
}
|
|
125229
|
-
return withCircleClipBorder(additive ?
|
|
125415
|
+
return withCircleClipBorder(additive ? React11.cloneElement(el2, { style: additive }) : el2);
|
|
125230
125416
|
}
|
|
125231
125417
|
const prev = el2.props;
|
|
125232
125418
|
const next = { ...pass };
|
|
@@ -125327,7 +125513,7 @@ function withExtras(name, render) {
|
|
|
125327
125513
|
}
|
|
125328
125514
|
return withCircleClipBorder(cloneWithKids(el2, next, kids3));
|
|
125329
125515
|
}
|
|
125330
|
-
return withCircleClipBorder(
|
|
125516
|
+
return withCircleClipBorder(React11.cloneElement(el2, next));
|
|
125331
125517
|
};
|
|
125332
125518
|
Wrapped.displayName = name;
|
|
125333
125519
|
return Wrapped;
|
|
@@ -125435,7 +125621,7 @@ function overlayEdgeStyle(edge, gap) {
|
|
|
125435
125621
|
}
|
|
125436
125622
|
function useFlippedEdge(edge, open, bubbleRef, anchorRef, gap = TOOLTIP_GAP) {
|
|
125437
125623
|
const initial = { edge, x: 0, y: 0, maxWidth: Infinity };
|
|
125438
|
-
const [placed, setPlaced] =
|
|
125624
|
+
const [placed, setPlaced] = React11.useState(initial);
|
|
125439
125625
|
useIsomorphicLayoutEffect(() => {
|
|
125440
125626
|
if (!open) {
|
|
125441
125627
|
setPlaced((previous) => previous.edge === edge && previous.x === 0 && previous.y === 0 && previous.maxWidth === Infinity ? previous : initial);
|
|
@@ -125984,10 +126170,10 @@ function calKeyActivate(enabled, activate) {
|
|
|
125984
126170
|
function focusRootOf(el2) {
|
|
125985
126171
|
return el2.closest(`[${MODAL_SCOPE_ATTR}]`) ?? el2.ownerDocument.body;
|
|
125986
126172
|
}
|
|
125987
|
-
function focusBelongsTo(active,
|
|
126173
|
+
function focusBelongsTo(active, scope2) {
|
|
125988
126174
|
if (active == null || active === active.ownerDocument.body) return true;
|
|
125989
126175
|
const from = focusRootOf(active);
|
|
125990
|
-
return from === focusRootOf(
|
|
126176
|
+
return from === focusRootOf(scope2) || from === active.ownerDocument.body;
|
|
125991
126177
|
}
|
|
125992
126178
|
function focusRootState(root) {
|
|
125993
126179
|
let state = focusRoots.get(root);
|
|
@@ -125997,13 +126183,13 @@ function focusRootState(root) {
|
|
|
125997
126183
|
}
|
|
125998
126184
|
return state;
|
|
125999
126185
|
}
|
|
126000
|
-
function restoreFocusOnDismiss(
|
|
126001
|
-
const doc =
|
|
126186
|
+
function restoreFocusOnDismiss(scope2, opener) {
|
|
126187
|
+
const doc = scope2.ownerDocument;
|
|
126002
126188
|
const Observer = doc.defaultView?.MutationObserver;
|
|
126003
126189
|
if (!Observer) return;
|
|
126004
|
-
const root = focusRootOf(
|
|
126190
|
+
const root = focusRootOf(scope2);
|
|
126005
126191
|
const state = focusRootState(root);
|
|
126006
|
-
state.openers.set(
|
|
126192
|
+
state.openers.set(scope2, opener);
|
|
126007
126193
|
if (state.observer) return;
|
|
126008
126194
|
const observer = new Observer(() => {
|
|
126009
126195
|
for (const [s2, o2] of state.openers) {
|
|
@@ -126032,11 +126218,11 @@ function ensureInitialFocusRuntime() {
|
|
|
126032
126218
|
let presented;
|
|
126033
126219
|
let presentedScope = null;
|
|
126034
126220
|
for (const t2 of fresh) {
|
|
126035
|
-
const
|
|
126036
|
-
if (!
|
|
126037
|
-
if (!unplaced && !focusBelongsTo(active,
|
|
126221
|
+
const scope2 = t2.closest(PRESENTED_SCOPE);
|
|
126222
|
+
if (!scope2 || active && scope2.contains(active)) continue;
|
|
126223
|
+
if (!unplaced && !focusBelongsTo(active, scope2)) continue;
|
|
126038
126224
|
presented = t2;
|
|
126039
|
-
presentedScope =
|
|
126225
|
+
presentedScope = scope2;
|
|
126040
126226
|
}
|
|
126041
126227
|
for (const t2 of fresh) focusRootState(focusRootOf(t2)).seen.add(t2);
|
|
126042
126228
|
const el2 = presented ?? (unplaced ? fresh[0] : void 0);
|
|
@@ -126051,13 +126237,13 @@ function ensureInitialFocusRuntime() {
|
|
|
126051
126237
|
}
|
|
126052
126238
|
function enterAuthoredOrderOnTab(target) {
|
|
126053
126239
|
const doc = target.ownerDocument;
|
|
126054
|
-
const
|
|
126240
|
+
const scope2 = target.closest(PRESENTED_SCOPE);
|
|
126055
126241
|
const renderRoot = focusRootOf(target);
|
|
126056
|
-
const root =
|
|
126242
|
+
const root = scope2 ?? renderRoot;
|
|
126057
126243
|
const onKeyDown = (e2) => {
|
|
126058
126244
|
if (e2.key !== "Tab" || e2.shiftKey || e2.altKey || e2.ctrlKey || e2.metaKey || e2.defaultPrevented || e2.target !== target) return;
|
|
126059
126245
|
if (target.tabIndex > 0) return;
|
|
126060
|
-
const ordered = Array.from(root.querySelectorAll("[tabindex]")).filter((c2) => c2.tabIndex > 0 && c2.closest(PRESENTED_SCOPE) ===
|
|
126246
|
+
const ordered = Array.from(root.querySelectorAll("[tabindex]")).filter((c2) => c2.tabIndex > 0 && c2.closest(PRESENTED_SCOPE) === scope2 && focusRootOf(c2) === renderRoot).sort((a2, b2) => a2.tabIndex - b2.tabIndex);
|
|
126061
126247
|
for (const c2 of ordered) {
|
|
126062
126248
|
c2.focus();
|
|
126063
126249
|
if (doc.activeElement === c2) {
|
|
@@ -126207,7 +126393,7 @@ function renderNodeInner(node, ctx) {
|
|
|
126207
126393
|
}
|
|
126208
126394
|
}
|
|
126209
126395
|
const el2 = renderInner(node, ctx);
|
|
126210
|
-
if (!
|
|
126396
|
+
if (!React11.isValidElement(el2)) return el2;
|
|
126211
126397
|
const extra = {};
|
|
126212
126398
|
const componentId = resolvedComponentId(node?.id, ctx);
|
|
126213
126399
|
if (componentId) {
|
|
@@ -126381,8 +126567,8 @@ function renderNodeInner(node, ctx) {
|
|
|
126381
126567
|
const finalStyle = extra.style ?? el2.props.style;
|
|
126382
126568
|
if (!finalStyle?.position) extra.style = { ...finalStyle ?? {}, position: "relative" };
|
|
126383
126569
|
}
|
|
126384
|
-
let out2 = tapActivator ?
|
|
126385
|
-
if (
|
|
126570
|
+
let out2 = tapActivator ? React11.cloneElement(el2, extra, tapActivator, el2.props.children) : Object.keys(extra).length ? React11.cloneElement(el2, extra) : el2;
|
|
126571
|
+
if (React11.isValidElement(out2)) out2 = withCircleClipBorder(out2);
|
|
126386
126572
|
if (a11yHint && !tapActivator) {
|
|
126387
126573
|
out2 = /* @__PURE__ */ jsx11(A11yHintDescription, { hint: a11yHint, idBase: componentId, children: out2 });
|
|
126388
126574
|
}
|
|
@@ -126599,10 +126785,10 @@ function renderInner(node, ctx) {
|
|
|
126599
126785
|
template: items[0],
|
|
126600
126786
|
renderRow: (t2, ic) => {
|
|
126601
126787
|
let row = renderNode(t2, asItem(ic));
|
|
126602
|
-
if (boundStagger > 0 &&
|
|
126788
|
+
if (boundStagger > 0 && React11.isValidElement(row)) {
|
|
126603
126789
|
const i2 = Number(ic.itemScope?.__index ?? 0);
|
|
126604
126790
|
const prev = row.props.style ?? {};
|
|
126605
|
-
row =
|
|
126791
|
+
row = React11.cloneElement(row, { style: { ...prev, animationDelay: `${i2 * boundStagger}ms` } });
|
|
126606
126792
|
}
|
|
126607
126793
|
if (boundSwipe && ctx.onAction && !props.horizontal) {
|
|
126608
126794
|
const leading = resolveSwipeActions(boundSwipe.leading, ic);
|
|
@@ -126662,7 +126848,7 @@ function renderInner(node, ctx) {
|
|
|
126662
126848
|
if (swipe && ctx.onAction && !props.horizontal) {
|
|
126663
126849
|
const leading = swipe.leading ?? [];
|
|
126664
126850
|
const trailing = swipe.trailing ?? [];
|
|
126665
|
-
const arr2 =
|
|
126851
|
+
const arr2 = React11.Children.toArray(rendered);
|
|
126666
126852
|
body = arr2.map((child, i2) => /* @__PURE__ */ jsx11(
|
|
126667
126853
|
SwipeRow,
|
|
126668
126854
|
{
|
|
@@ -127122,14 +127308,8 @@ function renderInner(node, ctx) {
|
|
|
127122
127308
|
// ───────────── feedback ─────────────
|
|
127123
127309
|
case "Banner":
|
|
127124
127310
|
return /* @__PURE__ */ jsx11(BannerNode, { props, ctx, wrap });
|
|
127125
|
-
case "Snackbar":
|
|
127126
|
-
|
|
127127
|
-
return /* @__PURE__ */ jsxs8("div", { style: { display: "flex", alignItems: "center", gap: 10, background: "#1c1f26", color: "#fff", borderRadius: ctx.radius("md", 10), padding: "12px 14px", width: "100%", boxSizing: "border-box", fontFamily: bodyFont(ctx), fontWeight: 500, fontSize: pxToRem(14), ...wrap }, children: [
|
|
127128
|
-
/* @__PURE__ */ jsx11("span", { style: { width: 18, height: 18, borderRadius: "50%", background: dot, display: "grid", placeItems: "center", fontSize: 11, flex: "none" }, children: "\u2713" }),
|
|
127129
|
-
/* @__PURE__ */ jsx11("span", { style: { flex: 1, minWidth: 0 }, children: txt(props.message, ctx) }),
|
|
127130
|
-
actionTextButton(ctx, props.action, asBoundText(props.actionLabel, ctx) || "Take action", "#fff", { flex: "none", textDecoration: "underline" })
|
|
127131
|
-
] });
|
|
127132
|
-
}
|
|
127311
|
+
case "Snackbar":
|
|
127312
|
+
return /* @__PURE__ */ jsx11(SnackbarNode, { props, ctx, wrap });
|
|
127133
127313
|
// RFC 0058 §4 — an INLINE card, drawn where the descriptor puts it, as iOS (`AlertDialogPreview`)
|
|
127134
127314
|
// and Android (`SDUIAlertDialogPreview`) draw it. It is not presented over the screen, so a
|
|
127135
127315
|
// screen that shows one inline (a cart's high-value confirm, a component gallery) keeps the rest
|
|
@@ -127171,7 +127351,7 @@ function reportUnknownComponent(ctx, pkg, type) {
|
|
|
127171
127351
|
function unknownComponentShowsDeveloperLabel(ctx) {
|
|
127172
127352
|
return ctx.debugUnknownComponents ?? ctx.previewSurface != null;
|
|
127173
127353
|
}
|
|
127174
|
-
var loadPdfFetch, useIsomorphicLayoutEffect, ResponsiveGrid, SPLIT_EXPANDED_MIN_WIDTH, SPLIT_COLUMN_GAP, ResponsiveSplitView, ABSOLUTE_URL_RE, appearKeyframesInjected, valueSwapKeyframesInjected, NUMERIC_TEXT, shimmerKeyframesInjected, pressStylesInjected, REVEAL_ON_FOCUS_ATTR, FOCUS_RING_CSS, focusStylesInjected, HLIST_CHILD_CSS, hListStylesInjected, listAnimateRuntimeInstalled, transitionKeyframesInjected, countUpRuntimeInjected, MEASURE_PREFIX, measureRuntimeInjected, revealRuntimeInjected, AMBIENT_HOST_STYLE, AmbientMotionBox, vectorAnimStylesInjected, scrollProgressRuntimeInjected, confettiRuntimeInjected, lottieRuntimeInjected, riveRuntimeInjected, gradientKeyframesInjected, parallaxRuntimeInjected, spinKeyframesInjected, marqueeKeyframesInjected, alignItems, zJustifyItems, hAlignItems, bodyFont, kids2, rowKidCtx, rowKids, staggeredKids, asTextL10n, asFinalTextL10n, asBoundText, useBoundString, InterpolatedTextView, txt, selectFragmentCase, fragmentValueHash, fragmentSlotContent, FragmentSlotNode, RichContentEditorNode, MediaFieldNode, WorkerSubtreeNode, RichContentNode, resolveItemDeep2, resolveRowAction2, resolveSwipeActions, resolveModBindings, resolvedComponentId, directServiceBindings, withRootStyle, ReactiveDirectScalars, HiddenGate, ExitPresence, StatefulSectionNode, KEYBOARD_INPUT_MODES, AUTOCAPITALIZE_VALUES, ENTER_KEY_HINTS, AUTOGROW_CEILING, EditableField, MENU_LONG_PRESS_MS, MenuNode, LoadMoreSentinel, FieldErrorNode, FormView, MediaSlotProvider, MEDIA_ITEM_BINDABLE, MediaPlayerView, VideoNode, PdfDocumentCanvas, PdfViewNode, WebViewNode, InteractivePicker, InteractiveDatePicker, InteractiveSearchField, InteractiveStepper, NODE_EXTRAS_TARGET, SYNTHETIC_TAP_ROLE, SYNTHETIC_TABINDEX, INFERRED_DECORATIVE, SELF_RENDERED_LEAF, ROLE_WHEN_NAMED, AUTHORED_ROLE, PENDING_RANGE, RANGE_ROLES, NODE_A11Y_ATTRS, INTERACTIVE_ROLES, ALWAYS_INTERACTIVE_COMPONENT_TYPES, TAP_ACTIVATOR_ATTR, TAP_GROUP_ATTR, NESTED_CONTROL_SELECTOR, VISUALLY_HIDDEN, NAME_SKIP_SELECTOR, activatorNameObservers, ACTIVATOR_STATE_ATTRS, controlNode, ToggleNode, SliderNode, SelectionControlNode, TabsNode, SegmentedControlNode, DisclosureGroupNode, GridNode, SplitViewNode, REVEAL_RELEASE_MS, REVEAL_FADE_MS, REVEAL_BUFFER, revealProgress, countWords, RevealText, TextNode, ImageNode, ANIMATION_LEAF, LottieNode, RiveNode, AvatarNode, IconNode, EMPTY_STATE_SPACING, EmptyStateNode, ButtonNode, OtpInputNode, ProgressBarNode, ACTIVITY_DEFAULT_NAME, ActivityIndicatorNode, NATIVELY_TABBABLE, BottomSheetNode, BOTTOM_DRAWER_HOST_STACK_EVENT, ModalBottomSheetNode, BottomDrawerNode, PRESENTED_OVERLAY_ATTR, TooltipNode, PopoverNode, ChipsInputNode, ChipNode, TableNode, GaugeRing, GaugeNode, RATING_METRICS, ratingMetrics, RatingNode, AvatarStripNode, CHART_STROKE_CYCLE, chartStrokeAt, chartBarCenter, ChartNode, donutSliceOpacity, DonutChartNode, ShapeNode, LegendMarker, LegendNode, cellAlign, DataTableNode, voiceNoteState, voiceNoteDelivery, VOICE_NOTE_DEFAULT_BARS, clampBarCount, VoiceNoteNode, TimelineNode, PagingNode, WheelPickerNode, ColorPickerNode, FilterChipsNode, TILE_PX, MAX_MERCATOR_LAT, DEFAULT_TILE_MAX_ZOOM, CIRCLE_SEGMENTS, METRES_PER_DEG_LAT, MARKER_HIT_RADIUS, SHAPE_HIT_RADIUS, MapNode, CAROUSEL_SETTLE_MS, scrollCarouselTo, CarouselNode, BannerNode, CollapsingHeaderNode, UnsupportedOnSurface, CALENDAR_DATE_ONLY_RE, CAL_DEFAULT_MAX_DOTS, CAL_AGENDA_INITIAL_DAYS, CAL_AGENDA_PAGE_DAYS, CAL_DEFAULT_SNAP_MINUTES, CAL_UNASSIGNED_LANE_ID, MonthCalendarNode, TimeGridNode, AgendaNode, ARIA_ROLE, initialFocusScheduled, PRESENTED_SCOPE, focusRoots, A11yHintDescription, reportedUnknownComponents, UnknownComponentNode, WebRenderer;
|
|
127354
|
+
var loadPdfFetch, useIsomorphicLayoutEffect, ResponsiveGrid, SPLIT_EXPANDED_MIN_WIDTH, SPLIT_COLUMN_GAP, ResponsiveSplitView, ABSOLUTE_URL_RE, appearKeyframesInjected, valueSwapKeyframesInjected, NUMERIC_TEXT, shimmerKeyframesInjected, pressStylesInjected, REVEAL_ON_FOCUS_ATTR, FOCUS_RING_CSS, focusStylesInjected, HLIST_CHILD_CSS, hListStylesInjected, listAnimateRuntimeInstalled, transitionKeyframesInjected, countUpRuntimeInjected, MEASURE_PREFIX, measureRuntimeInjected, revealRuntimeInjected, AMBIENT_HOST_STYLE, AmbientMotionBox, vectorAnimStylesInjected, scrollProgressRuntimeInjected, confettiRuntimeInjected, lottieRuntimeInjected, riveRuntimeInjected, gradientKeyframesInjected, parallaxRuntimeInjected, spinKeyframesInjected, marqueeKeyframesInjected, alignItems, zJustifyItems, hAlignItems, bodyFont, kids2, rowKidCtx, rowKids, staggeredKids, asTextL10n, asFinalTextL10n, asBoundText, useBoundString, InterpolatedTextView, txt, selectFragmentCase, fragmentValueHash, fragmentSlotContent, FragmentSlotNode, RichContentEditorNode, MediaFieldNode, WorkerSubtreeNode, RichContentNode, resolveItemDeep2, resolveRowAction2, resolveSwipeActions, resolveModBindings, resolvedComponentId, directServiceBindings, withRootStyle, ReactiveDirectScalars, HiddenGate, ExitPresence, StatefulSectionNode, KEYBOARD_INPUT_MODES, AUTOCAPITALIZE_VALUES, ENTER_KEY_HINTS, AUTOGROW_CEILING, EditableField, MENU_LONG_PRESS_MS, MenuNode, LoadMoreSentinel, FieldErrorNode, FormView, MediaSlotProvider, MEDIA_ITEM_BINDABLE, MediaPlayerView, VideoNode, PdfDocumentCanvas, PdfViewNode, WebViewNode, InteractivePicker, InteractiveDatePicker, InteractiveSearchField, InteractiveStepper, NODE_EXTRAS_TARGET, SYNTHETIC_TAP_ROLE, SYNTHETIC_TABINDEX, INFERRED_DECORATIVE, SELF_RENDERED_LEAF, ROLE_WHEN_NAMED, AUTHORED_ROLE, PENDING_RANGE, RANGE_ROLES, NODE_A11Y_ATTRS, INTERACTIVE_ROLES, ALWAYS_INTERACTIVE_COMPONENT_TYPES, TAP_ACTIVATOR_ATTR, TAP_GROUP_ATTR, NESTED_CONTROL_SELECTOR, VISUALLY_HIDDEN, NAME_SKIP_SELECTOR, activatorNameObservers, ACTIVATOR_STATE_ATTRS, controlNode, ToggleNode, SliderNode, SelectionControlNode, TabsNode, SegmentedControlNode, DisclosureGroupNode, GridNode, SplitViewNode, REVEAL_RELEASE_MS, REVEAL_FADE_MS, REVEAL_BUFFER, revealProgress, countWords, RevealText, TextNode, ImageNode, ANIMATION_LEAF, LottieNode, RiveNode, AvatarNode, IconNode, EMPTY_STATE_SPACING, EmptyStateNode, ButtonNode, OtpInputNode, ProgressBarNode, SnackbarNode, ACTIVITY_DEFAULT_NAME, ACTIVITY_RING_ARC, ActivityIndicatorNode, NATIVELY_TABBABLE, BottomSheetNode, BOTTOM_DRAWER_HOST_STACK_EVENT, ModalBottomSheetNode, BottomDrawerNode, PRESENTED_OVERLAY_ATTR, TooltipNode, PopoverNode, ChipsInputNode, ChipNode, TableNode, GaugeRing, GaugeNode, RATING_METRICS, ratingMetrics, RatingNode, AvatarStripNode, CHART_STROKE_CYCLE, chartStrokeAt, chartBarCenter, ChartNode, donutSliceOpacity, DonutChartNode, ShapeNode, LegendMarker, LegendNode, cellAlign, DataTableNode, voiceNoteState, voiceNoteDelivery, VOICE_NOTE_DEFAULT_BARS, clampBarCount, VoiceNoteNode, TimelineNode, PagingNode, WheelPickerNode, ColorPickerNode, FilterChipsNode, TILE_PX, MAX_MERCATOR_LAT, DEFAULT_TILE_MAX_ZOOM, CIRCLE_SEGMENTS, METRES_PER_DEG_LAT, MARKER_HIT_RADIUS, SHAPE_HIT_RADIUS, MapNode, CAROUSEL_SETTLE_MS, scrollCarouselTo, CarouselNode, BannerNode, CollapsingHeaderNode, UnsupportedOnSurface, CALENDAR_DATE_ONLY_RE, CAL_DEFAULT_MAX_DOTS, CAL_AGENDA_INITIAL_DAYS, CAL_AGENDA_PAGE_DAYS, CAL_DEFAULT_SNAP_MINUTES, CAL_UNASSIGNED_LANE_ID, MonthCalendarNode, TimeGridNode, AgendaNode, ARIA_ROLE, initialFocusScheduled, PRESENTED_SCOPE, focusRoots, A11yHintDescription, reportedUnknownComponents, UnknownComponentNode, WebRenderer;
|
|
127175
127355
|
var init_renderNode = __esm({
|
|
127176
127356
|
"../../core/web-renderer/src/renderNode.tsx"() {
|
|
127177
127357
|
"use strict";
|
|
@@ -127183,6 +127363,7 @@ var init_renderNode = __esm({
|
|
|
127183
127363
|
init_shape();
|
|
127184
127364
|
init_helpers();
|
|
127185
127365
|
init_bindings2();
|
|
127366
|
+
init_snackbarTiming();
|
|
127186
127367
|
init_bindings();
|
|
127187
127368
|
init_tokens();
|
|
127188
127369
|
init_message_format();
|
|
@@ -127215,11 +127396,11 @@ var init_renderNode = __esm({
|
|
|
127215
127396
|
init_rich_text_field();
|
|
127216
127397
|
init_richContent();
|
|
127217
127398
|
loadPdfFetch = () => Promise.resolve().then(() => (init_pdfFetch(), pdfFetch_exports));
|
|
127218
|
-
useIsomorphicLayoutEffect = typeof globalThis.document === "undefined" ?
|
|
127399
|
+
useIsomorphicLayoutEffect = typeof globalThis.document === "undefined" ? React11.useEffect : React11.useLayoutEffect;
|
|
127219
127400
|
ResponsiveGrid = ({ base, medium, expanded, initialCols, seedWidth, spacing, extra, children }) => {
|
|
127220
|
-
const ref =
|
|
127221
|
-
const [cols, setCols] =
|
|
127222
|
-
|
|
127401
|
+
const ref = React11.useRef(null);
|
|
127402
|
+
const [cols, setCols] = React11.useState(initialCols);
|
|
127403
|
+
React11.useEffect(() => {
|
|
127223
127404
|
const el2 = ref.current;
|
|
127224
127405
|
if (!el2) return;
|
|
127225
127406
|
const measure2 = () => {
|
|
@@ -127246,9 +127427,9 @@ var init_renderNode = __esm({
|
|
|
127246
127427
|
SPLIT_EXPANDED_MIN_WIDTH = 840;
|
|
127247
127428
|
SPLIT_COLUMN_GAP = 16;
|
|
127248
127429
|
ResponsiveSplitView = ({ primary, detail, primaryMaxWidth, initialWide, seedWidth, extra }) => {
|
|
127249
|
-
const ref =
|
|
127250
|
-
const [wide, setWide] =
|
|
127251
|
-
|
|
127430
|
+
const ref = React11.useRef(null);
|
|
127431
|
+
const [wide, setWide] = React11.useState(initialWide);
|
|
127432
|
+
React11.useEffect(() => {
|
|
127252
127433
|
const el2 = ref.current;
|
|
127253
127434
|
if (!el2) return;
|
|
127254
127435
|
const measure2 = () => {
|
|
@@ -127294,9 +127475,9 @@ var init_renderNode = __esm({
|
|
|
127294
127475
|
revealRuntimeInjected = false;
|
|
127295
127476
|
AMBIENT_HOST_STYLE = { display: "contents" };
|
|
127296
127477
|
AmbientMotionBox = ({ spec, kind, children }) => {
|
|
127297
|
-
const ref =
|
|
127478
|
+
const ref = React11.useRef(null);
|
|
127298
127479
|
const { minGapMs, maxGapMs } = spec;
|
|
127299
|
-
|
|
127480
|
+
React11.useEffect(() => {
|
|
127300
127481
|
const el2 = ref.current?.firstElementChild;
|
|
127301
127482
|
if (!el2 || typeof el2.animate !== "function") return;
|
|
127302
127483
|
let timer;
|
|
@@ -127378,14 +127559,14 @@ var init_renderNode = __esm({
|
|
|
127378
127559
|
}
|
|
127379
127560
|
};
|
|
127380
127561
|
bodyFont = (ctx) => fontStack(ctx.font("body").family, ctx.idiom);
|
|
127381
|
-
kids2 = (arr2, ctx) => Array.isArray(arr2) ? arr2.map((n2, i2) => /* @__PURE__ */ jsx11(
|
|
127562
|
+
kids2 = (arr2, ctx) => Array.isArray(arr2) ? arr2.map((n2, i2) => /* @__PURE__ */ jsx11(React11.Fragment, { children: renderNode(n2, ctx) }, n2?.id ?? i2)) : null;
|
|
127382
127563
|
rowKidCtx = (n2, ctx) => wantsRowStretch(n2) ? { ...ctx, rowStretch: true } : normalize(n2).type === "Divider" ? { ...ctx, rowDivider: true } : ctx;
|
|
127383
|
-
rowKids = (arr2, ctx) => Array.isArray(arr2) ? arr2.map((n2, i2) => /* @__PURE__ */ jsx11(
|
|
127564
|
+
rowKids = (arr2, ctx) => Array.isArray(arr2) ? arr2.map((n2, i2) => /* @__PURE__ */ jsx11(React11.Fragment, { children: renderNode(n2, rowKidCtx(n2, ctx)) }, n2?.id ?? i2)) : null;
|
|
127384
127565
|
staggeredKids = (arr2, ctx, staggerMs) => Array.isArray(arr2) ? arr2.map((n2, i2) => {
|
|
127385
127566
|
const el2 = renderNode(n2, ctx);
|
|
127386
|
-
if (!
|
|
127567
|
+
if (!React11.isValidElement(el2)) return /* @__PURE__ */ jsx11(React11.Fragment, { children: el2 }, n2?.id ?? i2);
|
|
127387
127568
|
const prev = el2.props.style ?? {};
|
|
127388
|
-
return
|
|
127569
|
+
return React11.cloneElement(el2, { key: n2?.id ?? i2, style: { ...prev, animationDelay: `${i2 * staggerMs}ms` } });
|
|
127389
127570
|
}) : null;
|
|
127390
127571
|
asTextL10n = (v2, ctx) => typeof v2 === "string" && v2.startsWith(TRANSLATION_PREFIX) ? asText2(resolveTranslation(v2, ctx.catalog)) : asText2(v2);
|
|
127391
127572
|
asFinalTextL10n = (v2, ctx) => typeof v2 === "string" ? v2.startsWith(TRANSLATION_PREFIX) ? asText2(resolveTranslation(v2, ctx.catalog)) : v2 : asText2(v2);
|
|
@@ -127398,13 +127579,13 @@ var init_renderNode = __esm({
|
|
|
127398
127579
|
const bound = Object.entries(params).filter(
|
|
127399
127580
|
([, v2]) => typeof v2 === "string" && v2.startsWith("$service:")
|
|
127400
127581
|
);
|
|
127401
|
-
const [live3, setLive] =
|
|
127582
|
+
const [live3, setLive] = React11.useState(() => {
|
|
127402
127583
|
const seed2 = {};
|
|
127403
127584
|
if (ctx.provider) for (const [k2, p2] of bound) seed2[k2] = ctx.provider.value(servicePath(p2));
|
|
127404
127585
|
return seed2;
|
|
127405
127586
|
});
|
|
127406
127587
|
const subKey = bound.map(([k2, p2]) => `${k2}=${p2}`).join("|");
|
|
127407
|
-
|
|
127588
|
+
React11.useEffect(() => {
|
|
127408
127589
|
const provider = ctx.provider;
|
|
127409
127590
|
if (!provider) return;
|
|
127410
127591
|
const unsubs = bound.map(
|
|
@@ -127446,11 +127627,11 @@ var init_renderNode = __esm({
|
|
|
127446
127627
|
fragmentSlotContent = ({ props, ctx, discriminator, slotId, extra }) => {
|
|
127447
127628
|
const selected = selectFragmentCase(props, discriminator);
|
|
127448
127629
|
const selectedId = typeof selected?.id === "string" ? selected.id : "";
|
|
127449
|
-
const previousId =
|
|
127450
|
-
const reportedUnknown =
|
|
127451
|
-
const reportedInvalid =
|
|
127452
|
-
const [announcement, setAnnouncement] =
|
|
127453
|
-
|
|
127630
|
+
const previousId = React11.useRef(selectedId);
|
|
127631
|
+
const reportedUnknown = React11.useRef(/* @__PURE__ */ new Set());
|
|
127632
|
+
const reportedInvalid = React11.useRef(/* @__PURE__ */ new Set());
|
|
127633
|
+
const [announcement, setAnnouncement] = React11.useState("");
|
|
127634
|
+
React11.useEffect(() => {
|
|
127454
127635
|
if (typeof discriminator === "string") {
|
|
127455
127636
|
if (discriminator && !props.cases?.some((candidate) => candidate.id === discriminator) && !reportedUnknown.current.has(discriminator)) {
|
|
127456
127637
|
reportedUnknown.current.add(discriminator);
|
|
@@ -127464,7 +127645,7 @@ var init_renderNode = __esm({
|
|
|
127464
127645
|
}
|
|
127465
127646
|
}
|
|
127466
127647
|
}, [ctx, discriminator, props.cases, slotId]);
|
|
127467
|
-
|
|
127648
|
+
React11.useEffect(() => {
|
|
127468
127649
|
if (previousId.current !== selectedId) {
|
|
127469
127650
|
const next = selected?.accessibilityAnnouncement ?? selected?.accessibility_announcement;
|
|
127470
127651
|
setAnnouncement(typeof next === "string" ? next : "");
|
|
@@ -127478,7 +127659,7 @@ var init_renderNode = __esm({
|
|
|
127478
127659
|
// and the right edge clips (branded-lite's home is a FragmentSlot → 32px cut in
|
|
127479
127660
|
// the phone preview). Included before ...extra so a modifier can still override.
|
|
127480
127661
|
/* @__PURE__ */ jsxs8("div", { "data-fragment-slot": slotId ?? "", "data-fragment-case": selectedId, style: { width: "100%", boxSizing: "border-box", ...extra }, children: [
|
|
127481
|
-
selected?.content ? /* @__PURE__ */ jsx11(
|
|
127662
|
+
selected?.content ? /* @__PURE__ */ jsx11(React11.Fragment, { children: renderNode(selected.content, ctx) }, selectedId) : null,
|
|
127482
127663
|
/* @__PURE__ */ jsx11("span", { "aria-live": "polite", style: { position: "absolute", width: 1, height: 1, padding: 0, margin: -1, overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", border: 0 }, children: announcement })
|
|
127483
127664
|
] })
|
|
127484
127665
|
);
|
|
@@ -127499,11 +127680,11 @@ var init_renderNode = __esm({
|
|
|
127499
127680
|
const fallbackPathStr = mediaFieldServicePath(props.fallbackTextPath);
|
|
127500
127681
|
const fallbackBound = useBoundValue(ctx, fallbackPathStr ? String(props.fallbackTextPath) : "");
|
|
127501
127682
|
const fallbackText = typeof fallbackBound === "string" ? fallbackBound : "";
|
|
127502
|
-
const [uploading, setUploading] =
|
|
127503
|
-
const [failed3, setFailed] =
|
|
127504
|
-
const fileRef =
|
|
127505
|
-
const previewRef =
|
|
127506
|
-
const [localPreview, setLocalPreview] =
|
|
127683
|
+
const [uploading, setUploading] = React11.useState(false);
|
|
127684
|
+
const [failed3, setFailed] = React11.useState(false);
|
|
127685
|
+
const fileRef = React11.useRef(null);
|
|
127686
|
+
const previewRef = React11.useRef(null);
|
|
127687
|
+
const [localPreview, setLocalPreview] = React11.useState("");
|
|
127507
127688
|
const uploadService = typeof props.uploadService === "string" ? props.uploadService : "";
|
|
127508
127689
|
const resolvedLabel = asText2(resolveScalarStatic(props.label, ctx));
|
|
127509
127690
|
const name = mediaFieldName(resolvedLabel);
|
|
@@ -127548,7 +127729,7 @@ var init_renderNode = __esm({
|
|
|
127548
127729
|
setUploading(false);
|
|
127549
127730
|
}
|
|
127550
127731
|
};
|
|
127551
|
-
|
|
127732
|
+
React11.useEffect(() => () => {
|
|
127552
127733
|
const previewUrl = previewRef.current;
|
|
127553
127734
|
if (previewUrl && typeof URL.revokeObjectURL === "function") URL.revokeObjectURL(previewUrl);
|
|
127554
127735
|
previewRef.current = null;
|
|
@@ -127620,7 +127801,7 @@ var init_renderNode = __esm({
|
|
|
127620
127801
|
const value = useBoundValue(ctx, typeof path2 === "string" ? path2 : "");
|
|
127621
127802
|
const policy = props.policy;
|
|
127622
127803
|
const catalog3 = ctx.provider && typeof ctx.provider.listActions === "function" ? ctx.provider : null;
|
|
127623
|
-
const validation =
|
|
127804
|
+
const validation = React11.useMemo(() => {
|
|
127624
127805
|
if (value === void 0 || value === null) return { ok: false, reason: "unresolved" };
|
|
127625
127806
|
if (typeof value !== "string") return { ok: false, reason: "value_type" };
|
|
127626
127807
|
if (!policy || typeof policy !== "object") return { ok: false, reason: "typed_decode" };
|
|
@@ -127630,8 +127811,8 @@ var init_renderNode = __esm({
|
|
|
127630
127811
|
return { ok: false, reason: "typed_decode" };
|
|
127631
127812
|
}
|
|
127632
127813
|
}, [catalog3, policy, slotId, value]);
|
|
127633
|
-
const reported =
|
|
127634
|
-
|
|
127814
|
+
const reported = React11.useRef(/* @__PURE__ */ new Set());
|
|
127815
|
+
React11.useEffect(() => {
|
|
127635
127816
|
const key3 = validation.ok ? `ok:${validation.treeHash}` : `bad:${validation.treeHash ?? validation.reason}`;
|
|
127636
127817
|
if (reported.current.has(key3)) return;
|
|
127637
127818
|
reported.current.add(key3);
|
|
@@ -127660,10 +127841,10 @@ var init_renderNode = __esm({
|
|
|
127660
127841
|
const hasPath = typeof path2 === "string" && path2 !== "";
|
|
127661
127842
|
const bound = useResolvedScalar(hasPath ? path2 : void 0, ctx);
|
|
127662
127843
|
const raw = hasPath ? bound : props.documentJson ?? props.document_json;
|
|
127663
|
-
const result =
|
|
127844
|
+
const result = React11.useMemo(() => layoutRichContentValue(raw), [raw]);
|
|
127664
127845
|
const reason = result && "rejected" in result ? result.rejected : void 0;
|
|
127665
|
-
const reported =
|
|
127666
|
-
|
|
127846
|
+
const reported = React11.useRef(/* @__PURE__ */ new Set());
|
|
127847
|
+
React11.useEffect(() => {
|
|
127667
127848
|
if (!reason) return;
|
|
127668
127849
|
const key3 = typeof raw === "string" ? `${reason}:${raw.length}:${richContentDocumentHash(raw)}` : `${reason}:non-string`;
|
|
127669
127850
|
if (reported.current.has(key3)) return;
|
|
@@ -127757,17 +127938,17 @@ var init_renderNode = __esm({
|
|
|
127757
127938
|
};
|
|
127758
127939
|
withRootStyle = (content, style) => {
|
|
127759
127940
|
if (Array.isArray(content)) return content.map((child) => withRootStyle(child, style));
|
|
127760
|
-
if (!
|
|
127761
|
-
if (content.type ===
|
|
127762
|
-
return
|
|
127941
|
+
if (!React11.isValidElement(content)) return content;
|
|
127942
|
+
if (content.type === React11.Fragment) {
|
|
127943
|
+
return React11.cloneElement(content, {}, React11.Children.map(content.props.children, (child) => withRootStyle(child, style)));
|
|
127763
127944
|
}
|
|
127764
127945
|
const element = content;
|
|
127765
|
-
return
|
|
127946
|
+
return React11.cloneElement(element, { style: { ...element.props.style, ...style } });
|
|
127766
127947
|
};
|
|
127767
127948
|
ReactiveDirectScalars = ({ node, ctx, bindings, style }) => {
|
|
127768
|
-
const [, rerender] =
|
|
127949
|
+
const [, rerender] = React11.useState(0);
|
|
127769
127950
|
const bindingKey = bindings.join("|");
|
|
127770
|
-
|
|
127951
|
+
React11.useEffect(() => {
|
|
127771
127952
|
if (!ctx.provider) return;
|
|
127772
127953
|
const unsubs = bindings.map((binding2) => ctx.provider.subscribe(servicePath(binding2), () => rerender((n2) => n2 + 1)));
|
|
127773
127954
|
return () => unsubs.forEach((unsubscribe) => unsubscribe());
|
|
@@ -127780,14 +127961,14 @@ var init_renderNode = __esm({
|
|
|
127780
127961
|
return /* @__PURE__ */ jsx11(ExitPresence, { hidden: hiddenBool(v2), exit: exit ?? null, children });
|
|
127781
127962
|
};
|
|
127782
127963
|
ExitPresence = ({ hidden, exit, children }) => {
|
|
127783
|
-
const [prevHidden, setPrevHidden] =
|
|
127784
|
-
const [exiting, setExiting] =
|
|
127964
|
+
const [prevHidden, setPrevHidden] = React11.useState(hidden);
|
|
127965
|
+
const [exiting, setExiting] = React11.useState(false);
|
|
127785
127966
|
if (hidden !== prevHidden) {
|
|
127786
127967
|
setPrevHidden(hidden);
|
|
127787
127968
|
setExiting(hidden && exit != null);
|
|
127788
127969
|
}
|
|
127789
|
-
const ref =
|
|
127790
|
-
const exitRef =
|
|
127970
|
+
const ref = React11.useRef(null);
|
|
127971
|
+
const exitRef = React11.useRef(exit);
|
|
127791
127972
|
exitRef.current = exit;
|
|
127792
127973
|
useIsomorphicLayoutEffect(() => {
|
|
127793
127974
|
if (!exiting) return void 0;
|
|
@@ -127820,8 +128001,8 @@ var init_renderNode = __esm({
|
|
|
127820
128001
|
const target = raw == null || raw === "" || isBound && !ctx.provider ? legacy : sectionSlot(isBound ? bound : raw);
|
|
127821
128002
|
const { graceMs, floorMs } = loadingTiming(ctx.kit, props.loadingGraceMs ?? props.loading_grace_ms, props.loadingFloorMs ?? props.loading_floor_ms);
|
|
127822
128003
|
const shown2 = useLoadingTiming(target, graceMs, floorMs);
|
|
127823
|
-
const changed =
|
|
127824
|
-
const first =
|
|
128004
|
+
const changed = React11.useRef(false);
|
|
128005
|
+
const first = React11.useRef(shown2);
|
|
127825
128006
|
if (shown2 !== first.current) changed.current = true;
|
|
127826
128007
|
const renderCfg = (cfg) => cfg && typeof cfg === "object" ? /* @__PURE__ */ jsxs8("div", { style: { textAlign: "center", padding: "24px 12px", color: C2("textSecondary", "#9aa2ad") }, children: [
|
|
127827
128008
|
cfg.title && /* @__PURE__ */ jsx11("div", { style: { fontSize: pxToRem(15), fontWeight: 600, color: C2("textPrimary", "#111") }, children: asText2(cfg.title) }),
|
|
@@ -127853,8 +128034,8 @@ var init_renderNode = __esm({
|
|
|
127853
128034
|
}
|
|
127854
128035
|
const animate = motionDefaultsAnimate(ctx);
|
|
127855
128036
|
const fadeMs = motionDefaultsDuration(ctx.kit, 220);
|
|
127856
|
-
const lastShown =
|
|
127857
|
-
const [outgoing, setOutgoing] =
|
|
128037
|
+
const lastShown = React11.useRef(null);
|
|
128038
|
+
const [outgoing, setOutgoing] = React11.useState(null);
|
|
127858
128039
|
useIsomorphicLayoutEffect(() => {
|
|
127859
128040
|
const was = lastShown.current;
|
|
127860
128041
|
if (!animate || !was || was.slot === shown2 || was.node == null) return void 0;
|
|
@@ -127862,7 +128043,7 @@ var init_renderNode = __esm({
|
|
|
127862
128043
|
const t2 = setTimeout(() => setOutgoing(null), fadeMs);
|
|
127863
128044
|
return () => clearTimeout(t2);
|
|
127864
128045
|
}, [shown2]);
|
|
127865
|
-
|
|
128046
|
+
React11.useEffect(() => {
|
|
127866
128047
|
lastShown.current = { slot: shown2, node: content };
|
|
127867
128048
|
});
|
|
127868
128049
|
if (changed.current && animate) {
|
|
@@ -127898,7 +128079,7 @@ var init_renderNode = __esm({
|
|
|
127898
128079
|
const onChangeAction = resolveRowAction2(props.onChange ?? cfg.onChange, ctx);
|
|
127899
128080
|
const borderless = props.borderless === true || cfg.borderless === true;
|
|
127900
128081
|
const secure = props.secure === true || cfg.secure === true;
|
|
127901
|
-
const [valueVisible, setValueVisible] =
|
|
128082
|
+
const [valueVisible, setValueVisible] = React11.useState(false);
|
|
127902
128083
|
const visibilityToggle = secure && (props.visibilityToggle === true || cfg.visibilityToggle === true);
|
|
127903
128084
|
const visibilityLabel = ctx.catalog?.get(valueVisible ? "auth.gate.password.hide" : "auth.gate.password.show") ?? (valueVisible ? "Hide password" : "Show password");
|
|
127904
128085
|
const erroredProp = props.error === true || cfg.error === true;
|
|
@@ -127912,20 +128093,20 @@ var init_renderNode = __esm({
|
|
|
127912
128093
|
const boundRawText = typeof boundVal === "string" ? boundVal : typeof boundVal === "number" ? String(boundVal) : void 0;
|
|
127913
128094
|
const boundText = serializeRichText && boundRawText !== void 0 ? richTextHtmlToPlainText(boundRawText) : boundRawText;
|
|
127914
128095
|
const literalText = typeof valueBinding === "string" ? serializeRichText ? richTextHtmlToPlainText(valueBinding) : valueBinding : "";
|
|
127915
|
-
const [local, setLocal] =
|
|
128096
|
+
const [local, setLocal] = React11.useState(
|
|
127916
128097
|
isBound ? boundText ?? "" : literalText
|
|
127917
128098
|
);
|
|
127918
|
-
const [edited, setEdited] =
|
|
127919
|
-
const [pristineRichValue, setPristineRichValue] =
|
|
128099
|
+
const [edited, setEdited] = React11.useState(false);
|
|
128100
|
+
const [pristineRichValue, setPristineRichValue] = React11.useState(
|
|
127920
128101
|
serializeRichText ? isBound ? boundRawText : typeof valueBinding === "string" ? valueBinding : void 0 : void 0
|
|
127921
128102
|
);
|
|
127922
|
-
const focused =
|
|
127923
|
-
const [touched, setTouched] =
|
|
127924
|
-
const [isFocused, setIsFocused] =
|
|
127925
|
-
const pendingEdits =
|
|
127926
|
-
const previousBoundText =
|
|
127927
|
-
const previousBoundRawText =
|
|
127928
|
-
|
|
128103
|
+
const focused = React11.useRef(false);
|
|
128104
|
+
const [touched, setTouched] = React11.useState(false);
|
|
128105
|
+
const [isFocused, setIsFocused] = React11.useState(false);
|
|
128106
|
+
const pendingEdits = React11.useRef([]);
|
|
128107
|
+
const previousBoundText = React11.useRef(boundText);
|
|
128108
|
+
const previousBoundRawText = React11.useRef(boundRawText);
|
|
128109
|
+
React11.useEffect(() => {
|
|
127929
128110
|
if (!isBound || boundText === void 0) return;
|
|
127930
128111
|
const boundTextChanged = previousBoundText.current !== boundText;
|
|
127931
128112
|
const boundRawTextChanged = previousBoundRawText.current !== boundRawText;
|
|
@@ -127956,23 +128137,23 @@ var init_renderNode = __esm({
|
|
|
127956
128137
|
}
|
|
127957
128138
|
if (!focused.current && boundText !== local) setLocal(boundText);
|
|
127958
128139
|
}, [boundText, serializeRichText ? boundRawText : void 0, isFocused, serializeRichText ? edited : false]);
|
|
127959
|
-
const formBag =
|
|
128140
|
+
const formBag = React11.useContext(FormValuesContext);
|
|
127960
128141
|
const fieldId = props.__formFieldId;
|
|
127961
|
-
const previousBinding =
|
|
128142
|
+
const previousBinding = React11.useRef(binding2);
|
|
127962
128143
|
const rule = props.validation ?? cfg.validation;
|
|
127963
128144
|
const { "aria-labelledby": labelledBy } = formFieldA11y(props);
|
|
127964
128145
|
const required3 = rule?.required === true || void 0;
|
|
127965
|
-
const ruleKey =
|
|
127966
|
-
|
|
128146
|
+
const ruleKey = React11.useMemo(() => rule ? JSON.stringify(rule) : "", [rule]);
|
|
128147
|
+
React11.useEffect(() => {
|
|
127967
128148
|
if (!formBag || !fieldId) return;
|
|
127968
128149
|
formBag.register(fieldId, rule);
|
|
127969
128150
|
return () => formBag.unregister(fieldId);
|
|
127970
128151
|
}, [fieldId, formBag, ruleKey]);
|
|
127971
128152
|
const formValue = serializeRichText && !edited && pristineRichValue !== void 0 ? pristineRichValue : serializeRichText ? richTextEditedHtml(pristineRichValue, pristineRichValue === void 0 ? "" : richTextHtmlToPlainText(pristineRichValue), local) : local;
|
|
127972
|
-
|
|
128153
|
+
React11.useEffect(() => {
|
|
127973
128154
|
if (formBag && fieldId) formBag.set(fieldId, formValue);
|
|
127974
128155
|
}, [formValue, fieldId, formBag, binding2]);
|
|
127975
|
-
|
|
128156
|
+
React11.useEffect(() => {
|
|
127976
128157
|
if (previousBinding.current === binding2) return;
|
|
127977
128158
|
previousBinding.current = binding2;
|
|
127978
128159
|
pendingEdits.current = [];
|
|
@@ -127991,7 +128172,7 @@ var init_renderNode = __esm({
|
|
|
127991
128172
|
const errorTextRaw = props.errorText ?? cfg.errorText;
|
|
127992
128173
|
const errorTextResolved = useBoundString(errorTextRaw, ctx);
|
|
127993
128174
|
const workerError = typeof boundError === "string" ? boundError : errorTextRaw == null ? void 0 : errorTextResolved;
|
|
127994
|
-
const validationCatalog =
|
|
128175
|
+
const validationCatalog = React11.useMemo(
|
|
127995
128176
|
() => ctx.catalog ? new Proxy({}, { get: (_t2, k2) => typeof k2 === "string" ? ctx.catalog.get(k2) : void 0 }) : void 0,
|
|
127996
128177
|
[ctx.catalog]
|
|
127997
128178
|
);
|
|
@@ -128006,7 +128187,7 @@ var init_renderNode = __esm({
|
|
|
128006
128187
|
const hasWorkerError = Boolean(workerError && workerError.trim());
|
|
128007
128188
|
const painted2 = rawMessage === null ? "" : translateOnly(rawMessage);
|
|
128008
128189
|
const message = !painted2.trim() || ruleMessagePending && !hasWorkerError ? null : painted2;
|
|
128009
|
-
const [feedbackShown, setFeedbackShown] =
|
|
128190
|
+
const [feedbackShown, setFeedbackShown] = React11.useState(false);
|
|
128010
128191
|
const revealed = message !== null && shouldRevealError({
|
|
128011
128192
|
rule,
|
|
128012
128193
|
feedbackShown,
|
|
@@ -128015,11 +128196,11 @@ var init_renderNode = __esm({
|
|
|
128015
128196
|
focused: isFocused,
|
|
128016
128197
|
submitAttempted: formBag?.submitAttempted ?? false
|
|
128017
128198
|
});
|
|
128018
|
-
|
|
128199
|
+
React11.useEffect(() => {
|
|
128019
128200
|
if (revealed) setFeedbackShown(true);
|
|
128020
128201
|
}, [revealed]);
|
|
128021
128202
|
const errored = erroredProp || revealed;
|
|
128022
|
-
const generatedId =
|
|
128203
|
+
const generatedId = React11.useId();
|
|
128023
128204
|
const errorId = revealed ? `${componentId ?? generatedId}__error` : void 0;
|
|
128024
128205
|
const emit = (v2) => {
|
|
128025
128206
|
if (onChangeAction && ctx.onAction) {
|
|
@@ -128031,16 +128212,16 @@ var init_renderNode = __esm({
|
|
|
128031
128212
|
});
|
|
128032
128213
|
}
|
|
128033
128214
|
};
|
|
128034
|
-
const ownsPrivateDraft =
|
|
128035
|
-
|
|
128215
|
+
const ownsPrivateDraft = React11.useRef(false);
|
|
128216
|
+
React11.useEffect(() => {
|
|
128036
128217
|
if (visibilityToggle && !isBound) ownsPrivateDraft.current = true;
|
|
128037
128218
|
}, [visibilityToggle, isBound]);
|
|
128038
|
-
const clearSensitiveDraft =
|
|
128219
|
+
const clearSensitiveDraft = React11.useRef(() => {
|
|
128039
128220
|
});
|
|
128040
128221
|
clearSensitiveDraft.current = () => {
|
|
128041
128222
|
if (ownsPrivateDraft.current && !isBound) emit("");
|
|
128042
128223
|
};
|
|
128043
|
-
|
|
128224
|
+
React11.useEffect(() => () => clearSensitiveDraft.current(), []);
|
|
128044
128225
|
const onInput = (e2) => {
|
|
128045
128226
|
const v2 = e2.currentTarget.value;
|
|
128046
128227
|
setLocal(v2);
|
|
@@ -128072,7 +128253,7 @@ var init_renderNode = __esm({
|
|
|
128072
128253
|
const submitLabelRaw = props.submitLabel ?? cfg.submitLabel;
|
|
128073
128254
|
const onSubmitAction = props.onSubmit ?? cfg.onSubmit;
|
|
128074
128255
|
const enterKeyHint = !multilineBox && ENTER_KEY_HINTS.has(submitLabelRaw) ? submitLabelRaw : !multilineBox && onSubmitAction ? "done" : void 0;
|
|
128075
|
-
const inputRef =
|
|
128256
|
+
const inputRef = React11.useRef(null);
|
|
128076
128257
|
useIsomorphicLayoutEffect(() => {
|
|
128077
128258
|
const el2 = inputRef.current;
|
|
128078
128259
|
const view = el2?.ownerDocument?.defaultView;
|
|
@@ -128087,8 +128268,8 @@ var init_renderNode = __esm({
|
|
|
128087
128268
|
}, [local, multilineBox, maxLines]);
|
|
128088
128269
|
const focusBinding = (typeof props.focusPath === "string" ? props.focusPath : typeof cfg.focusPath === "string" ? cfg.focusPath : void 0) ?? "";
|
|
128089
128270
|
const focusTokenVal = useBoundValue(ctx, focusBinding);
|
|
128090
|
-
const lastFocusToken =
|
|
128091
|
-
|
|
128271
|
+
const lastFocusToken = React11.useRef(void 0);
|
|
128272
|
+
React11.useEffect(() => {
|
|
128092
128273
|
if (!focusBinding) return;
|
|
128093
128274
|
const next = typeof focusTokenVal === "string" ? focusTokenVal : typeof focusTokenVal === "number" ? String(focusTokenVal) : "";
|
|
128094
128275
|
if (!next || next === lastFocusToken.current) return;
|
|
@@ -128163,13 +128344,13 @@ var init_renderNode = __esm({
|
|
|
128163
128344
|
};
|
|
128164
128345
|
MENU_LONG_PRESS_MS = 500;
|
|
128165
128346
|
MenuNode = withExtras("MenuNode", ({ props, ctx, wrap }) => {
|
|
128166
|
-
const [open, setOpen] =
|
|
128167
|
-
const hostRef =
|
|
128347
|
+
const [open, setOpen] = React11.useState(false);
|
|
128348
|
+
const hostRef = React11.useRef(null);
|
|
128168
128349
|
const context = props.style === "context";
|
|
128169
128350
|
const previewMode = context && props.preview != null;
|
|
128170
128351
|
const items = (Array.isArray(props.items) ? props.items : []).map((it2) => it2 && typeof it2.label === "string" && it2.label.startsWith("$item") ? { ...it2, label: resolveItemDeep2(it2.label, ctx) } : it2);
|
|
128171
128352
|
const C2 = ctx.color;
|
|
128172
|
-
|
|
128353
|
+
React11.useEffect(() => {
|
|
128173
128354
|
if (!open) return;
|
|
128174
128355
|
const onTop = () => menuRef.current != null && isWithinTopModal(menuRef.current);
|
|
128175
128356
|
const onDown = (e2) => {
|
|
@@ -128195,17 +128376,17 @@ var init_renderNode = __esm({
|
|
|
128195
128376
|
const flexGrow = typeof wrap?.flex === "string" ? parseFloat(wrap.flex) : typeof wrap?.flex === "number" ? wrap.flex : Number(wrap?.flexGrow ?? 0);
|
|
128196
128377
|
const fill = wrap?.width === "100%" || Number.isFinite(flexGrow) && flexGrow > 0;
|
|
128197
128378
|
const popupPlacement = fill ? { position: "absolute", top: "100%", left: 0, right: 0, zIndex: 20, marginTop: 4 } : { position: "absolute", top: "100%", right: 0, zIndex: 20, marginTop: 4 };
|
|
128198
|
-
const anchorRef =
|
|
128199
|
-
const menuRef =
|
|
128200
|
-
const dialogRef =
|
|
128379
|
+
const anchorRef = React11.useRef(null);
|
|
128380
|
+
const menuRef = React11.useRef(null);
|
|
128381
|
+
const dialogRef = React11.useRef(null);
|
|
128201
128382
|
const itemsKey = items.map((it2, i2) => `${it2?.id ?? i2}:${it2?.disabled ? 0 : 1}`).join("|");
|
|
128202
|
-
|
|
128383
|
+
React11.useEffect(() => {
|
|
128203
128384
|
if (!open || !modal) return;
|
|
128204
128385
|
const menu = menuRef.current;
|
|
128205
128386
|
if (!menu || menu.contains(document.activeElement)) return;
|
|
128206
128387
|
(menu.querySelector('[role="menuitem"][tabindex="0"]') ?? menu).focus();
|
|
128207
128388
|
}, [open, modal, itemsKey]);
|
|
128208
|
-
|
|
128389
|
+
React11.useEffect(() => {
|
|
128209
128390
|
if (!open || !modal) return;
|
|
128210
128391
|
const layer = pushModalLayer(() => dialogRef.current);
|
|
128211
128392
|
return () => {
|
|
@@ -128214,15 +128395,15 @@ var init_renderNode = __esm({
|
|
|
128214
128395
|
if (active == null || active === document.body || !document.contains(active)) anchorRef.current?.focus();
|
|
128215
128396
|
};
|
|
128216
128397
|
}, [open, modal]);
|
|
128217
|
-
const press =
|
|
128218
|
-
const pressFired =
|
|
128398
|
+
const press = React11.useRef(null);
|
|
128399
|
+
const pressFired = React11.useRef(false);
|
|
128219
128400
|
const cancelPress = () => {
|
|
128220
128401
|
if (press.current) {
|
|
128221
128402
|
clearTimeout(press.current.timer);
|
|
128222
128403
|
press.current = null;
|
|
128223
128404
|
}
|
|
128224
128405
|
};
|
|
128225
|
-
|
|
128406
|
+
React11.useEffect(() => cancelPress, []);
|
|
128226
128407
|
const contextHandlers = context ? {
|
|
128227
128408
|
onContextMenu: (e2) => {
|
|
128228
128409
|
e2.preventDefault();
|
|
@@ -128337,9 +128518,9 @@ var init_renderNode = __esm({
|
|
|
128337
128518
|
const isBound = typeof raw === "string" && isBinding(raw);
|
|
128338
128519
|
const bound = useBoundValue(ctx, isBound ? raw : "");
|
|
128339
128520
|
const cursor = isBound ? typeof bound === "string" ? bound : "" : String(raw ?? "");
|
|
128340
|
-
const ref =
|
|
128341
|
-
const fired =
|
|
128342
|
-
|
|
128521
|
+
const ref = React11.useRef(null);
|
|
128522
|
+
const fired = React11.useRef("");
|
|
128523
|
+
React11.useEffect(() => {
|
|
128343
128524
|
const el2 = ref.current;
|
|
128344
128525
|
if (!cursor || !ctx.onAction || !el2 || typeof IntersectionObserver === "undefined") return;
|
|
128345
128526
|
const io2 = new IntersectionObserver((entries) => {
|
|
@@ -128369,11 +128550,11 @@ var init_renderNode = __esm({
|
|
|
128369
128550
|
] });
|
|
128370
128551
|
});
|
|
128371
128552
|
FormView = withExtras("FormView", ({ props, ctx, wrap }) => {
|
|
128372
|
-
const bagRef =
|
|
128553
|
+
const bagRef = React11.useRef(null);
|
|
128373
128554
|
if (!bagRef.current) bagRef.current = createFormBag();
|
|
128374
128555
|
const bag = bagRef.current;
|
|
128375
|
-
|
|
128376
|
-
|
|
128556
|
+
React11.useSyncExternalStore(
|
|
128557
|
+
React11.useCallback((cb) => bag.subscribe(cb), [bag]),
|
|
128377
128558
|
() => bag.version,
|
|
128378
128559
|
() => bag.version
|
|
128379
128560
|
);
|
|
@@ -128390,7 +128571,7 @@ var init_renderNode = __esm({
|
|
|
128390
128571
|
ctx.onAction?.({ ...action, args: merged });
|
|
128391
128572
|
}
|
|
128392
128573
|
};
|
|
128393
|
-
const submitNode =
|
|
128574
|
+
const submitNode = React11.useMemo(() => {
|
|
128394
128575
|
const node = props.submitButton;
|
|
128395
128576
|
if (!node || valid) return node;
|
|
128396
128577
|
if (node.body) return { ...node, body: { ...node.body, props: { ...node.body.props ?? {}, disabled: true } } };
|
|
@@ -128440,11 +128621,11 @@ var init_renderNode = __esm({
|
|
|
128440
128621
|
const startPositionPath = typeof props.startPositionSeconds === "string" && isBinding(props.startPositionSeconds) ? props.startPositionSeconds : "";
|
|
128441
128622
|
const boundStartPosition = useResolvedScalar(startPositionPath || void 0, ctx);
|
|
128442
128623
|
const initialStartPosition = startPositionPath && typeof boundStartPosition === "number" && Number.isFinite(boundStartPosition) ? Math.max(0, boundStartPosition) : Math.max(0, Number.isFinite(Number(props.startPositionSeconds)) ? Number(props.startPositionSeconds) : 0);
|
|
128443
|
-
const [index, setIndex] =
|
|
128624
|
+
const [index, setIndex] = React11.useState(initialIndex);
|
|
128444
128625
|
const queueReady = !itemsPath || Array.isArray(boundQueue);
|
|
128445
128626
|
const seatKey = `${itemsPath ?? ""}|${startIndex}`;
|
|
128446
|
-
const seated =
|
|
128447
|
-
|
|
128627
|
+
const seated = React11.useRef(null);
|
|
128628
|
+
React11.useEffect(() => {
|
|
128448
128629
|
const last = Math.max(0, resolvedItems.length - 1);
|
|
128449
128630
|
if (resolvedItems.length === 0) return;
|
|
128450
128631
|
if (queueReady && seated.current !== seatKey) {
|
|
@@ -128459,19 +128640,19 @@ var init_renderNode = __esm({
|
|
|
128459
128640
|
}
|
|
128460
128641
|
setIndex((i2) => Math.min(Math.max(0, i2), last));
|
|
128461
128642
|
}, [resolvedItems.length, startIndex, queueReady, seatKey]);
|
|
128462
|
-
const [status, setStatus] =
|
|
128463
|
-
const [position, setPosition] =
|
|
128464
|
-
const [duration2, setDuration] =
|
|
128465
|
-
const [buffered, setBuffered] =
|
|
128466
|
-
const [rate, setRateState] =
|
|
128467
|
-
const [fullscreen, setFullscreen] =
|
|
128468
|
-
const [error, setError] =
|
|
128469
|
-
const mediaRef =
|
|
128470
|
-
const hostRef =
|
|
128471
|
-
const autoplayConsumed =
|
|
128643
|
+
const [status, setStatus] = React11.useState("idle");
|
|
128644
|
+
const [position, setPosition] = React11.useState(initialStartPosition);
|
|
128645
|
+
const [duration2, setDuration] = React11.useState(0);
|
|
128646
|
+
const [buffered, setBuffered] = React11.useState(0);
|
|
128647
|
+
const [rate, setRateState] = React11.useState(1);
|
|
128648
|
+
const [fullscreen, setFullscreen] = React11.useState(false);
|
|
128649
|
+
const [error, setError] = React11.useState("");
|
|
128650
|
+
const mediaRef = React11.useRef(null);
|
|
128651
|
+
const hostRef = React11.useRef(null);
|
|
128652
|
+
const autoplayConsumed = React11.useRef(false);
|
|
128472
128653
|
const item = resolvedItems[index];
|
|
128473
128654
|
const mediaKey2 = `${index}:${item?.id ?? item?.url ?? ""}`;
|
|
128474
|
-
|
|
128655
|
+
React11.useEffect(() => {
|
|
128475
128656
|
const outgoing = mediaRef.current;
|
|
128476
128657
|
return () => {
|
|
128477
128658
|
try {
|
|
@@ -128485,7 +128666,7 @@ var init_renderNode = __esm({
|
|
|
128485
128666
|
const isYouTube = provider === "youtube";
|
|
128486
128667
|
const isUnsupportedProvider = provider !== "direct" && !isYouTube;
|
|
128487
128668
|
const isAudio = ["audio", "podcast", "radio"].includes(String(item?.kind ?? ""));
|
|
128488
|
-
const capabilities =
|
|
128669
|
+
const capabilities = React11.useMemo(() => ({
|
|
128489
128670
|
seek: !isUnsupportedProvider && item?.live !== true,
|
|
128490
128671
|
rate: !isUnsupportedProvider && item?.live !== true,
|
|
128491
128672
|
queue: !isUnsupportedProvider && items.length > 1,
|
|
@@ -128513,9 +128694,9 @@ var init_renderNode = __esm({
|
|
|
128513
128694
|
error,
|
|
128514
128695
|
capabilities
|
|
128515
128696
|
};
|
|
128516
|
-
const slotProvider =
|
|
128517
|
-
|
|
128518
|
-
|
|
128697
|
+
const slotProvider = React11.useMemo(() => new MediaSlotProvider(state), []);
|
|
128698
|
+
React11.useEffect(() => slotProvider.set(state));
|
|
128699
|
+
React11.useEffect(() => {
|
|
128519
128700
|
if (!startPositionPath || typeof boundStartPosition !== "number" || !Number.isFinite(boundStartPosition) || status !== "idle") return;
|
|
128520
128701
|
const next = Math.max(0, boundStartPosition);
|
|
128521
128702
|
setPosition(next);
|
|
@@ -128526,7 +128707,7 @@ var init_renderNode = __esm({
|
|
|
128526
128707
|
}
|
|
128527
128708
|
}
|
|
128528
128709
|
}, [startPositionPath, boundStartPosition, status]);
|
|
128529
|
-
const emit =
|
|
128710
|
+
const emit = React11.useCallback((action, extra = {}) => {
|
|
128530
128711
|
if (!action || !ctx.onAction) return;
|
|
128531
128712
|
const snapshot2 = {
|
|
128532
128713
|
sessionId,
|
|
@@ -128545,13 +128726,13 @@ var init_renderNode = __esm({
|
|
|
128545
128726
|
};
|
|
128546
128727
|
ctx.onAction({ ...action, args: { ...action.args ?? {}, ...snapshot2, ...extra }, params: { ...action.params ?? {}, sessionId, index: String(index), ...Object.fromEntries(Object.entries(extra).map(([k2, v2]) => [k2, String(v2)])) } });
|
|
128547
128728
|
}, [ctx.onAction, sessionId, status, index, position, duration2, item, buffered, rate, props.muted, fullscreen, error]);
|
|
128548
|
-
|
|
128729
|
+
React11.useEffect(() => {
|
|
128549
128730
|
if (!isUnsupportedProvider || status === "error") return;
|
|
128550
128731
|
setStatus("error");
|
|
128551
128732
|
setError("provider_unsupported");
|
|
128552
128733
|
emit(props.onError, { state: "error", status: "error", error: "provider_unsupported", code: "provider_unsupported" });
|
|
128553
128734
|
}, [isUnsupportedProvider, status, emit, props.onError]);
|
|
128554
|
-
const play =
|
|
128735
|
+
const play = React11.useCallback(async () => {
|
|
128555
128736
|
if (isYouTube) return;
|
|
128556
128737
|
if (isUnsupportedProvider) {
|
|
128557
128738
|
setStatus("error");
|
|
@@ -128573,17 +128754,17 @@ var init_renderNode = __esm({
|
|
|
128573
128754
|
emit(props.onError, { state: "blocked", status: "blocked", error: message, code: "playback_blocked" });
|
|
128574
128755
|
}
|
|
128575
128756
|
}, [isYouTube, isUnsupportedProvider, emit, props.onError]);
|
|
128576
|
-
const pause =
|
|
128757
|
+
const pause = React11.useCallback(() => {
|
|
128577
128758
|
mediaRef.current?.pause();
|
|
128578
128759
|
setStatus("paused");
|
|
128579
128760
|
}, []);
|
|
128580
|
-
const seek =
|
|
128761
|
+
const seek = React11.useCallback((seconds) => {
|
|
128581
128762
|
const media = mediaRef.current;
|
|
128582
128763
|
if (!media || !Number.isFinite(seconds)) return;
|
|
128583
128764
|
media.currentTime = Math.max(0, Math.min(seconds, Number.isFinite(media.duration) ? media.duration : seconds));
|
|
128584
128765
|
setPosition(media.currentTime);
|
|
128585
128766
|
}, []);
|
|
128586
|
-
const select2 =
|
|
128767
|
+
const select2 = React11.useCallback((next) => {
|
|
128587
128768
|
if (resolvedItems.length === 0) return;
|
|
128588
128769
|
const normalized = (next % resolvedItems.length + resolvedItems.length) % resolvedItems.length;
|
|
128589
128770
|
const nextItem = resolvedItems[normalized];
|
|
@@ -128605,7 +128786,7 @@ var init_renderNode = __esm({
|
|
|
128605
128786
|
error: ""
|
|
128606
128787
|
});
|
|
128607
128788
|
}, [resolvedItems, emit, props.onItemChange]);
|
|
128608
|
-
const toggleFullscreen =
|
|
128789
|
+
const toggleFullscreen = React11.useCallback(async () => {
|
|
128609
128790
|
if (props.fullscreen === "disabled") return;
|
|
128610
128791
|
const host = hostRef.current;
|
|
128611
128792
|
try {
|
|
@@ -128615,7 +128796,7 @@ var init_renderNode = __esm({
|
|
|
128615
128796
|
setFullscreen((value) => !value);
|
|
128616
128797
|
}
|
|
128617
128798
|
}, [props.fullscreen]);
|
|
128618
|
-
|
|
128799
|
+
React11.useEffect(() => {
|
|
128619
128800
|
const listener = (event) => {
|
|
128620
128801
|
const detail = event.detail;
|
|
128621
128802
|
if (!detail || detail.sessionId !== sessionId) return;
|
|
@@ -128663,7 +128844,7 @@ var init_renderNode = __esm({
|
|
|
128663
128844
|
window.addEventListener("himalaya-media-command", listener);
|
|
128664
128845
|
return () => window.removeEventListener("himalaya-media-command", listener);
|
|
128665
128846
|
}, [sessionId, index, play, pause, seek, select2, toggleFullscreen]);
|
|
128666
|
-
|
|
128847
|
+
React11.useEffect(() => {
|
|
128667
128848
|
const listener = () => {
|
|
128668
128849
|
const value = document.fullscreenElement === hostRef.current;
|
|
128669
128850
|
setFullscreen(value);
|
|
@@ -128672,14 +128853,14 @@ var init_renderNode = __esm({
|
|
|
128672
128853
|
document.addEventListener("fullscreenchange", listener);
|
|
128673
128854
|
return () => document.removeEventListener("fullscreenchange", listener);
|
|
128674
128855
|
}, [emit, props.onFullscreenChange]);
|
|
128675
|
-
|
|
128856
|
+
React11.useEffect(() => {
|
|
128676
128857
|
const media = mediaRef.current;
|
|
128677
128858
|
if (!media || isYouTube || isUnsupportedProvider) return;
|
|
128678
128859
|
media.muted = props.muted === true;
|
|
128679
128860
|
media.playbackRate = rate;
|
|
128680
128861
|
if (position > 0) media.currentTime = position;
|
|
128681
128862
|
}, [item?.url, isUnsupportedProvider]);
|
|
128682
|
-
|
|
128863
|
+
React11.useEffect(() => {
|
|
128683
128864
|
if (isYouTube || isUnsupportedProvider || props.autoplay === "never" || autoplayConsumed.current) return;
|
|
128684
128865
|
if (props.autoplay === "once") {
|
|
128685
128866
|
autoplayConsumed.current = true;
|
|
@@ -128881,15 +129062,15 @@ var init_renderNode = __esm({
|
|
|
128881
129062
|
}
|
|
128882
129063
|
);
|
|
128883
129064
|
});
|
|
128884
|
-
PdfDocumentCanvas =
|
|
129065
|
+
PdfDocumentCanvas = React11.lazy(() => Promise.resolve().then(() => (init_pdfDocument(), pdfDocument_exports)).then((module) => ({ default: module.PdfDocument })));
|
|
128885
129066
|
PdfViewNode = withExtras("PdfViewNode", ({ props, ctx, wrap }) => {
|
|
128886
129067
|
const boundUrl = useResolvedScalar(props.url != null && isBinding(props.url) ? props.url : void 0, ctx);
|
|
128887
129068
|
const url = props.url != null && isBinding(props.url) ? boundUrl : props.url;
|
|
128888
129069
|
const rawUrl = typeof url === "string" && !isBinding(url) ? url : "";
|
|
128889
129070
|
const plan = rawUrl ? pdfEmbedPlan(rawUrl, void 0, typeof document !== "undefined" ? document.baseURI : void 0) : null;
|
|
128890
129071
|
const retypeSrc = plan?.mode === "retype" ? plan.src : null;
|
|
128891
|
-
const [retyped, setRetyped] =
|
|
128892
|
-
|
|
129072
|
+
const [retyped, setRetyped] = React11.useState(null);
|
|
129073
|
+
React11.useEffect(() => {
|
|
128893
129074
|
if (!retypeSrc) return;
|
|
128894
129075
|
let live3 = true;
|
|
128895
129076
|
let made = null;
|
|
@@ -128911,11 +129092,11 @@ var init_renderNode = __esm({
|
|
|
128911
129092
|
}, [retypeSrc]);
|
|
128912
129093
|
const settled = retyped && retyped.from === retypeSrc ? retyped : null;
|
|
128913
129094
|
const wantsShare = props.allowShare === true;
|
|
128914
|
-
const [fellBackFrom, setFellBackFrom] =
|
|
129095
|
+
const [fellBackFrom, setFellBackFrom] = React11.useState(null);
|
|
128915
129096
|
const directFellBack = plan?.mode === "direct" && fellBackFrom === plan.src;
|
|
128916
129097
|
const directSrc = plan?.mode === "direct" && (wantsShare || props.showPageControls !== false && directFellBack) ? plan.src : null;
|
|
128917
|
-
const [direct, setDirect] =
|
|
128918
|
-
|
|
129098
|
+
const [direct, setDirect] = React11.useState(null);
|
|
129099
|
+
React11.useEffect(() => {
|
|
128919
129100
|
if (!directSrc) return;
|
|
128920
129101
|
let live3 = true;
|
|
128921
129102
|
let made = null;
|
|
@@ -128932,16 +129113,16 @@ var init_renderNode = __esm({
|
|
|
128932
129113
|
}, [directSrc, wantsShare]);
|
|
128933
129114
|
const directDoc = direct && direct.from === directSrc ? direct : null;
|
|
128934
129115
|
const fallbackPageCount = plan?.mode === "retype" ? settled?.pageCount ?? null : directDoc?.count ?? null;
|
|
128935
|
-
const [nav, setNav] =
|
|
129116
|
+
const [nav, setNav] = React11.useState({ from: rawUrl, page: null, zoom: null });
|
|
128936
129117
|
const view = nav.from === rawUrl ? nav : { from: rawUrl, page: null, zoom: null };
|
|
128937
129118
|
const src = plan?.mode === "direct" ? plan.src : settled?.url ?? null;
|
|
128938
|
-
const [canvasCount, setCanvasCount] =
|
|
128939
|
-
const onPageCount =
|
|
129119
|
+
const [canvasCount, setCanvasCount] = React11.useState(null);
|
|
129120
|
+
const onPageCount = React11.useCallback((count2) => {
|
|
128940
129121
|
if (!Number.isInteger(count2) || count2 < 1) return;
|
|
128941
129122
|
setCanvasCount((cur) => cur?.from === src && cur.count === count2 ? cur : { from: src, count: count2 });
|
|
128942
129123
|
}, [src]);
|
|
128943
129124
|
const pageCount = canvasCount?.from === src ? canvasCount.count : fallbackPageCount;
|
|
128944
|
-
const onFallback =
|
|
129125
|
+
const onFallback = React11.useCallback(() => setFellBackFrom(src), [src]);
|
|
128945
129126
|
const loading = plan?.mode === "retype" && !settled || directSrc != null && wantsShare && !directDoc && typeof window !== "undefined";
|
|
128946
129127
|
const loadSrc = plan?.mode === "direct" && wantsShare ? directDoc?.blobUrl ?? src : src;
|
|
128947
129128
|
const ph = typeof props.height === "number" && props.height > 0 ? props.height : void 0;
|
|
@@ -128991,7 +129172,7 @@ var init_renderNode = __esm({
|
|
|
128991
129172
|
const data = base + pdfOpenFragment(sourceHash, { page, zoom: zoomable ? view.zoom : null, fitWidth: !zoomable });
|
|
128992
129173
|
const label3 = typeof props.title === "string" && props.title ? props.title : "PDF document";
|
|
128993
129174
|
const documentStyle = showPageControls || zoomable || allowShare ? { display: "block", width: "100%", flex: "1 1 auto", minHeight: ph ? 0 : 280, border: "none" } : frame;
|
|
128994
|
-
const object7 = typeof window === "undefined" ? /* @__PURE__ */ jsx11("object", { "data-himalaya-pdf": "static-fallback", data, type: "application/pdf", "aria-label": label3, style: documentStyle }) : /* @__PURE__ */ jsx11(
|
|
129175
|
+
const object7 = typeof window === "undefined" ? /* @__PURE__ */ jsx11("object", { "data-himalaya-pdf": "static-fallback", data, type: "application/pdf", "aria-label": label3, style: documentStyle }) : /* @__PURE__ */ jsx11(React11.Suspense, { fallback: /* @__PURE__ */ jsx11("div", { "data-himalaya-pdf": "loading", role: "img", "aria-label": "loading document", "aria-busy": "true", style: documentStyle }), children: /* @__PURE__ */ jsx11(
|
|
128995
129176
|
PdfDocumentCanvas,
|
|
128996
129177
|
{
|
|
128997
129178
|
src: loadSrc ?? src,
|
|
@@ -129071,7 +129252,7 @@ var init_renderNode = __esm({
|
|
|
129071
129252
|
const ar2 = typeof props.aspectRatio === "number" && props.aspectRatio > 0 ? props.aspectRatio : void 0;
|
|
129072
129253
|
const frameStyle = { width: "100%", boxSizing: "border-box", border: "none", borderRadius: ctx.radius("md", 8), background: "#fff", ...scrollEnabled ? {} : { overflow: "hidden" }, ...h2 ? { height: h2 } : ar2 ? { aspectRatio: String(ar2) } : { height: 200 } };
|
|
129073
129254
|
const frameKey = htmlStr ?? urlFrame?.src ?? null;
|
|
129074
|
-
const [loadedKey, setLoadedKey] =
|
|
129255
|
+
const [loadedKey, setLoadedKey] = React11.useState(null);
|
|
129075
129256
|
const loaded = loadedKey === frameKey;
|
|
129076
129257
|
const frameProps = {
|
|
129077
129258
|
title: "webview",
|
|
@@ -129102,19 +129283,19 @@ var init_renderNode = __esm({
|
|
|
129102
129283
|
const onChange = props.onChange;
|
|
129103
129284
|
const boundSel = useResolvedScalar(isBinding(props.selectedId) ? props.selectedId : void 0, ctx);
|
|
129104
129285
|
const selectedId = isBinding(props.selectedId) ? boundSel : props.selectedId;
|
|
129105
|
-
const [sel, setSel] =
|
|
129106
|
-
|
|
129286
|
+
const [sel, setSel] = React11.useState(ctx.empty ? "" : String(selectedId ?? ""));
|
|
129287
|
+
React11.useEffect(() => {
|
|
129107
129288
|
if (!ctx.empty && selectedId != null) setSel(String(selectedId));
|
|
129108
129289
|
}, [selectedId, ctx.empty]);
|
|
129109
|
-
const pickerBag =
|
|
129290
|
+
const pickerBag = React11.useContext(FormValuesContext);
|
|
129110
129291
|
const pickerFieldId = props.__formFieldId;
|
|
129111
129292
|
const pickerRuleKey = props.validation ? JSON.stringify(props.validation) : "";
|
|
129112
|
-
|
|
129293
|
+
React11.useEffect(() => {
|
|
129113
129294
|
if (!pickerBag || !pickerFieldId) return;
|
|
129114
129295
|
pickerBag.register(pickerFieldId, props.validation);
|
|
129115
129296
|
return () => pickerBag.unregister(pickerFieldId);
|
|
129116
129297
|
}, [pickerFieldId, pickerBag, pickerRuleKey]);
|
|
129117
|
-
|
|
129298
|
+
React11.useEffect(() => {
|
|
129118
129299
|
if (pickerBag && pickerFieldId) pickerBag.set(pickerFieldId, sel);
|
|
129119
129300
|
}, [sel, pickerFieldId, pickerBag]);
|
|
129120
129301
|
const emitPick = (id) => {
|
|
@@ -129230,24 +129411,24 @@ var init_renderNode = __esm({
|
|
|
129230
129411
|
const s2 = seedUnix();
|
|
129231
129412
|
return s2 == null ? null : clampUnix(s2);
|
|
129232
129413
|
};
|
|
129233
|
-
const [val, setVal] =
|
|
129414
|
+
const [val, setVal] = React11.useState(ctx.empty ? "" : toInput(shownSeed()));
|
|
129234
129415
|
const dateServiceBound = typeof props.valuePath === "string" && props.valuePath.startsWith("$service:");
|
|
129235
129416
|
const bagSource = () => dateServiceBound ? boundRaw : boundRaw !== void 0 && boundRaw !== null && boundRaw !== "" ? boundRaw : props.valueUnix;
|
|
129236
|
-
const [dateBagVal, setDateBagVal] =
|
|
129237
|
-
|
|
129417
|
+
const [dateBagVal, setDateBagVal] = React11.useState(ctx.empty ? "" : clampDateFieldValue(encodeDateFieldValue(bagSource()), props.minUnix, props.maxUnix, props.mode));
|
|
129418
|
+
React11.useEffect(() => {
|
|
129238
129419
|
if (ctx.empty) return;
|
|
129239
129420
|
setVal(toInput(shownSeed()));
|
|
129240
129421
|
setDateBagVal(clampDateFieldValue(encodeDateFieldValue(bagSource()), props.minUnix, props.maxUnix, props.mode));
|
|
129241
129422
|
}, [boundRaw, props.valueUnix, props.valuePath, ctx.empty]);
|
|
129242
|
-
const dateBag =
|
|
129423
|
+
const dateBag = React11.useContext(FormValuesContext);
|
|
129243
129424
|
const dateFieldId = props.__formFieldId;
|
|
129244
129425
|
const dateRuleKey = props.validation ? JSON.stringify(props.validation) : "";
|
|
129245
|
-
|
|
129426
|
+
React11.useEffect(() => {
|
|
129246
129427
|
if (!dateBag || !dateFieldId) return;
|
|
129247
129428
|
dateBag.register(dateFieldId, props.validation);
|
|
129248
129429
|
return () => dateBag.unregister(dateFieldId);
|
|
129249
129430
|
}, [dateFieldId, dateBag, dateRuleKey]);
|
|
129250
|
-
|
|
129431
|
+
React11.useEffect(() => {
|
|
129251
129432
|
if (dateBag && dateFieldId) dateBag.set(dateFieldId, dateBagVal);
|
|
129252
129433
|
}, [dateBagVal, dateFieldId, dateBag]);
|
|
129253
129434
|
if (!ctx.onAction) {
|
|
@@ -129316,11 +129497,11 @@ var init_renderNode = __esm({
|
|
|
129316
129497
|
const valueBinding = isBinding(props.value) ? props.value : void 0;
|
|
129317
129498
|
const boundValue = useResolvedScalar(valueBinding, ctx);
|
|
129318
129499
|
const initialValue = ctx.empty ? "" : valueBinding ? boundValue == null ? "" : String(boundValue) : String(props.value ?? "");
|
|
129319
|
-
const [local, setLocal] =
|
|
129320
|
-
|
|
129500
|
+
const [local, setLocal] = React11.useState(initialValue);
|
|
129501
|
+
React11.useEffect(() => {
|
|
129321
129502
|
if (!ctx.empty && valueBinding) setLocal(boundValue == null ? "" : String(boundValue));
|
|
129322
129503
|
}, [boundValue, ctx.empty, valueBinding]);
|
|
129323
|
-
const timer =
|
|
129504
|
+
const timer = React11.useRef(null);
|
|
129324
129505
|
const dispatch = (action, v2) => {
|
|
129325
129506
|
if (!action || !ctx.onAction) return;
|
|
129326
129507
|
ctx.onAction({ ...action, params: { ...action.params ?? {}, value: v2 }, args: { ...action.args ?? {}, value: v2 } });
|
|
@@ -129362,33 +129543,33 @@ var init_renderNode = __esm({
|
|
|
129362
129543
|
const boundValue = useResolvedScalar(props.valuePath, ctx);
|
|
129363
129544
|
const effectiveValue = props.valuePath != null ? boundValue : props.value;
|
|
129364
129545
|
const fallbackValue = effectiveValue ?? props.value ?? 0;
|
|
129365
|
-
const [value, setValue] =
|
|
129546
|
+
const [value, setValue] = React11.useState(() => {
|
|
129366
129547
|
const seed2 = Number(fallbackValue);
|
|
129367
129548
|
return Number.isFinite(seed2) ? Math.min(max, Math.max(min, seed2)) : 0;
|
|
129368
129549
|
});
|
|
129369
|
-
|
|
129550
|
+
React11.useEffect(() => {
|
|
129370
129551
|
const next = Number(fallbackValue);
|
|
129371
129552
|
if (Number.isFinite(next)) setValue(Math.min(max, Math.max(min, next)));
|
|
129372
129553
|
}, [fallbackValue, min, max]);
|
|
129373
|
-
const stepperBag =
|
|
129554
|
+
const stepperBag = React11.useContext(FormValuesContext);
|
|
129374
129555
|
const stepperFieldId = props.__formFieldId;
|
|
129375
129556
|
const stepperRuleKey = props.validation ? JSON.stringify(props.validation) : "";
|
|
129376
|
-
|
|
129557
|
+
React11.useEffect(() => {
|
|
129377
129558
|
if (!stepperBag || !stepperFieldId) return;
|
|
129378
129559
|
stepperBag.register(stepperFieldId, props.validation);
|
|
129379
129560
|
return () => stepperBag.unregister(stepperFieldId);
|
|
129380
129561
|
}, [stepperFieldId, stepperBag, stepperRuleKey]);
|
|
129381
129562
|
const serviceBound = typeof props.valuePath === "string" && isBinding(props.valuePath) && props.valuePath.startsWith("$service:");
|
|
129382
|
-
const [bagValue, setBagValue] =
|
|
129383
|
-
|
|
129563
|
+
const [bagValue, setBagValue] = React11.useState(() => serviceBound ? boundValue != null ? encodeStepperFieldValue(boundValue, { min, max }) : "" : encodeStepperFieldValue(value, { min, max }));
|
|
129564
|
+
React11.useEffect(() => {
|
|
129384
129565
|
if (!serviceBound || boundValue == null) return;
|
|
129385
129566
|
setBagValue(encodeStepperFieldValue(boundValue, { min, max }));
|
|
129386
129567
|
}, [boundValue, serviceBound, min, max]);
|
|
129387
|
-
|
|
129568
|
+
React11.useEffect(() => {
|
|
129388
129569
|
if (serviceBound) return;
|
|
129389
129570
|
setBagValue(encodeStepperFieldValue(value, { min, max }));
|
|
129390
129571
|
}, [value, serviceBound, min, max]);
|
|
129391
|
-
|
|
129572
|
+
React11.useEffect(() => {
|
|
129392
129573
|
if (stepperBag && stepperFieldId) stepperBag.set(stepperFieldId, bagValue);
|
|
129393
129574
|
}, [bagValue, stepperFieldId, stepperBag]);
|
|
129394
129575
|
const dispatch = (next) => {
|
|
@@ -129403,7 +129584,7 @@ var init_renderNode = __esm({
|
|
|
129403
129584
|
dispatch(next);
|
|
129404
129585
|
return next;
|
|
129405
129586
|
};
|
|
129406
|
-
const [pressed, setPressed] =
|
|
129587
|
+
const [pressed, setPressed] = React11.useState({ text: "", count: 0 });
|
|
129407
129588
|
const bump = (delta) => commit(value + delta);
|
|
129408
129589
|
const press = (delta) => {
|
|
129409
129590
|
const next = bump(delta);
|
|
@@ -129545,9 +129726,9 @@ var init_renderNode = __esm({
|
|
|
129545
129726
|
const items = Array.isArray(props.items) ? props.items : [];
|
|
129546
129727
|
const gridStagger = ctx.reduceMotion() ? 0 : Number(props.staggerMs ?? props.stagger_ms ?? 0);
|
|
129547
129728
|
const stagger = (el2, i2) => {
|
|
129548
|
-
if (!(gridStagger > 0) || !
|
|
129729
|
+
if (!(gridStagger > 0) || !React11.isValidElement(el2)) return el2;
|
|
129549
129730
|
const prev = el2.props.style ?? {};
|
|
129550
|
-
return
|
|
129731
|
+
return React11.cloneElement(el2, { style: { ...prev, animationDelay: `${i2 * gridStagger}ms` } });
|
|
129551
129732
|
};
|
|
129552
129733
|
const inner = itemsPath && items[0] && ctx.provider ? /* @__PURE__ */ jsx11(
|
|
129553
129734
|
BoundList,
|
|
@@ -129601,13 +129782,13 @@ var init_renderNode = __esm({
|
|
|
129601
129782
|
revealProgress = /* @__PURE__ */ new Map();
|
|
129602
129783
|
countWords = (s2) => s2.split(/\s+/).filter((t2) => t2 !== "").length;
|
|
129603
129784
|
RevealText = ({ text: text9, reduce, markdownHtml }) => {
|
|
129604
|
-
const tokens2 =
|
|
129605
|
-
const total =
|
|
129785
|
+
const tokens2 = React11.useMemo(() => text9.split(/(\s+)/).filter((t2) => t2 !== ""), [text9]);
|
|
129786
|
+
const total = React11.useMemo(
|
|
129606
129787
|
() => markdownHtml != null ? revealHtml(markdownHtml, 0, void 0).total : countWords(text9),
|
|
129607
129788
|
[text9, markdownHtml]
|
|
129608
129789
|
);
|
|
129609
|
-
const [shown2, setShown] =
|
|
129610
|
-
const prevRef =
|
|
129790
|
+
const [shown2, setShown] = React11.useState(total);
|
|
129791
|
+
const prevRef = React11.useRef(null);
|
|
129611
129792
|
useIsomorphicLayoutEffect(() => {
|
|
129612
129793
|
const prev = prevRef.current;
|
|
129613
129794
|
prevRef.current = text9;
|
|
@@ -129730,8 +129911,8 @@ var init_renderNode = __esm({
|
|
|
129730
129911
|
const boundInitials = useResolvedScalar(props.initials != null && isBinding(props.initials) ? props.initials : void 0, ctx);
|
|
129731
129912
|
const boundAlt = useResolvedScalar(contentDescription, ctx);
|
|
129732
129913
|
const fadeIn = motionDefaultsAnimate(ctx);
|
|
129733
|
-
const [shownSrc, setShownSrc] =
|
|
129734
|
-
const imgRef =
|
|
129914
|
+
const [shownSrc, setShownSrc] = React11.useState(null);
|
|
129915
|
+
const imgRef = React11.useRef(null);
|
|
129735
129916
|
const hasSource = props.url != null || props.initials != null || props.asset != null || props.icon != null;
|
|
129736
129917
|
const banner = fillWidth === true || props.width == null && props.height == null && !props.initials;
|
|
129737
129918
|
const w2 = banner ? "100%" : props.width ?? 40;
|
|
@@ -129745,7 +129926,7 @@ var init_renderNode = __esm({
|
|
|
129745
129926
|
const ph = props.placeholder ? C2(props.placeholder, "#e6e6e6") : void 0;
|
|
129746
129927
|
const imgUrl = props.url != null && isBinding(props.url) ? boundUrl : props.url;
|
|
129747
129928
|
const imgInitials = props.initials != null && isBinding(props.initials) ? boundInitials : props.initials;
|
|
129748
|
-
const [failedSrc, setFailedSrc] =
|
|
129929
|
+
const [failedSrc, setFailedSrc] = React11.useState(null);
|
|
129749
129930
|
const resolvedSrc = imgUrl && typeof imgUrl === "string" ? resolveAssetUrl(imgUrl, ctx.assetBaseUrl) : null;
|
|
129750
129931
|
const imgShown = !fadeIn || resolvedSrc != null && shownSrc === resolvedSrc;
|
|
129751
129932
|
useIsomorphicLayoutEffect(() => {
|
|
@@ -129778,7 +129959,7 @@ var init_renderNode = __esm({
|
|
|
129778
129959
|
if (imgInitials && typeof imgInitials === "string") {
|
|
129779
129960
|
const alt = asText2(boundAlt).trim();
|
|
129780
129961
|
const circle = avatarCircle(String(imgInitials), typeof w2 === "number" ? w2 : 40, C2, false, bodyFont(ctx));
|
|
129781
|
-
return
|
|
129962
|
+
return React11.cloneElement(circle, alt ? { role: "img", "aria-label": alt, [SELF_RENDERED_LEAF]: true } : { [ROLE_WHEN_NAMED]: "img", [SELF_RENDERED_LEAF]: true });
|
|
129782
129963
|
}
|
|
129783
129964
|
if (props.icon != null && props.url == null && props.asset == null && imgInitials == null) {
|
|
129784
129965
|
const side2 = typeof w2 === "number" ? w2 : 40;
|
|
@@ -129843,7 +130024,7 @@ var init_renderNode = __esm({
|
|
|
129843
130024
|
const a11y = described ? { role: "img", "aria-label": String(contentDescription), [SELF_RENDERED_LEAF]: true } : { "aria-hidden": "true", [INFERRED_DECORATIVE]: true, [SELF_RENDERED_LEAF]: true, [ROLE_WHEN_NAMED]: "img" };
|
|
129844
130025
|
const glyph = iconSvg(iconName, { size, color: C2(resolveScalarStatic(props.tint, ctx) ?? "textPrimary", "#636b78") });
|
|
129845
130026
|
const swap = useIconSwap(iconName, ctx);
|
|
129846
|
-
const animatedGlyph = Object.keys(effectStyle).length || swap.key > 0 ?
|
|
130027
|
+
const animatedGlyph = Object.keys(effectStyle).length || swap.key > 0 ? React11.cloneElement(glyph, { style: { ...glyph.props.style, ...swap.style, ...effectStyle }, key: swap.key }) : glyph;
|
|
129847
130028
|
return /* @__PURE__ */ jsx11("span", { ...a11y, style: { display: "inline-grid", placeItems: "center", width: size + 6, height: size + 6, lineHeight: 1, flex: "none", ...wrap }, children: animatedGlyph });
|
|
129848
130029
|
});
|
|
129849
130030
|
EMPTY_STATE_SPACING = {
|
|
@@ -130015,12 +130196,12 @@ var init_renderNode = __esm({
|
|
|
130015
130196
|
const C2 = ctx.color;
|
|
130016
130197
|
const bound = useResolvedScalar(props.valuePath, ctx);
|
|
130017
130198
|
const boundText = props.valuePath != null ? typeof bound === "string" ? bound : typeof bound === "number" ? String(bound) : "" : void 0;
|
|
130018
|
-
const [typed, setTyped] =
|
|
130019
|
-
|
|
130199
|
+
const [typed, setTyped] = React11.useState(void 0);
|
|
130200
|
+
React11.useEffect(() => {
|
|
130020
130201
|
setTyped(void 0);
|
|
130021
130202
|
}, [boundText, props.value, props.valuePath, typeof props.valuePath === "string" && props.valuePath.startsWith("$service:") ? ctx.provider : null]);
|
|
130022
130203
|
const otpPath = typeof props.valuePath === "string" && props.valuePath.startsWith("$service:") ? servicePath(props.valuePath) : "";
|
|
130023
|
-
|
|
130204
|
+
React11.useEffect(() => {
|
|
130024
130205
|
if (!ctx.provider || !otpPath) return;
|
|
130025
130206
|
let subscribing = true;
|
|
130026
130207
|
let active = true;
|
|
@@ -130110,12 +130291,38 @@ var init_renderNode = __esm({
|
|
|
130110
130291
|
};
|
|
130111
130292
|
return /* @__PURE__ */ jsx11("div", { ...a11y, style: { width: "100%", height: 6, borderRadius: 999, background: C2(boundTokenName(props.trackColorPath, props.trackColor, ctx) ?? "surfaceTertiary", "#eee"), overflow: "hidden", ...wrap }, children: /* @__PURE__ */ jsx11("div", { style: { width: `${Math.round((p2 ?? 0.4) * 100)}%`, height: "100%", borderRadius: 999, background: C2(boundTokenName(props.tintPath, props.tint, ctx) ?? "accentPrimary", "#116DFF"), opacity: p2 == null ? 0.45 : 1, ...animatedFill ? { transition: ctx.motionTransition(ctx.kit?.motion) } : {} } }) });
|
|
130112
130293
|
});
|
|
130294
|
+
SnackbarNode = withExtras("SnackbarNode", ({ props, ctx, wrap }) => {
|
|
130295
|
+
const [phase, setPhase] = React11.useState("shown");
|
|
130296
|
+
const hideAfter = ctx.empty ? void 0 : snackbarAutoHideMs(props.durationMs);
|
|
130297
|
+
const identity = snackbarIdentity(props);
|
|
130298
|
+
React11.useEffect(() => {
|
|
130299
|
+
setPhase("shown");
|
|
130300
|
+
if (hideAfter === void 0) return;
|
|
130301
|
+
let fade;
|
|
130302
|
+
const hide = setTimeout(() => {
|
|
130303
|
+
setPhase("fading");
|
|
130304
|
+
fade = setTimeout(() => setPhase("gone"), SNACKBAR_FADE_MS);
|
|
130305
|
+
}, hideAfter);
|
|
130306
|
+
return () => {
|
|
130307
|
+
clearTimeout(hide);
|
|
130308
|
+
if (fade !== void 0) clearTimeout(fade);
|
|
130309
|
+
};
|
|
130310
|
+
}, [hideAfter, identity]);
|
|
130311
|
+
if (phase === "gone") return null;
|
|
130312
|
+
const dot = sevColor(ctx, props.severity ?? "info");
|
|
130313
|
+
return /* @__PURE__ */ jsxs8("div", { "data-snackbar-phase": phase, style: { display: "flex", alignItems: "center", gap: 10, background: "#1c1f26", color: "#fff", borderRadius: ctx.radius("md", 10), padding: "12px 14px", width: "100%", boxSizing: "border-box", fontFamily: bodyFont(ctx), fontWeight: 500, fontSize: pxToRem(14), ...wrap, ...phase === "fading" ? { opacity: 0, transition: `opacity ${SNACKBAR_FADE_MS}ms ease-out` } : {} }, children: [
|
|
130314
|
+
/* @__PURE__ */ jsx11("span", { style: { width: 18, height: 18, borderRadius: "50%", background: dot, display: "grid", placeItems: "center", fontSize: 11, flex: "none" }, children: "\u2713" }),
|
|
130315
|
+
/* @__PURE__ */ jsx11("span", { style: { flex: 1, minWidth: 0 }, children: txt(props.message, ctx) }),
|
|
130316
|
+
actionTextButton(ctx, props.action, asBoundText(props.actionLabel, ctx) || "Take action", "#fff", { flex: "none", textDecoration: "underline" })
|
|
130317
|
+
] });
|
|
130318
|
+
});
|
|
130113
130319
|
ACTIVITY_DEFAULT_NAME = "Loading";
|
|
130320
|
+
ACTIVITY_RING_ARC = 0.25;
|
|
130114
130321
|
ActivityIndicatorNode = withExtras("ActivityIndicatorNode", ({ props, ctx, wrap }) => {
|
|
130115
130322
|
const C2 = ctx.color;
|
|
130116
130323
|
const size = props.size ?? 24;
|
|
130117
130324
|
const tint = C2(boundTokenName(props.tintPath, props.tint, ctx) ?? "accentPrimary", "#116DFF");
|
|
130118
|
-
const track = C2
|
|
130325
|
+
const track = activityRingTrack(C2, tint, { cssMix: true });
|
|
130119
130326
|
const thick = Math.max(3, Math.round(size / 8));
|
|
130120
130327
|
const bound = useResolvedScalar(props.valuePath, ctx);
|
|
130121
130328
|
const aiRaw = props.valuePath != null ? bound : props.value;
|
|
@@ -130128,7 +130335,11 @@ var init_renderNode = __esm({
|
|
|
130128
130335
|
return /* @__PURE__ */ jsx11("div", { role: "progressbar", "aria-label": ACTIVITY_DEFAULT_NAME, ...a11y, style: { width: size, height: size, borderRadius: "50%", flex: "none", background: `conic-gradient(${tint} ${pct * 360}deg, ${track} 0deg)`, WebkitMask: ringMask, mask: ringMask, ...wrap } });
|
|
130129
130336
|
}
|
|
130130
130337
|
ensureSpinKeyframes();
|
|
130131
|
-
|
|
130338
|
+
if (props.ring === true) {
|
|
130339
|
+
const ringMask = `radial-gradient(farthest-side, transparent calc(100% - ${thick}px), #000 calc(100% - ${thick}px))`;
|
|
130340
|
+
return /* @__PURE__ */ jsx11("div", { role: "status", "aria-busy": "true", "aria-label": ACTIVITY_DEFAULT_NAME, "data-activity-look": "indeterminate-ring", style: { width: size, height: size, borderRadius: "50%", flex: "none", background: `conic-gradient(${tint} ${ACTIVITY_RING_ARC * 360}deg, ${track} 0deg)`, WebkitMask: ringMask, mask: ringMask, animation: ctx.empty || ctx.reduceMotion() ? void 0 : "himalaya-spin 0.8s linear infinite", ...wrap } });
|
|
130341
|
+
}
|
|
130342
|
+
return /* @__PURE__ */ jsx11("div", { role: "status", "aria-busy": "true", "aria-label": ACTIVITY_DEFAULT_NAME, style: { width: size, height: size, borderRadius: "50%", border: `${thick}px solid ${track}`, borderTopColor: tint, boxSizing: "border-box", flex: "none", animation: ctx.empty || ctx.reduceMotion() ? void 0 : "himalaya-spin 0.8s linear infinite", ...wrap } });
|
|
130132
130343
|
});
|
|
130133
130344
|
NATIVELY_TABBABLE = 'a[href], area[href], button, input:not([type="hidden"]), select, textarea, iframe, object, embed, audio[controls], video[controls], summary, [contenteditable]:not([contenteditable="false"]), [tabindex]';
|
|
130134
130345
|
BottomSheetNode = (p2) => sheetIsNonModal(p2.props?.modal) ? /* @__PURE__ */ jsx11(BottomDrawerNode, { ...p2 }) : /* @__PURE__ */ jsx11(ModalBottomSheetNode, { ...p2 });
|
|
@@ -130140,8 +130351,8 @@ var init_renderNode = __esm({
|
|
|
130140
130351
|
const gated = props.presentedPath != null || props.presented != null;
|
|
130141
130352
|
const presented = props.presentedPath != null ? bound : props.presented;
|
|
130142
130353
|
const gateOpen = !gated || presented === true || presented === "true";
|
|
130143
|
-
const [dismissed, setDismissed] =
|
|
130144
|
-
|
|
130354
|
+
const [dismissed, setDismissed] = React11.useState(false);
|
|
130355
|
+
React11.useEffect(() => {
|
|
130145
130356
|
if (!gateOpen) setDismissed(false);
|
|
130146
130357
|
}, [gateOpen]);
|
|
130147
130358
|
const shown2 = gateOpen && !dismissed;
|
|
@@ -130149,26 +130360,26 @@ var init_renderNode = __esm({
|
|
|
130149
130360
|
const dismissible = props.dismissible !== false;
|
|
130150
130361
|
const edge = sheetEdge(props.edge);
|
|
130151
130362
|
const detents = edge === "bottom" ? sheetDetents(props.detents) : [];
|
|
130152
|
-
const [detentIndex, setDetentIndex] =
|
|
130153
|
-
|
|
130363
|
+
const [detentIndex, setDetentIndex] = React11.useState(0);
|
|
130364
|
+
React11.useEffect(() => {
|
|
130154
130365
|
if (!shown2) setDetentIndex(0);
|
|
130155
130366
|
}, [shown2]);
|
|
130156
|
-
const dialogRef =
|
|
130367
|
+
const dialogRef = React11.useRef(null);
|
|
130157
130368
|
const trapTab = useModalOverlay(dialogRef, shown2 && modal);
|
|
130158
|
-
const latest =
|
|
130369
|
+
const latest = React11.useRef({ ctx, onDismiss: props.onDismiss });
|
|
130159
130370
|
latest.current = { ctx, onDismiss: props.onDismiss };
|
|
130160
|
-
const closed =
|
|
130161
|
-
|
|
130371
|
+
const closed = React11.useRef(false);
|
|
130372
|
+
React11.useEffect(() => {
|
|
130162
130373
|
if (shown2) closed.current = false;
|
|
130163
130374
|
}, [shown2]);
|
|
130164
|
-
const dismiss =
|
|
130375
|
+
const dismiss = React11.useCallback(() => {
|
|
130165
130376
|
if (closed.current) return;
|
|
130166
130377
|
closed.current = true;
|
|
130167
130378
|
setDismissed(true);
|
|
130168
130379
|
const { ctx: now, onDismiss } = latest.current;
|
|
130169
130380
|
if (onDismiss != null) now.onAction?.(resolveItemDeep2(onDismiss, now));
|
|
130170
130381
|
}, []);
|
|
130171
|
-
|
|
130382
|
+
React11.useEffect(() => {
|
|
130172
130383
|
if (!shown2 || !dismissible) return;
|
|
130173
130384
|
const doc = dialogRef.current?.ownerDocument;
|
|
130174
130385
|
if (!doc) return;
|
|
@@ -130182,11 +130393,11 @@ var init_renderNode = __esm({
|
|
|
130182
130393
|
doc.addEventListener("keydown", onKey, true);
|
|
130183
130394
|
return () => doc.removeEventListener("keydown", onKey, true);
|
|
130184
130395
|
}, [shown2, dismissible, dismiss]);
|
|
130185
|
-
const drag =
|
|
130396
|
+
const drag = React11.useRef(null);
|
|
130186
130397
|
const reduceMotion = ctx.reduceMotion();
|
|
130187
|
-
const [mounted, setMounted] =
|
|
130188
|
-
const [entered, setEntered] =
|
|
130189
|
-
|
|
130398
|
+
const [mounted, setMounted] = React11.useState(shown2);
|
|
130399
|
+
const [entered, setEntered] = React11.useState(shown2 && ctx.staticRender === true);
|
|
130400
|
+
React11.useEffect(() => {
|
|
130190
130401
|
if (shown2) {
|
|
130191
130402
|
setMounted(true);
|
|
130192
130403
|
if (reduceMotion || typeof requestAnimationFrame !== "function") {
|
|
@@ -130210,8 +130421,8 @@ var init_renderNode = __esm({
|
|
|
130210
130421
|
const t2 = setTimeout(() => setMounted(false), DRAWER_EXIT_MS);
|
|
130211
130422
|
return () => clearTimeout(t2);
|
|
130212
130423
|
}, [shown2, reduceMotion]);
|
|
130213
|
-
const scrimRef =
|
|
130214
|
-
const [rtl, setRtl] =
|
|
130424
|
+
const scrimRef = React11.useRef(null);
|
|
130425
|
+
const [rtl, setRtl] = React11.useState(false);
|
|
130215
130426
|
useIsomorphicLayoutEffect(() => {
|
|
130216
130427
|
const el2 = scrimRef.current;
|
|
130217
130428
|
if (el2 && el2.ownerDocument.defaultView) setRtl(el2.ownerDocument.defaultView.getComputedStyle(el2).direction === "rtl");
|
|
@@ -130319,8 +130530,8 @@ var init_renderNode = __esm({
|
|
|
130319
130530
|
const gated = props.presentedPath != null || props.presented != null;
|
|
130320
130531
|
const presented = props.presentedPath != null ? bound : props.presented;
|
|
130321
130532
|
const gateOpen = !gated || presented === true || presented === "true";
|
|
130322
|
-
const [dismissed, setDismissed] =
|
|
130323
|
-
|
|
130533
|
+
const [dismissed, setDismissed] = React11.useState(false);
|
|
130534
|
+
React11.useEffect(() => {
|
|
130324
130535
|
if (!gateOpen) setDismissed(false);
|
|
130325
130536
|
}, [gateOpen]);
|
|
130326
130537
|
const shown2 = gateOpen && !dismissed;
|
|
@@ -130328,18 +130539,18 @@ var init_renderNode = __esm({
|
|
|
130328
130539
|
const autoMs = drawerAutoDismissMs(props.autoDismissMs);
|
|
130329
130540
|
const placement = sheetPlacement(props.placement);
|
|
130330
130541
|
const detents = sheetDetents(props.detents);
|
|
130331
|
-
const [detentIndex, setDetentIndex] =
|
|
130332
|
-
const [expanded, setExpanded] =
|
|
130333
|
-
|
|
130542
|
+
const [detentIndex, setDetentIndex] = React11.useState(0);
|
|
130543
|
+
const [expanded, setExpanded] = React11.useState(false);
|
|
130544
|
+
React11.useEffect(() => {
|
|
130334
130545
|
if (!shown2) {
|
|
130335
130546
|
setDetentIndex(0);
|
|
130336
130547
|
setExpanded(false);
|
|
130337
130548
|
}
|
|
130338
130549
|
}, [shown2]);
|
|
130339
130550
|
const reduceMotion = ctx.reduceMotion();
|
|
130340
|
-
const [mounted, setMounted] =
|
|
130341
|
-
const [entered, setEntered] =
|
|
130342
|
-
|
|
130551
|
+
const [mounted, setMounted] = React11.useState(shown2);
|
|
130552
|
+
const [entered, setEntered] = React11.useState(shown2 && ctx.staticRender === true);
|
|
130553
|
+
React11.useEffect(() => {
|
|
130343
130554
|
if (shown2) {
|
|
130344
130555
|
setMounted(true);
|
|
130345
130556
|
if (reduceMotion || typeof requestAnimationFrame !== "function") {
|
|
@@ -130363,10 +130574,10 @@ var init_renderNode = __esm({
|
|
|
130363
130574
|
const t2 = setTimeout(() => setMounted(false), DRAWER_EXIT_MS);
|
|
130364
130575
|
return () => clearTimeout(t2);
|
|
130365
130576
|
}, [shown2, reduceMotion]);
|
|
130366
|
-
const anchorRef =
|
|
130367
|
-
const panelRef =
|
|
130368
|
-
const [host, setHost] =
|
|
130369
|
-
const [hostTop, setHostTop] =
|
|
130577
|
+
const anchorRef = React11.useRef(null);
|
|
130578
|
+
const panelRef = React11.useRef(null);
|
|
130579
|
+
const [host, setHost] = React11.useState(null);
|
|
130580
|
+
const [hostTop, setHostTop] = React11.useState(true);
|
|
130370
130581
|
useIsomorphicLayoutEffect(() => {
|
|
130371
130582
|
if (!host) {
|
|
130372
130583
|
setHostTop(true);
|
|
@@ -130388,13 +130599,13 @@ var init_renderNode = __esm({
|
|
|
130388
130599
|
};
|
|
130389
130600
|
}, [host, mounted]);
|
|
130390
130601
|
useIsomorphicLayoutEffect(() => {
|
|
130391
|
-
const
|
|
130392
|
-
const own5 = (attr3) => Array.from(
|
|
130602
|
+
const scope2 = anchorRef.current?.closest(`[${MODAL_SCOPE_ATTR}]`);
|
|
130603
|
+
const own5 = (attr3) => Array.from(scope2?.querySelectorAll(`[${attr3}]`) ?? []).find((el2) => el2.closest(`[${MODAL_SCOPE_ATTR}]`) === scope2) ?? null;
|
|
130393
130604
|
const overlay = placement === "overlay" ? own5(SHEET_OVERLAY_HOST_ATTR) : null;
|
|
130394
130605
|
setHost(overlay ?? own5(DRAWER_HOST_ATTR));
|
|
130395
130606
|
}, [mounted, placement]);
|
|
130396
130607
|
const overHost = host?.hasAttribute(SHEET_OVERLAY_HOST_ATTR) ?? false;
|
|
130397
|
-
const [regionPx, setRegionPx] =
|
|
130608
|
+
const [regionPx, setRegionPx] = React11.useState(0);
|
|
130398
130609
|
useIsomorphicLayoutEffect(() => {
|
|
130399
130610
|
if (!detents.length || !mounted) return;
|
|
130400
130611
|
const region = host ? overHost ? host.parentElement : host.previousElementSibling : null;
|
|
@@ -130404,38 +130615,38 @@ var init_renderNode = __esm({
|
|
|
130404
130615
|
window.addEventListener("resize", measure2);
|
|
130405
130616
|
return () => window.removeEventListener("resize", measure2);
|
|
130406
130617
|
}, [host, overHost, mounted, detents.length]);
|
|
130407
|
-
const latest =
|
|
130618
|
+
const latest = React11.useRef({ ctx, onDismiss: props.onDismiss });
|
|
130408
130619
|
latest.current = { ctx, onDismiss: props.onDismiss };
|
|
130409
|
-
const closed =
|
|
130410
|
-
const remaining =
|
|
130411
|
-
|
|
130620
|
+
const closed = React11.useRef(false);
|
|
130621
|
+
const remaining = React11.useRef(autoMs ?? 0);
|
|
130622
|
+
React11.useEffect(() => {
|
|
130412
130623
|
if (!shown2) return;
|
|
130413
130624
|
closed.current = false;
|
|
130414
130625
|
remaining.current = autoMs ?? 0;
|
|
130415
130626
|
}, [shown2, autoMs]);
|
|
130416
|
-
const close =
|
|
130627
|
+
const close = React11.useCallback(() => {
|
|
130417
130628
|
if (closed.current) return;
|
|
130418
130629
|
closed.current = true;
|
|
130419
130630
|
setDismissed(true);
|
|
130420
130631
|
const { ctx: now, onDismiss } = latest.current;
|
|
130421
130632
|
if (onDismiss != null) now.onAction?.(resolveItemDeep2(onDismiss, now));
|
|
130422
130633
|
}, []);
|
|
130423
|
-
const toDetent =
|
|
130634
|
+
const toDetent = React11.useCallback((next, from) => {
|
|
130424
130635
|
if (next > from) setExpanded(true);
|
|
130425
130636
|
setDetentIndex(next);
|
|
130426
130637
|
}, []);
|
|
130427
|
-
const [hover, setHover] =
|
|
130428
|
-
const [pressed, setPressed] =
|
|
130429
|
-
const [focusIn, setFocusIn] =
|
|
130638
|
+
const [hover, setHover] = React11.useState(false);
|
|
130639
|
+
const [pressed, setPressed] = React11.useState(false);
|
|
130640
|
+
const [focusIn, setFocusIn] = React11.useState(false);
|
|
130430
130641
|
const paused = hover || pressed || focusIn;
|
|
130431
|
-
|
|
130642
|
+
React11.useEffect(() => {
|
|
130432
130643
|
if (!shown2) {
|
|
130433
130644
|
setHover(false);
|
|
130434
130645
|
setPressed(false);
|
|
130435
130646
|
setFocusIn(false);
|
|
130436
130647
|
}
|
|
130437
130648
|
}, [shown2]);
|
|
130438
|
-
|
|
130649
|
+
React11.useEffect(() => {
|
|
130439
130650
|
if (!shown2 || !hostTop || autoMs == null || paused || expanded) return;
|
|
130440
130651
|
const since = Date.now();
|
|
130441
130652
|
const t2 = setTimeout(() => {
|
|
@@ -130446,7 +130657,7 @@ var init_renderNode = __esm({
|
|
|
130446
130657
|
remaining.current = drawerRemainingMs(remaining.current, Date.now() - since);
|
|
130447
130658
|
};
|
|
130448
130659
|
}, [shown2, hostTop, autoMs, paused, expanded, close]);
|
|
130449
|
-
|
|
130660
|
+
React11.useEffect(() => {
|
|
130450
130661
|
if (!shown2 || !dismissible) return;
|
|
130451
130662
|
const doc = panelRef.current?.ownerDocument;
|
|
130452
130663
|
if (!doc) return;
|
|
@@ -130459,13 +130670,13 @@ var init_renderNode = __esm({
|
|
|
130459
130670
|
doc.addEventListener("keydown", onKey, true);
|
|
130460
130671
|
return () => doc.removeEventListener("keydown", onKey, true);
|
|
130461
130672
|
}, [shown2, dismissible, close, host]);
|
|
130462
|
-
const drag =
|
|
130463
|
-
const dragged =
|
|
130464
|
-
const [dragDy, setDragDy] =
|
|
130465
|
-
|
|
130673
|
+
const drag = React11.useRef(null);
|
|
130674
|
+
const dragged = React11.useRef(false);
|
|
130675
|
+
const [dragDy, setDragDy] = React11.useState(0);
|
|
130676
|
+
React11.useEffect(() => {
|
|
130466
130677
|
if (!shown2) setDragDy(0);
|
|
130467
130678
|
}, [shown2]);
|
|
130468
|
-
const dragState =
|
|
130679
|
+
const dragState = React11.useRef({ index: 0, count: 0, dismissible });
|
|
130469
130680
|
if (!shown2 && !mounted) return /* @__PURE__ */ jsx11("span", { ref: anchorRef, "data-bottom-drawer-anchor": "", hidden: true, ...{ [NODE_EXTRAS_TARGET]: "bottom-drawer-panel" } });
|
|
130470
130681
|
const sheet = idiomControls(ctx.idiom).sheet;
|
|
130471
130682
|
const r3 = `${sheet.cornerRadius}px`;
|
|
@@ -130607,23 +130818,23 @@ var init_renderNode = __esm({
|
|
|
130607
130818
|
const rich = title !== "";
|
|
130608
130819
|
const trigger = resolveTooltipTrigger(props.trigger, "pointer");
|
|
130609
130820
|
const edge = resolveOverlayEdge("Tooltip", props.edge);
|
|
130610
|
-
const [open, setOpen] =
|
|
130611
|
-
const anchorRef =
|
|
130612
|
-
const bubbleRef =
|
|
130613
|
-
const pressTimer =
|
|
130821
|
+
const [open, setOpen] = React11.useState(false);
|
|
130822
|
+
const anchorRef = React11.useRef(null);
|
|
130823
|
+
const bubbleRef = React11.useRef(null);
|
|
130824
|
+
const pressTimer = React11.useRef(null);
|
|
130614
130825
|
const placement = useFlippedEdge(edge, open, bubbleRef, anchorRef);
|
|
130615
130826
|
const placed = placement.edge;
|
|
130616
|
-
const latest =
|
|
130827
|
+
const latest = React11.useRef({ ctx, onDismiss: props.onDismiss, open });
|
|
130617
130828
|
latest.current = { ctx, onDismiss: props.onDismiss, open };
|
|
130618
|
-
const holding =
|
|
130619
|
-
const [needsTabStop, setNeedsTabStop] =
|
|
130829
|
+
const holding = React11.useRef({ hover: false, focus: false });
|
|
130830
|
+
const [needsTabStop, setNeedsTabStop] = React11.useState(false);
|
|
130620
130831
|
useIsomorphicLayoutEffect(() => {
|
|
130621
130832
|
const el2 = anchorRef.current;
|
|
130622
130833
|
const want = trigger === "hover" && el2 != null && !hasTabStop(el2);
|
|
130623
130834
|
if (want !== needsTabStop) setNeedsTabStop(want);
|
|
130624
130835
|
});
|
|
130625
|
-
const show =
|
|
130626
|
-
const dismiss =
|
|
130836
|
+
const show = React11.useCallback(() => setOpen(true), []);
|
|
130837
|
+
const dismiss = React11.useCallback(() => {
|
|
130627
130838
|
holding.current = { hover: false, focus: false };
|
|
130628
130839
|
const { ctx: now, onDismiss, open: wasOpen } = latest.current;
|
|
130629
130840
|
if (!wasOpen) return;
|
|
@@ -130631,7 +130842,7 @@ var init_renderNode = __esm({
|
|
|
130631
130842
|
setOpen(false);
|
|
130632
130843
|
if (onDismiss != null) now.onAction?.(resolveItemDeep2(onDismiss, now));
|
|
130633
130844
|
}, []);
|
|
130634
|
-
|
|
130845
|
+
React11.useEffect(() => {
|
|
130635
130846
|
if (!open) return;
|
|
130636
130847
|
const doc = bubbleRef.current?.ownerDocument;
|
|
130637
130848
|
if (!doc) return;
|
|
@@ -130655,7 +130866,7 @@ var init_renderNode = __esm({
|
|
|
130655
130866
|
if (timer) clearTimeout(timer);
|
|
130656
130867
|
};
|
|
130657
130868
|
}, [open, trigger, dismiss]);
|
|
130658
|
-
|
|
130869
|
+
React11.useEffect(() => () => {
|
|
130659
130870
|
if (pressTimer.current) clearTimeout(pressTimer.current);
|
|
130660
130871
|
}, []);
|
|
130661
130872
|
const cancelPress = () => {
|
|
@@ -130695,7 +130906,7 @@ var init_renderNode = __esm({
|
|
|
130695
130906
|
};
|
|
130696
130907
|
const hint = [title, text9].filter((s2) => s2 !== "").join(". ");
|
|
130697
130908
|
const anchor = props.anchor ? renderNode(props.anchor, ctx) : null;
|
|
130698
|
-
const wrapperHintId = `hm-tip-hint${
|
|
130909
|
+
const wrapperHintId = `hm-tip-hint${React11.useId()}`;
|
|
130699
130910
|
useIsomorphicLayoutEffect(() => {
|
|
130700
130911
|
const wrapper = anchorRef.current;
|
|
130701
130912
|
if (!wrapper || !hint || needsTabStop) return;
|
|
@@ -130717,7 +130928,7 @@ var init_renderNode = __esm({
|
|
|
130717
130928
|
/* @__PURE__ */ jsx11(OverlayAnchorClip, { wrap, children: needsTabStop ? /* @__PURE__ */ jsxs8(Fragment4, { children: [
|
|
130718
130929
|
anchor,
|
|
130719
130930
|
hint && /* @__PURE__ */ jsx11("span", { id: wrapperHintId, hidden: true, "data-hm-a11y-hint": "", children: hint })
|
|
130720
|
-
] }) : hint &&
|
|
130931
|
+
] }) : hint && React11.isValidElement(anchor) ? /* @__PURE__ */ jsxs8(Fragment4, { children: [
|
|
130721
130932
|
/* @__PURE__ */ jsx11(A11yHintDescription, { hint, children: anchor }),
|
|
130722
130933
|
/* @__PURE__ */ jsx11("span", { id: wrapperHintId, hidden: true, "data-hm-a11y-hint": "", children: hint })
|
|
130723
130934
|
] }) : /* @__PURE__ */ jsxs8(Fragment4, { children: [
|
|
@@ -130738,24 +130949,24 @@ var init_renderNode = __esm({
|
|
|
130738
130949
|
const gateOpen = gate === true || gate === "true";
|
|
130739
130950
|
const literal = props.presentedPath == null && props.presented != null;
|
|
130740
130951
|
const identity = { path: props.presentedPath, presented: props.presented, provider: ctx.provider };
|
|
130741
|
-
const [local, setLocal] =
|
|
130952
|
+
const [local, setLocal] = React11.useState({ ...identity, opened: false, dismissed: false });
|
|
130742
130953
|
const sameGate = local.path === identity.path && local.presented === identity.presented && local.provider === identity.provider;
|
|
130743
130954
|
const current = sameGate ? local : { ...identity, opened: false, dismissed: false };
|
|
130744
130955
|
if (!sameGate) setLocal(current);
|
|
130745
|
-
|
|
130956
|
+
React11.useEffect(() => {
|
|
130746
130957
|
if (!gateOpen) setLocal((previous) => previous.dismissed ? { ...previous, dismissed: false } : previous);
|
|
130747
130958
|
}, [gateOpen]);
|
|
130748
130959
|
const shown2 = !gated || (gateOpen || current.opened) && !current.dismissed;
|
|
130749
130960
|
const modal = gated && isOverlayModal("Popover", props.modal);
|
|
130750
|
-
const dialogRef =
|
|
130751
|
-
const anchorRef =
|
|
130752
|
-
const boxRef =
|
|
130961
|
+
const dialogRef = React11.useRef(null);
|
|
130962
|
+
const anchorRef = React11.useRef(null);
|
|
130963
|
+
const boxRef = React11.useRef(null);
|
|
130753
130964
|
const trapTab = useModalOverlay(dialogRef, shown2 && modal);
|
|
130754
130965
|
const placement = useFlippedEdge(resolveOverlayEdge("Popover", props.edge), gated && shown2, dialogRef, boxRef, 6);
|
|
130755
130966
|
const placed = placement.edge;
|
|
130756
|
-
const latest =
|
|
130967
|
+
const latest = React11.useRef({ ctx, onDismiss: props.onDismiss });
|
|
130757
130968
|
latest.current = { ctx, onDismiss: props.onDismiss };
|
|
130758
|
-
|
|
130969
|
+
React11.useEffect(() => {
|
|
130759
130970
|
if (!gated || !shown2) return;
|
|
130760
130971
|
const doc = dialogRef.current?.ownerDocument;
|
|
130761
130972
|
if (!doc) return;
|
|
@@ -130793,8 +131004,8 @@ var init_renderNode = __esm({
|
|
|
130793
131004
|
if (shown2) return;
|
|
130794
131005
|
setLocal({ ...identity, opened: true, dismissed: false });
|
|
130795
131006
|
} : void 0;
|
|
130796
|
-
const [anchorIsButton, setAnchorIsButton] =
|
|
130797
|
-
const [needsSeparateOpener, setNeedsSeparateOpener] =
|
|
131007
|
+
const [anchorIsButton, setAnchorIsButton] = React11.useState(false);
|
|
131008
|
+
const [needsSeparateOpener, setNeedsSeparateOpener] = React11.useState(false);
|
|
130798
131009
|
useIsomorphicLayoutEffect(() => {
|
|
130799
131010
|
const el2 = anchorRef.current;
|
|
130800
131011
|
const want = literal && el2 != null && !hasTabStop(el2);
|
|
@@ -130821,7 +131032,7 @@ var init_renderNode = __esm({
|
|
|
130821
131032
|
});
|
|
130822
131033
|
ChipsInputNode = withExtras("ChipsInputNode", ({ props, ctx, wrap }) => {
|
|
130823
131034
|
const placeholderText = useBoundString(props.placeholder, ctx);
|
|
130824
|
-
const [draft, setDraft] =
|
|
131035
|
+
const [draft, setDraft] = React11.useState("");
|
|
130825
131036
|
const C2 = ctx.color;
|
|
130826
131037
|
const bound = useResolvedScalar(props.valuesPath, ctx);
|
|
130827
131038
|
const raw = props.valuesPath != null ? bound : props.values;
|
|
@@ -131014,7 +131225,7 @@ var init_renderNode = __esm({
|
|
|
131014
131225
|
const who = asText2(a2.initials).trim();
|
|
131015
131226
|
const initials = avatarCircle(who || "?", size, C2, true, bodyFont(ctx));
|
|
131016
131227
|
const photo = typeof a2.imageUrl === "string" && a2.imageUrl && !isBinding(a2.imageUrl) ? a2.imageUrl : "";
|
|
131017
|
-
const circle = photo ?
|
|
131228
|
+
const circle = photo ? React11.cloneElement(
|
|
131018
131229
|
initials,
|
|
131019
131230
|
{ style: { ...initials.props.style, position: "relative", overflow: "hidden" } },
|
|
131020
131231
|
initials.props.children,
|
|
@@ -131022,7 +131233,7 @@ var init_renderNode = __esm({
|
|
|
131022
131233
|
e2.currentTarget.style.display = "none";
|
|
131023
131234
|
}, style: { position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover" } })
|
|
131024
131235
|
) : initials;
|
|
131025
|
-
return who ? /* @__PURE__ */ jsx11("div", { role: "listitem", style: wrapStyle, children:
|
|
131236
|
+
return who ? /* @__PURE__ */ jsx11("div", { role: "listitem", style: wrapStyle, children: React11.cloneElement(circle, { role: "img", "aria-label": who }) }, i2) : /* @__PURE__ */ jsx11("div", { "aria-hidden": "true", style: wrapStyle, children: circle }, i2);
|
|
131026
131237
|
}),
|
|
131027
131238
|
overflow > 0 && /* @__PURE__ */ jsx11("div", { role: "listitem", style: { marginLeft: -(size - shift), width: size, height: size, borderRadius: "50%", border: `2px solid ${C2("surfacePrimary", "#fff")}`, background: C2("surfaceTertiary", "#e6e6e6"), color: C2("textPrimary", "#111"), display: "grid", placeItems: "center", fontSize: size * 0.32, fontWeight: 700, fontFamily: bodyFont(ctx) }, children: /* @__PURE__ */ jsxs8("span", { role: "img", "aria-label": `${overflow} more`, children: [
|
|
131028
131239
|
"+",
|
|
@@ -131043,7 +131254,7 @@ var init_renderNode = __esm({
|
|
|
131043
131254
|
const declared = Array.isArray(props.series) ? props.series : [];
|
|
131044
131255
|
const multi = declared.length > 0;
|
|
131045
131256
|
const singleBound = useBoundValue(ctx, typeof props.valuesPath === "string" && !multi ? props.valuesPath : "");
|
|
131046
|
-
const seriesBindings =
|
|
131257
|
+
const seriesBindings = React11.useMemo(
|
|
131047
131258
|
() => declared.map((d2) => typeof d2?.valuesPath === "string" ? d2.valuesPath : ""),
|
|
131048
131259
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131049
131260
|
[declared.map((d2) => String(d2?.valuesPath ?? "")).join("\0")]
|
|
@@ -131189,9 +131400,9 @@ var init_renderNode = __esm({
|
|
|
131189
131400
|
] }) });
|
|
131190
131401
|
});
|
|
131191
131402
|
ShapeNode = withExtras("ShapeNode", ({ props, ctx, wrap }) => {
|
|
131192
|
-
const ref =
|
|
131193
|
-
const [box, setBox] =
|
|
131194
|
-
|
|
131403
|
+
const ref = React11.useRef(null);
|
|
131404
|
+
const [box, setBox] = React11.useState(null);
|
|
131405
|
+
React11.useEffect(() => {
|
|
131195
131406
|
const el2 = ref.current;
|
|
131196
131407
|
if (!el2) return;
|
|
131197
131408
|
const measure2 = () => {
|
|
@@ -131349,10 +131560,10 @@ var init_renderNode = __esm({
|
|
|
131349
131560
|
const isPlayable = !isFailed && !isUploading;
|
|
131350
131561
|
const isPlaying = state === "playing";
|
|
131351
131562
|
const isLoading = state === "loading";
|
|
131352
|
-
const [scrub, setScrub] =
|
|
131353
|
-
const [seeked, setSeeked] =
|
|
131563
|
+
const [scrub, setScrub] = React11.useState(null);
|
|
131564
|
+
const [seeked, setSeeked] = React11.useState(null);
|
|
131354
131565
|
const positionMs = Math.max(0, num4(props.positionMsPath != null ? boundPosition : void 0, props.positionMs, 0));
|
|
131355
|
-
|
|
131566
|
+
React11.useEffect(() => {
|
|
131356
131567
|
setSeeked(null);
|
|
131357
131568
|
}, [positionMs]);
|
|
131358
131569
|
const effectivePositionMs = seeked ?? positionMs;
|
|
@@ -131394,8 +131605,8 @@ var init_renderNode = __esm({
|
|
|
131394
131605
|
const barW = Math.max(0.6, slot * 0.58);
|
|
131395
131606
|
const cut2 = progress * W2;
|
|
131396
131607
|
const rates = Array.isArray(props.rates) ? props.rates.map(Number).filter((n2) => n2 > 0) : [];
|
|
131397
|
-
const [pickedRate, setPickedRate] =
|
|
131398
|
-
|
|
131608
|
+
const [pickedRate, setPickedRate] = React11.useState(null);
|
|
131609
|
+
React11.useEffect(() => {
|
|
131399
131610
|
setPickedRate(null);
|
|
131400
131611
|
}, [rate]);
|
|
131401
131612
|
const effectiveRate = pickedRate ?? rate;
|
|
@@ -131572,9 +131783,9 @@ var init_renderNode = __esm({
|
|
|
131572
131783
|
const items = (props.__pager ? props.pages : props.items) ?? [];
|
|
131573
131784
|
const pages2 = items.filter((page) => isNodeLike(page) || page?.type);
|
|
131574
131785
|
const requested = Math.max(0, Math.min(pages2.length - 1, props.currentIndex ?? 0));
|
|
131575
|
-
const [current, setCurrent] =
|
|
131576
|
-
const rail =
|
|
131577
|
-
const currentRef =
|
|
131786
|
+
const [current, setCurrent] = React11.useState(requested);
|
|
131787
|
+
const rail = React11.useRef(null);
|
|
131788
|
+
const currentRef = React11.useRef(current);
|
|
131578
131789
|
const itemsPath = props.itemsPath ?? props.items_path;
|
|
131579
131790
|
const boundRail = !!itemsPath && !!items[0] && !!ctx.provider;
|
|
131580
131791
|
const select2 = (index) => {
|
|
@@ -131583,12 +131794,12 @@ var init_renderNode = __esm({
|
|
|
131583
131794
|
setCurrent(index);
|
|
131584
131795
|
if (props.onChange && ctx.onAction) ctx.onAction({ ...props.onChange, args: { ...props.onChange.args ?? {}, index } });
|
|
131585
131796
|
};
|
|
131586
|
-
|
|
131797
|
+
React11.useEffect(() => {
|
|
131587
131798
|
currentRef.current = requested;
|
|
131588
131799
|
setCurrent(requested);
|
|
131589
131800
|
if (rail.current && !boundRail) rail.current.scrollLeft = requested * rail.current.clientWidth;
|
|
131590
131801
|
}, [requested, boundRail, pages2.length]);
|
|
131591
|
-
|
|
131802
|
+
React11.useEffect(() => {
|
|
131592
131803
|
const interval = props.autoplayIntervalMs;
|
|
131593
131804
|
if (props.__pager || boundRail || !Number.isFinite(interval) || interval <= 0 || pages2.length < 2 || ctx.reduceMotion()) return;
|
|
131594
131805
|
const timer = setInterval(() => {
|
|
@@ -131631,19 +131842,19 @@ var init_renderNode = __esm({
|
|
|
131631
131842
|
const opts = Array.isArray(rawOpts) ? rawOpts : [];
|
|
131632
131843
|
const selectedId = isBinding(props.selectedId) ? boundSel : props.selectedId;
|
|
131633
131844
|
const selIdx = Math.max(0, opts.findIndex((o2) => o2?.id === selectedId));
|
|
131634
|
-
const viewport =
|
|
131635
|
-
const settle =
|
|
131636
|
-
const pickerId =
|
|
131845
|
+
const viewport = React11.useRef(null);
|
|
131846
|
+
const settle = React11.useRef(void 0);
|
|
131847
|
+
const pickerId = React11.useId();
|
|
131637
131848
|
const interactive = !!ctx.onAction && !!props.onChange;
|
|
131638
131849
|
const emit = (index) => {
|
|
131639
131850
|
const id = opts[index]?.id;
|
|
131640
131851
|
if (!interactive || id == null || index === selIdx) return;
|
|
131641
131852
|
ctx.onAction({ ...props.onChange, args: { ...props.onChange.args ?? {}, selectedId: String(id) } });
|
|
131642
131853
|
};
|
|
131643
|
-
|
|
131854
|
+
React11.useEffect(() => {
|
|
131644
131855
|
if (viewport.current) viewport.current.scrollTop = selIdx * 32;
|
|
131645
131856
|
}, [selIdx, opts.length]);
|
|
131646
|
-
|
|
131857
|
+
React11.useEffect(() => () => clearTimeout(settle.current), []);
|
|
131647
131858
|
return /* @__PURE__ */ jsxs8("div", { style: { position: "relative", width: "100%", maxWidth: 220, height: 160, overflow: "hidden", background: C2("surfaceSecondary", "#f5f7fa"), borderRadius: 12, ...wrap }, children: [
|
|
131648
131859
|
/* @__PURE__ */ jsx11("div", { "aria-hidden": "true", style: { position: "absolute", top: 64, left: 8, right: 8, height: 32, background: C2("surfacePrimary", "#fff"), borderRadius: 8, boxShadow: "inset 0 0 0 1px rgba(0,0,0,.06)" } }),
|
|
131649
131860
|
/* @__PURE__ */ jsx11(
|
|
@@ -131754,23 +131965,23 @@ var init_renderNode = __esm({
|
|
|
131754
131965
|
const hasEvents = !!(props.onMapTap || props.onMarkerTap || props.onRegionChange || props.onShapeTap);
|
|
131755
131966
|
const boundShapes = useResolvedScalar(props.shapesPath, ctx);
|
|
131756
131967
|
const shapesRaw = Array.isArray(boundShapes) ? boundShapes : Array.isArray(props.shapes) ? props.shapes : [];
|
|
131757
|
-
const shapes =
|
|
131968
|
+
const shapes = React11.useMemo(() => shapesRaw.map((sh) => {
|
|
131758
131969
|
const kind = parseShapeKind(sh?.kind);
|
|
131759
131970
|
const pts = Array.isArray(sh?.points) ? sh.points.filter((p2) => p2 && typeof p2.latitude === "number" && typeof p2.longitude === "number") : [];
|
|
131760
131971
|
const ring = kind === "circle" && pts.length ? circleRing(pts[0].latitude, pts[0].longitude, typeof sh.radiusM === "number" ? sh.radiusM : 0) : pts;
|
|
131761
131972
|
return { ...sh, kind, points: ring };
|
|
131762
131973
|
}), [JSON.stringify(shapesRaw)]);
|
|
131763
131974
|
const boundCameraRaw = useResolvedScalar(props.cameraPath, ctx);
|
|
131764
|
-
const commandedCamera =
|
|
131765
|
-
const [box, setBox] =
|
|
131766
|
-
const [tileStatus, setTileStatus] =
|
|
131767
|
-
const [userCam, setUserCam] =
|
|
131768
|
-
const dragRef =
|
|
131769
|
-
const dragMovedRef =
|
|
131770
|
-
const regionReportedRef =
|
|
131771
|
-
const [boxEl, setBoxEl] =
|
|
131772
|
-
const attachBox =
|
|
131773
|
-
|
|
131975
|
+
const commandedCamera = React11.useMemo(() => decodeCamera(boundCameraRaw), [boundCameraRaw]);
|
|
131976
|
+
const [box, setBox] = React11.useState({ w: 400, h: h2 });
|
|
131977
|
+
const [tileStatus, setTileStatus] = React11.useState({});
|
|
131978
|
+
const [userCam, setUserCam] = React11.useState(null);
|
|
131979
|
+
const dragRef = React11.useRef(null);
|
|
131980
|
+
const dragMovedRef = React11.useRef(false);
|
|
131981
|
+
const regionReportedRef = React11.useRef(false);
|
|
131982
|
+
const [boxEl, setBoxEl] = React11.useState(null);
|
|
131983
|
+
const attachBox = React11.useCallback((el2) => setBoxEl(el2), []);
|
|
131984
|
+
React11.useEffect(() => {
|
|
131774
131985
|
const el2 = boxEl;
|
|
131775
131986
|
if (!el2) return;
|
|
131776
131987
|
const measure2 = () => {
|
|
@@ -131793,12 +132004,12 @@ var init_renderNode = __esm({
|
|
|
131793
132004
|
const explicitSchematic = schematic && props.routeMode?.toLowerCase() === "schematic";
|
|
131794
132005
|
const usesTileArm = !explicitSchematic && (otherTileReason || hasStaticMarkers) && (follow || !schematic);
|
|
131795
132006
|
const pinsOnly = hasStaticMarkers && !otherTileReason;
|
|
131796
|
-
const [userFix, setUserFix] =
|
|
131797
|
-
const [followBroken, setFollowBroken] =
|
|
131798
|
-
|
|
132007
|
+
const [userFix, setUserFix] = React11.useState(null);
|
|
132008
|
+
const [followBroken, setFollowBroken] = React11.useState(false);
|
|
132009
|
+
React11.useEffect(() => {
|
|
131799
132010
|
if (follow) setFollowBroken(false);
|
|
131800
132011
|
}, [follow]);
|
|
131801
|
-
|
|
132012
|
+
React11.useEffect(() => {
|
|
131802
132013
|
if (!observeUserLocation || !usesTileArm) return;
|
|
131803
132014
|
const geo = typeof navigator !== "undefined" ? navigator.geolocation : void 0;
|
|
131804
132015
|
if (!geo || typeof geo.watchPosition !== "function") return;
|
|
@@ -131825,7 +132036,7 @@ var init_renderNode = __esm({
|
|
|
131825
132036
|
const z4 = userCam?.z ?? fitted;
|
|
131826
132037
|
const cLat = followActive ? userFix.lat : userCam?.lat ?? baseLat;
|
|
131827
132038
|
const cLng = followActive ? userFix.lng : userCam?.lng ?? baseLng;
|
|
131828
|
-
|
|
132039
|
+
React11.useEffect(() => {
|
|
131829
132040
|
const resolved2 = resolveCamera(commandedCamera, cLat, cLng, z4);
|
|
131830
132041
|
if (!resolved2) return;
|
|
131831
132042
|
setFollowBroken(true);
|
|
@@ -131907,7 +132118,7 @@ var init_renderNode = __esm({
|
|
|
131907
132118
|
const endDrag = () => {
|
|
131908
132119
|
dragRef.current = null;
|
|
131909
132120
|
};
|
|
131910
|
-
|
|
132121
|
+
React11.useEffect(() => {
|
|
131911
132122
|
if (!boxEl || !usesTileArm || !interactive) return;
|
|
131912
132123
|
const zoomOnWheel = (event) => {
|
|
131913
132124
|
event.preventDefault();
|
|
@@ -131917,7 +132128,7 @@ var init_renderNode = __esm({
|
|
|
131917
132128
|
boxEl.addEventListener("wheel", zoomOnWheel, { passive: false });
|
|
131918
132129
|
return () => boxEl.removeEventListener("wheel", zoomOnWheel);
|
|
131919
132130
|
}, [boxEl, usesTileArm, interactive, z4, cLat, cLng]);
|
|
131920
|
-
|
|
132131
|
+
React11.useEffect(() => {
|
|
131921
132132
|
const action = props.onRegionChange;
|
|
131922
132133
|
const fire = ctx.onAction;
|
|
131923
132134
|
if (!usesTileArm || !action || !fire) return;
|
|
@@ -132054,30 +132265,30 @@ var init_renderNode = __esm({
|
|
|
132054
132265
|
const items = Array.isArray(props.items) ? props.items : [];
|
|
132055
132266
|
const pages2 = items.filter((p2) => isNodeLike(p2) || p2?.type);
|
|
132056
132267
|
const count2 = pages2.length;
|
|
132057
|
-
const [index, setIndex] =
|
|
132058
|
-
const indexRef =
|
|
132059
|
-
const trackRef =
|
|
132060
|
-
const [hovered, setHovered] =
|
|
132061
|
-
const [focused, setFocused] =
|
|
132268
|
+
const [index, setIndex] = React11.useState(typeof props.currentIndex === "number" ? props.currentIndex : 0);
|
|
132269
|
+
const indexRef = React11.useRef(index);
|
|
132270
|
+
const trackRef = React11.useRef(null);
|
|
132271
|
+
const [hovered, setHovered] = React11.useState(false);
|
|
132272
|
+
const [focused, setFocused] = React11.useState(false);
|
|
132062
132273
|
const paused = hovered || focused;
|
|
132063
132274
|
const interval = typeof props.autoplayIntervalMs === "number" && props.autoplayIntervalMs > 0 ? props.autoplayIntervalMs : 0;
|
|
132064
132275
|
const autoplay = interval > 0 && count2 > 1 && !ctx.reduceMotion();
|
|
132065
132276
|
const onChange = props.onChange;
|
|
132066
|
-
const onChangeRef =
|
|
132277
|
+
const onChangeRef = React11.useRef(onChange);
|
|
132067
132278
|
onChangeRef.current = onChange;
|
|
132068
|
-
const autoScrollRef =
|
|
132069
|
-
const endAutoScroll =
|
|
132279
|
+
const autoScrollRef = React11.useRef(null);
|
|
132280
|
+
const endAutoScroll = React11.useCallback(() => {
|
|
132070
132281
|
if (autoScrollRef.current) clearTimeout(autoScrollRef.current.timer);
|
|
132071
132282
|
autoScrollRef.current = null;
|
|
132072
132283
|
}, []);
|
|
132073
132284
|
const requestedIndex = Math.max(0, Math.min(count2 - 1, typeof props.currentIndex === "number" ? props.currentIndex : 0));
|
|
132074
|
-
|
|
132285
|
+
React11.useEffect(() => {
|
|
132075
132286
|
endAutoScroll();
|
|
132076
132287
|
indexRef.current = requestedIndex;
|
|
132077
132288
|
setIndex(requestedIndex);
|
|
132078
132289
|
if (trackRef.current) trackRef.current.scrollLeft = requestedIndex * trackRef.current.clientWidth;
|
|
132079
132290
|
}, [requestedIndex, count2, endAutoScroll]);
|
|
132080
|
-
|
|
132291
|
+
React11.useEffect(() => {
|
|
132081
132292
|
const el2 = trackRef.current;
|
|
132082
132293
|
el2?.addEventListener("scrollend", endAutoScroll);
|
|
132083
132294
|
return () => {
|
|
@@ -132085,14 +132296,14 @@ var init_renderNode = __esm({
|
|
|
132085
132296
|
endAutoScroll();
|
|
132086
132297
|
};
|
|
132087
132298
|
}, [endAutoScroll]);
|
|
132088
|
-
const pageTo =
|
|
132299
|
+
const pageTo = React11.useCallback((page) => {
|
|
132089
132300
|
if (page === indexRef.current) return;
|
|
132090
132301
|
indexRef.current = page;
|
|
132091
132302
|
setIndex(page);
|
|
132092
132303
|
const action = onChangeRef.current;
|
|
132093
132304
|
if (action && ctx.onAction) ctx.onAction({ ...action, args: { ...action.args ?? {}, index: page } });
|
|
132094
132305
|
}, [ctx]);
|
|
132095
|
-
|
|
132306
|
+
React11.useEffect(() => {
|
|
132096
132307
|
if (!autoplay || paused) return;
|
|
132097
132308
|
const id = setInterval(() => {
|
|
132098
132309
|
const next = (indexRef.current + 1) % count2;
|
|
@@ -132157,7 +132368,7 @@ var init_renderNode = __esm({
|
|
|
132157
132368
|
});
|
|
132158
132369
|
BannerNode = withExtras("BannerNode", ({ props, ctx, wrap }) => {
|
|
132159
132370
|
const C2 = ctx.color;
|
|
132160
|
-
const [dismissed, setDismissed] =
|
|
132371
|
+
const [dismissed, setDismissed] = React11.useState(false);
|
|
132161
132372
|
if (dismissed) return null;
|
|
132162
132373
|
const accent = sevColor(ctx, props.severity ?? "info");
|
|
132163
132374
|
return /* @__PURE__ */ jsxs8("div", { style: { display: "flex", gap: 11, width: "100%", boxSizing: "border-box", borderRadius: ctx.radius("md", 10), padding: 13, background: `color-mix(in srgb, ${accent} 12%, ${C2("surfacePrimary", "#fff")})`, border: `1px solid color-mix(in srgb, ${accent} 32%, transparent)`, ...wrap }, children: [
|
|
@@ -132190,15 +132401,15 @@ var init_renderNode = __esm({
|
|
|
132190
132401
|
const rawImageUrl = props.imageUrl != null && isBinding(props.imageUrl) ? boundImageUrl : props.imageUrl;
|
|
132191
132402
|
const heroSrc = typeof rawImageUrl === "string" && rawImageUrl !== "" ? rawImageUrl : typeof props.imageAsset === "string" && isWebAssetPath(props.imageAsset) ? props.imageAsset : void 0;
|
|
132192
132403
|
const resolvedHero = heroSrc ? resolveAssetUrl(heroSrc, ctx.assetBaseUrl) : void 0;
|
|
132193
|
-
const [failedHero, setFailedHero] =
|
|
132404
|
+
const [failedHero, setFailedHero] = React11.useState(null);
|
|
132194
132405
|
const imageUrl = resolvedHero && resolvedHero !== failedHero ? resolvedHero : void 0;
|
|
132195
132406
|
const expanded = Math.max(0, typeof props.expandedHeight === "number" && Number.isFinite(props.expandedHeight) ? props.expandedHeight : 280);
|
|
132196
132407
|
const collapsed = Math.max(0, Math.min(expanded, typeof props.collapsedHeight === "number" && props.collapsedHeight > 0 ? props.collapsedHeight : 64));
|
|
132197
132408
|
const parallax = typeof props.parallaxFactor === "number" && Number.isFinite(props.parallaxFactor) ? Math.max(0, Math.min(1, props.parallaxFactor)) : 0.5;
|
|
132198
132409
|
const span = Math.max(1, expanded - collapsed);
|
|
132199
|
-
const rootRef =
|
|
132200
|
-
const [offset, setOffset] =
|
|
132201
|
-
|
|
132410
|
+
const rootRef = React11.useRef(null);
|
|
132411
|
+
const [offset, setOffset] = React11.useState(0);
|
|
132412
|
+
React11.useEffect(() => {
|
|
132202
132413
|
const el2 = rootRef.current;
|
|
132203
132414
|
const win = el2?.ownerDocument?.defaultView;
|
|
132204
132415
|
if (!el2 || !win) return;
|
|
@@ -132300,22 +132511,22 @@ var init_renderNode = __esm({
|
|
|
132300
132511
|
const boundEnd = useResolvedScalar(props.selectedEndDatePath, ctx);
|
|
132301
132512
|
const seedStart = (props.selectedStartDatePath != null ? typeof boundStart === "string" ? boundStart : "" : typeof props.selectedStartDate === "string" ? props.selectedStartDate : "") || "";
|
|
132302
132513
|
const seedEnd = (props.selectedEndDatePath != null ? typeof boundEnd === "string" ? boundEnd : "" : typeof props.selectedEndDate === "string" ? props.selectedEndDate : "") || "";
|
|
132303
|
-
const [range, setRange] =
|
|
132304
|
-
const lastRangeSeed =
|
|
132305
|
-
|
|
132514
|
+
const [range, setRange] = React11.useState({ start: seedStart, end: seedEnd });
|
|
132515
|
+
const lastRangeSeed = React11.useRef(`${seedStart}|${seedEnd}`);
|
|
132516
|
+
React11.useEffect(() => {
|
|
132306
132517
|
const key3 = `${seedStart}|${seedEnd}`;
|
|
132307
132518
|
if (lastRangeSeed.current === key3) return;
|
|
132308
132519
|
lastRangeSeed.current = key3;
|
|
132309
132520
|
setRange({ start: seedStart, end: seedEnd });
|
|
132310
132521
|
}, [seedStart, seedEnd]);
|
|
132311
|
-
const seed2 =
|
|
132522
|
+
const seed2 = React11.useMemo(
|
|
132312
132523
|
() => monthSeed(drivenYear ?? props.year, drivenMonth ?? props.month, selectedDate),
|
|
132313
132524
|
[drivenYear, drivenMonth, props.year, props.month, selectedDate]
|
|
132314
132525
|
);
|
|
132315
|
-
const [view, setView] =
|
|
132526
|
+
const [view, setView] = React11.useState(seed2);
|
|
132316
132527
|
const seedKey = `${seed2.year}-${seed2.month}`;
|
|
132317
|
-
const lastSeed =
|
|
132318
|
-
|
|
132528
|
+
const lastSeed = React11.useRef(seedKey);
|
|
132529
|
+
React11.useEffect(() => {
|
|
132319
132530
|
if (lastSeed.current === seedKey) return;
|
|
132320
132531
|
lastSeed.current = seedKey;
|
|
132321
132532
|
setView(seed2);
|
|
@@ -132326,7 +132537,7 @@ var init_renderNode = __esm({
|
|
|
132326
132537
|
for (const d2 of decorations) if (d2 && typeof d2.date === "string") decByDate.set(d2.date, d2);
|
|
132327
132538
|
const rows = monthMatrix(year, month, firstWeekday);
|
|
132328
132539
|
const heads = weekdayLabels(firstWeekday);
|
|
132329
|
-
const gridRef =
|
|
132540
|
+
const gridRef = React11.useRef(null);
|
|
132330
132541
|
const monthLabel = new Date(year, month - 1, 1).toLocaleDateString(void 0, { month: "long", year: "numeric" });
|
|
132331
132542
|
const canPage = true;
|
|
132332
132543
|
const changeMonth = (delta) => {
|
|
@@ -132449,7 +132660,7 @@ var init_renderNode = __esm({
|
|
|
132449
132660
|
const events = Array.isArray(rawEvents) ? rawEvents : [];
|
|
132450
132661
|
const boundAnchor = useResolvedScalar(props.anchorDatePath, ctx);
|
|
132451
132662
|
const anchorRaw = props.anchorDatePath != null ? boundAnchor : props.anchorDate;
|
|
132452
|
-
const [pagedAnchor, setPagedAnchor] =
|
|
132663
|
+
const [pagedAnchor, setPagedAnchor] = React11.useState(null);
|
|
132453
132664
|
const localAnchor = pagedAnchor && Object.is(pagedAnchor.raw, anchorRaw) && pagedAnchor.path === props.anchorDatePath && pagedAnchor.mode === props.mode && pagedAnchor.provider === ctx.provider ? pagedAnchor.date : null;
|
|
132454
132665
|
if (pagedAnchor && !localAnchor) setPagedAnchor(null);
|
|
132455
132666
|
const anchor = localAnchor ?? (typeof anchorRaw === "string" ? parseLocalDate(anchorRaw) : null) ?? /* @__PURE__ */ new Date();
|
|
@@ -132689,7 +132900,7 @@ var init_renderNode = __esm({
|
|
|
132689
132900
|
const boundEvents = useResolvedScalar(props.eventsPath, ctx);
|
|
132690
132901
|
const rawEvents = props.eventsPath != null ? boundEvents : props.events;
|
|
132691
132902
|
const events = Array.isArray(rawEvents) ? rawEvents : [];
|
|
132692
|
-
const groups =
|
|
132903
|
+
const groups = React11.useMemo(() => {
|
|
132693
132904
|
const buckets = /* @__PURE__ */ new Map();
|
|
132694
132905
|
for (const ev of events) {
|
|
132695
132906
|
if (!ev) continue;
|
|
@@ -132709,18 +132920,18 @@ var init_renderNode = __esm({
|
|
|
132709
132920
|
const onSelect = (ev) => dispatchCalendarAction(ctx, ev?.onTap ?? props.onSelectEvent, { eventId: ev?.id });
|
|
132710
132921
|
const boundScrollTo = useResolvedScalar(props.scrollToDatePath, ctx);
|
|
132711
132922
|
const scrollTarget = props.scrollToDatePath != null ? typeof boundScrollTo === "string" ? boundScrollTo : void 0 : typeof props.scrollToDate === "string" ? props.scrollToDate : void 0;
|
|
132712
|
-
const containerRef =
|
|
132713
|
-
const [visibleDays, setVisibleDays] =
|
|
132923
|
+
const containerRef = React11.useRef(null);
|
|
132924
|
+
const [visibleDays, setVisibleDays] = React11.useState(CAL_AGENDA_INITIAL_DAYS);
|
|
132714
132925
|
const targetIndex = scrollTarget ? groups.findIndex((g2) => g2.key === scrollTarget) : -1;
|
|
132715
132926
|
const windowEnd = Math.max(visibleDays, targetIndex >= 0 ? targetIndex + 1 : 0);
|
|
132716
132927
|
const shown2 = groups.length > windowEnd ? groups.slice(0, windowEnd) : groups;
|
|
132717
132928
|
const hasMore = groups.length > shown2.length;
|
|
132718
|
-
|
|
132929
|
+
React11.useEffect(() => {
|
|
132719
132930
|
if (!scrollTarget) return;
|
|
132720
132931
|
containerRef.current?.querySelector(`[data-daygroup="${scrollTarget}"]`)?.scrollIntoView({ block: "start" });
|
|
132721
132932
|
}, [scrollTarget, windowEnd]);
|
|
132722
|
-
const sentinelRef =
|
|
132723
|
-
|
|
132933
|
+
const sentinelRef = React11.useRef(null);
|
|
132934
|
+
React11.useEffect(() => {
|
|
132724
132935
|
if (!hasMore) return;
|
|
132725
132936
|
const el2 = sentinelRef.current;
|
|
132726
132937
|
if (!el2 || typeof IntersectionObserver === "undefined") return;
|
|
@@ -132837,26 +133048,26 @@ var init_renderNode = __esm({
|
|
|
132837
133048
|
PRESENTED_SCOPE = '[aria-modal="true"], [role="dialog"], [role="alertdialog"], [role="menu"]';
|
|
132838
133049
|
focusRoots = /* @__PURE__ */ new WeakMap();
|
|
132839
133050
|
A11yHintDescription = ({ hint, idBase, children, ...forwarded }) => {
|
|
132840
|
-
const descId = `${idBase ?? "hm"}__hint${
|
|
133051
|
+
const descId = `${idBase ?? "hm"}__hint${React11.useId()}`;
|
|
132841
133052
|
const own5 = children.props;
|
|
132842
133053
|
const next = { ...forwarded };
|
|
132843
133054
|
if (forwarded.style) next.style = { ...own5.style ?? {}, ...forwarded.style };
|
|
132844
133055
|
const ids = [own5["aria-describedby"], forwarded["aria-describedby"], descId].flatMap((v2) => v2 ? String(v2).split(/\s+/) : []).filter(Boolean);
|
|
132845
133056
|
next["aria-describedby"] = Array.from(new Set(ids)).join(" ");
|
|
132846
133057
|
return /* @__PURE__ */ jsxs8(Fragment4, { children: [
|
|
132847
|
-
|
|
133058
|
+
React11.cloneElement(children, next),
|
|
132848
133059
|
/* @__PURE__ */ jsx11("span", { id: descId, hidden: true, "data-hm-a11y-hint": "", children: hint })
|
|
132849
133060
|
] });
|
|
132850
133061
|
};
|
|
132851
133062
|
reportedUnknownComponents = /* @__PURE__ */ new Set();
|
|
132852
133063
|
UnknownComponentNode = ({ pkg, type, props, ctx, wrap, ...extras }) => {
|
|
132853
133064
|
const hasTelemetry = !!ctx.emitTelemetry;
|
|
132854
|
-
|
|
133065
|
+
React11.useEffect(() => {
|
|
132855
133066
|
reportUnknownComponent(ctx, pkg, type);
|
|
132856
133067
|
}, [ctx.appId, ctx.screenId, hasTelemetry, pkg, type]);
|
|
132857
133068
|
const { style: extraStyle, children: extraChildren, ...attrs } = extras;
|
|
132858
133069
|
const nodeProps = (entries) => entries.filter(([, v2]) => isNodeLike(v2) || Array.isArray(v2) && v2.some(isNodeLike));
|
|
132859
|
-
const renderProps = (entries) => entries.map(([k2, v2]) => /* @__PURE__ */ jsx11(
|
|
133070
|
+
const renderProps = (entries) => entries.map(([k2, v2]) => /* @__PURE__ */ jsx11(React11.Fragment, { children: Array.isArray(v2) ? kids2(v2.filter(isNodeLike), ctx) : renderNode(v2, ctx) }, k2));
|
|
132860
133071
|
const childKeys = nodeProps(Object.entries(props ?? {}));
|
|
132861
133072
|
if (!unknownComponentShowsDeveloperLabel(ctx)) {
|
|
132862
133073
|
const contentKeys = childKeys.filter(([k2]) => k2 === "child" || k2 === "children");
|
|
@@ -132880,7 +133091,7 @@ var init_renderNode = __esm({
|
|
|
132880
133091
|
});
|
|
132881
133092
|
|
|
132882
133093
|
// ../../core/web-renderer/src/renderToHtml.tsx
|
|
132883
|
-
import
|
|
133094
|
+
import React12 from "react";
|
|
132884
133095
|
import { renderToStaticMarkup } from "react-dom/server";
|
|
132885
133096
|
function renderDescriptorToHtml(payload, tokens2, scheme = "light", provider = null, width, chrome, opts) {
|
|
132886
133097
|
const rtl = opts?.isRTL === true;
|
|
@@ -132900,18 +133111,18 @@ function renderDescriptorToHtml(payload, tokens2, scheme = "light", provider = n
|
|
|
132900
133111
|
const dir = rtl ? { dir: "rtl" } : {};
|
|
132901
133112
|
if (header || footer) {
|
|
132902
133113
|
return withFocusRing(renderToStaticMarkup(
|
|
132903
|
-
|
|
133114
|
+
React12.createElement(
|
|
132904
133115
|
"div",
|
|
132905
133116
|
// F-22 — same footer pin as ScreenHost: a full-height flex column + margin-top:auto
|
|
132906
133117
|
// keeps the footer at the bottom edge even when the payload is short.
|
|
132907
133118
|
{ "data-testid": "screen-host", ...dir, ...footer ? { style: { display: "flex", flexDirection: "column", minHeight: "100%", flexGrow: 1 } } : {} },
|
|
132908
|
-
header ?
|
|
133119
|
+
header ? React12.createElement(
|
|
132909
133120
|
"div",
|
|
132910
133121
|
{ "data-testid": "sticky-header", style: { position: "sticky", top: 0, zIndex: 10 } },
|
|
132911
133122
|
renderNode(header, ctx)
|
|
132912
133123
|
) : null,
|
|
132913
133124
|
renderNode(payload, ctx),
|
|
132914
|
-
footer ?
|
|
133125
|
+
footer ? React12.createElement(
|
|
132915
133126
|
"div",
|
|
132916
133127
|
{ "data-testid": "sticky-footer", style: { position: "sticky", bottom: 0, zIndex: 10, marginTop: "auto" } },
|
|
132917
133128
|
renderNode(footer, ctx)
|
|
@@ -132921,11 +133132,11 @@ function renderDescriptorToHtml(payload, tokens2, scheme = "light", provider = n
|
|
|
132921
133132
|
}
|
|
132922
133133
|
if (rtl) {
|
|
132923
133134
|
return withFocusRing(renderToStaticMarkup(
|
|
132924
|
-
|
|
133135
|
+
React12.createElement("div", dir, renderNode(payload, ctx))
|
|
132925
133136
|
));
|
|
132926
133137
|
}
|
|
132927
133138
|
return withFocusRing(renderToStaticMarkup(
|
|
132928
|
-
|
|
133139
|
+
React12.createElement(React12.Fragment, null, renderNode(payload, ctx))
|
|
132929
133140
|
));
|
|
132930
133141
|
}
|
|
132931
133142
|
var init_renderToHtml = __esm({
|
|
@@ -139901,9 +140112,9 @@ function renderedNameGaps(descriptor, state) {
|
|
|
139901
140112
|
const found = /* @__PURE__ */ new Map();
|
|
139902
140113
|
const rowsJudged = /* @__PURE__ */ new Map();
|
|
139903
140114
|
const rowTemplateOf = /* @__PURE__ */ new Map();
|
|
139904
|
-
const judge = (root, base,
|
|
140115
|
+
const judge = (root, base, scope2, depth, inRow) => {
|
|
139905
140116
|
if (inRow) rowsJudged.set(base, (rowsJudged.get(base) ?? 0) + 1);
|
|
139906
|
-
const ctx = { provider, scope, emptied: [], lists: [], unrendered: /* @__PURE__ */ new Set(), rowTemplates: [] };
|
|
140117
|
+
const ctx = { provider, scope: scope2, emptied: [], lists: [], unrendered: /* @__PURE__ */ new Set(), rowTemplates: [] };
|
|
139907
140118
|
const projected = projectRenderedNames(root, "", "", ctx);
|
|
139908
140119
|
for (const g2 of accessibleNameGaps(projected)) {
|
|
139909
140120
|
const rel = g2.at === "root" ? "" : g2.at;
|
|
@@ -151919,8 +152130,8 @@ function mergePushInputs(content, flags) {
|
|
|
151919
152130
|
}
|
|
151920
152131
|
return merged;
|
|
151921
152132
|
}
|
|
151922
|
-
function missingPushInputs(i2,
|
|
151923
|
-
const needed =
|
|
152133
|
+
function missingPushInputs(i2, scope2) {
|
|
152134
|
+
const needed = scope2 === "push_and_signing" ? [...REQUIRED_ORDER, ...ASC_ORDER] : REQUIRED_ORDER;
|
|
151924
152135
|
return needed.filter((name) => !text3(i2[name]));
|
|
151925
152136
|
}
|
|
151926
152137
|
function ascGroupError(i2) {
|
|
@@ -152695,8 +152906,8 @@ async function ask(question, deps) {
|
|
|
152695
152906
|
rl2.close();
|
|
152696
152907
|
}
|
|
152697
152908
|
}
|
|
152698
|
-
function defer(dir, input,
|
|
152699
|
-
return recordPushDeferral(dir, { reason, scope, missing: missingPushInputs(input,
|
|
152909
|
+
function defer(dir, input, scope2, reason) {
|
|
152910
|
+
return recordPushDeferral(dir, { reason, scope: scope2, missing: missingPushInputs(input, scope2), identity: input, resume: resume(dir) });
|
|
152700
152911
|
}
|
|
152701
152912
|
function renderPushStatus(http2, refresh = false) {
|
|
152702
152913
|
const body = http2.body ?? {};
|
|
@@ -152759,9 +152970,9 @@ function logOwnershipFailure(io2, ownership) {
|
|
|
152759
152970
|
endpoint: endpoints[ownership.check]
|
|
152760
152971
|
}));
|
|
152761
152972
|
}
|
|
152762
|
-
async function collect(input,
|
|
152973
|
+
async function collect(input, scope2, io2, flags, deps) {
|
|
152763
152974
|
if (!io2.isTTY || flags.json === true) return true;
|
|
152764
|
-
for (const name of missingPushInputs(input,
|
|
152975
|
+
for (const name of missingPushInputs(input, scope2)) {
|
|
152765
152976
|
const answer = await ask(`${PROMPTS[name]} (or Later to continue building):`, deps);
|
|
152766
152977
|
if (later(answer)) return false;
|
|
152767
152978
|
input[name] = answer;
|
|
@@ -152786,27 +152997,27 @@ async function runNotifySetup(pos, flags, io2, deps = {}) {
|
|
|
152786
152997
|
const content = pushInputsFromContent(dir);
|
|
152787
152998
|
const input = mergePushInputs({ ...local.selection, ...progress?.identity, ...content }, flags);
|
|
152788
152999
|
if (!input.initialized) return refuse4(io2, "app_not_initialized", "Create the app with himi init first. Credentials are optional during app creation.");
|
|
152789
|
-
let
|
|
153000
|
+
let scope2 = progress?.scope === "push_and_signing" || flags["apple-signing"] === true || input.ascKeyFile || input.ascKeyId || input.ascIssuerId ? "push_and_signing" : "push_only";
|
|
152790
153001
|
if (operation === "setup" && flags["no-push-setup"] === true) {
|
|
152791
|
-
io2.log(JSON.stringify(defer(dir, input,
|
|
153002
|
+
io2.log(JSON.stringify(defer(dir, input, scope2, "user_chose_later")));
|
|
152792
153003
|
return 0;
|
|
152793
153004
|
}
|
|
152794
|
-
if (operation === "setup" && io2.isTTY && flags.json !== true && flags.yes !== true &&
|
|
153005
|
+
if (operation === "setup" && io2.isTTY && flags.json !== true && flags.yes !== true && scope2 === "push_only") {
|
|
152795
153006
|
const choice = await ask("Apple signing: 1 Push only / 2 Push and automatic signing / Later:", deps);
|
|
152796
153007
|
if (later(choice)) {
|
|
152797
|
-
io2.log(JSON.stringify(defer(dir, input,
|
|
153008
|
+
io2.log(JSON.stringify(defer(dir, input, scope2, "user_chose_later")));
|
|
152798
153009
|
return 0;
|
|
152799
153010
|
}
|
|
152800
|
-
if (choice === "2")
|
|
153011
|
+
if (choice === "2") scope2 = "push_and_signing";
|
|
152801
153012
|
else if (choice !== "1") return refuse4(io2, "invalid_setup_choice");
|
|
152802
153013
|
}
|
|
152803
|
-
if (operation === "setup" && !await collect(input,
|
|
152804
|
-
io2.log(JSON.stringify(defer(dir, input,
|
|
153014
|
+
if (operation === "setup" && !await collect(input, scope2, io2, flags, deps)) {
|
|
153015
|
+
io2.log(JSON.stringify(defer(dir, input, scope2, "credentials_not_available")));
|
|
152805
153016
|
return 0;
|
|
152806
153017
|
}
|
|
152807
153018
|
const invalid = localIdentityRefusal(input);
|
|
152808
153019
|
if (invalid) return refuse4(io2, invalid.code, invalid.message);
|
|
152809
|
-
const missing = operation === "setup" ? missingPushInputs(input,
|
|
153020
|
+
const missing = operation === "setup" ? missingPushInputs(input, scope2) : !input.site ? ["site"] : [];
|
|
152810
153021
|
if (missing.length) {
|
|
152811
153022
|
io2.error(JSON.stringify({ ok: false, error: "needs_input", missing, resume: resume(dir), hint: "Provide file paths, never key contents. Or use --no-push-setup to continue building." }));
|
|
152812
153023
|
return 2;
|
|
@@ -152827,7 +153038,7 @@ async function runNotifySetup(pos, flags, io2, deps = {}) {
|
|
|
152827
153038
|
const valid = validateApnsAuthKey(apns.text);
|
|
152828
153039
|
if (!valid.ok) return refuse4(io2, valid.code, valid.reason);
|
|
152829
153040
|
let ascKey;
|
|
152830
|
-
if (
|
|
153041
|
+
if (scope2 === "push_and_signing") {
|
|
152831
153042
|
const asc = readKeyFile(input.ascKeyFile);
|
|
152832
153043
|
if (!asc.ok) return refuse4(io2, asc.code, asc.reason);
|
|
152833
153044
|
if (!isAppStoreConnectKey({ keyId: input.ascKeyId, issuerId: input.ascIssuerId, key: asc.text })) return refuse4(io2, "invalid_asc_key_file");
|
|
@@ -152845,7 +153056,7 @@ async function runNotifySetup(pos, flags, io2, deps = {}) {
|
|
|
152845
153056
|
apnsKeyId: input.apnsKeyId,
|
|
152846
153057
|
appleTeamId: input.appleTeamId,
|
|
152847
153058
|
apnsEnvironment: input.apnsEnvironment,
|
|
152848
|
-
scope,
|
|
153059
|
+
scope: scope2,
|
|
152849
153060
|
claimRequired: ownership.state === "not_claimed"
|
|
152850
153061
|
};
|
|
152851
153062
|
if (flags.yes !== true || flags["dry-run"] === true) {
|
|
@@ -152856,9 +153067,9 @@ async function runNotifySetup(pos, flags, io2, deps = {}) {
|
|
|
152856
153067
|
return 2;
|
|
152857
153068
|
}
|
|
152858
153069
|
io2.error(JSON.stringify({ plan: { ...plan, ...config2 ? { config: config2 } : {} } }));
|
|
152859
|
-
const answer = await ask("Configure this site's push credentials through Branded/Ping" + (
|
|
153070
|
+
const answer = await ask("Configure this site's push credentials through Branded/Ping" + (scope2 === "push_and_signing" ? " and request Apple signing resources" : "") + "? yes / Later:", deps);
|
|
152860
153071
|
if (answer.toLowerCase() !== "yes") {
|
|
152861
|
-
io2.log(JSON.stringify(defer(dir, input,
|
|
153072
|
+
io2.log(JSON.stringify(defer(dir, input, scope2, "user_chose_later")));
|
|
152862
153073
|
return 0;
|
|
152863
153074
|
}
|
|
152864
153075
|
}
|
|
@@ -158251,20 +158462,20 @@ function collectionName(name) {
|
|
|
158251
158462
|
if (typeof name !== "string" || !/^[A-Za-z0-9]+$/.test(name)) throw new Error(`collection name must be alphanumeric: ${JSON.stringify(name)}`);
|
|
158252
158463
|
}
|
|
158253
158464
|
function planResourceChange(input) {
|
|
158254
|
-
const { scope, catalog: catalog3, request } = input;
|
|
158465
|
+
const { scope: scope2, catalog: catalog3, request } = input;
|
|
158255
158466
|
let normalizedRequest = structuredClone(request);
|
|
158256
158467
|
let resource;
|
|
158257
158468
|
const operations = [];
|
|
158258
158469
|
if (request.kind === "put-kv") {
|
|
158259
158470
|
if (!request.spec || typeof request.spec !== "object") throw new Error("invalid KV schema: spec is required");
|
|
158260
|
-
const issues = validateDataResources({ kv: [request.spec] },
|
|
158471
|
+
const issues = validateDataResources({ kv: [request.spec] }, scope2.app).filter((issue2) => issue2.severity === "error");
|
|
158261
158472
|
if (issues.length) throw new Error(`invalid KV schema: ${issues.map((issue2) => issue2.message).join("; ")}`);
|
|
158262
158473
|
resource = `kv:${request.spec.name}`;
|
|
158263
158474
|
const existing = byName(catalog3, "kv", request.spec.name);
|
|
158264
158475
|
if (existing?.status === "deleted") throw new Error(`resource name "${request.spec.name}" is reserved by a tombstone; restore it instead`);
|
|
158265
158476
|
const spec = provisionedKvSpec(request.spec);
|
|
158266
158477
|
normalizedRequest = { kind: "put-kv", spec };
|
|
158267
|
-
const record2 = { kind: "kv", name: request.spec.name, physicalId: kvResourceKey(
|
|
158478
|
+
const record2 = { kind: "kv", name: request.spec.name, physicalId: kvResourceKey(scope2, request.spec.name), status: "active", version: existing ? existing.version + 1 : 1, spec };
|
|
158268
158479
|
if (!existing) operations.push({ kind: "create-kv", record: record2 });
|
|
158269
158480
|
else if (JSON.stringify(existing.spec) !== JSON.stringify(spec)) operations.push({ kind: "update-kv", record: record2 });
|
|
158270
158481
|
} else if (request.kind === "put-collection") {
|
|
@@ -158272,8 +158483,8 @@ function planResourceChange(input) {
|
|
|
158272
158483
|
collectionName(request.name);
|
|
158273
158484
|
const normalizedFields = request.fields.map((field) => ({ key: field?.key, displayName: field?.displayName, type: field?.type }));
|
|
158274
158485
|
normalizedRequest = { kind: "put-collection", name: request.name, fields: normalizedFields };
|
|
158275
|
-
const physical = `${namespacePrefix(
|
|
158276
|
-
const issues = validateCmsConfig({ collections: [{ id: physical, displayName: request.name, displayField: normalizedFields[0]?.key ?? "", readRole: "SITE_MEMBER", fields: normalizedFields }] },
|
|
158486
|
+
const physical = `${namespacePrefix(scope2.app)}${request.name}`;
|
|
158487
|
+
const issues = validateCmsConfig({ collections: [{ id: physical, displayName: request.name, displayField: normalizedFields[0]?.key ?? "", readRole: "SITE_MEMBER", fields: normalizedFields }] }, scope2.app).filter((issue2) => issue2.severity === "error");
|
|
158277
158488
|
if (issues.length) throw new Error(`invalid collection schema: ${issues.map((issue2) => issue2.message).join("; ")}`);
|
|
158278
158489
|
resource = `collection:${request.name}`;
|
|
158279
158490
|
const existing = byName(catalog3, "collection", request.name);
|
|
@@ -158319,7 +158530,7 @@ function planResourceChange(input) {
|
|
|
158319
158530
|
if (request.kind === "delete-resource" && existing.status === "active") operations.push({ kind: "tombstone-resource", resourceKind: request.resourceKind, name: request.name });
|
|
158320
158531
|
if (request.kind === "restore-resource" && existing.status === "deleted") operations.push({ kind: "restore-resource", resourceKind: request.resourceKind, name: request.name });
|
|
158321
158532
|
} else throw new Error(`unsupported resource change kind: ${String(request.kind)}`);
|
|
158322
|
-
return finalize({ scope: { ...
|
|
158533
|
+
return finalize({ scope: { ...scope2 }, resource, baseVersion: catalog3.version, request: normalizedRequest, operations });
|
|
158323
158534
|
}
|
|
158324
158535
|
var init_plan3 = __esm({
|
|
158325
158536
|
"../../core/data-resources/src/plan.ts"() {
|
|
@@ -158348,9 +158559,9 @@ function authorizeResourceAdminCaller(caller) {
|
|
|
158348
158559
|
if (caller.identity !== "installation") throw new ResourceApplyError("forbidden", "installation identity is required");
|
|
158349
158560
|
if (!caller.wixPermissions.includes("wix.data.manage")) throw new ResourceApplyError("forbidden", "wix.data.manage permission is required");
|
|
158350
158561
|
}
|
|
158351
|
-
function verifyPlan(
|
|
158562
|
+
function verifyPlan(scope2, plan) {
|
|
158352
158563
|
const { hash: hash2, ...unsigned } = plan;
|
|
158353
|
-
if (!equalScope(
|
|
158564
|
+
if (!equalScope(scope2, plan.scope) || hashResourcePlan(unsigned) !== hash2) throw new ResourceApplyError("invalid_plan", "plan hash or app/site/environment scope does not match");
|
|
158354
158565
|
if (plan.operations.length > 100) throw new ResourceApplyError("invalid_plan", "a resource plan may contain at most 100 operations");
|
|
158355
158566
|
const invalid = (message) => {
|
|
158356
158567
|
throw new ResourceApplyError("invalid_plan", message);
|
|
@@ -158358,11 +158569,11 @@ function verifyPlan(scope, plan) {
|
|
|
158358
158569
|
for (const operation of plan.operations) {
|
|
158359
158570
|
if (operation.kind === "create-kv" || operation.kind === "update-kv") {
|
|
158360
158571
|
const record2 = operation.record;
|
|
158361
|
-
if (plan.resource !== `kv:${record2.name}` || record2.kind !== "kv" || record2.status !== "active" || record2.physicalId !== kvResourceKey(
|
|
158362
|
-
if (validateDataResources({ kv: [record2.spec] },
|
|
158572
|
+
if (plan.resource !== `kv:${record2.name}` || record2.kind !== "kv" || record2.status !== "active" || record2.physicalId !== kvResourceKey(scope2, record2.name) || record2.spec.name !== record2.name || record2.spec.seed !== void 0) invalid("KV operation is not normalized to this plan scope");
|
|
158573
|
+
if (validateDataResources({ kv: [record2.spec] }, scope2.app).some((issue2) => issue2.severity === "error")) invalid("KV operation has an invalid schema");
|
|
158363
158574
|
} else if (operation.kind === "create-collection") {
|
|
158364
158575
|
const record2 = operation.record;
|
|
158365
|
-
if (plan.resource !== `collection:${record2.name}` || record2.kind !== "collection" || record2.status !== "active" || record2.version !== 1 || record2.physicalId !== `${namespacePrefix(
|
|
158576
|
+
if (plan.resource !== `collection:${record2.name}` || record2.kind !== "collection" || record2.status !== "active" || record2.version !== 1 || record2.physicalId !== `${namespacePrefix(scope2.app)}${record2.name}` || !/^[A-Za-z0-9]+$/.test(record2.name)) invalid("collection operation is not normalized to this plan scope");
|
|
158366
158577
|
const active = /* @__PURE__ */ new Set();
|
|
158367
158578
|
for (const field of record2.fields) {
|
|
158368
158579
|
const expectedPhysical = field.version === 1 ? field.logicalName : `${field.logicalName}__v${field.version}`;
|
|
@@ -158383,35 +158594,35 @@ function verifyPlan(scope, plan) {
|
|
|
158383
158594
|
}
|
|
158384
158595
|
}
|
|
158385
158596
|
async function applyResourcePlan(input) {
|
|
158386
|
-
const { scope, plan, expectedVersion, caller, store } = input;
|
|
158597
|
+
const { scope: scope2, plan, expectedVersion, caller, store } = input;
|
|
158387
158598
|
if (!input.idempotencyKey?.trim()) throw new ResourceApplyError("idempotency_required", "a non-empty idempotency key is required");
|
|
158388
158599
|
if (input.idempotencyKey.length > 256 || /[\u0000-\u001f\u007f]/.test(input.idempotencyKey)) throw new ResourceApplyError("invalid_plan", "idempotency key must be at most 256 characters and contain no control characters");
|
|
158389
|
-
verifyPlan(
|
|
158600
|
+
verifyPlan(scope2, plan);
|
|
158390
158601
|
authorizeResourceAdminCaller(caller);
|
|
158391
|
-
const replay = await store.findIdempotency(
|
|
158602
|
+
const replay = await store.findIdempotency(scope2, input.idempotencyKey);
|
|
158392
158603
|
if (replay) {
|
|
158393
158604
|
if (replay.planHash !== plan.hash) throw new ResourceApplyError("idempotency_conflict", "idempotency key was already used for a different plan");
|
|
158394
158605
|
return { ...replay.result, replayed: true };
|
|
158395
158606
|
}
|
|
158396
|
-
return store.withLock(
|
|
158397
|
-
const afterLockReplay = await store.findIdempotency(
|
|
158607
|
+
return store.withLock(scope2, plan.resource, input.idempotencyKey, async () => {
|
|
158608
|
+
const afterLockReplay = await store.findIdempotency(scope2, input.idempotencyKey);
|
|
158398
158609
|
if (afterLockReplay) {
|
|
158399
158610
|
if (afterLockReplay.planHash !== plan.hash) throw new ResourceApplyError("idempotency_conflict", "idempotency key was already used for a different plan");
|
|
158400
158611
|
return { ...afterLockReplay.result, replayed: true };
|
|
158401
158612
|
}
|
|
158402
|
-
const catalog3 = await store.read(
|
|
158613
|
+
const catalog3 = await store.read(scope2);
|
|
158403
158614
|
if (expectedVersion !== plan.baseVersion || catalog3.version !== expectedVersion) throw new ResourceApplyError("stale_version", `expected ${expectedVersion}, current ${catalog3.version}, plan base ${plan.baseVersion}`);
|
|
158404
158615
|
let replanned;
|
|
158405
158616
|
try {
|
|
158406
|
-
replanned = planResourceChange({ scope, catalog: catalog3, request: plan.request });
|
|
158617
|
+
replanned = planResourceChange({ scope: scope2, catalog: catalog3, request: plan.request });
|
|
158407
158618
|
} catch (error) {
|
|
158408
158619
|
throw new ResourceApplyError("invalid_plan", `plan request is no longer valid: ${error instanceof Error ? error.message : String(error)}`);
|
|
158409
158620
|
}
|
|
158410
158621
|
if (replanned.hash !== plan.hash) throw new ResourceApplyError("invalid_plan", "plan operations are not the canonical transition for its request and current catalog");
|
|
158411
158622
|
if (plan.operations.length === 0) return { catalog: catalog3, replayed: false, auditId: `noop:${plan.hash.slice(0, 16)}` };
|
|
158412
158623
|
const now = (input.now ?? (() => /* @__PURE__ */ new Date()))().toISOString();
|
|
158413
|
-
const event = { id: `${plan.hash.slice(0, 16)}:${input.idempotencyKey}`, at: now, scope: { ...
|
|
158414
|
-
return store.commit({ scope, expectedVersion, plan, idempotencyKey: input.idempotencyKey, event });
|
|
158624
|
+
const event = { id: `${plan.hash.slice(0, 16)}:${input.idempotencyKey}`, at: now, scope: { ...scope2 }, actor: `fn:${caller.functionName}`, planHash: plan.hash, idempotencyKey: input.idempotencyKey, fromVersion: catalog3.version, toVersion: catalog3.version + 1, operations: structuredClone(plan.operations) };
|
|
158625
|
+
return store.commit({ scope: scope2, expectedVersion, plan, idempotencyKey: input.idempotencyKey, event });
|
|
158415
158626
|
});
|
|
158416
158627
|
}
|
|
158417
158628
|
var ResourceApplyError;
|
|
@@ -158905,12 +159116,12 @@ function makeFunctionsHandler(options) {
|
|
|
158905
159116
|
throw new Error("KV provider is not configured");
|
|
158906
159117
|
}
|
|
158907
159118
|
};
|
|
158908
|
-
const
|
|
158909
|
-
const catalog3 = options.resourceStore ? await options.resourceStore.read(
|
|
158910
|
-
const capability = createFunctionDataCapability({ scope, data: selected.functionDataResources, catalog: catalog3, kv: options.dataKvProvider ?? emptyKv, ...wixApi ? { wix: wixApi } : {} });
|
|
159119
|
+
const scope2 = { app: target.app, siteId: siteBinding.siteId, environment: siteBinding.environment };
|
|
159120
|
+
const catalog3 = options.resourceStore ? await options.resourceStore.read(scope2) : { version: 0, resources: [] };
|
|
159121
|
+
const capability = createFunctionDataCapability({ scope: scope2, data: selected.functionDataResources, catalog: catalog3, kv: options.dataKvProvider ?? emptyKv, ...wixApi ? { wix: wixApi } : {} });
|
|
158911
159122
|
dataApi = createFunctionDataRpc({
|
|
158912
159123
|
capability,
|
|
158913
|
-
scope,
|
|
159124
|
+
scope: scope2,
|
|
158914
159125
|
catalog: catalog3,
|
|
158915
159126
|
capabilities: active.capabilities,
|
|
158916
159127
|
...active.capabilities.includes("resource_admin") && options.resourceStore ? {
|
|
@@ -163252,33 +163463,33 @@ var init_preview_assets_generated = __esm({
|
|
|
163252
163463
|
"../../packages/serve/src/preview-assets.generated.ts"() {
|
|
163253
163464
|
init_preview_assets_format();
|
|
163254
163465
|
PREVIEW_ASSET_MANIFEST = [
|
|
163255
|
-
{ key: "assets/DashboardHost-
|
|
163256
|
-
{ key: "assets/DevDrawer-
|
|
163257
|
-
{ key: "assets/IdiomCompare-
|
|
163258
|
-
{ key: "assets/LightboxViewer-
|
|
163259
|
-
{ key: "assets/PhonePreviewControl-
|
|
163260
|
-
{ key: "assets/SchemeCompare-
|
|
163261
|
-
{ key: "assets/index-
|
|
163262
|
-
{ key: "assets/pdf-
|
|
163263
|
-
{ key: "assets/pdf.worker.min-BQa_JDET.js", contentType: "application/javascript; charset=utf-8", offset:
|
|
163264
|
-
{ key: "assets/pdf.worker.min-BmVo14Nb.mjs", contentType: "application/javascript; charset=utf-8", offset:
|
|
163265
|
-
{ key: "assets/pdfDocument-
|
|
163266
|
-
{ key: "assets/pdfFetch-Cc8i1I1h.js", contentType: "application/javascript; charset=utf-8", offset:
|
|
163267
|
-
{ key: "fonts/Roboto-LICENSE.txt", contentType: "application/octet-stream", offset:
|
|
163268
|
-
{ key: "fonts/Roboto-Variable.ttf", contentType: "font/ttf", offset:
|
|
163269
|
-
{ key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset:
|
|
163270
|
-
{ key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset:
|
|
163271
|
-
{ key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset:
|
|
163272
|
-
{ key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset:
|
|
163273
|
-
{ key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset:
|
|
163274
|
-
{ key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset:
|
|
163275
|
-
{ key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset:
|
|
163276
|
-
{ key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset:
|
|
163277
|
-
{ key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset:
|
|
163278
|
-
{ key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset:
|
|
163279
|
-
{ key: "himi-sw.js", contentType: "application/javascript; charset=utf-8", offset:
|
|
163280
|
-
{ key: "index.html", contentType: "text/html; charset=utf-8", offset:
|
|
163281
|
-
{ key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset:
|
|
163466
|
+
{ key: "assets/DashboardHost-1jypScD2.js", contentType: "application/javascript; charset=utf-8", offset: 8, length: 2916, sha256: "73b7086df0cf3448a2bfe3ba276ec00a38c55542caebb2156675a36738a83fa3" },
|
|
163467
|
+
{ key: "assets/DevDrawer-BQ1xp__f.js", contentType: "application/javascript; charset=utf-8", offset: 2924, length: 16744, sha256: "d431422763f468ea57239ef416f3bce71549375b67f20e83d29511d75f15c46f" },
|
|
163468
|
+
{ key: "assets/IdiomCompare-CK_q192T.js", contentType: "application/javascript; charset=utf-8", offset: 19668, length: 1892, sha256: "59ca2d4f2faac878ecae8740faecf1d8e50136c0bb2ab28cb3ec12cd6df5d7bc" },
|
|
163469
|
+
{ key: "assets/LightboxViewer-COhqSEoj.js", contentType: "application/javascript; charset=utf-8", offset: 21560, length: 8132, sha256: "bf1696b76f086904f2e6f5aa88d73c809f0b75ccf0e2f85bb20170b4d4b93d43" },
|
|
163470
|
+
{ key: "assets/PhonePreviewControl-CJBzXYBw.js", contentType: "application/javascript; charset=utf-8", offset: 29692, length: 37729, sha256: "bafcaf544306b6c960671f01480b68b97b8d9f639f59f71bfe0a40d1630483c3" },
|
|
163471
|
+
{ key: "assets/SchemeCompare-s2ETtRsO.js", contentType: "application/javascript; charset=utf-8", offset: 67421, length: 1824, sha256: "c5f62861ae1843b28a961e2154c026e71e3f14b9bf933e3fb482eebaef2eb36f" },
|
|
163472
|
+
{ key: "assets/index-C4uN0_ln.js", contentType: "application/javascript; charset=utf-8", offset: 69245, length: 1301860, sha256: "b9728fe4fee91086095f4f6ccd03c4eb067e10b39c513a7c7e67ad07001f4919" },
|
|
163473
|
+
{ key: "assets/pdf-CJsqT7M-.js", contentType: "application/javascript; charset=utf-8", offset: 1371105, length: 488199, sha256: "5daa7c97dddee008bb1fc809bc405cb3b1fb6aad7392584218136961e503018d" },
|
|
163474
|
+
{ key: "assets/pdf.worker.min-BQa_JDET.js", contentType: "application/javascript; charset=utf-8", offset: 1859304, length: 73, sha256: "41bcfda4f3c8c0a81c785ea87c69afc8e7d0ed8c333324aee94c273d881bb6aa" },
|
|
163475
|
+
{ key: "assets/pdf.worker.min-BmVo14Nb.mjs", contentType: "application/javascript; charset=utf-8", offset: 1859377, length: 1317034, sha256: "a33cfe728c584fdba4fcc1fd54bcdc2f9f2f13889ddbb5b2bd1d0f8cbe49b84e" },
|
|
163476
|
+
{ key: "assets/pdfDocument-Cii5pAUm.js", contentType: "application/javascript; charset=utf-8", offset: 3176411, length: 3379, sha256: "bab1c624304f13d68d450b4bc8abd0574d394b1e4cddd3ac0d5ff6151debad24" },
|
|
163477
|
+
{ key: "assets/pdfFetch-Cc8i1I1h.js", contentType: "application/javascript; charset=utf-8", offset: 3179790, length: 2266, sha256: "1d21ad008921942217c9eac0c35b1713773b9d89c71e3ab4412781f7bb88f463" },
|
|
163478
|
+
{ key: "fonts/Roboto-LICENSE.txt", contentType: "application/octet-stream", offset: 3182056, length: 4610, sha256: "994062dd7af4186a739de55dd9e151c63b6301f8e2cbafc608d35c2e87da0cd2" },
|
|
163479
|
+
{ key: "fonts/Roboto-Variable.ttf", contentType: "font/ttf", offset: 3186666, length: 488584, sha256: "d7598e12c5dbef095ff8272cfc55da0250bd07fbdecbac8a530b9b277872a134" },
|
|
163480
|
+
{ key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset: 3675250, length: 90924, sha256: "ec4c7d63772d980d6e147b2df6215fd2737e4b04cebe0cf7e11dc695fb63cdcf" },
|
|
163481
|
+
{ key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset: 3766174, length: 90984, sha256: "bf4c16a2774edd38a921edf3099469866cd74c094fd596f3fa4e81f54a04dfaa" },
|
|
163482
|
+
{ key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset: 3857158, length: 90980, sha256: "368faca44fb9f7207e4af784e94750b1ee59c1098b8689e0f4a918926f244fb5" },
|
|
163483
|
+
{ key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset: 3948138, length: 90872, sha256: "97ed8f1a6772abe26e3d8af5cecfc4b02faa94497d585b0398b5053b739a70c1" },
|
|
163484
|
+
{ key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset: 4039010, length: 90980, sha256: "642feab8a48ddf6c7a89d7c2a7c0edfa0e6e773f671287e460e222703563191e" },
|
|
163485
|
+
{ key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset: 4129990, length: 108636, sha256: "37c179b4fefb63ea9637322b84583a2df53aa226c150294eea1675c14b1b8e29" },
|
|
163486
|
+
{ key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset: 4238626, length: 109084, sha256: "62e2fe4718129f36ecdb0ae4de385bd6b81ecc876146447167c6c140fad699a9" },
|
|
163487
|
+
{ key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset: 4347710, length: 109048, sha256: "4ecf270136af928612c76fe4ebade91d8156975e5ea4c0cf9225501dd1788e02" },
|
|
163488
|
+
{ key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset: 4456758, length: 107700, sha256: "dee56f09fd3efc127c1ea95557edc74110c1460a46287da36e0af25efd341ef5" },
|
|
163489
|
+
{ key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset: 4564458, length: 88108, sha256: "dced97a77624bc5f8b1ae65850360908297f4588e09feb6f22792d29dc7e765b" },
|
|
163490
|
+
{ key: "himi-sw.js", contentType: "application/javascript; charset=utf-8", offset: 4652566, length: 6748, sha256: "4a92459977d7cefa1a6a7e020c3a63509737f083b3f2773557c1a5771665811a" },
|
|
163491
|
+
{ key: "index.html", contentType: "text/html; charset=utf-8", offset: 4659314, length: 4947, sha256: "f1696b9320a90e440ce6db5a9eb3cfc62260a1d7a8b32c0fa78c749b013359e0" },
|
|
163492
|
+
{ key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset: 4664261, length: 17786, sha256: "084107ca997628c248f1b0ba3a7494744850df39fad813546ab8bdb82a6058da" }
|
|
163282
163493
|
];
|
|
163283
163494
|
}
|
|
163284
163495
|
});
|
|
@@ -186013,27 +186224,27 @@ var HttpDataKvAdminProvider = class {
|
|
|
186013
186224
|
if (!/^https?:\/\//.test(baseUrl)) throw new Error("data admin URL must be absolute http(s)");
|
|
186014
186225
|
if (!token) throw new Error("data admin token is required");
|
|
186015
186226
|
}
|
|
186016
|
-
async request(method,
|
|
186227
|
+
async request(method, scope2, name, body) {
|
|
186017
186228
|
const url = new URL(`/v1/data/admin/kv/${encodeURIComponent(name)}`, this.baseUrl);
|
|
186018
|
-
url.searchParams.set("app",
|
|
186019
|
-
url.searchParams.set("site",
|
|
186020
|
-
url.searchParams.set("environment",
|
|
186229
|
+
url.searchParams.set("app", scope2.app);
|
|
186230
|
+
url.searchParams.set("site", scope2.siteId);
|
|
186231
|
+
url.searchParams.set("environment", scope2.environment);
|
|
186021
186232
|
const serialized = body === void 0 ? void 0 : JSON.stringify(body);
|
|
186022
|
-
const idempotencyKey = serialized === void 0 ? void 0 : createHash4("sha256").update(`${
|
|
186233
|
+
const idempotencyKey = serialized === void 0 ? void 0 : createHash4("sha256").update(`${scope2.app}\0${scope2.siteId}\0${scope2.environment}\0${method}\0${name}\0${serialized}`).digest("hex");
|
|
186023
186234
|
const response = await this.fetchImpl(url, { method, headers: { authorization: `Bearer ${this.token}`, "content-type": "application/json", ...idempotencyKey ? { "idempotency-key": idempotencyKey } : {} }, ...serialized === void 0 ? {} : { body: serialized } });
|
|
186024
186235
|
if (response.status === 404 && method === "GET") return { exists: false };
|
|
186025
186236
|
if (!response.ok) throw new Error(`data admin ${method} failed (${response.status}): ${(await response.text()).slice(0, 256)}`);
|
|
186026
186237
|
return await response.json();
|
|
186027
186238
|
}
|
|
186028
|
-
inspect(
|
|
186029
|
-
return this.request("GET",
|
|
186239
|
+
inspect(scope2, name) {
|
|
186240
|
+
return this.request("GET", scope2, name);
|
|
186030
186241
|
}
|
|
186031
|
-
async create(
|
|
186032
|
-
const result = await this.request("PUT",
|
|
186242
|
+
async create(scope2, spec) {
|
|
186243
|
+
const result = await this.request("PUT", scope2, spec.name, { spec });
|
|
186033
186244
|
return result.status;
|
|
186034
186245
|
}
|
|
186035
|
-
async seed(
|
|
186036
|
-
const result = await this.request("POST",
|
|
186246
|
+
async seed(scope2, spec, values, options = {}) {
|
|
186247
|
+
const result = await this.request("POST", scope2, spec.name, { values, force: options.force ?? false });
|
|
186037
186248
|
return result.inserted;
|
|
186038
186249
|
}
|
|
186039
186250
|
};
|
|
@@ -188379,8 +188590,8 @@ function previewTokenNote(expiresAt, now = Date.now(), viaHandover = false) {
|
|
|
188379
188590
|
const minutes = Math.max(1, Math.round(seconds / 60));
|
|
188380
188591
|
return `${carrier}, and it expires at ${expiresAt} \u2014 about ${minutes} minute${minutes === 1 ? "" : "s"} from now; run the \`previewRenew\` command printed beside this note \u2014 from the same plane and credentials as this call (any \`--serve-url\`/\`--control-url\`/token flags you passed) \u2014 for a fresh one.`;
|
|
188381
188592
|
}
|
|
188382
|
-
function previewRenewCommand(app, release2, target,
|
|
188383
|
-
return `himi preview --app ${app} --release ${release2}` + (
|
|
188593
|
+
function previewRenewCommand(app, release2, target, scope2 = {}) {
|
|
188594
|
+
return `himi preview --app ${app} --release ${release2}` + (scope2.screen ? ` --screen ${scope2.screen}` : "") + (scope2.surface ? ` --surface ${scope2.surface}` : "") + (target !== "local" ? ` --target ${target}` : "");
|
|
188384
188595
|
}
|
|
188385
188596
|
function previewPlayerLink(app, release2, screenId) {
|
|
188386
188597
|
return buildPlayerPreviewUrl({ app, releaseId: release2, screenId, source: "cli" });
|
|
@@ -193569,8 +193780,8 @@ default (no --glyph): ${DEFAULT_GLYPH2} \u2014 a mark that claims nothing, so th
|
|
|
193569
193780
|
const rawLogs = r3.json?.logs ?? [];
|
|
193570
193781
|
const logs = byLevel(rawLogs);
|
|
193571
193782
|
const narrowed = !!(level || str10(flags.screen) || str10(flags.screenId) || num4(flags.since) !== void 0 || num4(flags.limit) !== void 0);
|
|
193572
|
-
const
|
|
193573
|
-
const note = logs.length > 0 ? void 0 : narrowed ? `no worker \`console.*\` lines matched this query${level && rawLogs.length ? ` (${rawLogs.length} line(s) were hidden by --level ${level})` : ""}. Drop --level/--screen/--since/--limit to see the whole console channel for ${
|
|
193783
|
+
const scope2 = release2 ? "this release" : "this app";
|
|
193784
|
+
const note = logs.length > 0 ? void 0 : narrowed ? `no worker \`console.*\` lines matched this query${level && rawLogs.length ? ` (${rawLogs.length} line(s) were hidden by --level ${level})` : ""}. Drop --level/--screen/--since/--limit to see the whole console channel for ${scope2}; the telemetry EVENT stream is a separate channel, read with \`himi telemetry\`.` : `no worker \`console.*\` output on ${scope2}. This is the console channel \u2014 distinct from the telemetry EVENT stream, which \`himi telemetry --app <app> --release <id>\` reads: ${scope2} can carry many events and no console lines \u2014 commonly because the worker never logged any, though an empty channel can also mean the lines aged out or never made it through ingestion. Boot-time \`console.log\` is visible via \`himi validate\` / \`himi render\`.`;
|
|
193574
193785
|
print({ ok: true, logs, ...note ? { note } : {} });
|
|
193575
193786
|
return 0;
|
|
193576
193787
|
}
|
|
@@ -194814,12 +195025,12 @@ ${label3}`);
|
|
|
194814
195025
|
return 1;
|
|
194815
195026
|
}
|
|
194816
195027
|
const storedAt2 = saveControlToken(target, result.token);
|
|
194817
|
-
let
|
|
195028
|
+
let scope2;
|
|
194818
195029
|
let exp;
|
|
194819
195030
|
let sub;
|
|
194820
195031
|
try {
|
|
194821
195032
|
const c2 = JSON.parse(Buffer.from(result.token.split(".")[0], "base64url").toString("utf8"));
|
|
194822
|
-
|
|
195033
|
+
scope2 = c2.apps;
|
|
194823
195034
|
exp = c2.exp;
|
|
194824
195035
|
sub = c2.sub;
|
|
194825
195036
|
} catch {
|
|
@@ -194831,10 +195042,10 @@ ${label3}`);
|
|
|
194831
195042
|
target,
|
|
194832
195043
|
sub,
|
|
194833
195044
|
exp,
|
|
194834
|
-
scope,
|
|
195045
|
+
scope: scope2,
|
|
194835
195046
|
storedAt: storedAt2,
|
|
194836
195047
|
...swap2 ? { notice: swap2 } : {},
|
|
194837
|
-
...Array.isArray(
|
|
195048
|
+
...Array.isArray(scope2) && scope2.length === 0 ? { hint: "you own no apps yet \u2014 claim one with `himi apps claim <slug>`" } : {}
|
|
194838
195049
|
});
|
|
194839
195050
|
return 0;
|
|
194840
195051
|
}
|
|
@@ -195387,9 +195598,9 @@ ${report3.ok ? "OK \u2014 data + serve plane reachable." : typeof report3.hint =
|
|
|
195387
195598
|
throw new Error("KV admin not configured");
|
|
195388
195599
|
} };
|
|
195389
195600
|
}
|
|
195390
|
-
const
|
|
195601
|
+
const scope2 = { app, siteId: site, environment: environment2 };
|
|
195391
195602
|
try {
|
|
195392
|
-
const report3 = sub === "plan" ? await planData({ scope, data, kv, call }) : sub === "create" ? await createData({ scope, data, kv, call, dryRun: flags["dry-run"] === true }) : await seedData({ scope, data, kv, call, dir, dryRun: flags["dry-run"] === true, force: flags.force === true });
|
|
195603
|
+
const report3 = sub === "plan" ? await planData({ scope: scope2, data, kv, call }) : sub === "create" ? await createData({ scope: scope2, data, kv, call, dryRun: flags["dry-run"] === true }) : await seedData({ scope: scope2, data, kv, call, dir, dryRun: flags["dry-run"] === true, force: flags.force === true });
|
|
195393
195604
|
print(report3);
|
|
195394
195605
|
return report3.ok ? 0 : 1;
|
|
195395
195606
|
} catch (error) {
|