react-semaphor 0.1.323 → 0.1.325

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.
Files changed (32) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -0
  2. package/dist/analytics-protocol/index.js +240 -0
  3. package/dist/chunks/{calendar-preferences-dialog-CLXaVo3h.js → calendar-preferences-dialog-BxeROxyq.js} +1 -1
  4. package/dist/chunks/{calendar-preferences-dialog-B9Hz3pTH.js → calendar-preferences-dialog-DHhT6Sja.js} +1 -1
  5. package/dist/chunks/{dashboard-briefing-launcher-CUEn7cr6.js → dashboard-briefing-launcher-BzIxRlzW.js} +3 -3
  6. package/dist/chunks/{dashboard-briefing-launcher-COLpvReF.js → dashboard-briefing-launcher-DZiFMK8I.js} +1 -1
  7. package/dist/chunks/{dashboard-controls-DH8gdpOc.js → dashboard-controls-BX693lE0.js} +1 -1
  8. package/dist/chunks/{dashboard-controls-CLShFyUq.js → dashboard-controls-DVwsWny9.js} +3 -3
  9. package/dist/chunks/{dashboard-json-Db0DpTMw.js → dashboard-json-D15C_I9e.js} +1 -1
  10. package/dist/chunks/{dashboard-json-eGBWfSN1.js → dashboard-json-DxNEFM-p.js} +1 -1
  11. package/dist/chunks/{edit-dashboard-visual-Cc3xpTNQ.js → edit-dashboard-visual-90_qEgRc.js} +1 -1
  12. package/dist/chunks/{edit-dashboard-visual-DmMKWtln.js → edit-dashboard-visual-wQyJEcVH.js} +3 -3
  13. package/dist/chunks/{index-PTx7430W.js → index-CffvIaZO.js} +33125 -32694
  14. package/dist/chunks/{index-CMS4bp9G.js → index-YTk9Hab2.js} +203 -203
  15. package/dist/chunks/{resource-management-panel-C1mbF-2a.js → resource-management-panel-CLoO2DL3.js} +2 -2
  16. package/dist/chunks/{resource-management-panel-DR7Ku6sa.js → resource-management-panel-DlnrD0y-.js} +1 -1
  17. package/dist/chunks/{use-create-flow-overlay-state-CmxTpqeg.js → use-create-flow-overlay-state-DocFanjO.js} +1 -1
  18. package/dist/chunks/{use-create-flow-overlay-state-B65gg2oB.js → use-create-flow-overlay-state-DsPoCfMu.js} +2 -2
  19. package/dist/chunks/{use-visual-utils-Diuguy3D.js → use-visual-utils-BdO22fQZ.js} +1 -1
  20. package/dist/chunks/{use-visual-utils-51Nsy8cj.js → use-visual-utils-DSbXQQD1.js} +1 -1
  21. package/dist/dashboard/index.cjs +1 -1
  22. package/dist/dashboard/index.js +1 -1
  23. package/dist/dashboard-authoring/index.cjs +3 -3
  24. package/dist/dashboard-authoring/index.js +825 -310
  25. package/dist/index.cjs +1 -1
  26. package/dist/index.js +5 -5
  27. package/dist/surfboard/index.cjs +1 -1
  28. package/dist/surfboard/index.js +2 -2
  29. package/dist/types/analytics-protocol.d.ts +172 -0
  30. package/dist/types/dashboard-authoring.d.ts +161 -0
  31. package/dist/types/main.d.ts +1 -0
  32. package/package.json +6 -1
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function n(i,e,s){return s?{code:i,message:e,path:s}:{code:i,message:e}}function p(i){const e=new Set;for(const s of i){if(e.has(s))return s;e.add(s)}return null}function a(i){return typeof i=="string"&&i.trim().length>0}function l(i){return!!(i&&typeof i=="object"&&!Array.isArray(i))}function m(i,e,s){if(!i||typeof i!="object"){s.push(n("missing_source","Analytics intent needs a source.",e));return}if(i.kind==="semantic"){a(i.domainId)||s.push(n("missing_semantic_domain","Semantic source needs a domainId.",`${e}.domainId`)),a(i.datasetName)||s.push(n("missing_dataset_name","Semantic source needs a datasetName.",`${e}.datasetName`));return}if(i.kind==="physical"){a(i.connectionId)||s.push(n("missing_connection_id","Physical source needs a connectionId.",`${e}.connectionId`)),a(i.tableName)||s.push(n("missing_table_name","Physical source needs a tableName.",`${e}.tableName`));return}if(i.kind==="sql"){a(i.connectionId)||s.push(n("missing_connection_id","SQL source needs a connectionId.",`${e}.connectionId`)),a(i.sql)||s.push(n("missing_sql","SQL source needs SQL text.",`${e}.sql`));return}s.push(n("invalid_source_kind","Source kind is not supported.",e))}function h(i){var r;const e=[],s=[];return!i||typeof i!="object"?{ok:!1,errors:[n("invalid_analytics_intent","Analytics intent must be a structured object.")],warnings:s}:(m(i.source,"source",e),i.kind==="metric"?a(i.metric)||e.push(n("missing_metric","Metric intent needs a metric.","metric")):i.kind==="records"?(!Array.isArray(i.fields)||i.fields.length===0)&&e.push(n("missing_record_fields","Records intent needs at least one field.","fields")):i.kind==="inputOptions"?(!i.field||!a(i.field.name))&&e.push(n("missing_input_options_field","Input options intent needs a field.","field")):i.kind==="sql"?((r=i.source)==null?void 0:r.kind)!=="sql"&&e.push(n("invalid_sql_source","SQL analytics intent must use a SQL source.","source")):e.push(n("invalid_analytics_kind","Analytics kind is not supported.","kind")),{ok:e.length===0,errors:e,warnings:s})}function g(i,e,s,r){if(!i||typeof i!="object"){s.push(n("invalid_view","Dashboard view must be an object.",e));return}if(a(i.title)||s.push(n("missing_view_title","Dashboard view needs a title.",e)),!i.presentation||typeof i.presentation!="object"){s.push(n("missing_presentation","Dashboard view needs a presentation.",`${e}.presentation`));return}if(i.presentation.kind==="text"){a(i.text)||r.push(n("missing_text_content","Text views should include text content.",`${e}.text`));return}if(!i.analytics){s.push(n("missing_view_analytics","Non-text dashboard views need analytics intent.",`${e}.analytics`));return}const u=h(i.analytics);for(const o of u.errors)s.push(n(o.code,o.message,`${e}.analytics${o.path?`.${o.path}`:""}`));for(const o of u.warnings)r.push(n(o.code,o.message,`${e}.analytics${o.path?`.${o.path}`:""}`))}function v(i){const e=[],s=[];if(!i||typeof i!="object")return{ok:!1,errors:[n("invalid_dashboard_intent","Dashboard intent must be a structured object.")],warnings:s};i.version!==1&&e.push(n("invalid_version","Dashboard intent version must be 1.")),i.kind!=="dashboard"&&e.push(n("invalid_kind","Experience intent kind must be dashboard.")),a(i.title)||e.push(n("missing_title","Dashboard intent needs a title.","title"));const r=Array.isArray(i.inputs)?i.inputs:[],u=p(r.filter(l).map(d=>d.id).filter(d=>typeof d=="string"));u&&e.push(n("duplicate_input_id",`Duplicate input id: ${u}.`,"inputs"));for(const[d,t]of r.entries()){const c=`inputs.${d}`;if(!l(t)){e.push(n("invalid_input","Dashboard input must be an object.",c));continue}a(t.id)||e.push(n("missing_input_id","Input needs an id.",`${c}.id`)),a(t.label)||e.push(n("missing_input_label","Input needs a label.",`${c}.label`)),(!t.field||!a(t.field.name))&&e.push(n("missing_input_field","Input needs a field.",`${c}.field`)),t.source&&m(t.source,`${c}.source`,e)}const o=Array.isArray(i.sections)?i.sections:[];o.length===0&&e.push(n("missing_sections","Dashboard intent needs at least one section.","sections"));const _=o.flatMap(d=>d&&typeof d=="object"&&Array.isArray(d.views)?d.views.filter(l).map(t=>t.id).filter(t=>!!t):[]),f=p(_);f&&e.push(n("duplicate_view_id",`Duplicate dashboard view id: ${f}.`,"sections"));for(const[d,t]of o.entries()){const c=`sections.${d}`;if(!t||typeof t!="object"){e.push(n("invalid_section","Dashboard section must be an object.",c));continue}if(a(t.title)||e.push(n("missing_section_title","Dashboard section needs a title.",c)),!Array.isArray(t.views)||t.views.length===0){e.push(n("missing_section_views","Dashboard section needs at least one view.",`${c}.views`));continue}for(const[b,y]of t.views.entries())g(y,`${c}.views.${b}`,e,s)}return{ok:e.length===0,errors:e,warnings:s}}exports.validateSemaphorAnalyticsIntent=h;exports.validateSemaphorDashboardIntent=v;
@@ -0,0 +1,240 @@
1
+ function s(i, e, n) {
2
+ return n ? { code: i, message: e, path: n } : { code: i, message: e };
3
+ }
4
+ function p(i) {
5
+ const e = /* @__PURE__ */ new Set();
6
+ for (const n of i) {
7
+ if (e.has(n))
8
+ return n;
9
+ e.add(n);
10
+ }
11
+ return null;
12
+ }
13
+ function a(i) {
14
+ return typeof i == "string" && i.trim().length > 0;
15
+ }
16
+ function l(i) {
17
+ return !!(i && typeof i == "object" && !Array.isArray(i));
18
+ }
19
+ function m(i, e, n) {
20
+ if (!i || typeof i != "object") {
21
+ n.push(s("missing_source", "Analytics intent needs a source.", e));
22
+ return;
23
+ }
24
+ if (i.kind === "semantic") {
25
+ a(i.domainId) || n.push(
26
+ s(
27
+ "missing_semantic_domain",
28
+ "Semantic source needs a domainId.",
29
+ `${e}.domainId`
30
+ )
31
+ ), a(i.datasetName) || n.push(
32
+ s(
33
+ "missing_dataset_name",
34
+ "Semantic source needs a datasetName.",
35
+ `${e}.datasetName`
36
+ )
37
+ );
38
+ return;
39
+ }
40
+ if (i.kind === "physical") {
41
+ a(i.connectionId) || n.push(
42
+ s(
43
+ "missing_connection_id",
44
+ "Physical source needs a connectionId.",
45
+ `${e}.connectionId`
46
+ )
47
+ ), a(i.tableName) || n.push(
48
+ s(
49
+ "missing_table_name",
50
+ "Physical source needs a tableName.",
51
+ `${e}.tableName`
52
+ )
53
+ );
54
+ return;
55
+ }
56
+ if (i.kind === "sql") {
57
+ a(i.connectionId) || n.push(
58
+ s(
59
+ "missing_connection_id",
60
+ "SQL source needs a connectionId.",
61
+ `${e}.connectionId`
62
+ )
63
+ ), a(i.sql) || n.push(s("missing_sql", "SQL source needs SQL text.", `${e}.sql`));
64
+ return;
65
+ }
66
+ n.push(s("invalid_source_kind", "Source kind is not supported.", e));
67
+ }
68
+ function y(i) {
69
+ var r;
70
+ const e = [], n = [];
71
+ return !i || typeof i != "object" ? {
72
+ ok: !1,
73
+ errors: [
74
+ s(
75
+ "invalid_analytics_intent",
76
+ "Analytics intent must be a structured object."
77
+ )
78
+ ],
79
+ warnings: n
80
+ } : (m(i.source, "source", e), i.kind === "metric" ? a(i.metric) || e.push(
81
+ s("missing_metric", "Metric intent needs a metric.", "metric")
82
+ ) : i.kind === "records" ? (!Array.isArray(i.fields) || i.fields.length === 0) && e.push(
83
+ s(
84
+ "missing_record_fields",
85
+ "Records intent needs at least one field.",
86
+ "fields"
87
+ )
88
+ ) : i.kind === "inputOptions" ? (!i.field || !a(i.field.name)) && e.push(
89
+ s(
90
+ "missing_input_options_field",
91
+ "Input options intent needs a field.",
92
+ "field"
93
+ )
94
+ ) : i.kind === "sql" ? ((r = i.source) == null ? void 0 : r.kind) !== "sql" && e.push(
95
+ s(
96
+ "invalid_sql_source",
97
+ "SQL analytics intent must use a SQL source.",
98
+ "source"
99
+ )
100
+ ) : e.push(
101
+ s("invalid_analytics_kind", "Analytics kind is not supported.", "kind")
102
+ ), { ok: e.length === 0, errors: e, warnings: n });
103
+ }
104
+ function g(i, e, n, r) {
105
+ if (!i || typeof i != "object") {
106
+ n.push(s("invalid_view", "Dashboard view must be an object.", e));
107
+ return;
108
+ }
109
+ if (a(i.title) || n.push(s("missing_view_title", "Dashboard view needs a title.", e)), !i.presentation || typeof i.presentation != "object") {
110
+ n.push(
111
+ s(
112
+ "missing_presentation",
113
+ "Dashboard view needs a presentation.",
114
+ `${e}.presentation`
115
+ )
116
+ );
117
+ return;
118
+ }
119
+ if (i.presentation.kind === "text") {
120
+ a(i.text) || r.push(
121
+ s(
122
+ "missing_text_content",
123
+ "Text views should include text content.",
124
+ `${e}.text`
125
+ )
126
+ );
127
+ return;
128
+ }
129
+ if (!i.analytics) {
130
+ n.push(
131
+ s(
132
+ "missing_view_analytics",
133
+ "Non-text dashboard views need analytics intent.",
134
+ `${e}.analytics`
135
+ )
136
+ );
137
+ return;
138
+ }
139
+ const u = y(i.analytics);
140
+ for (const o of u.errors)
141
+ n.push(
142
+ s(o.code, o.message, `${e}.analytics${o.path ? `.${o.path}` : ""}`)
143
+ );
144
+ for (const o of u.warnings)
145
+ r.push(
146
+ s(
147
+ o.code,
148
+ o.message,
149
+ `${e}.analytics${o.path ? `.${o.path}` : ""}`
150
+ )
151
+ );
152
+ }
153
+ function v(i) {
154
+ const e = [], n = [];
155
+ if (!i || typeof i != "object")
156
+ return {
157
+ ok: !1,
158
+ errors: [
159
+ s(
160
+ "invalid_dashboard_intent",
161
+ "Dashboard intent must be a structured object."
162
+ )
163
+ ],
164
+ warnings: n
165
+ };
166
+ i.version !== 1 && e.push(s("invalid_version", "Dashboard intent version must be 1.")), i.kind !== "dashboard" && e.push(s("invalid_kind", "Experience intent kind must be dashboard.")), a(i.title) || e.push(s("missing_title", "Dashboard intent needs a title.", "title"));
167
+ const r = Array.isArray(i.inputs) ? i.inputs : [], u = p(
168
+ r.filter(l).map((d) => d.id).filter((d) => typeof d == "string")
169
+ );
170
+ u && e.push(
171
+ s(
172
+ "duplicate_input_id",
173
+ `Duplicate input id: ${u}.`,
174
+ "inputs"
175
+ )
176
+ );
177
+ for (const [d, t] of r.entries()) {
178
+ const c = `inputs.${d}`;
179
+ if (!l(t)) {
180
+ e.push(s("invalid_input", "Dashboard input must be an object.", c));
181
+ continue;
182
+ }
183
+ a(t.id) || e.push(s("missing_input_id", "Input needs an id.", `${c}.id`)), a(t.label) || e.push(
184
+ s("missing_input_label", "Input needs a label.", `${c}.label`)
185
+ ), (!t.field || !a(t.field.name)) && e.push(
186
+ s("missing_input_field", "Input needs a field.", `${c}.field`)
187
+ ), t.source && m(t.source, `${c}.source`, e);
188
+ }
189
+ const o = Array.isArray(i.sections) ? i.sections : [];
190
+ o.length === 0 && e.push(
191
+ s(
192
+ "missing_sections",
193
+ "Dashboard intent needs at least one section.",
194
+ "sections"
195
+ )
196
+ );
197
+ const h = o.flatMap(
198
+ (d) => d && typeof d == "object" && Array.isArray(d.views) ? d.views.filter(l).map((t) => t.id).filter((t) => !!t) : []
199
+ ), f = p(h);
200
+ f && e.push(
201
+ s(
202
+ "duplicate_view_id",
203
+ `Duplicate dashboard view id: ${f}.`,
204
+ "sections"
205
+ )
206
+ );
207
+ for (const [d, t] of o.entries()) {
208
+ const c = `sections.${d}`;
209
+ if (!t || typeof t != "object") {
210
+ e.push(
211
+ s("invalid_section", "Dashboard section must be an object.", c)
212
+ );
213
+ continue;
214
+ }
215
+ if (a(t.title) || e.push(
216
+ s("missing_section_title", "Dashboard section needs a title.", c)
217
+ ), !Array.isArray(t.views) || t.views.length === 0) {
218
+ e.push(
219
+ s(
220
+ "missing_section_views",
221
+ "Dashboard section needs at least one view.",
222
+ `${c}.views`
223
+ )
224
+ );
225
+ continue;
226
+ }
227
+ for (const [_, b] of t.views.entries())
228
+ g(
229
+ b,
230
+ `${c}.views.${_}`,
231
+ e,
232
+ n
233
+ );
234
+ }
235
+ return { ok: e.length === 0, errors: e, warnings: n };
236
+ }
237
+ export {
238
+ y as validateSemaphorAnalyticsIntent,
239
+ v as validateSemaphorDashboardIntent
240
+ };
@@ -1 +1 @@
1
- "use strict";const e=require("react/jsx-runtime"),l=require("react"),t=require("./index-CMS4bp9G.js"),i=require("./switch-BXICAlvS.js"),G=require("./chevrons-up-down-Cuilz9aY.js");function W(n={}){var y,P,z,A;const{authToken:d,tokenProps:a}=t.useSemaphorContext(),x=n.enabled??!0,m=(d==null?void 0:d.accessToken)??null,f=(a==null?void 0:a.apiServiceUrl)??null,[L,C]=l.useState(!1),[j,b]=l.useState(!1),[h,g]=l.useState(!1),[N,c]=l.useState(null),[v,S]=l.useState(null),k=v||{tz:((P=(y=a==null?void 0:a.params)==null?void 0:y.calendarContext)==null?void 0:P.tz)||null,weekStart:((A=(z=a==null?void 0:a.params)==null?void 0:z.calendarContext)==null?void 0:A.weekStart)??null},p=l.useCallback(async()=>{if(!(!x||!m||!f)){C(!0),c(null);try{const o=await fetch(`${f}/v1/user-preferences/calendar`,{method:"GET",headers:{Authorization:`Bearer ${m}`}});if(!o.ok){const u=await o.json().catch(()=>({}));throw new Error(u.error||"Failed to fetch preferences")}const r=await o.json();S({tz:r.tz,weekStart:r.weekStart,source:r.source,isInherited:r.isInherited,userHasPrefs:r.userHasPrefs,inherited:r.inherited})}catch(o){const r=o instanceof Error?o.message:"Unknown error";c(r)}finally{C(!1)}}},[m,f,x]);l.useEffect(()=>{x&&p()},[x,p]);const T=l.useCallback(async o=>{if(!m||!f)return c("Not authenticated"),!1;b(!0),c(null);try{const r=await fetch(`${f}/v1/user-preferences/calendar`,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${m}`},body:JSON.stringify(o)});if(!r.ok){const u=await r.json().catch(()=>({}));throw new Error(u.error||"Failed to update preferences")}return await p(),!0}catch(r){const u=r instanceof Error?r.message:"Unknown error";return c(u),!1}finally{b(!1)}},[m,f,p]),w=l.useCallback(async()=>{if(!m||!f)return c("Not authenticated"),!1;g(!0),c(null);try{const o=await fetch(`${f}/v1/user-preferences/calendar`,{method:"DELETE",headers:{Authorization:`Bearer ${m}`}});if(!o.ok){const u=await o.json().catch(()=>({}));throw new Error(u.error||"Failed to clear preferences")}const r=await o.text();if(r)try{const u=JSON.parse(r);return S({tz:u.tz,weekStart:u.weekStart,source:u.source,isInherited:u.isInherited??!0,userHasPrefs:!1,inherited:u.inherited}),!0}catch{}return await p(),!0}catch(o){const r=o instanceof Error?o.message:"Unknown error";return c(r),!1}finally{g(!1)}},[m,f,p]);return{preferences:k,isLoading:L,isSaving:j,isClearing:h,error:N,updatePreferences:T,clearPreferences:w,refetch:p}}const E=[{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"}],M=[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:6,label:"Saturday"}],H="text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";function _(){try{const n=Intl;if(n.supportedValuesOf)return n.supportedValuesOf("timeZone")}catch{}return E.map(n=>n.value)}function q(n){switch(n){case"tenant":return"tenant";case"organization":return"organization";case"system":return"system";default:return"default"}}function O(n){const d=E.find(a=>a.value===n);return d?d.label:n}function V(n){const d=M.find(a=>a.value===n);return d?d.label:String(n)}function Z({open:n,onOpenChange:d}){var D,U,F;const{preferences:a,isLoading:x,isSaving:m,isClearing:f,updatePreferences:L,clearPreferences:C}=W({enabled:n}),j=a.tz||((D=a.inherited)==null?void 0:D.tz)||Intl.DateTimeFormat().resolvedOptions().timeZone,b=a.weekStart??((U=a.inherited)==null?void 0:U.weekStart)??1,[h,g]=l.useState(!a.userHasPrefs),[N,c]=l.useState(!1),[v,S]=l.useState(j),[k,p]=l.useState(b),[T,w]=l.useState(!1),y=l.useMemo(()=>_(),[]),P=l.useMemo(()=>y.filter(s=>!E.some(R=>R.value===s)),[y]),z=l.useMemo(()=>O(v),[v]),A=a.inherited?O(a.inherited.tz):"UTC",o=a.inherited?V(a.inherited.weekStart):"Monday",r=q((F=a.inherited)==null?void 0:F.source);l.useEffect(()=>{if(!n){c(!1);return}N||(a.userHasPrefs!==void 0&&g(!a.userHasPrefs),S(j),p(b))},[n,N,a.userHasPrefs,j,b]);const u=async()=>{if(x){t.ue.error("Preferences are still loading. Please try again.");return}h?await C()?(t.ue.success("Now using default settings. Please refresh the page to apply changes.",{duration:5e3}),d(!1)):t.ue.error("Failed to save preferences. Please try again."):await L({tz:v,weekStart:k})?(t.ue.success("Preferences saved. Please refresh the page to apply changes.",{duration:5e3}),d(!1)):t.ue.error("Failed to save preferences. Please try again.")},$=()=>{d(!1)},I=m||f,B=I||x;return e.jsx(t.Dialog,{open:n,onOpenChange:d,children:e.jsxs(t.DialogContent,{className:"rounded-control border-border/60 sm:max-w-[440px] sm:rounded-control",children:[e.jsxs(t.DialogHeader,{children:[e.jsx(t.DialogTitle,{className:"text-[15px]",children:"Calendar preferences"}),e.jsx(t.DialogDescription,{className:"text-[13px] leading-5",children:"Set your timezone and week-start for date calculations and displays."})]}),e.jsxs("div",{className:"space-y-4 py-1",children:[e.jsxs(t.RadioGroup,{value:h?"defaults":"custom",onValueChange:s=>{c(!0),g(s==="defaults")},className:"space-y-0.5",children:[e.jsxs("label",{htmlFor:"mode-defaults",className:i.cn("flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",h&&"bg-muted/50"),onClick:()=>{c(!0),g(!0)},children:[e.jsx(t.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 ",r," defaults"]}),e.jsxs("p",{className:"text-[12px] text-muted-foreground",children:[A,", week starts ",o]})]})]}),e.jsxs("label",{htmlFor:"mode-custom",className:i.cn("flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",!h&&"bg-muted/50"),onClick:()=>{c(!0),g(!1)},children:[e.jsx(t.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:i.cn("space-y-4 border-t border-border/60 pt-4 transition-opacity",h&&"pointer-events-none opacity-50"),children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(i.Label,{className:H,children:"Timezone"}),e.jsxs(i.Popover,{open:T,onOpenChange:w,modal:!0,children:[e.jsx(i.PopoverTrigger,{asChild:!0,children:e.jsxs(i.Button,{variant:"outline",size:"xs",role:"combobox","aria-expanded":T,className:"w-full justify-between text-[12px] font-normal",disabled:h,children:[e.jsx("span",{className:"truncate",children:z}),e.jsx(G.ChevronsUpDown,{className:"ml-2 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),e.jsx(i.PopoverContent,{className:"z-50 w-[--radix-popover-trigger-width] p-0",align:"start",children:e.jsxs(t.Command,{className:"overflow-visible",children:[e.jsx(t.CommandInput,{placeholder:"Search timezones…"}),e.jsxs(t.CommandList,{children:[e.jsx(t.CommandEmpty,{children:"No timezone found."}),e.jsx(t.CommandGroup,{heading:"Common",children:E.map(s=>e.jsxs(t.CommandItem,{value:`${s.value} ${s.label}`,onSelect:()=>{c(!0),S(s.value),w(!1)},children:[e.jsx(i.Check,{className:i.cn("h-3.5 w-3.5",v===s.value?"opacity-100":"opacity-0")}),e.jsx("span",{className:"flex-1",children:s.label}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:s.value})]},s.value))}),e.jsx(t.CommandSeparator,{}),e.jsx(t.CommandGroup,{heading:"All timezones",children:P.map(s=>e.jsxs(t.CommandItem,{value:s,onSelect:()=>{c(!0),S(s),w(!1)},children:[e.jsx(i.Check,{className:i.cn("h-3.5 w-3.5",v===s?"opacity-100":"opacity-0")}),s]},s))})]})]})})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(i.Label,{className:H,children:"Week starts on"}),e.jsx(t.RadioGroup,{value:String(k),onValueChange:s=>{c(!0),p(Number(s))},className:"flex gap-4",disabled:h,children:M.map(s=>e.jsxs("label",{htmlFor:`week-start-${s.value}`,className:i.cn("flex cursor-pointer items-center gap-2 text-[13px]",h&&"cursor-not-allowed"),children:[e.jsx(t.RadioGroupItem,{value:String(s.value),id:`week-start-${s.value}`,disabled:h}),s.label]},s.value))})]})]})]}),e.jsxs(t.DialogFooter,{children:[e.jsx(i.Button,{variant:"outline",size:"xs",onClick:$,disabled:I,children:"Cancel"}),e.jsx(i.Button,{size:"xs",onClick:u,disabled:B,children:I?e.jsxs(e.Fragment,{children:[e.jsx(i.LoaderCircle,{className:"h-3.5 w-3.5 animate-spin"}),"Saving…"]}):"Save"})]})]})})}exports.CalendarPreferencesDialog=Z;
1
+ "use strict";const e=require("react/jsx-runtime"),l=require("react"),t=require("./index-YTk9Hab2.js"),i=require("./switch-BXICAlvS.js"),G=require("./chevrons-up-down-Cuilz9aY.js");function W(n={}){var y,P,z,A;const{authToken:d,tokenProps:a}=t.useSemaphorContext(),x=n.enabled??!0,m=(d==null?void 0:d.accessToken)??null,f=(a==null?void 0:a.apiServiceUrl)??null,[L,C]=l.useState(!1),[j,b]=l.useState(!1),[h,g]=l.useState(!1),[N,c]=l.useState(null),[v,S]=l.useState(null),k=v||{tz:((P=(y=a==null?void 0:a.params)==null?void 0:y.calendarContext)==null?void 0:P.tz)||null,weekStart:((A=(z=a==null?void 0:a.params)==null?void 0:z.calendarContext)==null?void 0:A.weekStart)??null},p=l.useCallback(async()=>{if(!(!x||!m||!f)){C(!0),c(null);try{const o=await fetch(`${f}/v1/user-preferences/calendar`,{method:"GET",headers:{Authorization:`Bearer ${m}`}});if(!o.ok){const u=await o.json().catch(()=>({}));throw new Error(u.error||"Failed to fetch preferences")}const r=await o.json();S({tz:r.tz,weekStart:r.weekStart,source:r.source,isInherited:r.isInherited,userHasPrefs:r.userHasPrefs,inherited:r.inherited})}catch(o){const r=o instanceof Error?o.message:"Unknown error";c(r)}finally{C(!1)}}},[m,f,x]);l.useEffect(()=>{x&&p()},[x,p]);const T=l.useCallback(async o=>{if(!m||!f)return c("Not authenticated"),!1;b(!0),c(null);try{const r=await fetch(`${f}/v1/user-preferences/calendar`,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${m}`},body:JSON.stringify(o)});if(!r.ok){const u=await r.json().catch(()=>({}));throw new Error(u.error||"Failed to update preferences")}return await p(),!0}catch(r){const u=r instanceof Error?r.message:"Unknown error";return c(u),!1}finally{b(!1)}},[m,f,p]),w=l.useCallback(async()=>{if(!m||!f)return c("Not authenticated"),!1;g(!0),c(null);try{const o=await fetch(`${f}/v1/user-preferences/calendar`,{method:"DELETE",headers:{Authorization:`Bearer ${m}`}});if(!o.ok){const u=await o.json().catch(()=>({}));throw new Error(u.error||"Failed to clear preferences")}const r=await o.text();if(r)try{const u=JSON.parse(r);return S({tz:u.tz,weekStart:u.weekStart,source:u.source,isInherited:u.isInherited??!0,userHasPrefs:!1,inherited:u.inherited}),!0}catch{}return await p(),!0}catch(o){const r=o instanceof Error?o.message:"Unknown error";return c(r),!1}finally{g(!1)}},[m,f,p]);return{preferences:k,isLoading:L,isSaving:j,isClearing:h,error:N,updatePreferences:T,clearPreferences:w,refetch:p}}const E=[{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"}],M=[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:6,label:"Saturday"}],H="text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";function _(){try{const n=Intl;if(n.supportedValuesOf)return n.supportedValuesOf("timeZone")}catch{}return E.map(n=>n.value)}function q(n){switch(n){case"tenant":return"tenant";case"organization":return"organization";case"system":return"system";default:return"default"}}function O(n){const d=E.find(a=>a.value===n);return d?d.label:n}function V(n){const d=M.find(a=>a.value===n);return d?d.label:String(n)}function Z({open:n,onOpenChange:d}){var D,U,F;const{preferences:a,isLoading:x,isSaving:m,isClearing:f,updatePreferences:L,clearPreferences:C}=W({enabled:n}),j=a.tz||((D=a.inherited)==null?void 0:D.tz)||Intl.DateTimeFormat().resolvedOptions().timeZone,b=a.weekStart??((U=a.inherited)==null?void 0:U.weekStart)??1,[h,g]=l.useState(!a.userHasPrefs),[N,c]=l.useState(!1),[v,S]=l.useState(j),[k,p]=l.useState(b),[T,w]=l.useState(!1),y=l.useMemo(()=>_(),[]),P=l.useMemo(()=>y.filter(s=>!E.some(R=>R.value===s)),[y]),z=l.useMemo(()=>O(v),[v]),A=a.inherited?O(a.inherited.tz):"UTC",o=a.inherited?V(a.inherited.weekStart):"Monday",r=q((F=a.inherited)==null?void 0:F.source);l.useEffect(()=>{if(!n){c(!1);return}N||(a.userHasPrefs!==void 0&&g(!a.userHasPrefs),S(j),p(b))},[n,N,a.userHasPrefs,j,b]);const u=async()=>{if(x){t.ue.error("Preferences are still loading. Please try again.");return}h?await C()?(t.ue.success("Now using default settings. Please refresh the page to apply changes.",{duration:5e3}),d(!1)):t.ue.error("Failed to save preferences. Please try again."):await L({tz:v,weekStart:k})?(t.ue.success("Preferences saved. Please refresh the page to apply changes.",{duration:5e3}),d(!1)):t.ue.error("Failed to save preferences. Please try again.")},$=()=>{d(!1)},I=m||f,B=I||x;return e.jsx(t.Dialog,{open:n,onOpenChange:d,children:e.jsxs(t.DialogContent,{className:"rounded-control border-border/60 sm:max-w-[440px] sm:rounded-control",children:[e.jsxs(t.DialogHeader,{children:[e.jsx(t.DialogTitle,{className:"text-[15px]",children:"Calendar preferences"}),e.jsx(t.DialogDescription,{className:"text-[13px] leading-5",children:"Set your timezone and week-start for date calculations and displays."})]}),e.jsxs("div",{className:"space-y-4 py-1",children:[e.jsxs(t.RadioGroup,{value:h?"defaults":"custom",onValueChange:s=>{c(!0),g(s==="defaults")},className:"space-y-0.5",children:[e.jsxs("label",{htmlFor:"mode-defaults",className:i.cn("flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",h&&"bg-muted/50"),onClick:()=>{c(!0),g(!0)},children:[e.jsx(t.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 ",r," defaults"]}),e.jsxs("p",{className:"text-[12px] text-muted-foreground",children:[A,", week starts ",o]})]})]}),e.jsxs("label",{htmlFor:"mode-custom",className:i.cn("flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",!h&&"bg-muted/50"),onClick:()=>{c(!0),g(!1)},children:[e.jsx(t.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:i.cn("space-y-4 border-t border-border/60 pt-4 transition-opacity",h&&"pointer-events-none opacity-50"),children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(i.Label,{className:H,children:"Timezone"}),e.jsxs(i.Popover,{open:T,onOpenChange:w,modal:!0,children:[e.jsx(i.PopoverTrigger,{asChild:!0,children:e.jsxs(i.Button,{variant:"outline",size:"xs",role:"combobox","aria-expanded":T,className:"w-full justify-between text-[12px] font-normal",disabled:h,children:[e.jsx("span",{className:"truncate",children:z}),e.jsx(G.ChevronsUpDown,{className:"ml-2 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),e.jsx(i.PopoverContent,{className:"z-50 w-[--radix-popover-trigger-width] p-0",align:"start",children:e.jsxs(t.Command,{className:"overflow-visible",children:[e.jsx(t.CommandInput,{placeholder:"Search timezones…"}),e.jsxs(t.CommandList,{children:[e.jsx(t.CommandEmpty,{children:"No timezone found."}),e.jsx(t.CommandGroup,{heading:"Common",children:E.map(s=>e.jsxs(t.CommandItem,{value:`${s.value} ${s.label}`,onSelect:()=>{c(!0),S(s.value),w(!1)},children:[e.jsx(i.Check,{className:i.cn("h-3.5 w-3.5",v===s.value?"opacity-100":"opacity-0")}),e.jsx("span",{className:"flex-1",children:s.label}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:s.value})]},s.value))}),e.jsx(t.CommandSeparator,{}),e.jsx(t.CommandGroup,{heading:"All timezones",children:P.map(s=>e.jsxs(t.CommandItem,{value:s,onSelect:()=>{c(!0),S(s),w(!1)},children:[e.jsx(i.Check,{className:i.cn("h-3.5 w-3.5",v===s?"opacity-100":"opacity-0")}),s]},s))})]})]})})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(i.Label,{className:H,children:"Week starts on"}),e.jsx(t.RadioGroup,{value:String(k),onValueChange:s=>{c(!0),p(Number(s))},className:"flex gap-4",disabled:h,children:M.map(s=>e.jsxs("label",{htmlFor:`week-start-${s.value}`,className:i.cn("flex cursor-pointer items-center gap-2 text-[13px]",h&&"cursor-not-allowed"),children:[e.jsx(t.RadioGroupItem,{value:String(s.value),id:`week-start-${s.value}`,disabled:h}),s.label]},s.value))})]})]})]}),e.jsxs(t.DialogFooter,{children:[e.jsx(i.Button,{variant:"outline",size:"xs",onClick:$,disabled:I,children:"Cancel"}),e.jsx(i.Button,{size:"xs",onClick:u,disabled:B,children:I?e.jsxs(e.Fragment,{children:[e.jsx(i.LoaderCircle,{className:"h-3.5 w-3.5 animate-spin"}),"Saving…"]}):"Save"})]})]})})}exports.CalendarPreferencesDialog=Z;
@@ -1,6 +1,6 @@
1
1
  import { jsx as r, jsxs as s, Fragment as X } from "react/jsx-runtime";
2
2
  import ee, { useState as h, useCallback as F, useEffect as ae, useMemo as H } from "react";
3
- import { u as re, b as te, c as se, d as ne, e as le, f as oe, R as W, g as O, C as ie, h as ce, i as de, j as ue, k as _, l as R, m as me, n as fe, o as N } from "./index-PTx7430W.js";
3
+ import { u as re, b as te, c as se, d as ne, e as le, f as oe, R as W, g as O, C as ie, h as ce, i as de, j as ue, k as _, l as R, m as me, n as fe, o as N } from "./index-CffvIaZO.js";
4
4
  import { a as S, L as G, P as he, b as pe, B as j, d as ge, e as V, f as ve } from "./switch-Deo2Ltmj.js";
5
5
  import { C as be } from "./chevrons-up-down-CA-XvN1o.js";
6
6
  function we(n = {}) {
@@ -1,9 +1,9 @@
1
1
  import { jsx as t, jsxs as s, Fragment as ae } from "react/jsx-runtime";
2
2
  import { c as Ie, L as yn, a1 as ao, B as pe, f as ne, G as ct, u as H, E as bt, aJ as Dr, a9 as ha, g as Ke, e as He, H as pa, a as v, S as Tn, X as Ce, P as Fe, b as Ze, d as Xe, aK as so, aL as oo, aH as fa, aM as ga, a2 as Ge, a3 as Je, a4 as Qe, a5 as Ye, a6 as ue, Q as io, aN as ba, aO as xa, $ as je, T as lo, J as co, K as Tr, aP as uo } from "./switch-Deo2Ltmj.js";
3
- import { b as ut, c as mt, d as ht, e as pt, f as ft, bb as mo, n as ya, af as ho, ag as po, au as va, bO as fo, o as he, av as vn, x as go, aM as Ln, aN as Rn, aP as Fn, aQ as ze, aU as Na, aH as Kt, bP as bo, bQ as xo, a$ as Pn, b0 as Mn, b1 as Bn, b2 as On, b3 as Vn, b4 as $n, b5 as Un, u as Dt, _ as ot, a9 as _n, a5 as wa, a6 as jn, $ as Ca, a4 as yo, ab as vo, bJ as No, bR as wo, aJ as Co, a7 as Lr, w as Vt, a1 as ko, bS as So, bT as Eo, bU as Ao, bV as Io, bW as Do, bX as To, bY as Lo, bZ as Ro, b_ as ka, b$ as Fo, c0 as Po, c1 as Sa, c2 as Mo, c3 as Bo, c4 as gt, c5 as Oo, bI as Ea, aw as Aa, c6 as Vo, c7 as $o, c8 as Uo, c9 as _o, ca as jo, cb as zo, cc as Ko, cd as Ia, ce as Ho, cf as qo, cg as Da, ch as Ta, ci as La, cj as Wo, ck as Go, b8 as Ra, bx as Jo, bu as Qo, cl as Yo, aV as Zo, cm as Fa, cn as Xo, co as ei, aW as Rr, cp as ti, cq as ni, cr as Nn, cs as ri, ct as ai, cu as Pa, cv as zn, cw as si, cx as oi, cy as ii, cz as Ma, cA as Tt, cB as Ba, ay as wn, b6 as Oa, cC as li, cD as di, ax as Cn, cE as Va, cF as ci, cG as ui, cH as mi, cI as hi, cJ as pi, cK as fi, cL as gi, cM as bi } from "./index-PTx7430W.js";
4
- import { V as xi, E as Fr, a as Pr, b as yi, c as vi, L as Ni, d as wi, C as Ci, u as $a, e as Ua, f as ki, R as Si, S as Ei } from "./use-create-flow-overlay-state-B65gg2oB.js";
3
+ import { b as ut, c as mt, d as ht, e as pt, f as ft, bb as mo, n as ya, af as ho, ag as po, au as va, bO as fo, o as he, av as vn, x as go, aM as Ln, aN as Rn, aP as Fn, aQ as ze, aU as Na, aH as Kt, bP as bo, bQ as xo, a$ as Pn, b0 as Mn, b1 as Bn, b2 as On, b3 as Vn, b4 as $n, b5 as Un, u as Dt, _ as ot, a9 as _n, a5 as wa, a6 as jn, $ as Ca, a4 as yo, ab as vo, bJ as No, bR as wo, aJ as Co, a7 as Lr, w as Vt, a1 as ko, bS as So, bT as Eo, bU as Ao, bV as Io, bW as Do, bX as To, bY as Lo, bZ as Ro, b_ as ka, b$ as Fo, c0 as Po, c1 as Sa, c2 as Mo, c3 as Bo, c4 as gt, c5 as Oo, bI as Ea, aw as Aa, c6 as Vo, c7 as $o, c8 as Uo, c9 as _o, ca as jo, cb as zo, cc as Ko, cd as Ia, ce as Ho, cf as qo, cg as Da, ch as Ta, ci as La, cj as Wo, ck as Go, b8 as Ra, bx as Jo, bu as Qo, cl as Yo, aV as Zo, cm as Fa, cn as Xo, co as ei, aW as Rr, cp as ti, cq as ni, cr as Nn, cs as ri, ct as ai, cu as Pa, cv as zn, cw as si, cx as oi, cy as ii, cz as Ma, cA as Tt, cB as Ba, ay as wn, b6 as Oa, cC as li, cD as di, ax as Cn, cE as Va, cF as ci, cG as ui, cH as mi, cI as hi, cJ as pi, cK as fi, cL as gi, cM as bi } from "./index-CffvIaZO.js";
4
+ import { V as xi, E as Fr, a as Pr, b as yi, c as vi, L as Ni, d as wi, C as Ci, u as $a, e as Ua, f as ki, R as Si, S as Ei } from "./use-create-flow-overlay-state-DsPoCfMu.js";
5
5
  import Ai, { useState as S, useContext as Ii, useRef as Ae, useCallback as me, useEffect as ce, useMemo as V } from "react";
6
- import { u as _a } from "./use-visual-utils-Diuguy3D.js";
6
+ import { u as _a } from "./use-visual-utils-BdO22fQZ.js";
7
7
  import { k as Mr } from "./date-formatter-DyIOb6uC.js";
8
8
  import "./index-CJdxSyQq.js";
9
9
  import "react-dom";
@@ -1,4 +1,4 @@
1
- "use strict";const e=require("react/jsx-runtime"),a=require("./switch-BXICAlvS.js"),l=require("./index-CMS4bp9G.js"),oe=require("./use-create-flow-overlay-state-CmxTpqeg.js"),h=require("react"),xn=require("./use-visual-utils-51Nsy8cj.js"),Bs=require("./date-formatter-D9Bvw5Qk.js");require("./index-DRlMUglg.js");require("react-dom");/**
1
+ "use strict";const e=require("react/jsx-runtime"),a=require("./switch-BXICAlvS.js"),l=require("./index-YTk9Hab2.js"),oe=require("./use-create-flow-overlay-state-DocFanjO.js"),h=require("react"),xn=require("./use-visual-utils-DSbXQQD1.js"),Bs=require("./date-formatter-D9Bvw5Qk.js");require("./index-DRlMUglg.js");require("react-dom");/**
2
2
  * @license lucide-react v0.453.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("./switch-BXICAlvS.js"),s=require("./index-CMS4bp9G.js"),v=require("react");require("./index-DRlMUglg.js");const Zt=require("react-dom"),O=require("./dashboard-briefing-launcher-COLpvReF.js"),xt=require("./index-D7KJindZ.js"),es=require("./calendar-preferences-dialog-CLXaVo3h.js"),ts=require("./use-debounced-dirty-check-XHSwAefL.js"),Re=require("./normalize-dashboard-for-dirty-check-BXRUMVb2.js"),ct=require("./save-CqrBQKG6.js"),ss=require("./palette-CanPG11m.js"),rs=require("./braces-C7BeIXvM.js");function ns(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(a,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return a.default=t,Object.freeze(a)}const E=ns(v);/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("./switch-BXICAlvS.js"),s=require("./index-YTk9Hab2.js"),v=require("react");require("./index-DRlMUglg.js");const Zt=require("react-dom"),O=require("./dashboard-briefing-launcher-DZiFMK8I.js"),xt=require("./index-D7KJindZ.js"),es=require("./calendar-preferences-dialog-BxeROxyq.js"),ts=require("./use-debounced-dirty-check-XHSwAefL.js"),Re=require("./normalize-dashboard-for-dirty-check-BXRUMVb2.js"),ct=require("./save-CqrBQKG6.js"),ss=require("./palette-CanPG11m.js"),rs=require("./braces-C7BeIXvM.js");function ns(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(a,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return a.default=t,Object.freeze(a)}const E=ns(v);/**
2
2
  * @license lucide-react v0.453.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,13 +1,13 @@
1
1
  import { jsx as t, jsxs as i, Fragment as R } from "react/jsx-runtime";
2
2
  import { c as K, u as N, B as _, az as dt, E as Vt, L as Hr, a1 as jr, a as te, aA as qr, aB as Vr, aC as rt, aD as me, aE as ct, aF as Kt, f as $e, X as Qt, aG as Wt, aH as Kr, G as Rt, Y as Qr, Z as Wr, _ as Jr, a0 as Yr, j as Xr, aI as Zr } from "./switch-Deo2Ltmj.js";
3
- import { bf as ea, u as G, b as Jt, bg as ta, aH as re, c as Yt, d as ra, e as at, f as nt, n as aa, bh as ue, aU as Fe, bi as na, bj as Ut, bk as Xt, bl as Zt, bm as sa, b8 as lt, bn as oa, bo as ia, bp as da, bq as ca, br as la, bs as ua, ad as pe, bt as fe, o as k, bu as ma, bv as er, ay as ut, bd as pa, bw as fa, bx as ha, by as tr, aT as rr, aW as ar, ax as ga, aL as ba, bz as xa, bA as va, y as ya, x as Ue, J as wa, z as Ye, bB as Na, bC as Sa, bD as Da, Z as Ca, bE as ka, I as Xe, bF as Ea, bG as La, bH as Ia, bI as Aa, aM as Ma, aN as Pa, aO as Oa, aP as _a, aQ as $, bJ as Ra, aR as Tt, bK as Ua, bL as Ta, bM as Fa, H as $a, bN as Ga, a$ as Ba, b0 as za, b1 as Ha, b2 as ja, b3 as qa, b4 as Va, b5 as Ka, b6 as Ft, v as st } from "./index-PTx7430W.js";
3
+ import { bf as ea, u as G, b as Jt, bg as ta, aH as re, c as Yt, d as ra, e as at, f as nt, n as aa, bh as ue, aU as Fe, bi as na, bj as Ut, bk as Xt, bl as Zt, bm as sa, b8 as lt, bn as oa, bo as ia, bp as da, bq as ca, br as la, bs as ua, ad as pe, bt as fe, o as k, bu as ma, bv as er, ay as ut, bd as pa, bw as fa, bx as ha, by as tr, aT as rr, aW as ar, ax as ga, aL as ba, bz as xa, bA as va, y as ya, x as Ue, J as wa, z as Ye, bB as Na, bC as Sa, bD as Da, Z as Ca, bE as ka, I as Xe, bF as Ea, bG as La, bH as Ia, bI as Aa, aM as Ma, aN as Pa, aO as Oa, aP as _a, aQ as $, bJ as Ra, aR as Tt, bK as Ua, bL as Ta, bM as Fa, H as $a, bN as Ga, a$ as Ba, b0 as za, b1 as Ha, b2 as ja, b3 as qa, b4 as Va, b5 as Ka, b6 as Ft, v as st } from "./index-CffvIaZO.js";
4
4
  import * as I from "react";
5
5
  import nr, { useState as w, useMemo as V, useEffect as Ge, useRef as $t, useLayoutEffect as Qa, useCallback as Wa } from "react";
6
6
  import "./index-CJdxSyQq.js";
7
7
  import { createPortal as Ja } from "react-dom";
8
- import { L as Ya, b as Xa, u as Za, A as en, V as tn, K as rn, e as an, M as nn, N as sn, U as on } from "./dashboard-briefing-launcher-CUEn7cr6.js";
8
+ import { L as Ya, b as Xa, u as Za, A as en, V as tn, K as rn, e as an, M as nn, N as sn, U as on } from "./dashboard-briefing-launcher-BzIxRlzW.js";
9
9
  import { d as sr } from "./index-DFOb_6HB.js";
10
- import { C as dn } from "./calendar-preferences-dialog-B9Hz3pTH.js";
10
+ import { C as dn } from "./calendar-preferences-dialog-DHhT6Sja.js";
11
11
  import { u as cn } from "./use-debounced-dirty-check-BwAbnX_5.js";
12
12
  import { s as Ze } from "./normalize-dashboard-for-dirty-check-5KpZN8xr.js";
13
13
  import { S as Gt } from "./save-DxkSzUTZ.js";
@@ -1,7 +1,7 @@
1
1
  import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
2
  import { useMemo as m, useState as b, useRef as f, useEffect as S } from "react";
3
3
  import { u as o, a as N, B as p, X as D, C as J } from "./switch-Deo2Ltmj.js";
4
- import "./index-PTx7430W.js";
4
+ import "./index-CffvIaZO.js";
5
5
  import "./index-CJdxSyQq.js";
6
6
  import "react-dom";
7
7
  function C() {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),o=require("react"),s=require("./switch-BXICAlvS.js");require("./index-CMS4bp9G.js");require("./index-DRlMUglg.js");require("react-dom");function b(){const t=s.useDashboardStore(e=>e.dashboard),c=s.useDashboardStore(e=>e.actions.setDashboard),u=s.useDashboardStore(e=>e.showDashboardJSON),h=s.useDashboardStore(e=>e.actions.setShowDashboardJSON),a=o.useMemo(()=>t?JSON.stringify(t,null,2):"",[t]),[l,d]=o.useState(a),n=o.useRef(a);return o.useEffect(()=>{a!==n.current&&(d(a),n.current=a)},[a]),r.jsxs("div",{className:s.cn("relative p-2",{hidden:!u}),children:[r.jsxs(s.Button,{variant:"secondary",size:"sm",className:"absolute right-2 top-2 z-10 h-8",onClick:()=>h(!1),children:[r.jsx(s.X,{className:"mr-2 h-4 w-4"}),"Close"]}),r.jsx("div",{className:"h-[550px] overflow-hidden",children:r.jsx(s.CodeEditor,{value:l,onValueChange:e=>{d(e);try{const i=JSON.parse(e);n.current=JSON.stringify(i,null,2),c(i)}catch{}},language:"json"})})]})}exports.default=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),o=require("react"),s=require("./switch-BXICAlvS.js");require("./index-YTk9Hab2.js");require("./index-DRlMUglg.js");require("react-dom");function b(){const t=s.useDashboardStore(e=>e.dashboard),c=s.useDashboardStore(e=>e.actions.setDashboard),u=s.useDashboardStore(e=>e.showDashboardJSON),h=s.useDashboardStore(e=>e.actions.setShowDashboardJSON),a=o.useMemo(()=>t?JSON.stringify(t,null,2):"",[t]),[l,d]=o.useState(a),n=o.useRef(a);return o.useEffect(()=>{a!==n.current&&(d(a),n.current=a)},[a]),r.jsxs("div",{className:s.cn("relative p-2",{hidden:!u}),children:[r.jsxs(s.Button,{variant:"secondary",size:"sm",className:"absolute right-2 top-2 z-10 h-8",onClick:()=>h(!1),children:[r.jsx(s.X,{className:"mr-2 h-4 w-4"}),"Close"]}),r.jsx("div",{className:"h-[550px] overflow-hidden",children:r.jsx(s.CodeEditor,{value:l,onValueChange:e=>{d(e);try{const i=JSON.parse(e);n.current=JSON.stringify(i,null,2),c(i)}catch{}},language:"json"})})]})}exports.default=b;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),N=require("react"),n=require("./index-CMS4bp9G.js"),t=require("./switch-BXICAlvS.js"),Ne=require("./use-create-flow-overlay-state-CmxTpqeg.js"),ft=require("./use-visual-utils-51Nsy8cj.js"),Fn=require("./chevrons-up-down-Cuilz9aY.js"),Sa=require("react-dom");require("./index-DRlMUglg.js");const wa=require("./palette-CanPG11m.js"),Ta=require("./common-types-C73-Ud1-.js");function Ea(s){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const r in s)if(r!=="default"){const l=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(a,r,l.get?l:{enumerable:!0,get:()=>s[r]})}}return a.default=s,Object.freeze(a)}const Ia=Ea(N);/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),N=require("react"),n=require("./index-YTk9Hab2.js"),t=require("./switch-BXICAlvS.js"),Ne=require("./use-create-flow-overlay-state-DocFanjO.js"),ft=require("./use-visual-utils-DSbXQQD1.js"),Fn=require("./chevrons-up-down-Cuilz9aY.js"),Sa=require("react-dom");require("./index-DRlMUglg.js");const wa=require("./palette-CanPG11m.js"),Ta=require("./common-types-C73-Ud1-.js");function Ea(s){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const r in s)if(r!=="default"){const l=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(a,r,l.get?l:{enumerable:!0,get:()=>s[r]})}}return a.default=s,Object.freeze(a)}const Ia=Ea(N);/**
2
2
  * @license lucide-react v0.453.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,10 +1,10 @@
1
1
  import { jsx as e, jsxs as a, Fragment as De } from "react/jsx-runtime";
2
2
  import * as lc from "react";
3
3
  import Jt, { useState as K, useEffect as Se, useRef as Ee, useCallback as Ie, useMemo as ce, useContext as pr, Suspense as ic } from "react";
4
- import { cN as gi, b as Ia, c as Da, d as Ea, e as Aa, f as Qa, n as ns, ar as nt, aw as vt, cO as xi, cP as Xn, o as st, cQ as bi, aH as yt, cR as fr, cS as vi, cT as yi, cU as Ni, cV as gr, cW as xr, ay as us, as as bt, cX as ss, c1 as br, cY as oc, c4 as rs, cZ as Ci, c_ as cc, ad as ms, c$ as dc, d0 as uc, d1 as sr, d2 as Zn, u as La, y as wi, d3 as mc, d4 as hc, d5 as Si, d6 as Ti, d7 as pc, d8 as fc, d9 as gc, al as Pa, am as pa, an as fa, ao as Vn, ap as Yt, aq as Ga, da as rr, bF as wn, db as ki, dc as ea, dd as pt, de as xc, b_ as ca, cE as Ii, df as vr, dg as Di, dh as bc, di as vc, dj as yc, dk as Nc, dl as Cc, dm as wc, dn as Sc, dp as Ei, dq as Tc, dr as Rs, ds as kc, dt as kl, du as Ic, dv as Il, dw as Dc, dx as Ec, dy as Ac, dz as Ha, aC as Gt, aE as Ht, dA as Ai, dB as yr, b8 as Nr, bP as Cr, dC as wr, dD as Oc, dE as Oi, dF as Fi, dG as Kt, dH as Fc, dI as Mc, dJ as Mi, V as Ri, dK as Li, dL as Rc, dM as Lc, dN as Pc, dO as kn, dP as Vc, dQ as Bc, dR as Dl, dS as _c, E as hs, s as Sr, dT as zc, dU as Tr, bg as $c, dV as El, I as ft, dW as qc, dX as jc, dY as Pi, dZ as Vi, bG as Kc, d_ as kr, d$ as Ir, bd as ps, e0 as Bi, e1 as _i, e2 as Al, e3 as Bn, e4 as Uc, e5 as Gc, e6 as Hc, e7 as Wc, e8 as Qc, aZ as Dr, e9 as Jc, ea as Yc, eb as zi, ec as $i, ed as Xc, ee as Zc, ef as ed, eg as td, eh as qi, ei as ad, ej as nd, ek as fs, el as gs, aM as tn, aN as an, aP as nn, bh as In, aU as Ut, em as sa, en as Oa, eo as Fa, ep as da, eq as Ja, er as sd, es as rd, et as ld, eu as id, ev as od, ew as cd, ex as dd, cm as xs, ey as ud, ez as Ol, aD as Xt, ax as Zt, eA as md, eB as hd, eC as pd, eD as fd, eE as ji, eF as gd, eG as xd, eH as bd, eI as vd, eJ as yd, eK as lr, eL as Nd, eM as Cd, eN as ir, eO as or, eP as wd, eQ as Sd, eR as Td, eS as kd, eT as Fl, bQ as cr, eU as ua, a$ as Id, eV as Dd, b0 as Ed, b1 as Ad, b2 as Od, b3 as Fd, b4 as Md, b5 as Rd, b6 as Ld, aQ as ut, aL as Pd, eW as Vd, eX as Ya, eY as Xa, eZ as Za, aO as Er, bJ as Bd, aR as _d, e_ as zd, e$ as $d, f0 as qd, f1 as bs, f2 as lt, f3 as it, f4 as ot, cC as jd, cD as Kd, f5 as Ki, f6 as Ui, cz as Ud, bI as Gi, f7 as Gd, f8 as Hd, f9 as Wd, fa as Qd, fb as Jd, fc as Yd, fd as Xd, fe as Zd, ff as eu, fg as tu, fh as au, fi as nu, fj as Ca, fk as vn, fl as Wa, R as vs, g as Ma, fm as su, fn as Ml, fo as ru, fp as lu, fq as Ls, fr as Rl, fs as iu, ft as ou, fu as cu, fv as du, fw as uu, fx as Ps, fy as Hi, fz as mu, fA as ls, fB as hu, fC as Wi, fD as pu, fE as Qi, ci as fu, fF as gu, a2 as xu, fG as Wn, fH as bu, fI as Ll, fJ as vu, fK as yu, fL as Pl, fM as Nu, fN as Cu, fO as wu, fP as Su, fQ as Tu, fR as ku, fS as Iu, cy as Du, cA as Eu, fT as Ji, fU as Au, fV as Ou, fW as Fu, fX as Mu, fY as Ru, fZ as Lu, f_ as Pu, f$ as Vu, g0 as Bu, g1 as Yi, g2 as _u, g3 as ys, g4 as Ns, g5 as Xi, g6 as zu, g7 as $u, g8 as Zi, g9 as qu, ga as ju, gb as Cs, gc as Vs, gd as Ku, ge as Uu, gf as Gu, gg as Hu, gh as Wu, gi as Vl, gj as en, gk as eo, cB as Qu, gl as to, gm as ao, gn as es, go as no, gp as so, gq as Bl, gr as Ju, gs as Yu, gt as ts, gu as Xu, gv as Ar, cx as Zu, gw as em, gx as is, C as Dn, h as En, j as An, i as On, k as Fn, l as Mn, gy as tm, gz as Rn, gA as ra, gB as dr, gC as ur, gD as Ln, gE as ro, gF as am, gG as Bs, gH as _s, gI as nm, gJ as zs, gK as sm, gL as _l, gM as zl, cH as rm, gN as lm, cI as im, cK as om, cL as cm, x as dm, gO as um, gP as mm, gQ as hm, bK as pm, bL as fm, bM as gm, aW as ws, cv as Ss, gR as $l, gS as lo, c6 as $s, gT as xm, gU as bm, gV as vm, F as ym, au as Nm, gW as Cm, gX as wm, av as Sm } from "./index-PTx7430W.js";
4
+ import { cN as gi, b as Ia, c as Da, d as Ea, e as Aa, f as Qa, n as ns, ar as nt, aw as vt, cO as xi, cP as Xn, o as st, cQ as bi, aH as yt, cR as fr, cS as vi, cT as yi, cU as Ni, cV as gr, cW as xr, ay as us, as as bt, cX as ss, c1 as br, cY as oc, c4 as rs, cZ as Ci, c_ as cc, ad as ms, c$ as dc, d0 as uc, d1 as sr, d2 as Zn, u as La, y as wi, d3 as mc, d4 as hc, d5 as Si, d6 as Ti, d7 as pc, d8 as fc, d9 as gc, al as Pa, am as pa, an as fa, ao as Vn, ap as Yt, aq as Ga, da as rr, bF as wn, db as ki, dc as ea, dd as pt, de as xc, b_ as ca, cE as Ii, df as vr, dg as Di, dh as bc, di as vc, dj as yc, dk as Nc, dl as Cc, dm as wc, dn as Sc, dp as Ei, dq as Tc, dr as Rs, ds as kc, dt as kl, du as Ic, dv as Il, dw as Dc, dx as Ec, dy as Ac, dz as Ha, aC as Gt, aE as Ht, dA as Ai, dB as yr, b8 as Nr, bP as Cr, dC as wr, dD as Oc, dE as Oi, dF as Fi, dG as Kt, dH as Fc, dI as Mc, dJ as Mi, V as Ri, dK as Li, dL as Rc, dM as Lc, dN as Pc, dO as kn, dP as Vc, dQ as Bc, dR as Dl, dS as _c, E as hs, s as Sr, dT as zc, dU as Tr, bg as $c, dV as El, I as ft, dW as qc, dX as jc, dY as Pi, dZ as Vi, bG as Kc, d_ as kr, d$ as Ir, bd as ps, e0 as Bi, e1 as _i, e2 as Al, e3 as Bn, e4 as Uc, e5 as Gc, e6 as Hc, e7 as Wc, e8 as Qc, aZ as Dr, e9 as Jc, ea as Yc, eb as zi, ec as $i, ed as Xc, ee as Zc, ef as ed, eg as td, eh as qi, ei as ad, ej as nd, ek as fs, el as gs, aM as tn, aN as an, aP as nn, bh as In, aU as Ut, em as sa, en as Oa, eo as Fa, ep as da, eq as Ja, er as sd, es as rd, et as ld, eu as id, ev as od, ew as cd, ex as dd, cm as xs, ey as ud, ez as Ol, aD as Xt, ax as Zt, eA as md, eB as hd, eC as pd, eD as fd, eE as ji, eF as gd, eG as xd, eH as bd, eI as vd, eJ as yd, eK as lr, eL as Nd, eM as Cd, eN as ir, eO as or, eP as wd, eQ as Sd, eR as Td, eS as kd, eT as Fl, bQ as cr, eU as ua, a$ as Id, eV as Dd, b0 as Ed, b1 as Ad, b2 as Od, b3 as Fd, b4 as Md, b5 as Rd, b6 as Ld, aQ as ut, aL as Pd, eW as Vd, eX as Ya, eY as Xa, eZ as Za, aO as Er, bJ as Bd, aR as _d, e_ as zd, e$ as $d, f0 as qd, f1 as bs, f2 as lt, f3 as it, f4 as ot, cC as jd, cD as Kd, f5 as Ki, f6 as Ui, cz as Ud, bI as Gi, f7 as Gd, f8 as Hd, f9 as Wd, fa as Qd, fb as Jd, fc as Yd, fd as Xd, fe as Zd, ff as eu, fg as tu, fh as au, fi as nu, fj as Ca, fk as vn, fl as Wa, R as vs, g as Ma, fm as su, fn as Ml, fo as ru, fp as lu, fq as Ls, fr as Rl, fs as iu, ft as ou, fu as cu, fv as du, fw as uu, fx as Ps, fy as Hi, fz as mu, fA as ls, fB as hu, fC as Wi, fD as pu, fE as Qi, ci as fu, fF as gu, a2 as xu, fG as Wn, fH as bu, fI as Ll, fJ as vu, fK as yu, fL as Pl, fM as Nu, fN as Cu, fO as wu, fP as Su, fQ as Tu, fR as ku, fS as Iu, cy as Du, cA as Eu, fT as Ji, fU as Au, fV as Ou, fW as Fu, fX as Mu, fY as Ru, fZ as Lu, f_ as Pu, f$ as Vu, g0 as Bu, g1 as Yi, g2 as _u, g3 as ys, g4 as Ns, g5 as Xi, g6 as zu, g7 as $u, g8 as Zi, g9 as qu, ga as ju, gb as Cs, gc as Vs, gd as Ku, ge as Uu, gf as Gu, gg as Hu, gh as Wu, gi as Vl, gj as en, gk as eo, cB as Qu, gl as to, gm as ao, gn as es, go as no, gp as so, gq as Bl, gr as Ju, gs as Yu, gt as ts, gu as Xu, gv as Ar, cx as Zu, gw as em, gx as is, C as Dn, h as En, j as An, i as On, k as Fn, l as Mn, gy as tm, gz as Rn, gA as ra, gB as dr, gC as ur, gD as Ln, gE as ro, gF as am, gG as Bs, gH as _s, gI as nm, gJ as zs, gK as sm, gL as _l, gM as zl, cH as rm, gN as lm, cI as im, cK as om, cL as cm, x as dm, gO as um, gP as mm, gQ as hm, bK as pm, bL as fm, bM as gm, aW as ws, cv as Ss, gR as $l, gS as lo, c6 as $s, gT as xm, gU as bm, gV as vm, F as ym, au as Nm, gW as Cm, gX as wm, av as Sm } from "./index-CffvIaZO.js";
5
5
  import { c as Ue, H as we, B as Z, W as os, M as sn, a as W, G as M, aQ as Tm, L as $, a2 as te, a3 as ae, a4 as ne, a5 as se, a6 as j, aR as io, g as kt, X as tt, a0 as wt, Y as Lt, Z as St, _ as Tt, P as It, b as At, d as Dt, C as ma, aS as km, aI as Sn, aT as Or, aU as oo, aF as Fr, aD as Im, a1 as Me, aV as Dm, f as ha, u as Ae, e as ga, aW as Mr, aX as _n, E as co, T as Ts, J as ks, K as oa, N as Ta, $ as Wt, V as Is, S as Ra, k as Em, aJ as ka, aY as Am, aZ as Om, a_ as uo, ah as Fm, aL as Mm, a$ as Rm, b0 as Lm, b1 as ql, b2 as Pm, b3 as Vm, b4 as Bm, b5 as _m, aP as zm, b6 as jl, b7 as $m, b8 as Kl, R as mr, b9 as rn, ba as qm, a7 as Ze, bb as jm, bc as Pn, bd as cs, be as la, bf as Qn, bg as Ul, bh as Rt, bi as Km, Q as mo, bj as rt, v as Gl, bk as Um, bl as Gm, bm as Hm, bn as Wm, bo as Qm, bp as Jm, bq as Ym, br as Xm, bs as Zm, bt as eh, bu as th, bv as ah, ay as Hl, bw as nh, bx as sh, by as rh, O as Ds } from "./switch-Deo2Ltmj.js";
6
- import { f as lh, g as xt, S as ih, h as ho, V as po, u as oh, e as ch, R as Es, C as Wl } from "./use-create-flow-overlay-state-B65gg2oB.js";
7
- import { r as fo, f as zn } from "./use-visual-utils-Diuguy3D.js";
6
+ import { f as lh, g as xt, S as ih, h as ho, V as po, u as oh, e as ch, R as Es, C as Wl } from "./use-create-flow-overlay-state-DsPoCfMu.js";
7
+ import { r as fo, f as zn } from "./use-visual-utils-BdO22fQZ.js";
8
8
  import { C as go } from "./chevrons-up-down-CA-XvN1o.js";
9
9
  import { createPortal as dh } from "react-dom";
10
10
  import "./index-CJdxSyQq.js";