react-semaphor 0.1.512 → 0.1.513
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/analytics-protocol/index.js +10 -10
- package/dist/brand-studio/index.cjs +1 -1
- package/dist/brand-studio/index.js +4 -4
- package/dist/briefings/index.js +5 -5
- package/dist/chunks/{calculated-field-identity-CJL54uFx.js → calculated-field-identity-DnRd4YIY.js} +4 -4
- package/dist/chunks/{card-config-utils-Bq1enstT.js → card-config-utils-B2cDWQqB.js} +5 -5
- package/dist/chunks/{dashboard-briefing-launcher-Dna1RtyP.cjs → dashboard-briefing-launcher-BgGxFDKD.cjs} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-CKOSxJJy.js → dashboard-briefing-launcher-C7ptb5Yf.js} +10 -10
- package/dist/chunks/{dashboard-controls-9H6PxWNh.cjs → dashboard-controls-BFT7savs.cjs} +1 -1
- package/dist/chunks/{dashboard-controls-BqePoOt8.js → dashboard-controls-BybAeRL8.js} +12 -12
- package/dist/chunks/{dashboard-date-comparison-definition-BX0ltXzm.js → dashboard-date-comparison-definition-D7Bl-YAl.js} +1 -1
- package/dist/chunks/{dashboard-json-BJJ1cddf.js → dashboard-json-DmgEQ0yQ.js} +7 -7
- package/dist/chunks/{dashboard-json-BwwJoZdd.cjs → dashboard-json-qNJC4fZW.cjs} +1 -1
- package/dist/chunks/{edit-dashboard-visual-cJdvfkou.cjs → edit-dashboard-visual-BS219qr8.cjs} +1 -1
- package/dist/chunks/{edit-dashboard-visual-Db2mRA_9.js → edit-dashboard-visual-CHqpQVfv.js} +16 -16
- package/dist/chunks/{editor-action-buttons-CKS-8x2Y.cjs → editor-action-buttons-6NvSUz4D.cjs} +1 -1
- package/dist/chunks/{editor-action-buttons-ktNQjwNQ.js → editor-action-buttons-DbU_vUvm.js} +7 -7
- package/dist/chunks/{field-aggregations-DUb0NU6c.js → field-aggregations-CzuQKtqx.js} +6 -6
- package/dist/chunks/{field-dependencies-Cl97kkHy.js → field-dependencies-DXW4jtvJ.js} +11 -11
- package/dist/chunks/{index-0pdaQ9e1.js → index-CnGVjyF8.js} +11 -11
- package/dist/chunks/{index-CdlFHeq9.cjs → index-CrxlydOT.cjs} +246 -241
- package/dist/chunks/{index-SVO291wS.js → index-WMVZeOZp.js} +35072 -34608
- package/dist/chunks/{matrix-analytical-definition-xesmc3Qa.js → matrix-analytical-definition-BDAK2aEi.js} +1 -1
- package/dist/chunks/{matrix-card-CnKQpnsj.js → matrix-card-DOIeTmjh.js} +2 -2
- package/dist/chunks/{matrix-control-sources-CRRdP03Q.js → matrix-control-sources-BxKH2yu2.js} +5 -5
- package/dist/chunks/{matrix-definition-RyU0cpLX.js → matrix-definition-I9rHB9zN.js} +1 -1
- package/dist/chunks/{matrix-formatter-ZVS5QOuq.js → matrix-formatter-BLunke3R.js} +4 -4
- package/dist/chunks/{matrix-member-presentation-CzGZJd3a.js → matrix-member-presentation-DO1VSqfh.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-xL8IhFzp.js → matrix-operation-contract-D0HfzwZg.js} +27 -27
- package/dist/chunks/{metric-comparison-C-sYqv0g.js → metric-comparison-Dqc7_tnW.js} +1 -1
- package/dist/chunks/{pivot-header-presentation-DVylCBHB.js → pivot-header-presentation-Dm9dUQsl.js} +3 -3
- package/dist/chunks/{pivot-result-identity-BSudrDLN.js → pivot-result-identity-8M-bZrw9.js} +1 -1
- package/dist/chunks/{pivot-result-lifecycle-CmjpW7qG.js → pivot-result-lifecycle-BeOpjAhg.js} +7 -7
- package/dist/chunks/{raw-temporal-CUJ86xHI.js → raw-temporal-DrmCX9Wq.js} +2 -2
- package/dist/chunks/{raw-temporal-contract-Eyr5U8DK.js → raw-temporal-contract-CFLGwTiI.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-CBZBmpxZ.js → report-preferences-dialog-BoDcPtha.js} +6 -6
- package/dist/chunks/{report-preferences-dialog-DserKhuQ.cjs → report-preferences-dialog-CaefWf8W.cjs} +1 -1
- package/dist/chunks/{report-runtime-context-DWvUf1HT.js → report-runtime-context-Cs65Mrxj.js} +5 -5
- package/dist/chunks/{selection-reducer-B94WgZ9V.js → selection-reducer-BIiQXbGM.js} +1 -1
- package/dist/chunks/{semantic-format-CBlRO8Aw.js → semantic-format-BZxJLKvw.js} +2 -2
- package/dist/chunks/{source-entity-resolution-DZhUckix.js → source-entity-resolution-D7vnmDwm.js} +1 -1
- package/dist/chunks/switch--Re1K566.cjs +134 -0
- package/dist/chunks/{switch-CrstROAR.js → switch-QfKb0Iwe.js} +2373 -2294
- package/dist/chunks/{temporal-bucket-contract-D5QlJbmm.js → temporal-bucket-contract-IWDgyTMw.js} +1 -1
- package/dist/chunks/{token-types-CPde8_LG.js → token-types-Dl0hcKBX.js} +1 -1
- package/dist/chunks/{update-policy-D9q1Tz8k.js → update-policy-BeQqjupC.js} +2 -2
- package/dist/chunks/{validators-BDYzZFgs.js → validators-CkHsAvwB.js} +12 -12
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.js +10 -10
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +3 -3
- package/dist/data-app-codegen/index.js +2 -2
- package/dist/data-app-codegen-node/index.js +3 -3
- package/dist/data-app-sdk/index.js +5 -5
- package/dist/data-app-sdk-adapters/index.js +2 -2
- package/dist/data-app-sdk-validation/index.js +5 -5
- package/dist/format-utils/index.js +16 -16
- package/dist/index.cjs +1 -1
- package/dist/index.js +32 -32
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/components/calculated-fields/field-picker-panel.d.ts +5 -1
- package/dist/types/components/calculated-fields/placeholder-field-picker.d.ts +30 -0
- package/dist/types/components/calculated-fields/templates-menu.d.ts +9 -3
- package/dist/types/components/explorer/fields/field-option-list.d.ts +3 -1
- package/dist/types/components/semaphor/code-editor.d.ts +28 -0
- package/dist/types/components/surfboard/filter/use-dashboard-filter-mapping-popover.d.ts +0 -1
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.js +40 -31
- package/dist/types/lib/hooks/calculated-fields/use-calculated-field-templates.d.ts +9 -0
- package/dist/types/lib/hooks/calculated-fields/use-formula-placeholders.d.ts +54 -0
- package/dist/types/lib/stores/dashboard-store.d.ts +1 -2
- package/dist/types/lib/types/calculated-field-template-types.d.ts +13 -0
- package/dist/types/lib/types/common-types.d.ts +0 -7
- package/dist/types/lib/types/index.d.ts +1 -0
- package/dist/types/lib/utils/calculated-field-row-templates.d.ts +13 -0
- package/dist/types/lib/utils/calculated-field-token-utils.d.ts +23 -0
- package/package.json +1 -1
- package/dist/chunks/switch-BkcJCTS7.cjs +0 -134
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as a, t as s, u as f } from "./validators-
|
|
2
|
-
import "./matrix-operation-contract-
|
|
1
|
+
import { r as a, t as s, u as f } from "./validators-CkHsAvwB.js";
|
|
2
|
+
import "./matrix-operation-contract-D0HfzwZg.js";
|
|
3
3
|
function u(i, r = {}) {
|
|
4
4
|
var n, o;
|
|
5
5
|
if (i.type !== "matrixTable" || !i.config || typeof i.config != "object" || !("matrix" in i.config)) return { status: "absent" };
|
package/dist/chunks/{matrix-control-sources-CRRdP03Q.js → matrix-control-sources-BxKH2yu2.js}
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
var te = Object.defineProperty;
|
|
2
2
|
var re = (e, t, o) => t in e ? te(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
|
|
3
3
|
var x = (e, t, o) => re(e, typeof t != "symbol" ? t + "" : t, o);
|
|
4
|
-
import {
|
|
4
|
+
import { h as oe, f as ne, U as ie, F as ae, a_ as G, G as se, am as P, ak as ce, u as j, $ as le } from "./validators-CkHsAvwB.js";
|
|
5
5
|
import { C as A } from "./common-types-C6cAQgyh.js";
|
|
6
|
-
import "./matrix-operation-contract-
|
|
7
|
-
import { v as de, y as ue } from "./calculated-field-identity-
|
|
8
|
-
import { v as ge } from "./field-aggregations-
|
|
6
|
+
import "./matrix-operation-contract-D0HfzwZg.js";
|
|
7
|
+
import { v as de, y as ue } from "./calculated-field-identity-DnRd4YIY.js";
|
|
8
|
+
import { v as ge } from "./field-aggregations-CzuQKtqx.js";
|
|
9
9
|
import { ZodError as fe } from "zod";
|
|
10
|
-
import { a as H } from "./matrix-card-
|
|
10
|
+
import { a as H } from "./matrix-card-DOIeTmjh.js";
|
|
11
11
|
import { m as Y, a as Z } from "./constants-DeLIHVAW.js";
|
|
12
12
|
function me(e, t) {
|
|
13
13
|
const r = Ne(e);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { b4 as L, S as T, ak as _ } from "./validators-
|
|
2
|
-
import "./matrix-operation-contract-
|
|
3
|
-
import { t as d, c as P, g as $, e as C, a as x, b as O, d as A, f as Z, i as k } from "./semantic-format-
|
|
4
|
-
import { f as R, s as U, k as z, j as V, b as X } from "./raw-temporal-
|
|
1
|
+
import { b4 as L, S as T, ak as _ } from "./validators-CkHsAvwB.js";
|
|
2
|
+
import "./matrix-operation-contract-D0HfzwZg.js";
|
|
3
|
+
import { t as d, c as P, g as $, e as C, a as x, b as O, d as A, f as Z, i as k } from "./semantic-format-BZxJLKvw.js";
|
|
4
|
+
import { f as R, s as U, k as z, j as V, b as X } from "./raw-temporal-DrmCX9Wq.js";
|
|
5
5
|
import { b as p, c as M } from "./constants-DeLIHVAW.js";
|
|
6
6
|
import { f as j } from "./index-CACdoqu3.js";
|
|
7
7
|
import { d as E, f as Y } from "./temporal-bucket-B9hMwemw.js";
|
package/dist/chunks/{matrix-operation-contract-xL8IhFzp.js → matrix-operation-contract-D0HfzwZg.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z as r } from "zod";
|
|
2
|
-
import { K as g, E as se, U as B, ba as L, S as v, M as Ce, b2 as te, bb as je, aL as qe, F as Ee, m as Fe,
|
|
2
|
+
import { K as g, E as se, U as B, ba as L, S as v, M as Ce, b2 as te, bb as je, aL as qe, F as Ee, m as Fe, a as xe, b0 as Ke, aQ as Ne, aR as Oe, aU as Be, aV as Te, aE as q, aJ as P, ax as Me, aO as De, aP as ie, av as Pe, at as m, au as Ve, aK as Ue, aB as ze, aC as Le, v as re, aG as Ge, s as Qe, q as ne, ah as He } from "./validators-CkHsAvwB.js";
|
|
3
3
|
const V = {
|
|
4
4
|
answerSummary: "string",
|
|
5
5
|
responseDetail: "responseDetail",
|
|
@@ -40,7 +40,7 @@ const V = {
|
|
|
40
40
|
periodRows: "recordArray",
|
|
41
41
|
sql: "unknown",
|
|
42
42
|
omitted: "stringArray"
|
|
43
|
-
}, gt = Object.freeze({ coordinates: 2e4 }),
|
|
43
|
+
}, gt = Object.freeze({ coordinates: 2e4 }), k = r.string().uuid(), p = r.string().min(1), We = r.number().int().positive().max(Number.MAX_SAFE_INTEGER);
|
|
44
44
|
function c(t, s, e) {
|
|
45
45
|
t.addIssue({ code: "custom", path: s, message: e });
|
|
46
46
|
}
|
|
@@ -63,7 +63,7 @@ const Ye = r.object({
|
|
|
63
63
|
id: p,
|
|
64
64
|
rows: G,
|
|
65
65
|
columns: G,
|
|
66
|
-
measureIds: r.array(
|
|
66
|
+
measureIds: r.array(k).min(1).readonly()
|
|
67
67
|
}).strict(), ae = r.object({
|
|
68
68
|
pages: r.array(Ye).readonly(),
|
|
69
69
|
blocks: r.array(Je).readonly()
|
|
@@ -140,7 +140,7 @@ const Ye = r.object({
|
|
|
140
140
|
coverage: r.object({
|
|
141
141
|
rowPaths: r.array(g).readonly(),
|
|
142
142
|
columnPaths: r.array(g).readonly(),
|
|
143
|
-
measureIds: r.array(
|
|
143
|
+
measureIds: r.array(k).readonly()
|
|
144
144
|
}).strict(),
|
|
145
145
|
cells: r.array(
|
|
146
146
|
Ce.extend({ value: te }).strict()
|
|
@@ -163,7 +163,7 @@ const Ye = r.object({
|
|
|
163
163
|
for (const u of t.cells)
|
|
164
164
|
(!n.has(v(u.rowPath)) || !a.has(v(u.columnPath)) || !l.has(u.measureId)) && c(s, ["cells"], "Cell is outside certified coverage.");
|
|
165
165
|
}), Q = r.object({
|
|
166
|
-
id:
|
|
166
|
+
id: k,
|
|
167
167
|
column: qe,
|
|
168
168
|
nativeDataType: p,
|
|
169
169
|
semanticFormat: je.optional()
|
|
@@ -267,10 +267,10 @@ const Ye = r.object({
|
|
|
267
267
|
window: ue
|
|
268
268
|
}).strict(), de = r.enum(["member", "subtotal", "grand_total"]), ss = r.discriminatedUnion("kind", [
|
|
269
269
|
r.object({ kind: r.literal("hierarchy"), label: r.string() }).strict(),
|
|
270
|
-
r.object({ kind: r.literal("level"), levelId:
|
|
270
|
+
r.object({ kind: r.literal("level"), levelId: k, label: r.string() }).strict(),
|
|
271
271
|
r.object({
|
|
272
272
|
kind: r.literal("measure"),
|
|
273
|
-
measureId:
|
|
273
|
+
measureId: k,
|
|
274
274
|
columnPath: g,
|
|
275
275
|
role: de,
|
|
276
276
|
label: r.string()
|
|
@@ -420,7 +420,7 @@ const Ye = r.object({
|
|
|
420
420
|
"requires_sql_escape_hatch",
|
|
421
421
|
"unsupported_sdk_capability"
|
|
422
422
|
]);
|
|
423
|
-
function
|
|
423
|
+
function wt(t) {
|
|
424
424
|
return me(t).ok;
|
|
425
425
|
}
|
|
426
426
|
function me(t) {
|
|
@@ -546,7 +546,7 @@ function hs(t, s) {
|
|
|
546
546
|
return i.push(`${s}.fields must be an array.`), (e.sdkSpec !== void 0 || e.sdkBuilder !== void 0) && i.push(`${s}.fields must be an array for executable views.`), i.push(...E(e, `${s}`)), i;
|
|
547
547
|
e.fields.forEach((d, b) => {
|
|
548
548
|
i.push(...f(d, `${s}.fields.${b}`));
|
|
549
|
-
}),
|
|
549
|
+
}), w(e.queryKind) || i.push(`${s}.queryKind must be a supported codegen query kind.`), e.sdkBuilder !== void 0 && !ge(e.sdkBuilder) && i.push(`${s}.sdkBuilder must be a supported SDK builder.`), e.metricBindingKeys !== void 0 && (Array.isArray(e.metricBindingKeys) ? e.metricBindingKeys.some(
|
|
550
550
|
(d) => typeof d != "string" || d.trim().length === 0
|
|
551
551
|
) && i.push(`${s}.metricBindingKeys must be an array of strings.`) : i.push(`${s}.metricBindingKeys must be an array of strings.`));
|
|
552
552
|
const n = o(e.sdkSpec), a = (n == null ? void 0 : n.builder) === "semaphor.metric";
|
|
@@ -556,7 +556,7 @@ function hs(t, s) {
|
|
|
556
556
|
`${s}.metricBindingKeys must match the generated metric field binding keys in order.`
|
|
557
557
|
);
|
|
558
558
|
const u = o(e.computation);
|
|
559
|
-
return (u == null ? void 0 : u.kind) === "server_query" &&
|
|
559
|
+
return (u == null ? void 0 : u.kind) === "server_query" && w(e.queryKind) && w(u.queryKind) && u.queryKind !== e.queryKind && i.push(`${s}.computation.queryKind must match queryKind.`), i.push(
|
|
560
560
|
...Rs({
|
|
561
561
|
value: e.sdkSpec,
|
|
562
562
|
path: `${s}.sdkSpec`,
|
|
@@ -655,16 +655,16 @@ function $s({
|
|
|
655
655
|
return [`${i} must match ${e}.`];
|
|
656
656
|
const n = [];
|
|
657
657
|
return t.length !== s.length ? (n.push(`${i} must match ${e}.`), n) : (t.forEach((a, l) => {
|
|
658
|
-
|
|
658
|
+
ws(o(a), o(s[l])) || n.push(`${i}.${l} must match ${e}.${l}.`);
|
|
659
659
|
}), n);
|
|
660
660
|
}
|
|
661
|
-
function
|
|
662
|
-
return !t || !s ? !1 : t.name === s.name && (t.role || "measure") === (s.role || "measure") && Y(t) === Y(s) &&
|
|
661
|
+
function ws(t, s) {
|
|
662
|
+
return !t || !s ? !1 : t.name === s.name && (t.role || "measure") === (s.role || "measure") && Y(t) === Y(s) && ks(t, s);
|
|
663
663
|
}
|
|
664
664
|
function Y(t) {
|
|
665
665
|
return typeof t.aggregate == "string" ? t.aggregate.toUpperCase() : "SUM";
|
|
666
666
|
}
|
|
667
|
-
function
|
|
667
|
+
function ks(t, s) {
|
|
668
668
|
const e = o(t.source), i = o(s.source);
|
|
669
669
|
if (Is(e, i))
|
|
670
670
|
return !1;
|
|
@@ -779,7 +779,7 @@ function Rs(t) {
|
|
|
779
779
|
const e = [];
|
|
780
780
|
if (!ge(s.builder))
|
|
781
781
|
return e.push(`${t.path}.builder must be a supported SDK builder.`), e;
|
|
782
|
-
t.sdkBuilder && s.builder !== t.sdkBuilder && e.push(`${t.path}.builder must match sdkBuilder.`), t.queryKind &&
|
|
782
|
+
t.sdkBuilder && s.builder !== t.sdkBuilder && e.push(`${t.path}.builder must match sdkBuilder.`), t.queryKind && w(t.queryKind) && s.builder !== Fs(t.queryKind) && e.push(`${t.path}.builder must match queryKind.`);
|
|
783
783
|
const i = o(s.spec);
|
|
784
784
|
if (!i)
|
|
785
785
|
return e.push(`${t.path}.spec must be an object.`), e;
|
|
@@ -1067,7 +1067,7 @@ function Ds(t, s) {
|
|
|
1067
1067
|
const i = [];
|
|
1068
1068
|
switch (e.kind) {
|
|
1069
1069
|
case "server_query":
|
|
1070
|
-
|
|
1070
|
+
w(e.queryKind) || i.push(
|
|
1071
1071
|
`${s}.queryKind must be a supported codegen query kind.`
|
|
1072
1072
|
), e.queryOwnership !== void 0 && e.queryOwnership !== "view_owned" && e.queryOwnership !== "shared_query" && i.push(
|
|
1073
1073
|
`${s}.queryOwnership must be view_owned or shared_query.`
|
|
@@ -1236,7 +1236,7 @@ function M(t, s) {
|
|
|
1236
1236
|
);
|
|
1237
1237
|
}), e.kind !== "semantic" && i.push(`${s} must use semantic source identity.`), (typeof e.domainId != "string" || !e.domainId.trim() || typeof e.datasetName != "string" || !e.datasetName.trim()) && i.push(`${s} must include semantic domainId and datasetName.`), i;
|
|
1238
1238
|
}
|
|
1239
|
-
function
|
|
1239
|
+
function w(t) {
|
|
1240
1240
|
return rs.has(t);
|
|
1241
1241
|
}
|
|
1242
1242
|
function ge(t) {
|
|
@@ -1353,7 +1353,7 @@ const Ls = r.union([
|
|
|
1353
1353
|
answeredObligations: r.array(r.string()),
|
|
1354
1354
|
missingObligations: r.array(r.string()),
|
|
1355
1355
|
warnings: r.array(De).optional()
|
|
1356
|
-
}).passthrough(),
|
|
1356
|
+
}).passthrough(), we = r.object({
|
|
1357
1357
|
intentId: r.string().optional(),
|
|
1358
1358
|
queryId: r.string().optional(),
|
|
1359
1359
|
status: r.enum(["answered", "partial", "failed"]),
|
|
@@ -1378,7 +1378,7 @@ const Ls = r.union([
|
|
|
1378
1378
|
diagnosticFeedback: ve.optional(),
|
|
1379
1379
|
population: Se.optional(),
|
|
1380
1380
|
metadata: r.record(r.string(), r.unknown()).optional()
|
|
1381
|
-
}).passthrough(), Qs =
|
|
1381
|
+
}).passthrough(), Qs = we;
|
|
1382
1382
|
function Hs(t) {
|
|
1383
1383
|
switch (t) {
|
|
1384
1384
|
case "boolean":
|
|
@@ -1436,7 +1436,7 @@ const Ws = Object.fromEntries(
|
|
|
1436
1436
|
aggregate: Pe.optional(),
|
|
1437
1437
|
sourceKey: r.string().optional(),
|
|
1438
1438
|
source: z.optional()
|
|
1439
|
-
}).passthrough(),
|
|
1439
|
+
}).passthrough(), ke = r.object({
|
|
1440
1440
|
id: r.string().optional(),
|
|
1441
1441
|
builder: r.literal("semaphor.inputOptions"),
|
|
1442
1442
|
source: z.optional(),
|
|
@@ -1460,7 +1460,7 @@ const Ws = Object.fromEntries(
|
|
|
1460
1460
|
type: r.string().optional(),
|
|
1461
1461
|
serverSide: r.boolean().optional(),
|
|
1462
1462
|
fieldRef: $.optional(),
|
|
1463
|
-
optionQuery:
|
|
1463
|
+
optionQuery: ke.optional(),
|
|
1464
1464
|
bindings: r.array(Ie).optional(),
|
|
1465
1465
|
appliesToViewIds: r.array(r.string()),
|
|
1466
1466
|
relationshipHint: r.unknown().optional(),
|
|
@@ -1504,11 +1504,11 @@ const Ws = Object.fromEntries(
|
|
|
1504
1504
|
type: r.string().optional(),
|
|
1505
1505
|
serverSide: r.boolean().optional(),
|
|
1506
1506
|
fieldRef: $.optional(),
|
|
1507
|
-
optionQuery:
|
|
1507
|
+
optionQuery: ke.optional(),
|
|
1508
1508
|
bindings: r.array(Ie),
|
|
1509
1509
|
appliesToViewIds: r.array(r.string()),
|
|
1510
1510
|
notAppliedToViewIds: r.array(r.string())
|
|
1511
|
-
}).passthrough(),
|
|
1511
|
+
}).passthrough(), kt = r.object({
|
|
1512
1512
|
schemaVersion: r.literal(T),
|
|
1513
1513
|
title: r.string(),
|
|
1514
1514
|
purpose: r.string().optional(),
|
|
@@ -1734,7 +1734,7 @@ const mt = {
|
|
|
1734
1734
|
resultShape: r.literal("matrix"),
|
|
1735
1735
|
result: le.optional(),
|
|
1736
1736
|
metadata: r.object({ rowLimitExceeded: r.boolean(), matrixFailure: U.optional() }).passthrough()
|
|
1737
|
-
}, ft =
|
|
1737
|
+
}, ft = we.extend(mt), Kt = ft.superRefine((t, s) => {
|
|
1738
1738
|
t.status === "failed" == !!t.result && s.addIssue({ code: "custom", message: "Only answered or partial Matrix execution carries a window." }), t.result && t.status === "partial" != t.result.window.failures.length > 0 && s.addIssue({ code: "custom", message: "Matrix execution status must match acquired window failures." });
|
|
1739
1739
|
});
|
|
1740
1740
|
export {
|
|
@@ -1781,15 +1781,15 @@ export {
|
|
|
1781
1781
|
Gs as f,
|
|
1782
1782
|
It as g,
|
|
1783
1783
|
ve as h,
|
|
1784
|
-
|
|
1784
|
+
wt as i,
|
|
1785
1785
|
Se as j,
|
|
1786
1786
|
$e as k,
|
|
1787
|
-
|
|
1787
|
+
we as l,
|
|
1788
1788
|
Qs as m,
|
|
1789
1789
|
Ws as n,
|
|
1790
1790
|
Ys as o,
|
|
1791
1791
|
At as p,
|
|
1792
|
-
|
|
1792
|
+
kt as q,
|
|
1793
1793
|
le as r,
|
|
1794
1794
|
Ls as s,
|
|
1795
1795
|
Ae as t,
|
package/dist/chunks/{pivot-header-presentation-DVylCBHB.js → pivot-header-presentation-Dm9dUQsl.js}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var x = Object.defineProperty;
|
|
2
2
|
var T = (e, r, t) => r in e ? x(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
|
|
3
3
|
var y = (e, r, t) => T(e, typeof r != "symbol" ? r + "" : r, t);
|
|
4
|
-
import { i as C } from "./semantic-format-
|
|
5
|
-
import { d as _ } from "./matrix-formatter-
|
|
6
|
-
import { b as g } from "./raw-temporal-
|
|
4
|
+
import { i as C } from "./semantic-format-BZxJLKvw.js";
|
|
5
|
+
import { d as _ } from "./matrix-formatter-BLunke3R.js";
|
|
6
|
+
import { b as g } from "./raw-temporal-DrmCX9Wq.js";
|
|
7
7
|
import { PDF_SAFETY_LIMIT_EXCEEDED as S, getUtf8ByteLength as V, FAST_PDF_POLICY as M } from "../pdf-export-policy/index.js";
|
|
8
8
|
import { f as P } from "./temporal-bucket-B9hMwemw.js";
|
|
9
9
|
function R(e, r, t) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var y = Object.defineProperty;
|
|
2
2
|
var c = (t, e, r) => e in t ? y(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
3
|
var u = (t, e, r) => c(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
-
import { v as d } from "./temporal-bucket-contract-
|
|
4
|
+
import { v as d } from "./temporal-bucket-contract-IWDgyTMw.js";
|
|
5
5
|
function f(t) {
|
|
6
6
|
return !!(t != null && t.isSubtotal && t.subtotalScope === "pivot-value");
|
|
7
7
|
}
|
package/dist/chunks/{pivot-result-lifecycle-CmjpW7qG.js → pivot-result-lifecycle-BeOpjAhg.js}
RENAMED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
var $ = Object.defineProperty;
|
|
2
2
|
var E = (e, o, t) => o in e ? $(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
|
|
3
3
|
var u = (e, o, t) => E(e, typeof o != "symbol" ? o + "" : o, t);
|
|
4
|
-
import { p as _, a as K } from "./raw-temporal-
|
|
5
|
-
import { b as j } from "./report-runtime-context-
|
|
4
|
+
import { p as _, a as K } from "./raw-temporal-DrmCX9Wq.js";
|
|
5
|
+
import { b as j } from "./report-runtime-context-Cs65Mrxj.js";
|
|
6
6
|
import { i as f, p as F } from "./temporal-bucket-B9hMwemw.js";
|
|
7
|
-
import { a6 as S } from "./validators-
|
|
8
|
-
import "./matrix-operation-contract-
|
|
9
|
-
import { a as M } from "./metric-comparison-
|
|
10
|
-
import { a as P } from "./temporal-bucket-contract-
|
|
11
|
-
import { b as T, P as O } from "./pivot-result-identity-
|
|
7
|
+
import { a6 as S } from "./validators-CkHsAvwB.js";
|
|
8
|
+
import "./matrix-operation-contract-D0HfzwZg.js";
|
|
9
|
+
import { a as M } from "./metric-comparison-Dqc7_tnW.js";
|
|
10
|
+
import { a as P } from "./temporal-bucket-contract-IWDgyTMw.js";
|
|
11
|
+
import { b as T, P as O } from "./pivot-result-identity-8M-bZrw9.js";
|
|
12
12
|
class x extends Error {
|
|
13
13
|
constructor(t) {
|
|
14
14
|
super(
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var W = Object.defineProperty;
|
|
2
2
|
var Q = (e, t, r) => t in e ? W(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
3
|
var b = (e, t, r) => Q(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
-
import { b8 as K, b9 as J,
|
|
4
|
+
import { b8 as K, b9 as J, i as T } from "./validators-CkHsAvwB.js";
|
|
5
5
|
import { canonicalizeSupportedLocale as M, canonicalizeSupportedCurrencyCode as z } from "../value-format-preferences/index.js";
|
|
6
6
|
import { i as g, t as L } from "./temporal-bucket-B9hMwemw.js";
|
|
7
|
-
import { p as ee } from "./raw-temporal-contract-
|
|
7
|
+
import { p as ee } from "./raw-temporal-contract-CFLGwTiI.js";
|
|
8
8
|
import { f as te } from "./index-CACdoqu3.js";
|
|
9
9
|
let I;
|
|
10
10
|
function C(e, t) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var d = Object.defineProperty;
|
|
2
2
|
var i = (a, e, t) => e in a ? d(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
|
|
3
3
|
var n = (a, e, t) => i(a, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { R as l } from "./validators-
|
|
4
|
+
import { R as l } from "./validators-CkHsAvwB.js";
|
|
5
5
|
class r extends Error {
|
|
6
6
|
constructor(t) {
|
|
7
7
|
super(t);
|
package/dist/chunks/{report-preferences-dialog-CBZBmpxZ.js → report-preferences-dialog-BoDcPtha.js}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs as o, Fragment as j, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import oe, { useState as S, useRef as X, useEffect as U, useCallback as E, useMemo as _ } from "react";
|
|
3
|
-
import { az as ee, aA as ce, aB as B, aC as $, aD as de, g as ue, h as me, i as fe, j as he, k as M, l as H, aE as ve, aF as V, b as ye, aG as pe, aH as ge, aI as Se, aJ as be, aK as Te } from "./index-
|
|
4
|
-
import { u as ae, c as F, O as W, P as we, a as Ce, B as D, b as ke, d as q, L as te, a4 as z, T as xe, F as Ne, G, I as K } from "./switch-
|
|
5
|
-
import { a as Pe } from "./report-runtime-context-
|
|
3
|
+
import { az as ee, aA as ce, aB as B, aC as $, aD as de, g as ue, h as me, i as fe, j as he, k as M, l as H, aE as ve, aF as V, b as ye, aG as pe, aH as ge, aI as Se, aJ as be, aK as Te } from "./index-WMVZeOZp.js";
|
|
4
|
+
import { u as ae, c as F, O as W, P as we, a as Ce, B as D, b as ke, d as q, L as te, a4 as z, T as xe, F as Ne, G, I as K } from "./switch-QfKb0Iwe.js";
|
|
5
|
+
import { a as Pe } from "./report-runtime-context-Cs65Mrxj.js";
|
|
6
6
|
import "./x-CXDkqdur.js";
|
|
7
|
-
import "./card-config-utils-
|
|
8
|
-
import "./validators-
|
|
9
|
-
import "./matrix-operation-contract-
|
|
7
|
+
import "./card-config-utils-B2cDWQqB.js";
|
|
8
|
+
import "./validators-CkHsAvwB.js";
|
|
9
|
+
import "./matrix-operation-contract-D0HfzwZg.js";
|
|
10
10
|
import { parseValueFormatPreferencesResponse as Ae, canonicalizeSupportedLocale as Ee, canonicalizeSupportedCurrencyCode as ze } from "../value-format-preferences/index.js";
|
|
11
11
|
function De(e = {}) {
|
|
12
12
|
const { authToken: i, tokenProps: a } = ee(), d = ae(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),o=require("react"),d=require("./index-CdlFHeq9.cjs"),s=require("./switch-BkcJCTS7.cjs"),V=require("./report-runtime-context-DzvHBPxl.cjs");require("./x-B6ghREd2.cjs");require("./card-config-utils-CMO4_zVs.cjs");require("./validators-DVYAnnX0.cjs");require("./matrix-operation-contract-DoiWTUbT.cjs");const L=require("../value-format-preferences/index.cjs");function G(a={}){const{authToken:c,tokenProps:t}=d.useSemaphorContext(),m=s.useDashboardStore(p=>p.actions.applyResolvedCalendarPreferences),r=a.enabled??!0,i=(c==null?void 0:c.accessToken)??null,h=(t==null?void 0:t.apiServiceUrl)??null,[g,S]=o.useState(!1),[b,C]=o.useState(!1),[f,j]=o.useState(!1),[T,x]=o.useState(null),[w,P]=o.useState(null),v=o.useRef(i);v.current=i,o.useEffect(()=>{P(null),x(null),S(!1),C(!1),j(!1)},[i]);const N=o.useCallback(async p=>{const n=V.parseCalendarPreferencesResponse(await p.json());if(!n.ok)throw new Error("Calendar preferences response is invalid");return n.value},[]),k=o.useCallback(async()=>{if(!r||!i||!h)return;const p=i;S(!0),x(null);try{const n=await fetch(`${h}/v1/user-preferences/calendar`,{method:"GET",headers:{Authorization:`Bearer ${i}`}});if(!n.ok){const y=await n.json().catch(()=>({}));throw new Error(y.error||"Failed to fetch preferences")}const l=await N(n);v.current===p&&P(l)}catch(n){v.current===p&&x(n instanceof Error?n.message:"Unknown error")}finally{v.current===p&&S(!1)}},[i,h,r,N]);o.useEffect(()=>{r&&k()},[r,k]);const E=o.useCallback(async p=>{if(!i||!h)return x("Not authenticated"),!1;const n=i;C(!0),x(null);try{const l=await fetch(`${h}/v1/user-preferences/calendar`,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`},body:JSON.stringify(p)});if(!l.ok){const D=await l.json().catch(()=>({}));throw new Error(D.error||"Failed to update preferences")}const y=await N(l);return v.current!==n?!1:(P(y),m(y.resolved,y.sources),!0)}catch(l){return v.current===n&&x(l instanceof Error?l.message:"Unknown error"),!1}finally{v.current===n&&C(!1)}},[i,h,m,N]),A=o.useCallback(async()=>{if(!i||!h)return x("Not authenticated"),!1;const p=i;j(!0),x(null);try{const n=await fetch(`${h}/v1/user-preferences/calendar`,{method:"DELETE",headers:{Authorization:`Bearer ${i}`}});if(!n.ok){const y=await n.json().catch(()=>({}));throw new Error(y.error||"Failed to clear preferences")}const l=await N(n);return v.current!==p?!1:(P(l),m(l.resolved,l.sources),!0)}catch(n){return v.current===p&&x(n instanceof Error?n.message:"Unknown error"),!1}finally{v.current===p&&j(!1)}},[i,h,m,N]);return{preferences:w,isLoading:g,isSaving:b,isClearing:f,error:T,updatePreferences:E,clearPreferences:A,refetch:k}}const F=[{value:"America/New_York",label:"Eastern Time (US & Canada)"},{value:"America/Chicago",label:"Central Time (US & Canada)"},{value:"America/Denver",label:"Mountain Time (US & Canada)"},{value:"America/Los_Angeles",label:"Pacific Time (US & Canada)"},{value:"America/Phoenix",label:"Arizona"},{value:"America/Anchorage",label:"Alaska"},{value:"Pacific/Honolulu",label:"Hawaii"},{value:"Europe/London",label:"London"},{value:"Europe/Paris",label:"Paris, Berlin, Rome"},{value:"Asia/Tokyo",label:"Tokyo"},{value:"Asia/Shanghai",label:"Beijing, Shanghai"},{value:"Asia/Kolkata",label:"Mumbai, New Delhi"},{value:"Australia/Sydney",label:"Sydney"},{value:"UTC",label:"UTC"}],B=[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:6,label:"Saturday"}],R="text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";function W(){try{const a=Intl;if(a.supportedValuesOf)return a.supportedValuesOf("timeZone")}catch{}return F.map(a=>a.value)}function H(a){if(!a)return"default";if(a.tz!==a.weekStart)return"inherited";switch(a.tz){case"viewer_tenant":return"tenant";case"viewer_organization":return"organization";case"system_default":return"system";case"session_initial":return"embedded";default:return"default"}}function U(a){const c=F.find(t=>t.value===a);return c?c.label:a}function K(a){const c=B.find(t=>t.value===a);return c?c.label:String(a)}function J({active:a,onClose:c}){const{preferences:t,isLoading:m,isSaving:r,isClearing:i,updatePreferences:h,clearPreferences:g}=G({enabled:a}),S=d.useCalendarContext(),b=(t==null?void 0:t.resolved.tz)||(S==null?void 0:S.tz)||"UTC",C=(t==null?void 0:t.resolved.weekStart)??(S==null?void 0:S.weekStart)??1,[f,j]=o.useState((t==null?void 0:t.stored)===null),[T,x]=o.useState(!1),[w,P]=o.useState(b),[v,N]=o.useState(C),[k,E]=o.useState(!1),A=o.useMemo(()=>W(),[]),p=o.useMemo(()=>A.filter(u=>!F.some(M=>M.value===u)),[A]),n=o.useMemo(()=>U(w),[w]),l=t!=null&&t.inherited?U(t.inherited.tz):"UTC",y=t!=null&&t.inherited?K(t.inherited.weekStart):"Monday",D=H(t==null?void 0:t.inheritedSources);o.useEffect(()=>{if(!a){x(!1);return}T||(t&&j(t.stored===null),P(b),N(C))},[a,T,t,b,C]);const O=async()=>{if(m){s.ue.error("Preferences are still loading. Please try again.");return}f?await g()?(s.ue.success("Now using default settings."),c()):s.ue.error("Failed to save preferences. Please try again."):await h({tz:w,weekStart:v})?(s.ue.success("Preferences saved."),c()):s.ue.error("Failed to save preferences. Please try again.")},_=()=>{c()},z=r||i,$=z||m;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-4 py-1",children:[e.jsxs(d.RadioGroup,{value:f?"defaults":"custom",onValueChange:u=>{x(!0),j(u==="defaults")},className:"space-y-0.5",children:[e.jsxs("label",{htmlFor:"mode-defaults",className:s.cn("flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",f&&"bg-muted/50"),onClick:()=>{x(!0),j(!0)},children:[e.jsx(d.RadioGroupItem,{value:"defaults",id:"mode-defaults",className:"mt-0.5"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-[13px] font-medium text-foreground",children:["Use ",D," defaults"]}),e.jsxs("p",{className:"text-[12px] text-muted-foreground",children:[l,", week starts ",y]})]})]}),e.jsxs("label",{htmlFor:"mode-custom",className:s.cn("flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",!f&&"bg-muted/50"),onClick:()=>{x(!0),j(!1)},children:[e.jsx(d.RadioGroupItem,{value:"custom",id:"mode-custom",className:"mt-0.5"}),e.jsx("p",{className:"flex-1 text-[13px] font-medium text-foreground",children:"Use custom settings"})]})]}),e.jsxs("div",{className:s.cn("space-y-4 border-t border-border/60 pt-4 transition-opacity",f&&"pointer-events-none opacity-50"),children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(s.Label,{className:R,children:"Timezone"}),e.jsxs(s.Popover,{open:k,onOpenChange:E,modal:!0,children:[e.jsx(s.PopoverTrigger,{asChild:!0,children:e.jsxs(s.Button,{variant:"outline",size:"xs",role:"combobox","aria-expanded":k,className:"w-full justify-between text-[12px] font-normal",disabled:f,children:[e.jsx("span",{className:"truncate",children:n}),e.jsx(d.ChevronsUpDown,{className:"ml-2 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),e.jsx(s.PopoverContent,{className:"z-50 w-[--radix-popover-trigger-width] p-0",align:"start",children:e.jsxs(d.Command,{className:"overflow-visible",children:[e.jsx(d.CommandInput,{placeholder:"Search timezones…"}),e.jsxs(d.CommandList,{children:[e.jsx(d.CommandEmpty,{children:"No timezone found."}),e.jsx(d.CommandGroup,{heading:"Common",children:F.map(u=>e.jsxs(d.CommandItem,{value:`${u.value} ${u.label}`,onSelect:()=>{x(!0),P(u.value),E(!1)},children:[e.jsx(s.Check,{className:s.cn("h-3.5 w-3.5",w===u.value?"opacity-100":"opacity-0")}),e.jsx("span",{className:"flex-1",children:u.label}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:u.value})]},u.value))}),e.jsx(d.CommandSeparator,{}),e.jsx(d.CommandGroup,{heading:"All timezones",children:p.map(u=>e.jsxs(d.CommandItem,{value:u,onSelect:()=>{x(!0),P(u),E(!1)},children:[e.jsx(s.Check,{className:s.cn("h-3.5 w-3.5",w===u?"opacity-100":"opacity-0")}),u]},u))})]})]})})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(s.Label,{className:R,children:"Week starts on"}),e.jsx(d.RadioGroup,{value:String(v),onValueChange:u=>{x(!0),N(Number(u))},className:"flex gap-4",disabled:f,children:B.map(u=>e.jsxs("label",{htmlFor:`week-start-${u.value}`,className:s.cn("flex cursor-pointer items-center gap-2 text-[13px]",f&&"cursor-not-allowed"),children:[e.jsx(d.RadioGroupItem,{value:String(u.value),id:`week-start-${u.value}`,disabled:f}),u.label]},u.value))})]})]})]}),e.jsxs(d.DialogFooter,{children:[e.jsx(s.Button,{variant:"outline",size:"xs",onClick:_,disabled:z,children:"Cancel"}),e.jsx(s.Button,{size:"xs",onClick:O,disabled:$,children:z?e.jsxs(e.Fragment,{children:[e.jsx(s.LoaderCircle,{className:"h-3.5 w-3.5 animate-spin"}),"Saving…"]}):"Save"})]})]})}function Y(a={}){const{authToken:c,tokenProps:t}=d.useSemaphorContext(),m=s.useDashboardStore(n=>n.actions.applyResolvedValueFormatPreferences),r=a.enabled??!0,i=(c==null?void 0:c.accessToken)??null,h=(t==null?void 0:t.apiServiceUrl)??null,g=o.useRef(i);g.current=i;const[S,b]=o.useState(null),[C,f]=o.useState(!1),[j,T]=o.useState(!1),[x,w]=o.useState(!1),[P,v]=o.useState(null);o.useEffect(()=>{b(null),v(null),f(!1),T(!1),w(!1)},[i]);const N=o.useCallback(async n=>{const l=L.parseValueFormatPreferencesResponse(await n.json());if(!l.ok)throw new Error("Value format preferences response is invalid");return l.value},[]),k=o.useCallback(async(n,l)=>{if(!i||!h)throw new Error("Not authenticated");const y=await fetch(`${h}/v1/user-preferences/value-format`,{method:n,headers:{Authorization:`Bearer ${i}`,...l?{"Content-Type":"application/json"}:{}},body:l?JSON.stringify(l):void 0});if(!y.ok){const D=await y.json().catch(()=>({}));throw new Error(D.error||"Failed to update preferences")}return N(y)},[i,h,N]),E=o.useCallback(async()=>{if(!r||!i||!h)return;const n=i;f(!0),v(null);try{const l=await k("GET");g.current===n&&b(l)}catch(l){g.current===n&&v(l instanceof Error?l.message:"Unknown error")}finally{g.current===n&&f(!1)}},[i,h,r,k]);o.useEffect(()=>{r&&E()},[r,E]);const A=o.useCallback(async n=>{const l=i;T(!0),v(null);try{const y=await k("PATCH",n);return g.current!==l?!1:(b(y),m(y.resolved,y.sources),!0)}catch(y){return g.current===l&&v(y instanceof Error?y.message:"Unknown error"),!1}finally{g.current===l&&T(!1)}},[i,m,k]),p=o.useCallback(async()=>{const n=i;w(!0),v(null);try{const l=await k("DELETE");return g.current!==n?!1:(b(l),m(l.resolved,l.sources),!0)}catch(l){return g.current===n&&v(l instanceof Error?l.message:"Unknown error"),!1}finally{g.current===n&&w(!1)}},[i,m,k]);return{preferences:S,isLoading:C,isSaving:j,isClearing:x,error:P,updatePreferences:A,clearPreferences:p,refetch:E}}const I=["locale","dateStyle","dateTime.dateStyle","dateTime.timeStyle","defaultCurrency"];function q(a,c){var t,m;switch(c){case"locale":return a==null?void 0:a.locale;case"dateStyle":return a==null?void 0:a.dateStyle;case"dateTime.dateStyle":return(t=a==null?void 0:a.dateTime)==null?void 0:t.dateStyle;case"dateTime.timeStyle":return(m=a==null?void 0:a.dateTime)==null?void 0:m.timeStyle;case"defaultCurrency":return a==null?void 0:a.defaultCurrency}}function Z(a){var m,r;const c=(m=a==null?void 0:a.dateTime)==null?void 0:m.dateStyle,t=(r=a==null?void 0:a.dateTime)==null?void 0:r.timeStyle;return{locale:a==null?void 0:a.locale,dateStyle:a==null?void 0:a.dateStyle,dateTime:c===void 0&&t===void 0?void 0:{dateStyle:c,timeStyle:t},defaultCurrency:a==null?void 0:a.defaultCurrency}}function Q({active:a,onClose:c}){var g,S,b,C,f,j,T;const{preferences:t,isLoading:m,isSaving:r,updatePreferences:i}=Y({enabled:a});if(!a)return null;if(!t)return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"py-2",children:e.jsx("div",{className:"flex min-h-36 items-center justify-center text-[12px] text-muted-foreground",children:m?"Loading preferences…":"Preferences unavailable."})}),e.jsxs(d.DialogFooter,{className:"justify-between sm:justify-between",children:[e.jsx(s.Button,{variant:"ghost",size:"xs",disabled:!0,children:"Reset display formats"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(s.Button,{variant:"outline",size:"xs",onClick:c,children:"Cancel"}),e.jsx(s.Button,{size:"xs",disabled:!0,children:"Save"})]})]})]});const h=[((g=t.stored)==null?void 0:g.locale)??"",((S=t.stored)==null?void 0:S.dateStyle)??"",((C=(b=t.stored)==null?void 0:b.dateTime)==null?void 0:C.dateStyle)??"",((j=(f=t.stored)==null?void 0:f.dateTime)==null?void 0:j.timeStyle)??"",((T=t.stored)==null?void 0:T.defaultCurrency)??""].join(":");return e.jsx(X,{preferences:t,isSaving:r,updatePreferences:i,onClose:c},h)}function X({preferences:a,isSaving:c,updatePreferences:t,onClose:m}){var b,C;const[r,i]=o.useState(()=>Z(a.stored)),h=(r.locale===void 0||L.canonicalizeSupportedLocale(r.locale)!==void 0)&&(r.defaultCurrency===void 0||L.canonicalizeSupportedCurrencyCode(r.defaultCurrency)!==void 0)&&(r.dateStyle===void 0||["short","medium","long"].includes(r.dateStyle))&&(((b=r.dateTime)==null?void 0:b.dateStyle)===void 0||["short","medium","long"].includes(r.dateTime.dateStyle))&&(((C=r.dateTime)==null?void 0:C.timeStyle)===void 0||["short","medium","long"].includes(r.dateTime.timeStyle)),g=async()=>{const f={...r.locale!==void 0?{locale:r.locale}:{},...r.dateStyle!==void 0?{dateStyle:r.dateStyle}:{},...r.dateTime?{dateTime:{...r.dateTime}}:{},...r.defaultCurrency!==void 0?{defaultCurrency:r.defaultCurrency}:{}},j=I.filter(w=>q(r,w)===void 0&&q(a.stored,w)!==void 0),T={...Object.keys(f).length>0?{set:f}:{},...j.length>0?{clear:j}:{}};(Object.keys(T).length===0?!0:await t(T))?(s.ue.success("Display format preferences saved."),m()):s.ue.error("Failed to save preferences. Please try again.")},S=async()=>{await t({clear:[...I]})?(s.ue.success("Display format preferences reset."),m()):s.ue.error("Failed to reset display format preferences. Please try again.")};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"py-2",children:e.jsx(d.DisplayFormatPreferencesFields,{value:r,inherited:a.inherited,inheritedSources:a.inheritedSources,onChange:i,disabled:c})}),e.jsxs(d.DialogFooter,{className:"justify-between sm:justify-between",children:[e.jsx(s.Button,{variant:"ghost",size:"xs",onClick:S,disabled:c||a.stored===null,children:"Reset display formats"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(s.Button,{variant:"outline",size:"xs",onClick:m,disabled:c,children:"Cancel"}),e.jsx(s.Button,{size:"xs",onClick:g,disabled:c||!h,children:c?e.jsxs(e.Fragment,{children:[e.jsx(s.LoaderCircle,{className:"h-3.5 w-3.5 animate-spin"}),"Saving…"]}):"Save"})]})]})]})}function ee({open:a,onOpenChange:c}){const[t,m]=o.useState("display"),r=()=>c(!1);return e.jsx(d.Dialog,{open:a,onOpenChange:c,children:e.jsxs(d.DialogContent,{className:"rounded-control border-border/60 sm:max-w-[440px] sm:rounded-control",children:[e.jsxs(d.DialogHeader,{children:[e.jsx(d.DialogTitle,{className:"text-[15px]",children:"Report preferences"}),e.jsx(d.DialogDescription,{className:"text-[13px] leading-5",children:"Set how values and Calendar periods appear for you."})]}),e.jsxs(s.Tabs,{value:t,onValueChange:m,children:[e.jsxs(s.TabsList,{variant:"underline",className:"w-full justify-start",children:[e.jsx(s.TabsTrigger,{value:"display",children:"Display formats"}),e.jsx(s.TabsTrigger,{value:"calendar",children:"Calendar"})]}),e.jsx(s.TabsContent,{value:"display",children:e.jsx(Q,{active:a&&t==="display",onClose:r})}),e.jsx(s.TabsContent,{value:"calendar",children:e.jsx(J,{active:a&&t==="calendar",onClose:r})})]})]})})}exports.ReportPreferencesDialog=ee;
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),o=require("react"),d=require("./index-CrxlydOT.cjs"),s=require("./switch--Re1K566.cjs"),V=require("./report-runtime-context-DzvHBPxl.cjs");require("./x-B6ghREd2.cjs");require("./card-config-utils-CMO4_zVs.cjs");require("./validators-DVYAnnX0.cjs");require("./matrix-operation-contract-DoiWTUbT.cjs");const L=require("../value-format-preferences/index.cjs");function G(a={}){const{authToken:c,tokenProps:t}=d.useSemaphorContext(),m=s.useDashboardStore(p=>p.actions.applyResolvedCalendarPreferences),r=a.enabled??!0,i=(c==null?void 0:c.accessToken)??null,h=(t==null?void 0:t.apiServiceUrl)??null,[g,S]=o.useState(!1),[b,C]=o.useState(!1),[f,j]=o.useState(!1),[T,x]=o.useState(null),[w,P]=o.useState(null),v=o.useRef(i);v.current=i,o.useEffect(()=>{P(null),x(null),S(!1),C(!1),j(!1)},[i]);const N=o.useCallback(async p=>{const n=V.parseCalendarPreferencesResponse(await p.json());if(!n.ok)throw new Error("Calendar preferences response is invalid");return n.value},[]),k=o.useCallback(async()=>{if(!r||!i||!h)return;const p=i;S(!0),x(null);try{const n=await fetch(`${h}/v1/user-preferences/calendar`,{method:"GET",headers:{Authorization:`Bearer ${i}`}});if(!n.ok){const y=await n.json().catch(()=>({}));throw new Error(y.error||"Failed to fetch preferences")}const l=await N(n);v.current===p&&P(l)}catch(n){v.current===p&&x(n instanceof Error?n.message:"Unknown error")}finally{v.current===p&&S(!1)}},[i,h,r,N]);o.useEffect(()=>{r&&k()},[r,k]);const E=o.useCallback(async p=>{if(!i||!h)return x("Not authenticated"),!1;const n=i;C(!0),x(null);try{const l=await fetch(`${h}/v1/user-preferences/calendar`,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`},body:JSON.stringify(p)});if(!l.ok){const D=await l.json().catch(()=>({}));throw new Error(D.error||"Failed to update preferences")}const y=await N(l);return v.current!==n?!1:(P(y),m(y.resolved,y.sources),!0)}catch(l){return v.current===n&&x(l instanceof Error?l.message:"Unknown error"),!1}finally{v.current===n&&C(!1)}},[i,h,m,N]),A=o.useCallback(async()=>{if(!i||!h)return x("Not authenticated"),!1;const p=i;j(!0),x(null);try{const n=await fetch(`${h}/v1/user-preferences/calendar`,{method:"DELETE",headers:{Authorization:`Bearer ${i}`}});if(!n.ok){const y=await n.json().catch(()=>({}));throw new Error(y.error||"Failed to clear preferences")}const l=await N(n);return v.current!==p?!1:(P(l),m(l.resolved,l.sources),!0)}catch(n){return v.current===p&&x(n instanceof Error?n.message:"Unknown error"),!1}finally{v.current===p&&j(!1)}},[i,h,m,N]);return{preferences:w,isLoading:g,isSaving:b,isClearing:f,error:T,updatePreferences:E,clearPreferences:A,refetch:k}}const F=[{value:"America/New_York",label:"Eastern Time (US & Canada)"},{value:"America/Chicago",label:"Central Time (US & Canada)"},{value:"America/Denver",label:"Mountain Time (US & Canada)"},{value:"America/Los_Angeles",label:"Pacific Time (US & Canada)"},{value:"America/Phoenix",label:"Arizona"},{value:"America/Anchorage",label:"Alaska"},{value:"Pacific/Honolulu",label:"Hawaii"},{value:"Europe/London",label:"London"},{value:"Europe/Paris",label:"Paris, Berlin, Rome"},{value:"Asia/Tokyo",label:"Tokyo"},{value:"Asia/Shanghai",label:"Beijing, Shanghai"},{value:"Asia/Kolkata",label:"Mumbai, New Delhi"},{value:"Australia/Sydney",label:"Sydney"},{value:"UTC",label:"UTC"}],B=[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:6,label:"Saturday"}],R="text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";function W(){try{const a=Intl;if(a.supportedValuesOf)return a.supportedValuesOf("timeZone")}catch{}return F.map(a=>a.value)}function H(a){if(!a)return"default";if(a.tz!==a.weekStart)return"inherited";switch(a.tz){case"viewer_tenant":return"tenant";case"viewer_organization":return"organization";case"system_default":return"system";case"session_initial":return"embedded";default:return"default"}}function U(a){const c=F.find(t=>t.value===a);return c?c.label:a}function K(a){const c=B.find(t=>t.value===a);return c?c.label:String(a)}function J({active:a,onClose:c}){const{preferences:t,isLoading:m,isSaving:r,isClearing:i,updatePreferences:h,clearPreferences:g}=G({enabled:a}),S=d.useCalendarContext(),b=(t==null?void 0:t.resolved.tz)||(S==null?void 0:S.tz)||"UTC",C=(t==null?void 0:t.resolved.weekStart)??(S==null?void 0:S.weekStart)??1,[f,j]=o.useState((t==null?void 0:t.stored)===null),[T,x]=o.useState(!1),[w,P]=o.useState(b),[v,N]=o.useState(C),[k,E]=o.useState(!1),A=o.useMemo(()=>W(),[]),p=o.useMemo(()=>A.filter(u=>!F.some(M=>M.value===u)),[A]),n=o.useMemo(()=>U(w),[w]),l=t!=null&&t.inherited?U(t.inherited.tz):"UTC",y=t!=null&&t.inherited?K(t.inherited.weekStart):"Monday",D=H(t==null?void 0:t.inheritedSources);o.useEffect(()=>{if(!a){x(!1);return}T||(t&&j(t.stored===null),P(b),N(C))},[a,T,t,b,C]);const O=async()=>{if(m){s.ue.error("Preferences are still loading. Please try again.");return}f?await g()?(s.ue.success("Now using default settings."),c()):s.ue.error("Failed to save preferences. Please try again."):await h({tz:w,weekStart:v})?(s.ue.success("Preferences saved."),c()):s.ue.error("Failed to save preferences. Please try again.")},_=()=>{c()},z=r||i,$=z||m;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-4 py-1",children:[e.jsxs(d.RadioGroup,{value:f?"defaults":"custom",onValueChange:u=>{x(!0),j(u==="defaults")},className:"space-y-0.5",children:[e.jsxs("label",{htmlFor:"mode-defaults",className:s.cn("flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",f&&"bg-muted/50"),onClick:()=>{x(!0),j(!0)},children:[e.jsx(d.RadioGroupItem,{value:"defaults",id:"mode-defaults",className:"mt-0.5"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-[13px] font-medium text-foreground",children:["Use ",D," defaults"]}),e.jsxs("p",{className:"text-[12px] text-muted-foreground",children:[l,", week starts ",y]})]})]}),e.jsxs("label",{htmlFor:"mode-custom",className:s.cn("flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",!f&&"bg-muted/50"),onClick:()=>{x(!0),j(!1)},children:[e.jsx(d.RadioGroupItem,{value:"custom",id:"mode-custom",className:"mt-0.5"}),e.jsx("p",{className:"flex-1 text-[13px] font-medium text-foreground",children:"Use custom settings"})]})]}),e.jsxs("div",{className:s.cn("space-y-4 border-t border-border/60 pt-4 transition-opacity",f&&"pointer-events-none opacity-50"),children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(s.Label,{className:R,children:"Timezone"}),e.jsxs(s.Popover,{open:k,onOpenChange:E,modal:!0,children:[e.jsx(s.PopoverTrigger,{asChild:!0,children:e.jsxs(s.Button,{variant:"outline",size:"xs",role:"combobox","aria-expanded":k,className:"w-full justify-between text-[12px] font-normal",disabled:f,children:[e.jsx("span",{className:"truncate",children:n}),e.jsx(d.ChevronsUpDown,{className:"ml-2 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),e.jsx(s.PopoverContent,{className:"z-50 w-[--radix-popover-trigger-width] p-0",align:"start",children:e.jsxs(d.Command,{className:"overflow-visible",children:[e.jsx(d.CommandInput,{placeholder:"Search timezones…"}),e.jsxs(d.CommandList,{children:[e.jsx(d.CommandEmpty,{children:"No timezone found."}),e.jsx(d.CommandGroup,{heading:"Common",children:F.map(u=>e.jsxs(d.CommandItem,{value:`${u.value} ${u.label}`,onSelect:()=>{x(!0),P(u.value),E(!1)},children:[e.jsx(s.Check,{className:s.cn("h-3.5 w-3.5",w===u.value?"opacity-100":"opacity-0")}),e.jsx("span",{className:"flex-1",children:u.label}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:u.value})]},u.value))}),e.jsx(d.CommandSeparator,{}),e.jsx(d.CommandGroup,{heading:"All timezones",children:p.map(u=>e.jsxs(d.CommandItem,{value:u,onSelect:()=>{x(!0),P(u),E(!1)},children:[e.jsx(s.Check,{className:s.cn("h-3.5 w-3.5",w===u?"opacity-100":"opacity-0")}),u]},u))})]})]})})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(s.Label,{className:R,children:"Week starts on"}),e.jsx(d.RadioGroup,{value:String(v),onValueChange:u=>{x(!0),N(Number(u))},className:"flex gap-4",disabled:f,children:B.map(u=>e.jsxs("label",{htmlFor:`week-start-${u.value}`,className:s.cn("flex cursor-pointer items-center gap-2 text-[13px]",f&&"cursor-not-allowed"),children:[e.jsx(d.RadioGroupItem,{value:String(u.value),id:`week-start-${u.value}`,disabled:f}),u.label]},u.value))})]})]})]}),e.jsxs(d.DialogFooter,{children:[e.jsx(s.Button,{variant:"outline",size:"xs",onClick:_,disabled:z,children:"Cancel"}),e.jsx(s.Button,{size:"xs",onClick:O,disabled:$,children:z?e.jsxs(e.Fragment,{children:[e.jsx(s.LoaderCircle,{className:"h-3.5 w-3.5 animate-spin"}),"Saving…"]}):"Save"})]})]})}function Y(a={}){const{authToken:c,tokenProps:t}=d.useSemaphorContext(),m=s.useDashboardStore(n=>n.actions.applyResolvedValueFormatPreferences),r=a.enabled??!0,i=(c==null?void 0:c.accessToken)??null,h=(t==null?void 0:t.apiServiceUrl)??null,g=o.useRef(i);g.current=i;const[S,b]=o.useState(null),[C,f]=o.useState(!1),[j,T]=o.useState(!1),[x,w]=o.useState(!1),[P,v]=o.useState(null);o.useEffect(()=>{b(null),v(null),f(!1),T(!1),w(!1)},[i]);const N=o.useCallback(async n=>{const l=L.parseValueFormatPreferencesResponse(await n.json());if(!l.ok)throw new Error("Value format preferences response is invalid");return l.value},[]),k=o.useCallback(async(n,l)=>{if(!i||!h)throw new Error("Not authenticated");const y=await fetch(`${h}/v1/user-preferences/value-format`,{method:n,headers:{Authorization:`Bearer ${i}`,...l?{"Content-Type":"application/json"}:{}},body:l?JSON.stringify(l):void 0});if(!y.ok){const D=await y.json().catch(()=>({}));throw new Error(D.error||"Failed to update preferences")}return N(y)},[i,h,N]),E=o.useCallback(async()=>{if(!r||!i||!h)return;const n=i;f(!0),v(null);try{const l=await k("GET");g.current===n&&b(l)}catch(l){g.current===n&&v(l instanceof Error?l.message:"Unknown error")}finally{g.current===n&&f(!1)}},[i,h,r,k]);o.useEffect(()=>{r&&E()},[r,E]);const A=o.useCallback(async n=>{const l=i;T(!0),v(null);try{const y=await k("PATCH",n);return g.current!==l?!1:(b(y),m(y.resolved,y.sources),!0)}catch(y){return g.current===l&&v(y instanceof Error?y.message:"Unknown error"),!1}finally{g.current===l&&T(!1)}},[i,m,k]),p=o.useCallback(async()=>{const n=i;w(!0),v(null);try{const l=await k("DELETE");return g.current!==n?!1:(b(l),m(l.resolved,l.sources),!0)}catch(l){return g.current===n&&v(l instanceof Error?l.message:"Unknown error"),!1}finally{g.current===n&&w(!1)}},[i,m,k]);return{preferences:S,isLoading:C,isSaving:j,isClearing:x,error:P,updatePreferences:A,clearPreferences:p,refetch:E}}const I=["locale","dateStyle","dateTime.dateStyle","dateTime.timeStyle","defaultCurrency"];function q(a,c){var t,m;switch(c){case"locale":return a==null?void 0:a.locale;case"dateStyle":return a==null?void 0:a.dateStyle;case"dateTime.dateStyle":return(t=a==null?void 0:a.dateTime)==null?void 0:t.dateStyle;case"dateTime.timeStyle":return(m=a==null?void 0:a.dateTime)==null?void 0:m.timeStyle;case"defaultCurrency":return a==null?void 0:a.defaultCurrency}}function Z(a){var m,r;const c=(m=a==null?void 0:a.dateTime)==null?void 0:m.dateStyle,t=(r=a==null?void 0:a.dateTime)==null?void 0:r.timeStyle;return{locale:a==null?void 0:a.locale,dateStyle:a==null?void 0:a.dateStyle,dateTime:c===void 0&&t===void 0?void 0:{dateStyle:c,timeStyle:t},defaultCurrency:a==null?void 0:a.defaultCurrency}}function Q({active:a,onClose:c}){var g,S,b,C,f,j,T;const{preferences:t,isLoading:m,isSaving:r,updatePreferences:i}=Y({enabled:a});if(!a)return null;if(!t)return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"py-2",children:e.jsx("div",{className:"flex min-h-36 items-center justify-center text-[12px] text-muted-foreground",children:m?"Loading preferences…":"Preferences unavailable."})}),e.jsxs(d.DialogFooter,{className:"justify-between sm:justify-between",children:[e.jsx(s.Button,{variant:"ghost",size:"xs",disabled:!0,children:"Reset display formats"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(s.Button,{variant:"outline",size:"xs",onClick:c,children:"Cancel"}),e.jsx(s.Button,{size:"xs",disabled:!0,children:"Save"})]})]})]});const h=[((g=t.stored)==null?void 0:g.locale)??"",((S=t.stored)==null?void 0:S.dateStyle)??"",((C=(b=t.stored)==null?void 0:b.dateTime)==null?void 0:C.dateStyle)??"",((j=(f=t.stored)==null?void 0:f.dateTime)==null?void 0:j.timeStyle)??"",((T=t.stored)==null?void 0:T.defaultCurrency)??""].join(":");return e.jsx(X,{preferences:t,isSaving:r,updatePreferences:i,onClose:c},h)}function X({preferences:a,isSaving:c,updatePreferences:t,onClose:m}){var b,C;const[r,i]=o.useState(()=>Z(a.stored)),h=(r.locale===void 0||L.canonicalizeSupportedLocale(r.locale)!==void 0)&&(r.defaultCurrency===void 0||L.canonicalizeSupportedCurrencyCode(r.defaultCurrency)!==void 0)&&(r.dateStyle===void 0||["short","medium","long"].includes(r.dateStyle))&&(((b=r.dateTime)==null?void 0:b.dateStyle)===void 0||["short","medium","long"].includes(r.dateTime.dateStyle))&&(((C=r.dateTime)==null?void 0:C.timeStyle)===void 0||["short","medium","long"].includes(r.dateTime.timeStyle)),g=async()=>{const f={...r.locale!==void 0?{locale:r.locale}:{},...r.dateStyle!==void 0?{dateStyle:r.dateStyle}:{},...r.dateTime?{dateTime:{...r.dateTime}}:{},...r.defaultCurrency!==void 0?{defaultCurrency:r.defaultCurrency}:{}},j=I.filter(w=>q(r,w)===void 0&&q(a.stored,w)!==void 0),T={...Object.keys(f).length>0?{set:f}:{},...j.length>0?{clear:j}:{}};(Object.keys(T).length===0?!0:await t(T))?(s.ue.success("Display format preferences saved."),m()):s.ue.error("Failed to save preferences. Please try again.")},S=async()=>{await t({clear:[...I]})?(s.ue.success("Display format preferences reset."),m()):s.ue.error("Failed to reset display format preferences. Please try again.")};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"py-2",children:e.jsx(d.DisplayFormatPreferencesFields,{value:r,inherited:a.inherited,inheritedSources:a.inheritedSources,onChange:i,disabled:c})}),e.jsxs(d.DialogFooter,{className:"justify-between sm:justify-between",children:[e.jsx(s.Button,{variant:"ghost",size:"xs",onClick:S,disabled:c||a.stored===null,children:"Reset display formats"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(s.Button,{variant:"outline",size:"xs",onClick:m,disabled:c,children:"Cancel"}),e.jsx(s.Button,{size:"xs",onClick:g,disabled:c||!h,children:c?e.jsxs(e.Fragment,{children:[e.jsx(s.LoaderCircle,{className:"h-3.5 w-3.5 animate-spin"}),"Saving…"]}):"Save"})]})]})]})}function ee({open:a,onOpenChange:c}){const[t,m]=o.useState("display"),r=()=>c(!1);return e.jsx(d.Dialog,{open:a,onOpenChange:c,children:e.jsxs(d.DialogContent,{className:"rounded-control border-border/60 sm:max-w-[440px] sm:rounded-control",children:[e.jsxs(d.DialogHeader,{children:[e.jsx(d.DialogTitle,{className:"text-[15px]",children:"Report preferences"}),e.jsx(d.DialogDescription,{className:"text-[13px] leading-5",children:"Set how values and Calendar periods appear for you."})]}),e.jsxs(s.Tabs,{value:t,onValueChange:m,children:[e.jsxs(s.TabsList,{variant:"underline",className:"w-full justify-start",children:[e.jsx(s.TabsTrigger,{value:"display",children:"Display formats"}),e.jsx(s.TabsTrigger,{value:"calendar",children:"Calendar"})]}),e.jsx(s.TabsContent,{value:"display",children:e.jsx(Q,{active:a&&t==="display",onClose:r})}),e.jsx(s.TabsContent,{value:"calendar",children:e.jsx(J,{active:a&&t==="calendar",onClose:r})})]})]})})}exports.ReportPreferencesDialog=ee;
|
package/dist/chunks/{report-runtime-context-DWvUf1HT.js → report-runtime-context-Cs65Mrxj.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseValueFormatPreferences as _, isReportPreferenceSource as C } from "../value-format-preferences/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import { i as k, z as g } from "./validators-CkHsAvwB.js";
|
|
3
3
|
const M = {
|
|
4
4
|
tz: "UTC",
|
|
5
5
|
weekStart: 1,
|
|
@@ -120,7 +120,7 @@ function $(e) {
|
|
|
120
120
|
}
|
|
121
121
|
};
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function O(e) {
|
|
124
124
|
if (!o(e))
|
|
125
125
|
return {
|
|
126
126
|
ok: !1,
|
|
@@ -222,7 +222,7 @@ function D(e) {
|
|
|
222
222
|
}
|
|
223
223
|
};
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function j(e) {
|
|
226
226
|
if (!o(e))
|
|
227
227
|
return {
|
|
228
228
|
ok: !1,
|
|
@@ -364,7 +364,7 @@ function K(e) {
|
|
|
364
364
|
}
|
|
365
365
|
]
|
|
366
366
|
};
|
|
367
|
-
const a = n(e, E, "$"), r =
|
|
367
|
+
const a = n(e, E, "$"), r = O(e.calendar), t = P(e.valueFormat), s = j(e.preferenceSources);
|
|
368
368
|
return r.ok || a.push(
|
|
369
369
|
...r.issues.map((c) => ({
|
|
370
370
|
...c,
|
|
@@ -383,5 +383,5 @@ export {
|
|
|
383
383
|
M as D,
|
|
384
384
|
D as a,
|
|
385
385
|
K as b,
|
|
386
|
-
|
|
386
|
+
O as p
|
|
387
387
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { d as se, e as K } from "./constants-DeLIHVAW.js";
|
|
2
2
|
import { t as ee, a as te } from "./index-CACdoqu3.js";
|
|
3
|
-
import { ay as oe } from "./validators-
|
|
4
|
-
import "./matrix-operation-contract-
|
|
3
|
+
import { ay as oe } from "./validators-CkHsAvwB.js";
|
|
4
|
+
import "./matrix-operation-contract-D0HfzwZg.js";
|
|
5
5
|
function ne(e) {
|
|
6
6
|
if (!e || typeof e != "object") return !1;
|
|
7
7
|
const t = e.type;
|