react-semaphor 0.1.603 → 0.1.604
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/activity/index.js +1 -73
- package/dist/analytics-protocol/index.js +1 -1491
- package/dist/appearance/index.js +1 -12
- package/dist/appearance-runtime/index.js +1 -5
- package/dist/assistant-context/index.js +1 -11
- package/dist/assistant-protocol/index.js +1 -152
- package/dist/brand-studio/index.js +4 -1594
- package/dist/briefings/index.js +1 -70
- package/dist/chunks/add-to-dashboard-DeHEBEqG.js +12 -0
- package/dist/chunks/analytics-base-schemas-BREc5WGv.js +1 -0
- package/dist/chunks/appearance-context-BqBZrijL.js +1 -0
- package/dist/chunks/appearance-runtime-provider-DmbCrOOG.js +1 -0
- package/dist/chunks/applied-constraints-CinevlKD.js +1 -0
- package/dist/chunks/assistant-chat-CjYrwVDa.js +56 -0
- package/dist/chunks/attribution-BEFSsbNn.js +1 -0
- package/dist/chunks/availability-3AIOf6Z-.js +1 -0
- package/dist/chunks/bookmark-impact-C89zBLq3.js +1 -0
- package/dist/chunks/bookmark-state-69YYnRql.js +1 -0
- package/dist/chunks/brand-DCaZyRt6.js +1 -0
- package/dist/chunks/card-filter-builder-CTp6RAz1.js +17 -0
- package/dist/chunks/column-bands-DwxbZ6UI.js +1 -0
- package/dist/chunks/comparison-window-caption-C312mn3s.js +1 -0
- package/dist/chunks/context-ALdccLHw.js +2 -0
- package/dist/chunks/conversation-JMK2kyTK.js +1 -0
- package/dist/chunks/dashboard-BX28ld6s.js +1 -0
- package/dist/chunks/dashboard-briefing-launcher-qo7GH4EO.js +37 -0
- package/dist/chunks/dashboard-controls-DhRjB7MA.js +42 -0
- package/dist/chunks/dashboard-json-9cHzhSjC.js +1 -0
- package/dist/chunks/dates-D-KP8G-z.js +1 -0
- package/dist/chunks/edit-DEAK0UZo.js +1 -0
- package/dist/chunks/edit-dashboard-visual-Duq_QkB_.js +93 -0
- package/dist/chunks/export-file-format-B-wQNHIn.js +4 -0
- package/dist/chunks/filter-line-CwQrqORc.js +1 -0
- package/dist/chunks/filter-reach-preview-gixPFlZj.js +1 -0
- package/dist/chunks/filter-value-text-B3tXakhd.js +1 -0
- package/dist/chunks/index-B-VF1ogs.js +1 -0
- package/dist/chunks/index-BE1DfxNs.js +1 -0
- package/dist/chunks/index-DViPGDFj.js +1 -0
- package/dist/chunks/layout-grid-BWtlgw0T.js +6 -0
- package/dist/chunks/matrix-analytical-definition-CtFqWyCK.js +1 -0
- package/dist/chunks/matrix-member-presentation-Q0MCJ-YK.js +1 -0
- package/dist/chunks/matrix-operation-contract-D1RC1bfi.js +1 -0
- package/dist/chunks/metric-comparison-DEZYXROZ.js +1 -0
- package/dist/chunks/normalize-dashboard-for-dirty-check-ILKfqgL3.js +1 -0
- package/dist/chunks/paintbrush-BjS3SbrH.js +6 -0
- package/dist/chunks/palette-BzC-CGOc.js +6 -0
- package/dist/chunks/pickers-DuBrUht0.js +1 -0
- package/dist/chunks/pivot-result-contract-expectations-DTQAgr4n.js +1 -0
- package/dist/chunks/pivot-result-identity-DTNCB--h.js +1 -0
- package/dist/chunks/raw-temporal-value-DeyEhL0S.js +1 -0
- package/dist/chunks/rendered-file-BbvwaU6z.js +1 -0
- package/dist/chunks/report-preferences-dialog-B_gUmCzG.js +1 -0
- package/dist/chunks/report-runtime-context-BWzIHCKK.js +1 -0
- package/dist/chunks/resolve-dashboard-input-context-B-TtRqxu.js +8 -0
- package/dist/chunks/resolver-AN9ChBfZ.js +1 -0
- package/dist/chunks/save-DdFUZcbi.js +6 -0
- package/dist/chunks/saved-dashboard-context-BAJ5tWiq.js +1 -0
- package/dist/chunks/schema-MC0cQSAb.js +4 -0
- package/dist/chunks/selection-filter-compiler-CCoCD25M.js +1 -0
- package/dist/chunks/semaphor-ready-indicator-DzjorP3t.js +999 -0
- package/dist/chunks/set-DuJfGkbY.js +1 -0
- package/dist/chunks/shelf-drop-preview-context-BlLJ5RsT.js +6 -0
- package/dist/chunks/stored-dashboard-Ctcpkllg.js +1 -0
- package/dist/chunks/style-sheet-parts-BRGt9O05.js +178 -0
- package/dist/chunks/table-export-sheet-rC5pKmXg.js +2 -0
- package/dist/chunks/token-types-Bj9iMy0w.js +1 -0
- package/dist/chunks/validators-CqV3Yka1.js +1 -0
- package/dist/chunks/variable-draft-DJrfUyhv.js +1 -0
- package/dist/chunks/visual-choice-DgEFfkE-.js +1 -0
- package/dist/dashboard/index.js +1 -7
- package/dist/dashboard-authoring/index.js +1 -4614
- package/dist/format-utils/index.js +1 -425
- package/dist/index.js +1 -554
- package/dist/layouts/index.js +1 -7
- package/dist/live-channel/index.js +1 -124
- package/dist/pdf-export-policy/index.js +1 -92
- package/dist/pdf-table-layout/index.js +1 -993
- package/dist/report-runtime-context/index.js +1 -9
- package/dist/shared/index.js +1 -6
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +1 -9
- package/dist/types/index.js +1 -88
- package/dist/types/lib/filter-values/build-card-filter-definition.d.ts +32 -0
- package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +9 -0
- package/dist/types/lib/stores/explorer-actions.d.ts +7 -6
- package/dist/types/lib/types/semantic-types.d.ts +6 -10
- package/dist/types/lib/utils/field-state-calculator.d.ts +7 -19
- package/dist/types/shared/dashboard-authoring/calculations/definition.d.ts +13 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-base.d.ts +125 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-field-folders.d.ts +55 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-joins.d.ts +114 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-prune.d.ts +12 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-catalog.d.ts +60 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-folders.d.ts +132 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/index.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/join-reach.d.ts +42 -0
- package/dist/types/shared/dashboard-authoring/card-field-places.d.ts +28 -0
- package/dist/types/shared/dashboard-authoring/field-folders/field-folders.d.ts +115 -0
- package/dist/types/shared/dashboard-authoring/field-folders/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/filter-reach-decision.d.ts +11 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +6 -1
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/see-records/result.d.ts +7 -22
- package/dist/usage-events/index.js +1 -285
- package/dist/value-format-preferences/index.js +1 -635
- package/package.json +4 -1
- package/dist/chunks/add-to-dashboard-CFF-wFU-.js +0 -291
- package/dist/chunks/analytics-base-schemas-DsUh5Q3C.js +0 -680
- package/dist/chunks/appearance-context-BwBp25ZG.js +0 -162
- package/dist/chunks/appearance-runtime-provider-BRHYELkC.js +0 -80
- package/dist/chunks/applied-constraints-DU-wndZ7.js +0 -47
- package/dist/chunks/assistant-chat-B6hNQI1t.js +0 -6115
- package/dist/chunks/attribution-BvoKvhcj.js +0 -32
- package/dist/chunks/availability-Bp5Gfu1I.js +0 -44
- package/dist/chunks/bookmark-impact-Ba2PLcGp.js +0 -76
- package/dist/chunks/bookmark-state-n7AaNzR_.js +0 -1667
- package/dist/chunks/brand-BoUV0iHF.js +0 -54
- package/dist/chunks/card-filter-builder-Y22HizVx.js +0 -4069
- package/dist/chunks/column-bands-RdM-kjDe.js +0 -47
- package/dist/chunks/comparison-window-caption-Ck2TIbnR.js +0 -741
- package/dist/chunks/context-UCQ7sere.js +0 -369
- package/dist/chunks/conversation-sQiWYUOb.js +0 -16
- package/dist/chunks/dashboard-BghI99oY.js +0 -14
- package/dist/chunks/dashboard-briefing-launcher-DtBAnGiH.js +0 -4875
- package/dist/chunks/dashboard-controls-CtFXlyjV.js +0 -2290
- package/dist/chunks/dashboard-json-DfGBUtCd.js +0 -66
- package/dist/chunks/dates-BnrXF4bb.js +0 -185
- package/dist/chunks/edit-9df1zOWe.js +0 -226
- package/dist/chunks/edit-dashboard-visual-oxt3x1wb.js +0 -18397
- package/dist/chunks/export-file-format-C-tJsxsf.js +0 -111
- package/dist/chunks/filter-line-Cy5YYqRL.js +0 -703
- package/dist/chunks/filter-reach-copy-CE_ZX147.js +0 -5111
- package/dist/chunks/filter-value-text-fWvSDwkl.js +0 -153
- package/dist/chunks/index-BVKzKl5d.js +0 -90
- package/dist/chunks/index-CV_Kzou0.js +0 -595
- package/dist/chunks/index-D5rxbtS4.js +0 -2795
- package/dist/chunks/layout-grid-9LndRoLa.js +0 -16
- package/dist/chunks/matrix-analytical-definition-CCp48UCw.js +0 -1233
- package/dist/chunks/matrix-member-presentation-zNehruXR.js +0 -391
- package/dist/chunks/matrix-operation-contract-DPBj69D8.js +0 -1413
- package/dist/chunks/metric-comparison-B0FR-Q8I.js +0 -600
- package/dist/chunks/normalize-dashboard-for-dirty-check-XKgH3GFX.js +0 -119
- package/dist/chunks/paintbrush-58FQYY-y.js +0 -27
- package/dist/chunks/palette-Be62Tkoa.js +0 -23
- package/dist/chunks/pickers-DkqmtnTL.js +0 -2403
- package/dist/chunks/pivot-result-contract-expectations-BYqAmG9n.js +0 -5092
- package/dist/chunks/pivot-result-identity-CAP4--iq.js +0 -77
- package/dist/chunks/raw-temporal-value-Dg_MTFF7.js +0 -3778
- package/dist/chunks/rendered-file-D8xEuVVx.js +0 -108
- package/dist/chunks/report-preferences-dialog-uJp9GBTM.js +0 -1651
- package/dist/chunks/report-runtime-context-c77_KF9v.js +0 -388
- package/dist/chunks/resolve-dashboard-input-context-Rtl1ffmE.js +0 -25324
- package/dist/chunks/resolver-DG_tfEpt.js +0 -156
- package/dist/chunks/save-C5A0JnEV.js +0 -21
- package/dist/chunks/saved-dashboard-context-tcyTU8jm.js +0 -618
- package/dist/chunks/schema-C9NPiIru.js +0 -2568
- package/dist/chunks/selection-filter-compiler-DNijjI5y.js +0 -150
- package/dist/chunks/semaphor-ready-indicator-FBvunj6S.js +0 -145603
- package/dist/chunks/shelf-drop-preview-context-QKStrcK9.js +0 -2466
- package/dist/chunks/stored-dashboard-CHozcAY9.js +0 -4075
- package/dist/chunks/style-sheet-parts-CDCG-8Ej.js +0 -8681
- package/dist/chunks/table-export-sheet-ZFIvs6Sj.js +0 -949
- package/dist/chunks/token-types-XbM6QByy.js +0 -8
- package/dist/chunks/upload-H15d7uHK.js +0 -15
- package/dist/chunks/validators-Baf3VIf5.js +0 -3686
- package/dist/chunks/variable-draft-C2y8Jp6Z.js +0 -242
- package/dist/chunks/visual-choice-DDfHfHvY.js +0 -172
package/dist/briefings/index.js
CHANGED
|
@@ -1,70 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "../chunks/validators-Baf3VIf5.js";
|
|
3
|
-
import "../chunks/export-file-format-C-tJsxsf.js";
|
|
4
|
-
import "zod";
|
|
5
|
-
import "../chunks/matrix-operation-contract-DPBj69D8.js";
|
|
6
|
-
import "../chunks/analytics-base-schemas-DsUh5Q3C.js";
|
|
7
|
-
import "../value-format-preferences/index.js";
|
|
8
|
-
import { E as g, L as l, a5 as B, H as m, a7 as c, C as E, B as d, G as I, N as T, F as C, D as A, M as h, $ as u, j as p, a0 as D, a1 as F, a8 as S, o as _, m as b, n as R, R as N, l as y, T as M, f as O, e as v, U as G, w as x, s as L, c as U, a2 as V, i as H, d as J, K as z, J as P, h as q, b as X, a as K, a9 as Q, g as Y, a3 as j, X as k, a6 as w, Y as W, I as Z, a4 as $, t as ee, k as ae, Z as ie, _ as re, q as te, O as se, S as ne, Q as oe, p as fe, r as ge, u as le, v as Be, P as me, V as ce, W as Ee } from "../chunks/index-D5rxbtS4.js";
|
|
9
|
-
export {
|
|
10
|
-
g as BRIEFING_ARTIFACT_FORMATS,
|
|
11
|
-
l as BRIEFING_ATTACHMENT_FORMATS,
|
|
12
|
-
B as BRIEFING_ATTACHMENT_OMISSION_CODES,
|
|
13
|
-
m as BRIEFING_CONTENT_LIMITS,
|
|
14
|
-
c as BRIEFING_DELIVERY_OUTCOME_STATUSES,
|
|
15
|
-
E as BRIEFING_KIND,
|
|
16
|
-
d as BRIEFING_RUN_CANCELLED_ERROR,
|
|
17
|
-
I as BRIEFING_TEXT_LIMITS,
|
|
18
|
-
T as BriefingContractError,
|
|
19
|
-
C as DEFAULT_BRIEFING_ARTIFACT_FORMATS,
|
|
20
|
-
A as DEFAULT_BRIEFING_SCHEDULE,
|
|
21
|
-
h as MAX_BRIEFING_ATTACHMENTS,
|
|
22
|
-
u as briefingAttachmentFileTraits,
|
|
23
|
-
p as briefingAttachmentFormatLabel,
|
|
24
|
-
D as briefingAttachmentNeedsExportJob,
|
|
25
|
-
F as briefingAttachmentProduction,
|
|
26
|
-
S as briefingDeliveryChannelOutcome,
|
|
27
|
-
_ as briefingScheduleDayOccurs,
|
|
28
|
-
b as briefingScheduleMonths,
|
|
29
|
-
R as briefingScheduleShortMonths,
|
|
30
|
-
N as buildBriefingJobConfig,
|
|
31
|
-
y as buildBriefingScheduleExpr,
|
|
32
|
-
M as buildCreateBriefingRequest,
|
|
33
|
-
O as buildDashboardTemporalSnapshotEntries,
|
|
34
|
-
v as buildMatrixDeliveryEnvelope,
|
|
35
|
-
G as buildUpdateBriefingRequest,
|
|
36
|
-
x as canCreateBriefingForUser,
|
|
37
|
-
L as canonicalBriefingMonthDays,
|
|
38
|
-
U as captureMatrixExport,
|
|
39
|
-
V as completeBriefingCardAttachment,
|
|
40
|
-
H as completeBriefingCardAttachmentSettings,
|
|
41
|
-
J as describeBriefingSchedule,
|
|
42
|
-
z as formatBriefingComparisonValues,
|
|
43
|
-
P as formatBriefingDisplayValue,
|
|
44
|
-
q as getBriefingCardAttachmentCapability,
|
|
45
|
-
X as getBriefingCardAttachmentFormats,
|
|
46
|
-
K as getBriefingCreationIntents,
|
|
47
|
-
Q as getBriefingDisplayTypeLabel,
|
|
48
|
-
Y as getBriefingPresentation,
|
|
49
|
-
j as getDefaultBriefingCardAttachmentFormat,
|
|
50
|
-
k as isBriefingArtifactFormat,
|
|
51
|
-
w as isBriefingAttachmentOmissionCode,
|
|
52
|
-
W as isBriefingDeliveryChannel,
|
|
53
|
-
Z as isBriefingNumericValue,
|
|
54
|
-
$ as isBriefingTableExportCardType,
|
|
55
|
-
ee as isEmailOnlyBriefingDelivery,
|
|
56
|
-
ae as isValidBriefingTimezone,
|
|
57
|
-
ie as matrixDeliveryPayloadSchema,
|
|
58
|
-
re as matrixDeliveryQuerySchema,
|
|
59
|
-
te as nextBriefingScheduleDates,
|
|
60
|
-
se as normalizeBriefingContentDocument,
|
|
61
|
-
ne as normalizeBriefingDraft,
|
|
62
|
-
oe as normalizeBriefingJobConfig,
|
|
63
|
-
fe as parseBriefingScheduleExpr,
|
|
64
|
-
ge as readBriefingCardFacts,
|
|
65
|
-
le as readBriefingDeliveryOutcome,
|
|
66
|
-
Be as readBriefingOmittedAttachments,
|
|
67
|
-
me as validateBriefingContentDocument,
|
|
68
|
-
ce as validateBriefingDraft,
|
|
69
|
-
Ee as validateBriefingJobConfig
|
|
70
|
-
};
|
|
1
|
+
import"../chunks/pivot-result-contract-expectations-DTQAgr4n.js";import"../chunks/validators-CqV3Yka1.js";import"../chunks/export-file-format-B-wQNHIn.js";import"zod";import"../chunks/matrix-operation-contract-D1RC1bfi.js";import"../chunks/analytics-base-schemas-BREc5WGv.js";import"../value-format-preferences/index.js";import{E as g,L as l,a5 as B,H as m,a7 as c,C as E,B as d,G as I,N as T,F as C,D as A,M as h,$ as u,k as p,a0 as D,a1 as F,a8 as S,q as _,n as b,o as R,R as N,m as y,T as M,h as O,f as v,U as x,x as G,t as L,e as U,a2 as V,j as H,d as J,K as z,J as P,i as q,c as X,b as K,a9 as Q,a as Y,a3 as j,X as k,a6 as w,Y as W,I as Z,a4 as $,u as ee,l as ae,Z as ie,_ as re,s as te,O as se,S as ne,Q as oe,p as fe,r as ge,v as le,w as Be,P as me,V as ce,W as Ee}from"../chunks/index-B-VF1ogs.js";export{g as BRIEFING_ARTIFACT_FORMATS,l as BRIEFING_ATTACHMENT_FORMATS,B as BRIEFING_ATTACHMENT_OMISSION_CODES,m as BRIEFING_CONTENT_LIMITS,c as BRIEFING_DELIVERY_OUTCOME_STATUSES,E as BRIEFING_KIND,d as BRIEFING_RUN_CANCELLED_ERROR,I as BRIEFING_TEXT_LIMITS,T as BriefingContractError,C as DEFAULT_BRIEFING_ARTIFACT_FORMATS,A as DEFAULT_BRIEFING_SCHEDULE,h as MAX_BRIEFING_ATTACHMENTS,u as briefingAttachmentFileTraits,p as briefingAttachmentFormatLabel,D as briefingAttachmentNeedsExportJob,F as briefingAttachmentProduction,S as briefingDeliveryChannelOutcome,_ as briefingScheduleDayOccurs,b as briefingScheduleMonths,R as briefingScheduleShortMonths,N as buildBriefingJobConfig,y as buildBriefingScheduleExpr,M as buildCreateBriefingRequest,O as buildDashboardTemporalSnapshotEntries,v as buildMatrixDeliveryEnvelope,x as buildUpdateBriefingRequest,G as canCreateBriefingForUser,L as canonicalBriefingMonthDays,U as captureMatrixExport,V as completeBriefingCardAttachment,H as completeBriefingCardAttachmentSettings,J as describeBriefingSchedule,z as formatBriefingComparisonValues,P as formatBriefingDisplayValue,q as getBriefingCardAttachmentCapability,X as getBriefingCardAttachmentFormats,K as getBriefingCreationIntents,Q as getBriefingDisplayTypeLabel,Y as getBriefingPresentation,j as getDefaultBriefingCardAttachmentFormat,k as isBriefingArtifactFormat,w as isBriefingAttachmentOmissionCode,W as isBriefingDeliveryChannel,Z as isBriefingNumericValue,$ as isBriefingTableExportCardType,ee as isEmailOnlyBriefingDelivery,ae as isValidBriefingTimezone,ie as matrixDeliveryPayloadSchema,re as matrixDeliveryQuerySchema,te as nextBriefingScheduleDates,se as normalizeBriefingContentDocument,ne as normalizeBriefingDraft,oe as normalizeBriefingJobConfig,fe as parseBriefingScheduleExpr,ge as readBriefingCardFacts,le as readBriefingDeliveryOutcome,Be as readBriefingOmittedAttachments,me as validateBriefingContentDocument,ce as validateBriefingDraft,Ee as validateBriefingJobConfig};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{A as c,i as y,o as h}from"./context-ALdccLHw.js";function f(e,t){return e.role===t.role&&e.name===t.name&&e.aggregate===t.aggregate&&e.granularity===t.granularity;}function S(e){var n,s;const t=(n=e.selectedCard)==null?void 0:n.description;return(t==null?void 0:t.status)!=="described"||t.sql||((s=e.editing)==null?void 0:s.mode)==="sql"?[]:t.fields;}function M(e,t){if(t.length===0)return[];if(t.length>c.taggedFields)return[`taggedFields: at most ${c.taggedFields}`];const n=S(e);return t.flatMap((s,a)=>n.some(o=>f(o,s))?t.slice(0,a).some(o=>f(o,s))?[`taggedFields.${a}: tagged twice`]:[]:[`taggedFields.${a}: not a field of the card the context asks about`]);}function q(e,t){return t!=null&&t.length?`Fields of the asked-about card the user tagged in this question: ${t.map(y).join("; ")}.
|
|
2
|
+
|
|
3
|
+
${e}`:e;}function C(e){if(e.kind==="text")return{type:"text",text:e.text};const{kind:t,...n}=e;return{type:`data-${t}`,...(e.kind==="stage"?{id:e.stageId}:{}),data:n};}function U(e,t){return e.kind!=="text"?[C(e)]:[{type:"text-start",id:t},{type:"text-delta",id:t,delta:e.text},{type:"text-end",id:t}];}function T(e){if(e==="failed"||e==="interrupted")return{kind:"refusal",code:"model_unavailable",message:h.model_unavailable};if(e==="running")return{kind:"refusal",code:"turn_in_progress",message:h.turn_in_progress};}function $(e,t){let n=-1;e.forEach((a,o)=>{t(a)==="text"&&(n=o);});let s=-1;return e.forEach((a,o)=>{o<n&&t(a)==="step"&&(s=o);}),new Set(e.filter((a,o)=>o<s&&t(a)==="text"));}const p={conversation:"nowhere",text:"body",stage:"details",using:"details",clarify:"body",artifact:"body",refusal:"body",trace:"details",proposal:"body",proposal_operations:"nowhere",proposal_refused:"body",model_change:"body"};function P(e){return Object.hasOwn(p,e)&&p[e]==="body";}function b(e){return e.kind==="text"?v(e.text):e.kind==="stage"&&!e.change?"step":"other";}function v(e){return e.trim().length>0?"text":"other";}function V(e){const t=$(e,b);return e.flatMap(n=>n.kind==="text"&&!t.has(n)?[n.text]:[]).filter(n=>n.trim().length>0).join(`
|
|
4
|
+
|
|
5
|
+
`);}const B=5;function K(e){if(!Array.isArray(e))return;const t=e.filter(n=>!!n&&typeof n=="object"&&typeof n.what=="string"&&typeof n.now=="string");return t.length>0?t.map(({what:n,now:s})=>({what:n,now:s})):void 0;}const k={proposal_not_found:"This suggestion has expired. Ask for a new one.",proposal_stale:"The data model changed while these were being added. Nothing was added; ask for a new suggestion.",not_permitted:"You don’t have permission to change the data model.",apply_in_progress:"They’re still being added.",apply_outcome_unknown:"It isn’t clear whether they were added. Check the data model before asking again."},A="They couldn’t be added.",N={...k,proposal_stale:"Someone changed these in the data model since they were suggested. Nothing was saved; ask for a new suggestion.",apply_in_progress:"They’re still being saved.",apply_outcome_unknown:"It isn’t clear whether they were saved. Check the data model before asking again."},E="They couldn’t be saved.",g={exists:()=>"it’s already in the model",missing_fields:e=>`a dataset or field it uses is no longer in ${e}`,type_mismatch:()=>"its fields’ types don’t match",not_supported:()=>"the data doesn’t support it"};function x(e,t){switch(e==null?void 0:e.status){case"added":return"added";case"existing":return"already in the model";case"left_out":return"left out";case"refused":return`not added: ${O(e.reasons,t)}`;default:return"outcome unknown";}}function O(e,t){const n=e.find(s=>Object.hasOwn(g,s));return n?g[n](t):"it no longer fits the model";}function m(e){return e==="apply_outcome_unknown";}function w(e,t){const n=t==="edits"?N:k;return typeof e=="string"&&Object.hasOwn(n,e)?n[e]:t==="edits"?E:A;}const z={conversationId:"with tool calls",addedSources:"left out",allows:"left out",turns:"shown"},J={turnId:"left out",startedAt:"shown",message:"shown",taggedFields:"shown",parts:"shown",outcome:"shown",toolCalls:"with tool calls",model:"with tool calls",instructionsVersion:"with tool calls"};function W(e,t){var o;const n=(o=e.turns[0])==null?void 0:o.startedAt,s=[`${t.assistantName} conversation${n?` · ${n.slice(0,16).replace("T"," ")} UTC`:""}`,...(t.toolCalls?[`Conversation ${e.conversationId}`]:[])],a=e.turns.map(r=>{const d=[`You: ${I(r)}`,"",`${t.assistantName}:`],i=T(r.outcome),l=[...r.parts,...(i?[i]:[])];return d.push(...L(l)),t.toolCalls&&r.toolCalls&&d.push(...F(r.toolCalls,r.model,r.instructionsVersion)),d.join(`
|
|
6
|
+
`);});return[s.join(`
|
|
7
|
+
`),...a].join(`
|
|
8
|
+
|
|
9
|
+
`)+`
|
|
10
|
+
`;}function I(e){return[...(e.taggedFields??[]).map(n=>`@${n.label}`),e.message].join(" ");}function L(e){const t=$(e,b),n=/* @__PURE__ */new Set(),s=[];for(const a of e)switch(a.kind){case"text":!t.has(a)&&a.text.trim()&&s.push(a.text.trim());break;case"proposal":s.push("Dashboard changes",...a.changes.filter(o=>o.sentence).map(o=>`+ ${o.sentence}`));break;case"proposal_refused":s.push("Not added",`! ${a.message}`);break;case"model_change":s.push(...R(a));break;case"clarify":s.push(a.multiple?`${a.question} (pick any)`:a.question,...a.options.map((o,r)=>` ${r+1}. ${o.label}`));break;case"artifact":s.push(`[Result: ${a.artifact.title}]`);break;case"refusal":s.push(a.message);break;case"stage":n.add(a.stageId);break;case"using":case"trace":case"conversation":case"proposal_operations":break;default:return a;}return n.size&&s.push(`(${n.size} ${n.size===1?"step":"steps"})`),s;}function F(e,t,n){const s=["","Tool calls:"];return(t||n)&&s.push(` model ${t??"unknown"}${n?` · instructions ${n}`:""}`),e.length||s.push(" none"),e.forEach((a,o)=>{var u;const r=a.durationMs===void 0?"":` · ${a.durationMs} ms`,d=a.rowCount===void 0?"":` · ${a.rowCount} ${a.rowCount===1?"row":"rows"}`,i=a.ok||(u=a.error)==null?void 0:u.trim(),l=i&&!i.includes(`
|
|
11
|
+
`)?`: ${i}`:"";s.push(` ${o+1}. ${D(a.tool)}${r}${d} · ${a.ok?"ok":`failed${l}`}`),i&&!l&&s.push(" error:",..._(i)),i&&!l&&s.push(" input:"),s.push(..._(JSON.stringify(a.input??{},null,2)));}),s;}function _(e){return e.split(`
|
|
12
|
+
`).map(t=>` ${t}`);}function D(e){return e.replace(/^semaphor_/,"");}function R(e){const t=e.changes.map(s=>s.sentence??s.op),n=e.outcome;if(e.changeKind==="edits"){const s=n?n.status==="applied"?"saved":n.status==="dismissed"?"not saved: Not now":`${m(n.code)?"unclear whether saved":"not saved"}: ${w(n.code,"edits")}`:"proposed",a=(n==null?void 0:n.status)==="refused"?(n.changed??[]).map(o=>` Changed since: ${o.what} is now ${o.now}`):[];return[`Data model change (${s})`,...t.map(o=>`+ ${o}`),...a];}return n?n.status==="dismissed"?["Data model change (not added: Not now)",...t.map(s=>`+ ${s}`)]:n.status==="refused"?[`Data model change (${m(n.code)?"unclear whether added":"not added"}: ${w(n.code)})`,...t.map(a=>`+ ${a}`)]:["Data model change",...t.map((s,a)=>`+ ${s} (${x(n.links[a],e.domainLabel)})`)]:["Data model change (proposed)",...t.map(s=>`+ ${s}`)];}function Y(e){if(e.kind==="semantic")return JSON.stringify(["semantic",e.domainId,e.datasetName]);if(e.kind==="sql")return JSON.stringify(["sql",e.connectionId]);}function G(e){return e.label??(e.kind==="semantic"?e.datasetName:e.kind==="physical"?e.tableName:"SQL");}function H(e){return{columns:e.columns,records:e.records,rowCount:e.rowCount,governed:e.status.governed,complete:e.status.complete,truncated:e.status.truncated};}const Q={number:"kpi",line:"line",bar:"bar",stackedBar:"stackedBar",table:"table"};export{p as A,z as C,B as M,S as a,C as b,U as c,T as d,J as e,W as f,D as g,P as h,b as i,v as j,V as k,Y as l,G as m,Q as n,K as o,x as p,q,O as r,f as s,M as t,m as u,H as v,$ as w,w as x};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{z as e}from"zod";const Z=["missing_dependency","missing_relationship","population_required","ambiguous_relationship"];function Re(t){return Z.includes(t);}const Ie=200,D=["second","minute","hour","day","week","month","quarter","year"];function xe(t){return typeof t=="string"&&D.includes(t);}const B=["week_of_short","week_of_long","quarter_short","quarter_long","fiscal_quarter_short","fiscal_year","short","long","numeric","iso"],G=["hour","day","week","month","quarter","year"],De={invalidMetadata:"invalid_raw_temporal_metadata"};function z(t){return t==="second"||t==="minute"||t==="hour"?"datetime":"date";}const we={missingMetadata:"missing_temporal_bucket_metadata",invalidMetadata:"invalid_temporal_bucket_metadata",invalidValue:"invalid_temporal_bucket_value"},je="__auto_count__";function w(t){try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0;}catch{return!1;}}const L=20;function d(t){if(!(typeof t!="number"||!Number.isFinite(t)))return Math.max(0,Math.min(L,Math.trunc(t)));}function s(t){return typeof t=="string"?t:void 0;}function S(t){return typeof t=="string"&&t.trim()?t:void 0;}function _(t){return typeof t=="boolean"?t:void 0;}function $(t){if(typeof t!="string")return;const a=t.trim().toUpperCase();return /^[A-Z]{3}$/.test(a)?a:void 0;}function H(t){return typeof t=="number"&&Number.isFinite(t)?t:void 0;}function c(t){return Object.fromEntries(Object.entries(t).filter(([,a])=>a!==void 0));}const K=/* @__PURE__ */new Set(["number","currency","percent","percentage","scientific"]),W=/* @__PURE__ */new Set(["millisecond","second","minute","hour","day"]);function v(t){return typeof t=="string"&&W.has(t)?t:void 0;}function X(t){const a=t.percentValueMode??"fraction";if(t.scale===1&&a==="whole"){const{scale:i,...f}=t;return{...f,percentValueMode:"whole"};}const o=t.minimumFractionDigits??(t.maximumFractionDigits===void 0?1:0),n=t.maximumFractionDigits??Math.max(o,1);return c({type:"number",scale:a==="whole"?t.scale:t.scale*100,minimumFractionDigits:o,maximumFractionDigits:n,useGrouping:t.useGrouping,prefix:t.prefix,suffix:`%${t.suffix??""}`,negativeStyle:t.negativeStyle,signDisplay:t.signDisplay});}function Y(t){const a=t.type==="percentage"?"percent":t.type;let o=d(t.minimumFractionDigits),n=d(t.maximumFractionDigits);const i=d(t.decimals);o===void 0&&n===void 0&&i!==void 0&&(o=i,n=i),o!==void 0&&n!==void 0&&o>n&&([o,n]=[n,o]);const f=t.negativeStyle==="parentheses"||t.negativeStyle==="minus"?t.negativeStyle:void 0,P=t.signDisplay==="auto"||t.signDisplay==="always"||t.signDisplay==="exceptZero"||t.signDisplay==="never"?t.signDisplay:void 0,m=c({type:a,currency:a==="currency"?$(t.currency):void 0,minimumFractionDigits:o,maximumFractionDigits:n,useGrouping:_(t.useGrouping)??_(t.thousandsSeparator),prefix:s(t.prefix),suffix:a==="percent"&&t.suffix==="%"?void 0:s(t.suffix),negativeStyle:f,compact:_(t.compact),scale:H(t.scale),percentValueMode:a==="percent"?t.percentValueMode==="whole"?"whole":"fraction":void 0,signDisplay:P});return m.type==="percent"&&m.scale!==void 0?X(m):m;}function J(t){if(!t||typeof t!="object"||Array.isArray(t))return;const a=t;if(a.type==="temporal_bucket"){const o=a.presentation;return o&&typeof o=="object"&&!Array.isArray(o)?{type:"temporal_bucket",presentation:o}:void 0;}if(typeof a.type=="string"&&K.has(a.type))return Y(a);if(a.type==="date"||a.type==="datetime"){const o=S(a.pattern),n=a.preset==="short"||a.preset==="long"||a.preset==="numeric"||a.preset==="iso"?a.preset:void 0,i=o&&(a.dialect==="date_fns"||a.dialect==="semaphor_tokens")?a.dialect:void 0;return c({type:"date",pattern:o,dialect:i,preset:o?void 0:n,relative:a.relative===!0?!0:void 0,timezone:S(a.timezone),sourceTimezone:S(a.sourceTimezone),prefix:s(a.prefix),suffix:s(a.suffix)});}if(a.type==="duration"){const o=d(a.maxUnits);return c({type:"duration",inputUnit:v(a.inputUnit),outputStyle:a.outputStyle==="compact"||a.outputStyle==="digital"||a.outputStyle==="long"?a.outputStyle:void 0,largestUnit:v(a.largestUnit),smallestUnit:v(a.smallestUnit),maxUnits:o===void 0?void 0:Math.min(o,10),prefix:s(a.prefix),suffix:s(a.suffix),negativeStyle:a.negativeStyle==="parentheses"||a.negativeStyle==="minus"?a.negativeStyle:void 0});}if(a.type==="string")return c({type:"string",prefix:s(a.prefix),suffix:s(a.suffix)});}const Q=e.record(e.string(),e.unknown()),p=e.array(Q),u=e.enum(["SUM","COUNT","AVG","MIN","MAX","MEDIAN","DISTINCT"]),g=e.enum(["postgres","mysql","mssql","snowflake","clickhouse","bigquery","redshift","duckdb","sqlite","unknown"]),ee=e.enum(D),h=e.enum(["dimension","measure","date","id","unknown"]),y=e.enum(["string","number","boolean","date","datetime","unknown"]),T=e.union([e.number(),e.string(),e.null()]),k=e.enum(["millisecond","second","minute","hour","day"]),te=e.enum(B),ae=e.discriminatedUnion("mode",[e.object({mode:e.literal("auto")}).strict(),e.object({mode:e.literal("preset"),preset:te}).strict(),e.object({mode:e.literal("pattern"),pattern:e.string().min(1)}).strict()]),j=e.object({type:e.literal("temporal_bucket"),presentation:ae}).strict(),oe=e.object({tz:e.string().min(1).refine(w,{message:"tz must be a valid IANA timezone"}),weekStart:e.number().int().min(0).max(6),fiscalCalendar:e.object({kind:e.literal("month_aligned"),yearStartMonth:e.number().int().min(1).max(12)}).strict().optional()}).strict(),R=e.object({kind:e.literal("temporal_bucket"),granularity:ee,calendar:oe}).strict(),ne=e.object({grainSource:e.enum(["automatic","card"]),window:e.object({startInclusive:e.string(),endExclusive:e.string()}).strict().optional(),automaticGrain:e.enum(G),holdsTime:e.boolean()}).strict(),ie=e.object({kind:e.literal("raw_temporal"),valueKind:e.enum(["date","wall_datetime","instant"])}).strict(),Ae=e.object({kind:e.literal("raw_temporal"),valueKind:e.enum(["date","wall_datetime","instant"]),tz:e.string().min(1).refine(w,"tz must be an IANA timezone.")}).strict(),r=e.string(),I=e.number().int().min(0).max(20),A=e.object({type:e.enum(["number","currency","percent","scientific"]),currency:e.string().regex(/^[A-Z]{3}$/,"Expected an ISO 4217 currency code.").optional(),minimumFractionDigits:I.optional(),maximumFractionDigits:I.optional(),useGrouping:e.boolean().optional(),prefix:r.optional(),suffix:r.optional(),negativeStyle:e.enum(["minus","parentheses"]).optional(),compact:e.boolean().optional(),scale:e.number().finite().optional(),percentValueMode:e.enum(["fraction","whole"]).optional(),signDisplay:e.enum(["auto","always","exceptZero","never"]).optional()}).strict().superRefine((t,a)=>{const{minimumFractionDigits:o,maximumFractionDigits:n}=t;o!==void 0&&n!==void 0&&o>n&&a.addIssue({code:e.ZodIssueCode.custom,path:["minimumFractionDigits"],message:"minimumFractionDigits must not exceed maximumFractionDigits."}),t.currency!==void 0&&t.type!=="currency"&&a.addIssue({code:e.ZodIssueCode.custom,path:["currency"],message:"Only a currency format names a currency."}),t.type==="percent"?(t.percentValueMode===void 0&&a.addIssue({code:e.ZodIssueCode.custom,path:["percentValueMode"],message:"A percent format states percentValueMode: fraction (0.25 is 25%) or whole (25 is 25%)."}),t.scale!==void 0&&a.addIssue({code:e.ZodIssueCode.custom,path:["scale"],message:"A percent format has no scale; percentValueMode says how the value is read."})):t.percentValueMode!==void 0&&a.addIssue({code:e.ZodIssueCode.custom,path:["percentValueMode"],message:"Only a percent format has percentValueMode."});}),se=["short","long","numeric","iso"],F=e.object({type:e.literal("date"),pattern:e.string().min(1).optional(),dialect:e.enum(["semaphor_tokens","date_fns"]).optional(),preset:e.enum(se).optional(),relative:e.boolean().optional(),timezone:e.string().min(1).optional(),sourceTimezone:e.string().min(1).optional(),prefix:r.optional(),suffix:r.optional()}).strict().superRefine((t,a)=>{t.pattern!==void 0&&t.preset!==void 0&&a.addIssue({code:e.ZodIssueCode.custom,path:["preset"],message:"A date format has a pattern or a preset, not both."}),t.dialect!==void 0&&t.pattern===void 0&&a.addIssue({code:e.ZodIssueCode.custom,path:["dialect"],message:"dialect names the token set of a pattern."});}),C=e.object({type:e.literal("duration"),inputUnit:k.optional(),outputStyle:e.enum(["compact","digital","long"]).optional(),largestUnit:k.optional(),smallestUnit:k.optional(),maxUnits:e.number().int().min(0).max(10).optional(),prefix:r.optional(),suffix:r.optional(),negativeStyle:e.enum(["minus","parentheses"]).optional()}).strict(),M=e.object({type:e.literal("string"),prefix:r.optional(),suffix:r.optional()}).strict(),O=e.union([A,F,C,M]),re=e.unknown().superRefine((t,a)=>{t&&typeof t=="object"&&"locale"in t&&["number","currency","percent","percentage","scientific"].includes(String(t.type))&&a.addIssue({code:e.ZodIssueCode.custom,path:["locale"],message:"Numeric semantic formats inherit locale from viewer preferences."});}).transform(t=>J(t)??t).pipe(O),Fe=e.union([O,j]),Ce=["number","currency","percent","scientific","duration","date","string","temporal_bucket"];function ce(t){switch(t){case"number":case"currency":case"percent":case"scientific":return A;case"date":return F;case"duration":return C;case"string":return M;case"temporal_bucket":return j;default:return;}}function Me(t){let a=ce(t);for(;a&&!(a instanceof e.ZodObject);)a=a instanceof e.ZodEffects?a.innerType():void 0;return a?Object.keys(a.shape):void 0;}function le(t,a){return e.object(t).passthrough().superRefine((o,n)=>{for(const i of a)Object.prototype.hasOwnProperty.call(o,i)||n.addIssue({code:"custom",path:[i],message:`Required field "${i}" is missing.`});});}const E=e.object({kind:e.literal("semantic"),domainId:e.string(),datasetName:e.string(),datasetId:e.string().optional(),label:e.string().optional(),connectionId:e.string().optional()}).passthrough(),pe=e.object({kind:e.literal("physical"),connectionId:e.string(),connectionType:e.string().optional(),tableName:e.string(),databaseName:e.string().optional(),schemaName:e.string().optional(),label:e.string().optional(),dialect:g.optional()}).passthrough(),ue=e.object({kind:e.literal("sql"),connectionId:e.string(),dialect:g.optional(),label:e.string().optional()}).passthrough(),N=e.union([E,pe,ue]),me=e.object({name:e.string(),label:e.string().optional(),role:h.optional(),dataType:y.optional(),source:N.optional(),aggregate:u.optional()}).passthrough(),V=me,de=e.object({kind:e.literal("field"),field:V,aggregate:u.optional()}).passthrough(),ge=e.object({kind:e.literal("derived_field"),name:e.string(),label:e.string(),description:e.string().optional(),resultRole:h,dataType:y,computeStage:e.enum(["row","aggregate"]),expression:e.string(),expressionLanguage:e.literal("semaphor_sql_template").optional(),inputs:e.record(de),defaultAggregate:u.optional(),aggregationBehavior:e.enum(["additive","non_additive","ratio_of_sums","weighted","pre_aggregated","snapshot"]).optional(),aggregationStrategy:e.enum(["default","symmetric_aggregate","aggregate_then_join","weighted"]).optional(),format:re.optional(),tags:e.array(e.string()).optional()}).passthrough(),U=ge,Oe=V.and(e.object({derivedField:U.optional()}).passthrough()),he=E,ye=e.object({kind:e.literal("physical"),connectionId:e.string().optional(),connectionType:e.string().optional(),tableName:e.string(),databaseName:e.string().optional(),schemaName:e.string().optional(),label:e.string().optional(),dialect:g.optional()}).passthrough(),be=e.object({kind:e.literal("sql"),connectionId:e.string().optional(),dialect:g.optional(),label:e.string().optional()}).passthrough(),fe=e.union([he,ye,be]),Ee=e.object({key:e.string().optional(),name:e.string(),label:e.string().optional(),role:h.optional(),dataType:y.optional(),source:fe.optional(),aggregate:u.optional(),derivedField:e.never().optional()}).passthrough(),l=e.object({key:e.string(),name:e.string(),label:e.string(),role:h.optional(),dataType:y.optional(),aggregate:u.optional(),source:N.optional(),derivedField:U.optional(),temporalBucket:R.optional(),rawTemporal:ie.optional(),dateGrain:ne.optional(),pivotIdentity:e.object({metricId:e.string().min(1),metricAlias:e.string().min(1),members:e.array(e.object({fieldId:e.string().min(1),value:e.string().nullable(),temporalBucket:R.optional()}).strict())}).strict().optional()}).passthrough().superRefine((t,a)=>{if(t.temporalBucket&&t.rawTemporal&&a.addIssue({code:e.ZodIssueCode.custom,path:["rawTemporal"],message:"A result column cannot carry both temporalBucket and rawTemporal metadata."}),t.temporalBucket){const o=z(t.temporalBucket.granularity);t.dataType!==o&&a.addIssue({code:e.ZodIssueCode.custom,path:["dataType"],message:`${t.temporalBucket.granularity} temporal buckets require dataType ${o}.`});}if(t.rawTemporal){const o=t.rawTemporal.valueKind==="date"?"date":"datetime";t.dataType!==o&&a.addIssue({code:e.ZodIssueCode.custom,path:["dataType"],message:`${t.rawTemporal.valueKind} raw temporal values require dataType ${o}.`});}}),Ne=e.object({records:p,columns:e.array(l).optional()}).passthrough(),Ve=e.object({records:p,columns:e.array(l)}).passthrough(),q=e.object({code:e.string(),message:e.string().optional(),invalidField:e.string().optional(),fieldRole:e.enum(["measure","date","dimension","input","source","sql"]).optional(),validMeasureCandidates:e.array(e.string()).optional(),validDateCandidates:e.array(e.string()).optional(),validDimensionCandidates:e.array(e.string()).optional(),recommendedNextStep:e.string()}).passthrough(),x=e.object({code:e.string(),message:e.string(),path:e.string().optional(),fieldRole:e.enum(["measure","date","dimension","input","source","sql"]).optional(),repairHint:q.optional()}).passthrough(),Ue=e.object({ok:e.boolean(),errors:e.array(x),warnings:e.array(x),repairHints:e.array(q)}).passthrough(),Se=e.object({page:e.number(),pageSize:e.number(),pageCount:e.number(),totalCount:e.number(),hasNextPage:e.boolean(),hasPrevPage:e.boolean()}).passthrough(),b={intentId:e.string().optional(),queryPath:e.enum(["query_spec","sql","sql_python"]),warnings:e.array(e.string()).optional(),rowCount:e.number().optional(),rowLimitExceeded:e.boolean().optional(),limit:e.number().optional(),pagination:Se.optional()},qe=e.object({...b,kind:e.literal("metric"),primaryValue:T,measures:e.record(T).optional(),missingMeasures:e.array(e.string()).optional(),comparison:e.object({kind:e.enum(["previous_period","previous_year","target"]),words:e.string().optional(),value:T.optional(),delta:e.union([e.number(),e.null()]).optional(),deltaPercent:e.union([e.number(),e.null()]).optional()}).passthrough().optional(),records:p.optional()}).passthrough(),Pe=e.object({...b,kind:e.literal("records"),columns:e.array(l),records:p,totals:e.object({mode:e.literal("server"),scope:e.literal("filtered_result"),row:e.record(e.string(),e.unknown()),columns:e.array(l).optional()}).passthrough().optional()}).passthrough(),_e=e.object({inputId:e.string().min(1),status:e.enum(["applied","inactive","skipped","overridden","error"]),reason:e.enum(["unrelated","population_required","missing_dependency","missing_relationship","ambiguous_relationship","invalid_metadata","unsupported_dependency","override_not_eligible"]).optional()}),ve=e.object({complete:e.boolean(),reason:e.enum(["unsupported","truncated"]).optional()}),Te=e.object({kind:e.literal("standardCursor"),pageSize:e.number().int().positive(),hasMore:e.boolean(),nextCursor:e.string().min(1).optional()}),Ze=e.object({...b,kind:e.literal("inputOptions"),dependencyOutcomes:e.array(_e).optional(),match:ve.optional(),page:Te.optional(),options:e.array(le({label:e.string(),value:e.unknown(),count:e.number().optional(),disambiguation:e.array(e.string()).optional()},["value"]))}).passthrough(),Be=e.object({...b,kind:e.literal("sql"),columns:e.array(l),records:p,sqlShape:e.object({statementType:e.string().optional(),explicitLimit:e.number().optional(),hasPythonCode:e.boolean().optional()}).passthrough().optional()}).passthrough();export{Te as $,G as A,Ce as B,ce as C,Me as D,E,pe as F,ue as G,me as H,V as I,ge as J,U as K,Oe as L,Ie as M,Ee as N,Z as O,l as P,Ne as Q,De as R,je as S,we as T,Ve as U,x as V,Ue as W,qe as X,Pe as Y,_e as Z,ve as _,z as a,Ze as a0,Be as a1,R as b,Re as c,D as d,xe as e,B as f,p as g,u as h,w as i,ee as j,j as k,ne as l,ie as m,T as n,Ae as o,A as p,se as q,Q as r,N as s,J as t,F as u,C as v,M as w,O as x,re as y,Fe as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext as A,useContext as g}from"react";import{S,c as C,a as E}from"./schema-MC0cQSAb.js";import{b as R}from"./resolver-AN9ChBfZ.js";const _={background:"--semaphor-background",foreground:"--semaphor-foreground",muted:"--semaphor-muted",mutedForeground:"--semaphor-muted-foreground",border:"--semaphor-border",input:"--semaphor-input",primary:"--semaphor-primary",primaryForeground:"--semaphor-primary-foreground",accent:"--semaphor-accent",accentForeground:"--semaphor-accent-foreground",selection:"--semaphor-selection",card:"--semaphor-card",cardForeground:"--semaphor-card-foreground",positive:"--semaphor-positive",negative:"--semaphor-negative",warning:"--semaphor-warning",info:"--semaphor-info",destructive:"--semaphor-destructive",destructiveForeground:"--semaphor-destructive-foreground"},x={light:{"--semaphor-code-string":"158 64% 22%","--semaphor-code-number":"158 64% 22%","--semaphor-code-boolean":"158 64% 22%","--semaphor-code-fn":"217 91% 40%","--semaphor-code-keyword":"263 70% 42%"},dark:{"--semaphor-code-string":"158 64% 52%","--semaphor-code-number":"158 64% 52%","--semaphor-code-boolean":"158 64% 52%","--semaphor-code-fn":"213 94% 68%","--semaphor-code-keyword":"264 89% 74%"}};function k(o){var a,c,i,d;const e=o.defaults??S,r=o.mode??v(o.spec.mode,o.systemMode),n=b(o.spec.schemes[r]??e.schemes[r]),t=((a=n.tokens)==null?void 0:a.color)??{},m={...x[r]};for(const[f,u]of Object.entries(_)){const p=t[f];if(!p)continue;const h=C(p);if(!h)throw new Error(`Invalid compiled appearance color for ${f}`);m[u]=h;}z(m,(c=n.tokens)==null?void 0:c.radius),w(m,(i=n.tokens)==null?void 0:i.typography);const s=O(n,e.schemes[r],r);return{mode:r,scheme:n,cssVariables:m,colorValues:t,chartPalette:s.palette,chartTheme:s,table:(d=n.components)==null?void 0:d.table};}const P={light:{background:"#fff",title:"#000",body:"#000",footer:"#999",border:"rgb(128,131,139)",cornerRadius:4},dark:{background:"#000",title:"#fff",body:"#fff",footer:"#999",border:"rgb(128,131,139)",cornerRadius:2}},T=2;function O(o,e,r){var a,c,i,d,f,u,p;const n=(a=o.components)==null?void 0:a.chart,t=(c=o.tokens)==null?void 0:c.typography,m=(i=e.tokens)==null?void 0:i.typography,s=(t==null?void 0:t.baseFontSize)??(m==null?void 0:m.baseFontSize)??14;return{mode:r,palette:(n==null?void 0:n.palette)??((f=(d=e.components)==null?void 0:d.chart)==null?void 0:f.palette)??E,font:{family:(t==null?void 0:t.fontFamily)??(m==null?void 0:m.fontFamily)??"",size:s-T},gridColor:n==null?void 0:n.gridColor,axisColor:(n==null?void 0:n.axisColor)??(n==null?void 0:n.foreground),legendColor:n==null?void 0:n.foreground,tooltip:P[r],barRadius:(n==null?void 0:n.barRadius)??((p=(u=e.components)==null?void 0:u.chart)==null?void 0:p.barRadius)??0};}function w(o,e){e!=null&&e.fontFamily&&(o["--semaphor-font-family"]=e.fontFamily),e!=null&&e.headingFontFamily&&(o["--semaphor-heading-font-family"]=e.headingFontFamily),e!=null&&e.monoFontFamily&&(o["--semaphor-mono-font-family"]=e.monoFontFamily),(e==null?void 0:e.baseFontSize)!==void 0&&(o["--semaphor-font-size"]=`${e.baseFontSize}px`);}function z(o,e){o["--semaphor-brand"]=o["--semaphor-primary"]??o["--semaphor-foreground"],o["--semaphor-secondary"]=o["--semaphor-accent"]??o["--semaphor-muted"],o["--semaphor-secondary-foreground"]=o["--semaphor-accent-foreground"]??o["--semaphor-foreground"],o["--semaphor-popover"]=o["--semaphor-card"]??o["--semaphor-background"],o["--semaphor-popover-foreground"]=o["--semaphor-card-foreground"]??o["--semaphor-foreground"],o["--semaphor-ring"]=o["--semaphor-primary"]??o["--semaphor-foreground"];const r=F((e==null?void 0:e.control)??5),n=F((e==null?void 0:e.card)??(e==null?void 0:e.control)??5);o["--semaphor-radius"]=r,o["--semaphor-control-radius"]=r,o["--semaphor-card-radius"]=n;}const l={none:"none",subtle:"0 1px 2px 0 rgb(0 0 0 / 0.05)",raised:"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)"};function b(o,e,r){return typeof o=="string"?(e==="shadow"||r==="shadow")&&o in l?l[o]:o:typeof o!="object"||o===null||Array.isArray(o)?o:Object.fromEntries(Object.entries(o).map(([n,t])=>[n,b(t,n,e)]));}function F(o){return`${Number((o/16).toFixed(4))}rem`;}function v(o,e="light"){return o==="system"?e:o;}const H=k({spec:R(),mode:"light"}),D=A(L("semaphor-default-appearance",H));function I(){return g(D);}function L(o,e,r={}){return{instanceId:o,compiledAppearance:e,layers:r,scopeProps:M(o,e),portalSnapshot:{instanceId:o,compiledAppearance:e}};}function M(o,e){return{className:e.mode,style:N(e),"data-semaphor-theme":e.mode,"data-semaphor-appearance-instance":o};}function N(o){var m,s;const e={colorScheme:o.mode};o.cssVariables["--semaphor-font-family"]&&(e.fontFamily="var(--semaphor-font-family)");const n=(m=o.scheme.tokens)==null?void 0:m.typography,t=(s=S.schemes[o.mode].tokens)==null?void 0:s.typography;(n==null?void 0:n.baseFontSize)!==void 0&&n.baseFontSize!==(t==null?void 0:t.baseFontSize)&&(e.fontSize=n.baseFontSize);for(const[a,c]of Object.entries(o.cssVariables))e[a]=c;return e;}export{D as A,L as a,l as b,k as c,I as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as l}from"react/jsx-runtime";import{createContext as M,useId as v,useMemo as c,useContext as A,useState as T,useEffect as x}from"react";import{c as I,a as g,A as k}from"./appearance-context-BqBZrijL.js";import{b as C}from"./resolver-AN9ChBfZ.js";const L={theme:"system",setTheme:()=>null},E=M(L);function P(e,n="system"){return S(e)?e:n;}function S(e){return e==="light"||e==="dark"||e==="system";}function q(e){return/* @__PURE__ */l(z,{...e});}function z({appearance:e,organizationAppearance:n,dashboardStyle:a,tokenAppearance:i,reactAppearance:t,resolvedAppearance:r,systemMode:o,children:m}){const s=v(),u=c(()=>R(s),[s]),{theme:w}=A(E),p=V(w),d=c(()=>({organizationAppearance:n,dashboardStyle:a,tokenAppearance:i,reactAppearance:t??e}),[e,a,n,t,i]),f=c(()=>r??C(d),[d,r]),h=c(()=>I({spec:f,systemMode:o??p}),[f,p,o]),y=c(()=>g(u,h,d),[h,u,d]);return/* @__PURE__ */l(k.Provider,{value:y,children:m});}function R(e){return`semaphor-appearance-${e.replace(/[^a-zA-Z0-9_-]/g,"")}`;}function V(e){const n=P(e),[a,i]=T(()=>j());return x(()=>{var o,m;if(n!=="system"||typeof window>"u")return;const t=(o=window.matchMedia)==null?void 0:o.call(window,"(prefers-color-scheme: dark)");if(!t)return;const r=()=>{i(t.matches?"dark":"light");};return r(),typeof t.addEventListener=="function"?(t.addEventListener("change",r),()=>t.removeEventListener("change",r)):((m=t.addListener)==null||m.call(t,r),()=>{var s;return(s=t.removeListener)==null?void 0:s.call(t,r);});},[n]),n==="system"?a:n;}function j(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";}export{q as A,z as I,E as T,P as n};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const d=/* @__PURE__ */new Set(["dataset_not_reachable","field_not_resolvable","missing_metadata","unsupported_calculated_filter","relationship_unsupported","relationship_missing","relationship_ambiguous"]);function n(t){return!!t&&typeof t=="object"&&!Array.isArray(t);}function a(t){if(!(!n(t)||typeof t.name!="string"))return{name:t.name,...(typeof t.label=="string"?{label:t.label}:{})};}function f(t){if(!n(t))return;const r=t.relationshipIds;if(!Array.isArray(r)||!r.length||!r.every(s=>typeof s=="string"&&s)||t.direction!=="to_one"&&t.direction!=="to_many")return;const e=Array.isArray(t.datasets)?t.datasets.map(a):[];if(e.some(s=>!s))return;const i=a(t.matchingDataset),o=a(t.base);return{relationshipIds:[...r],...(o?{base:o}:{}),datasets:e,direction:t.direction,...(i?{matchingDataset:i}:{})};}function c(t){if(!n(t)||!Array.isArray(t.filterReach))return[];const r=[];for(const e of t.filterReach)if(!(!n(e)||typeof e.filterId!="string"||!e.filterId))if(e.status==="applied"){const i=e.through===void 0?void 0:f(e.through);if(e.through!==void 0&&!i)continue;r.push({filterId:e.filterId,status:"applied",...(i?{through:i}:{})});}else e.status==="skipped"&&typeof e.reason=="string"&&d.has(e.reason)?r.push({filterId:e.filterId,status:"skipped",reason:e.reason}):e.status==="blocked"&&typeof e.message=="string"&&r.push({filterId:e.filterId,status:"blocked",message:e.message});return r;}export{c as a,f as r};
|