@malloy-publisher/server 0.9.5 → 0.9.7

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 (21) hide show
  1. package/dist/app/api-doc.yaml +157 -21
  2. package/dist/app/assets/{EnvironmentPage-wGTml4WZ.js → EnvironmentPage-V6cQ_Kpr.js} +1 -1
  3. package/dist/app/assets/{HomePage-BPFJHBxN.js → HomePage-BM31X4Y8.js} +1 -1
  4. package/dist/app/assets/{MainPage-CNLgQje2.js → MainPage-CQW3P4wB.js} +1 -1
  5. package/dist/app/assets/{ModelPage-Br6I_s4J.js → ModelPage-dBHaHb6u.js} +2 -2
  6. package/dist/app/assets/{PackagePage-B6lmG1Uq.js → PackagePage-B-ruDCyR.js} +1 -1
  7. package/dist/app/assets/{RenderedResult-BUb2Xvr2.es-17Y63pbB.js → RenderedResult-CkUS04tl.es-CNz9JsEK.js} +1 -1
  8. package/dist/app/assets/{RouteError-B4yUUZFj.js → RouteError-DLJlCtRG.js} +1 -1
  9. package/dist/app/assets/{ThemeEditorPage-CjK8EVnV.js → ThemeEditorPage-Ck4rJ1vv.js} +1 -1
  10. package/dist/app/assets/{ToggleButtonGroup-BKiI79mw.js → ToggleButtonGroup-Bwj7gIJm.js} +1 -1
  11. package/dist/app/assets/{documentRoutes-D_78AAbq.js → documentRoutes-DGm_-EUy.js} +1 -1
  12. package/dist/app/assets/{index-B3woRPfQ.js → index-BcsfsLm3.js} +1 -1
  13. package/dist/app/assets/{index-dQ3jNgKw.js → index-D3HZqxOW.js} +1 -1
  14. package/dist/app/assets/{index-BIqIsMFr.js → index-hnA8HjeH.js} +5 -5
  15. package/dist/app/assets/{index-CfX148tj.js → index-wawGd6k1.js} +1 -1
  16. package/dist/app/assets/{index.es-Bhhg6pWY.js → index.es-B2kJpnhe.js} +1 -1
  17. package/dist/app/index.html +1 -1
  18. package/dist/package_load_worker.mjs +119 -9
  19. package/dist/server.mjs +961 -199
  20. package/package.json +2 -2
  21. package/dist/sshcrypto-cqb52edz.node +0 -0
@@ -653,6 +653,10 @@ paths:
653
653
  $ref: "#/components/responses/NotFound"
654
654
  "500":
655
655
  $ref: "#/components/responses/InternalServerError"
656
+ "424":
657
+ $ref: "#/components/responses/ConnectionUnavailable"
658
+ "502":
659
+ $ref: "#/components/responses/DatabaseUnreachable"
656
660
  "503":
657
661
  $ref: "#/components/responses/ServiceUnavailable"
658
662
 
@@ -710,6 +714,10 @@ paths:
710
714
  $ref: "#/components/responses/NotFound"
711
715
  "500":
712
716
  $ref: "#/components/responses/InternalServerError"
717
+ "424":
718
+ $ref: "#/components/responses/ConnectionUnavailable"
719
+ "502":
720
+ $ref: "#/components/responses/DatabaseUnreachable"
713
721
  "503":
714
722
  $ref: "#/components/responses/ServiceUnavailable"
715
723
 
@@ -762,8 +770,12 @@ paths:
762
770
  $ref: "#/components/responses/Unauthorized"
763
771
  "404":
764
772
  $ref: "#/components/responses/NotFound"
773
+ "424":
774
+ $ref: "#/components/responses/ConnectionUnavailable"
765
775
  "500":
766
776
  $ref: "#/components/responses/InternalServerError"
777
+ "502":
778
+ $ref: "#/components/responses/DatabaseUnreachable"
767
779
  "503":
768
780
  $ref: "#/components/responses/ServiceUnavailable"
769
781
 
@@ -812,8 +824,12 @@ paths:
812
824
  $ref: "#/components/responses/Unauthorized"
813
825
  "404":
814
826
  $ref: "#/components/responses/NotFound"
827
+ "424":
828
+ $ref: "#/components/responses/ConnectionUnavailable"
815
829
  "500":
816
830
  $ref: "#/components/responses/InternalServerError"
831
+ "502":
832
+ $ref: "#/components/responses/DatabaseUnreachable"
817
833
  "503":
818
834
  $ref: "#/components/responses/ServiceUnavailable"
819
835
 
@@ -890,8 +906,12 @@ paths:
890
906
  $ref: "#/components/responses/NotFound"
891
907
  "413":
892
908
  $ref: "#/components/responses/PayloadTooLarge"
909
+ "424":
910
+ $ref: "#/components/responses/ConnectionUnavailable"
893
911
  "500":
894
912
  $ref: "#/components/responses/InternalServerError"
913
+ "502":
914
+ $ref: "#/components/responses/DatabaseUnreachable"
895
915
  "503":
896
916
  $ref: "#/components/responses/ServiceUnavailable"
897
917
  "504":
@@ -940,8 +960,12 @@ paths:
940
960
  $ref: "#/components/responses/Unauthorized"
941
961
  "404":
942
962
  $ref: "#/components/responses/NotFound"
963
+ "424":
964
+ $ref: "#/components/responses/ConnectionUnavailable"
943
965
  "500":
944
966
  $ref: "#/components/responses/InternalServerError"
967
+ "502":
968
+ $ref: "#/components/responses/DatabaseUnreachable"
945
969
  "503":
946
970
  $ref: "#/components/responses/ServiceUnavailable"
947
971
 
@@ -1008,6 +1032,10 @@ paths:
1008
1032
  $ref: "#/components/responses/NotFound"
1009
1033
  "500":
1010
1034
  $ref: "#/components/responses/InternalServerError"
1035
+ "424":
1036
+ $ref: "#/components/responses/ConnectionUnavailable"
1037
+ "502":
1038
+ $ref: "#/components/responses/DatabaseUnreachable"
1011
1039
  "503":
1012
1040
  $ref: "#/components/responses/ServiceUnavailable"
1013
1041
 
@@ -1070,6 +1098,10 @@ paths:
1070
1098
  $ref: "#/components/responses/NotFound"
1071
1099
  "500":
1072
1100
  $ref: "#/components/responses/InternalServerError"
1101
+ "424":
1102
+ $ref: "#/components/responses/ConnectionUnavailable"
1103
+ "502":
1104
+ $ref: "#/components/responses/DatabaseUnreachable"
1073
1105
  "503":
1074
1106
  $ref: "#/components/responses/ServiceUnavailable"
1075
1107
 
@@ -1126,8 +1158,12 @@ paths:
1126
1158
  $ref: "#/components/responses/Unauthorized"
1127
1159
  "404":
1128
1160
  $ref: "#/components/responses/NotFound"
1161
+ "424":
1162
+ $ref: "#/components/responses/ConnectionUnavailable"
1129
1163
  "500":
1130
1164
  $ref: "#/components/responses/InternalServerError"
1165
+ "502":
1166
+ $ref: "#/components/responses/DatabaseUnreachable"
1131
1167
  "503":
1132
1168
  $ref: "#/components/responses/ServiceUnavailable"
1133
1169
 
@@ -1182,8 +1218,12 @@ paths:
1182
1218
  $ref: "#/components/responses/Unauthorized"
1183
1219
  "404":
1184
1220
  $ref: "#/components/responses/NotFound"
1221
+ "424":
1222
+ $ref: "#/components/responses/ConnectionUnavailable"
1185
1223
  "500":
1186
1224
  $ref: "#/components/responses/InternalServerError"
1225
+ "502":
1226
+ $ref: "#/components/responses/DatabaseUnreachable"
1187
1227
  "503":
1188
1228
  $ref: "#/components/responses/ServiceUnavailable"
1189
1229
 
@@ -1262,8 +1302,12 @@ paths:
1262
1302
  $ref: "#/components/responses/NotFound"
1263
1303
  "413":
1264
1304
  $ref: "#/components/responses/PayloadTooLarge"
1305
+ "424":
1306
+ $ref: "#/components/responses/ConnectionUnavailable"
1265
1307
  "500":
1266
1308
  $ref: "#/components/responses/InternalServerError"
1309
+ "502":
1310
+ $ref: "#/components/responses/DatabaseUnreachable"
1267
1311
  "503":
1268
1312
  $ref: "#/components/responses/ServiceUnavailable"
1269
1313
  "504":
@@ -1318,8 +1362,12 @@ paths:
1318
1362
  $ref: "#/components/responses/Unauthorized"
1319
1363
  "404":
1320
1364
  $ref: "#/components/responses/NotFound"
1365
+ "424":
1366
+ $ref: "#/components/responses/ConnectionUnavailable"
1321
1367
  "500":
1322
1368
  $ref: "#/components/responses/InternalServerError"
1369
+ "502":
1370
+ $ref: "#/components/responses/DatabaseUnreachable"
1323
1371
  "503":
1324
1372
  $ref: "#/components/responses/ServiceUnavailable"
1325
1373
 
@@ -1884,6 +1932,10 @@ paths:
1884
1932
  $ref: "#/components/responses/InternalServerError"
1885
1933
  "501":
1886
1934
  $ref: "#/components/responses/NotImplemented"
1935
+ "424":
1936
+ $ref: "#/components/responses/ConnectionUnavailable"
1937
+ "502":
1938
+ $ref: "#/components/responses/DatabaseUnreachable"
1887
1939
  "503":
1888
1940
  $ref: "#/components/responses/ServiceUnavailable"
1889
1941
  "504":
@@ -2328,6 +2380,10 @@ paths:
2328
2380
  $ref: "#/components/responses/InternalServerError"
2329
2381
  "501":
2330
2382
  $ref: "#/components/responses/NotImplemented"
2383
+ "424":
2384
+ $ref: "#/components/responses/ConnectionUnavailable"
2385
+ "502":
2386
+ $ref: "#/components/responses/DatabaseUnreachable"
2331
2387
  "503":
2332
2388
  $ref: "#/components/responses/ServiceUnavailable"
2333
2389
  "504":
@@ -2869,6 +2925,31 @@ components:
2869
2925
  application/json:
2870
2926
  schema:
2871
2927
  $ref: "#/components/schemas/Error"
2928
+ ConnectionUnavailable:
2929
+ description: |
2930
+ The connection is misconfigured, so the query never ran. `reason`
2931
+ says how: CONNECTION_AUTH_FAILED (the database rejected the
2932
+ connection's credentials) or CONNECTION_NOT_FOUND (the model names a
2933
+ connection the environment does not have). The query is fine, and a
2934
+ retry fails the same way until the connection is fixed. For
2935
+ CONNECTION_AUTH_FAILED the body carries a fixed message, because the
2936
+ driver's text can name a user; it is logged.
2937
+ content:
2938
+ application/json:
2939
+ schema:
2940
+ $ref: "#/components/schemas/Error"
2941
+ DatabaseUnreachable:
2942
+ description: |
2943
+ The database connection failed. With `reason: CONNECTION_FAILED` the
2944
+ connection is down: the database could not be reached (refused, reset, timed out,
2945
+ or closed by the server), so the query never ran and a retry can
2946
+ succeed. That reason is what marks the customer's database being down
2947
+ rather than this server failing. The body carries a fixed message,
2948
+ because the driver's text can name an internal host; it is logged.
2949
+ content:
2950
+ application/json:
2951
+ schema:
2952
+ $ref: "#/components/schemas/Error"
2872
2953
  GatewayTimeout:
2873
2954
  description: |
2874
2955
  The query exceeded the per-request wall-clock budget
@@ -3406,6 +3487,11 @@ components:
3406
3487
  (the reader could not read a served notebook's cells). The rest are
3407
3488
  `warn` (a mistyped `(markdown)` opener, a missing `kind=notebook`, a
3408
3489
  block that never closes, and similar).
3490
+ Deprecated-format findings, all `warn`: each `.malloynb` notebook
3491
+ (`model` is its path), and each source a file declares deprecated
3492
+ `#(filter)` annotations on (`model` is that file, `subject` the
3493
+ source; a source that only inherits or imports a filter is not
3494
+ reported). Both still load and run.
3409
3495
  Server-computed and read-only:
3410
3496
  ignored on
3411
3497
  create/update requests and only returned in responses. Present only
@@ -4890,7 +4976,9 @@ components:
4890
4976
  type: string
4891
4977
  description:
4892
4978
  Query string to execute on the model. If the query parameter is
4893
- set, the queryName parameter must be empty.
4979
+ set, the queryName parameter must be empty. It may hold one run
4980
+ statement, after any source or query definitions; text with more
4981
+ than one run statement is a 400, since only the last would run.
4894
4982
  sourceName:
4895
4983
  type: string
4896
4984
  description: |
@@ -5676,8 +5764,9 @@ components:
5676
5764
  type: string
5677
5765
  enum: [disable, no-verify, verify-ca, verify-full]
5678
5766
  description:
5679
- TLS mode for a connection reached through a `proxy` (SSH bastion).
5680
- Because the driver connects to a local tunnel endpoint, the cert
5767
+ TLS mode for the connection. On a connection reached through a
5768
+ `proxy` (SSH bastion), the driver connects to a local tunnel
5769
+ endpoint, so the cert
5681
5770
  hostname can't be checked from the tunnel address alone; use
5682
5771
  `verify-full` to check it against the real host. `verify-ca`
5683
5772
  validates the server cert chain against the trusted CA bundle (e.g.
@@ -5694,9 +5783,20 @@ components:
5694
5783
  superset; it adds the hostname check without narrowing CA trust.
5695
5784
  The server defaults it to
5696
5785
  `no-verify` when a proxy is set (so a force-SSL target isn't rejected
5697
- for plaintext) — a server-applied default, not a schema default. Only
5698
- valid on a proxied connection — a direct connection uses the
5699
- deployment PGSSLMODE and rejects this field.
5786
+ for plaintext) — a server-applied default, not a schema default. On
5787
+ a direct connection the same modes apply against the configured
5788
+ host; when omitted, the deployment PGSSLMODE applies. Ignored when
5789
+ connectionString is set, which carries its own sslmode. Not applied
5790
+ to a DuckLake catalog connection.
5791
+ statementTimeoutMilliseconds:
5792
+ type: integer
5793
+ minimum: 1
5794
+ maximum: 2147483647
5795
+ description:
5796
+ Maximum run time of each statement on the database, in
5797
+ milliseconds. The database cancels a statement that exceeds it.
5798
+ When omitted, the database's own statement_timeout applies. Not
5799
+ applied to a DuckLake catalog connection.
5700
5800
 
5701
5801
  MysqlConnection:
5702
5802
  type: object
@@ -6065,11 +6165,13 @@ components:
6065
6165
  DuckdbConnection:
6066
6166
  type: object
6067
6167
  description: >
6068
- DuckDB database connection configuration. Exposes data-source intent,
6069
- attached foreign databases, and optional setup SQL for initialization
6070
- (e.g. ATTACH commands for external lakehouses), subject to Publisher policy
6071
- (setup SQL must be enabled with PUBLISHER_ALLOW_DUCKDB_SETUP_SQL=true and
6072
- is refused under EXTENSION_FETCH_POLICY=local-only).
6168
+ DuckDB database connection configuration: attached foreign databases,
6169
+ and optional setup SQL for anything they do not cover (e.g. ATTACH
6170
+ commands for external lakehouses). Setup SQL must be enabled with
6171
+ PUBLISHER_ALLOW_DUCKDB_SETUP_SQL=true and is refused under
6172
+ EXTENSION_FETCH_POLICY=local-only. Database files, working directories,
6173
+ filesystem/network policy, extension loading, temp directories, and
6174
+ resource knobs remain owned by Publisher.
6073
6175
  properties:
6074
6176
  setupSQL:
6075
6177
  type: string
@@ -6077,7 +6179,11 @@ components:
6077
6179
  Optional initialization SQL script executed against the DuckDB
6078
6180
  session upon connection (e.g. ATTACH commands for external lakehouses).
6079
6181
  Multiple statements must be separated by a semicolon and newline (;\n).
6080
- Refused unless the deployment sets PUBLISHER_ALLOW_DUCKDB_SETUP_SQL=true.
6182
+ Use absolute paths: a relative path resolves against the server's
6183
+ working directory. Withheld from responses like a credential; an
6184
+ update that omits it keeps the stored script, and an empty string
6185
+ removes it. Refused unless the deployment sets
6186
+ PUBLISHER_ALLOW_DUCKDB_SETUP_SQL=true.
6081
6187
  attachedDatabases:
6082
6188
  type: array
6083
6189
  items:
@@ -6187,12 +6293,28 @@ components:
6187
6293
  says nothing about whether the caller reached the right server; the
6188
6294
  latter is a routing problem worth retrying elsewhere.
6189
6295
 
6296
+ CONNECTION_FAILED, on a 502, means the database could not be
6297
+ reached (the connection was refused, reset or timed out, or the
6298
+ server closed it), so the query never ran. The query and the model
6299
+ are fine; retrying elsewhere will not help, and neither will
6300
+ rewriting the query.
6301
+
6302
+ CONNECTION_AUTH_FAILED, on a 424, means the database rejected the
6303
+ connection's credentials (a wrong password, an invalid key, an
6304
+ expired token), so the query never ran. Whoever configures the
6305
+ connection has to fix it; retrying fails the same way.
6306
+
6307
+ CONNECTION_NOT_FOUND, on a 424, means the model names a connection
6308
+ the environment does not have, usually one deleted after the
6309
+ package was loaded.
6310
+
6190
6311
  Deliberately an open string rather than an enum. Generators render
6191
6312
  an enum closed, so adding a second value here would break every
6192
6313
  client generated before it -- on the one field whose purpose is to
6193
6314
  grow. Callers must treat an unrecognized value as absent.
6194
6315
 
6195
- Known values: TABLE_NOT_FOUND.
6316
+ Known values: TABLE_NOT_FOUND, CONNECTION_FAILED,
6317
+ CONNECTION_AUTH_FAILED, CONNECTION_NOT_FOUND.
6196
6318
  problems:
6197
6319
  type: array
6198
6320
  description: |
@@ -6302,10 +6424,16 @@ components:
6302
6424
  "package" runs the same worker compiler and file selection as
6303
6425
  reload over every .malloy and .malloynb file, without swapping the
6304
6426
  result into the served package; with a source, importers compile
6305
- against the replacement. Package diagnostics can name files hidden
6306
- from discovery. No rows or SQL are returned, and caller-provided
6307
- source remains subject to authorize gates. includeSql is not
6308
- available at "package".
6427
+ against the replacement. It also reports the render-tag findings
6428
+ (code "render-tag") and the dashboard, given and drill findings
6429
+ (code "dashboard-lint") a reload would put on the package's
6430
+ warnings, at their own severity and with no position. The
6431
+ package's other warnings (storage, persist, materialization,
6432
+ explores, surface and discovery warnings, among others) are not
6433
+ reported. Package diagnostics can name
6434
+ files hidden from discovery. No rows or SQL are returned, and
6435
+ caller-provided source remains subject to authorize gates.
6436
+ includeSql is not available at "package".
6309
6437
 
6310
6438
  "append" text is checked against the model's PUBLISHED surface, so
6311
6439
  it may not declare its own data roots: import, connection.table(…),
@@ -7771,14 +7899,22 @@ components:
7771
7899
  file does not publish. That text can include `#(authorize)`
7772
7900
  expressions, `given:` defaults, connection names and raw SQL.
7773
7901
 
7774
- Only the models list, the model GET and the query route read it. The
7775
- notebook-cell route, the dashboards route, the MCP tools, and the legacy
7776
- `/projects/...` aliases of these routes ignore it.
7902
+ Only the models list, the model GET and the query route read it, plus
7903
+ the MCP `execute_query` tool's argument of the same name, which runs a
7904
+ query the way this route does. MCP offers that argument only when
7905
+ `publisher.config.json` sets `"mcp": { "includeHiddenFilesAndSources":
7906
+ true }`, which is for authoring servers. Without it the argument is not
7907
+ in the tool's schema and is ignored if sent, so an agent answering
7908
+ questions stays on the curated surface.
7909
+ This route is not affected by that setting. The notebook-cell route, the dashboards
7910
+ route, the other MCP tools, and the legacy `/projects/...` aliases of
7911
+ these routes ignore it.
7777
7912
 
7778
7913
  Like every route on this server, it is unauthenticated. A deployment
7779
7914
  that authenticates in front of Publisher decides who may send it, and
7780
7915
  should pass it only for callers allowed to work with a package's hidden
7781
- files, such as its authors.
7916
+ files, such as its authors. A deployment that exposes the MCP port has
7917
+ to make the same decision for the `execute_query` argument.
7782
7918
 
7783
7919
  Only `true` and `false` are accepted. Any other value is refused with
7784
7920
  400.
@@ -1 +1 @@
1
- import{q as r,E as t,j as e,a5 as i,am as o}from"./index-BIqIsMFr.js";function c(){const s=r(),{environmentName:n}=t();if(n){const a=i({environmentName:n});return e.jsx(o,{onSelectPackage:s,resourceUri:a})}else return e.jsx("div",{children:e.jsx("h2",{children:"Missing environment name"})})}export{c as default};
1
+ import{q as r,E as t,j as e,a5 as i,am as o}from"./index-hnA8HjeH.js";function c(){const s=r(),{environmentName:n}=t();if(n){const a=i({environmentName:n});return e.jsx(o,{onSelectPackage:s,resourceUri:a})}else return e.jsx("div",{children:e.jsx("h2",{children:"Missing environment name"})})}export{c as default};
@@ -1 +1 @@
1
- import{q as t,j as o,J as a}from"./index-BIqIsMFr.js";function s(){const n=t();return o.jsx(a,{onClickEnvironment:n})}export{s as default};
1
+ import{q as t,j as o,J as a}from"./index-hnA8HjeH.js";function s(){const n=t();return o.jsx(a,{onClickEnvironment:n})}export{s as default};
@@ -1 +1 @@
1
- import{c as g,j as t,s as E,B as Se,m as Q,e as le,g as he,a as xe,r as u,u as me,b as Me,d as V,f as fe,T as G,h as K,i as Ce,k as Pe,l as Ee,o as ge,n as ze,p as Ie,t as ce,v as De,w as Te,x as N,y as $,M as Re,P as Be,z as Le,S as He,A as Z,C as $e,D as Oe,I as de,E as ye,q as J,F as p,G as Ne,H as Y,K as W,L as ee,N as Ae,O as Ve,Q as pe,R as We,U as te,V as re,W as ne,X as Fe,Y as Ue,Z as _e,_ as Xe}from"./index-BIqIsMFr.js";import{e as Ye,s as qe}from"./documentRoutes-D_78AAbq.js";const Qe=g(t.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),Ge=E(Se,{name:"MuiBreadcrumbCollapsed"})(Q(({theme:e})=>({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`,...e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},borderRadius:2,"&:hover, &:focus":{...e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}},"&:active":{boxShadow:e.shadows[0],...e.palette.mode==="light"?{backgroundColor:le(e.palette.grey[200],.12)}:{backgroundColor:le(e.palette.grey[600],.12)}}}))),Ke=E(Qe)({width:24,height:16});function Ze(e){const{slots:r={},slotProps:o={},...n}=e,s=e;return t.jsx("li",{children:t.jsx(Ge,{focusRipple:!0,...n,ownerState:s,children:t.jsx(Ke,{as:r.CollapsedIcon,ownerState:s,...o.collapsedIcon})})})}function Je(e){return he("MuiBreadcrumbs",e)}const et=xe("MuiBreadcrumbs",["root","ol","li","separator"]),tt=e=>{const{classes:r}=e;return fe({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},Je,r)},rt=E(G,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,r)=>[{[`& .${et.li}`]:r.li},r.root]})({}),nt=E("ol",{name:"MuiBreadcrumbs",slot:"Ol"})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),ot=E("li",{name:"MuiBreadcrumbs",slot:"Separator"})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function st(e,r,o,n){return e.reduce((s,l,i)=>(i<e.length-1?s=s.concat(l,t.jsx(ot,{"aria-hidden":!0,className:r,ownerState:n,children:o},`separator-${i}`)):s.push(l),s),[])}const at=u.forwardRef(function(r,o){const n=me({props:r,name:"MuiBreadcrumbs"}),{children:s,className:l,component:i="nav",slots:d={},slotProps:f={},expandText:h="Show path",itemsAfterCollapse:m=1,itemsBeforeCollapse:v=1,maxItems:y=8,separator:z="/",...H}=n,[I,M]=u.useState(!1),j={...n,component:i,expanded:I,expandText:h,itemsAfterCollapse:m,itemsBeforeCollapse:v,maxItems:y,separator:z},C=tt(j),D=Me({elementType:d.CollapsedIcon,externalSlotProps:f.collapsedIcon,ownerState:j}),k=u.useRef(null),w=c=>{const S=()=>{M(!0);const b=k.current.querySelector("a[href],button,[tabindex]");b&&b.focus()};return v+m>=c.length?c:[...c.slice(0,v),t.jsx(Ze,{"aria-label":h,slots:{CollapsedIcon:d.CollapsedIcon},slotProps:{collapsedIcon:D},onClick:S},"ellipsis"),...c.slice(c.length-m,c.length)]},T=u.Children.toArray(s).filter(c=>u.isValidElement(c)).map((c,S)=>t.jsx("li",{className:C.li,children:c},`child-${S}`));return t.jsx(rt,{ref:o,component:i,color:"textSecondary",className:V(C.root,l),ownerState:j,...H,children:t.jsx(nt,{className:C.ol,ref:k,ownerState:j,children:st(I||y&&T.length<=y?T:w(T),C.separator,z,j)})})});function it(e,r,o){const n=r.getBoundingClientRect(),s=o&&o.getBoundingClientRect(),l=ge(r);let i;if(r.fakeTransform)i=r.fakeTransform;else{const h=l.getComputedStyle(r);i=h.getPropertyValue("-webkit-transform")||h.getPropertyValue("transform")}let d=0,f=0;if(i&&i!=="none"&&typeof i=="string"){const h=i.split("(")[1].split(")")[0].split(",");d=parseInt(h[4],10),f=parseInt(h[5],10)}return e==="left"?s?`translateX(${s.right+d-n.left}px)`:`translateX(${l.innerWidth+d-n.left}px)`:e==="right"?s?`translateX(-${n.right-s.left-d}px)`:`translateX(-${n.left+n.width-d}px)`:e==="up"?s?`translateY(${s.bottom+f-n.top}px)`:`translateY(${l.innerHeight+f-n.top}px)`:s?`translateY(-${n.top-s.top+n.height-f}px)`:`translateY(-${n.top+n.height-f}px)`}function lt(e){return typeof e=="function"?e():e}function A(e,r,o){const n=lt(o),s=it(e,r,n);s&&(r.style.webkitTransform=s,r.style.transform=s)}const ct=u.forwardRef(function(r,o){const n=K(),s={enter:n.transitions.easing.easeOut,exit:n.transitions.easing.sharp},l={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:i,appear:d=!0,children:f,container:h,direction:m="down",easing:v=s,in:y,onEnter:z,onEntered:H,onEntering:I,onExit:M,onExited:j,onExiting:C,style:D,timeout:k=l,TransitionComponent:w=Ce,...T}=r,c=u.useRef(null),S=Pe(Ee(f),c,o),b=a=>x=>{a&&(x===void 0?a(c.current):a(c.current,x))},F=b((a,x)=>{A(m,a,h),Ie(a),z&&z(a,x)}),se=b((a,x)=>{const L=ce({timeout:k,style:D,easing:v},{mode:"enter"});a.style.webkitTransition=n.transitions.create("-webkit-transform",{...L}),a.style.transition=n.transitions.create("transform",{...L}),a.style.webkitTransform="none",a.style.transform="none",I&&I(a,x)}),R=b(H),B=b(C),P=b(a=>{const x=ce({timeout:k,style:D,easing:v},{mode:"exit"});a.style.webkitTransition=n.transitions.create("-webkit-transform",x),a.style.transition=n.transitions.create("transform",x),A(m,a,h),M&&M(a)}),U=b(a=>{a.style.webkitTransition="",a.style.transition="",j&&j(a)}),_=a=>{i&&i(c.current,a)},O=u.useCallback(()=>{c.current&&A(m,c.current,h)},[m,h]);return u.useEffect(()=>{if(y||m==="down"||m==="right")return;const a=ze(()=>{c.current&&A(m,c.current,h)}),x=ge(c.current);return x.addEventListener("resize",a),()=>{a.clear(),x.removeEventListener("resize",a)}},[m,y,h]),u.useEffect(()=>{y||O()},[y,O]),t.jsx(w,{nodeRef:c,onEnter:F,onEntered:R,onEntering:se,onExit:P,onExited:U,onExiting:B,addEndListener:_,appear:d,in:y,timeout:k,...T,children:(a,{ownerState:x,...L})=>u.cloneElement(f,{ref:S,style:{visibility:a==="exited"&&!y?"hidden":void 0,...D,...f.props.style},...L})})});function dt(e){return he("MuiDrawer",e)}xe("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const be=(e,r)=>{const{ownerState:o}=e;return[r.root,(o.variant==="permanent"||o.variant==="persistent")&&r.docked,r.modal]},pt=e=>{const{classes:r,anchor:o,variant:n}=e,s={root:["root",`anchor${$(o)}`],docked:[(n==="permanent"||n==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${$(o)}`,n!=="temporary"&&`paperAnchorDocked${$(o)}`]};return fe(s,dt,r)},ut=E(Re,{name:"MuiDrawer",slot:"Root",overridesResolver:be})(Q(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),ht=E("div",{shouldForwardProp:Le,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:be})({flex:"0 0 auto"}),xt=E(Be,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,r)=>{const{ownerState:o}=e;return[r.paper,r[`paperAnchor${$(o.anchor)}`],o.variant!=="temporary"&&r[`paperAnchorDocked${$(o.anchor)}`]]}})(Q(({theme:e})=>({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(e.vars||e).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0,variants:[{props:{anchor:"left"},style:{left:0}},{props:{anchor:"top"},style:{top:0,left:0,right:0,height:"auto",maxHeight:"100%"}},{props:{anchor:"right"},style:{right:0}},{props:{anchor:"bottom"},style:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"}},{props:({ownerState:r})=>r.anchor==="left"&&r.variant!=="temporary",style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="top"&&r.variant!=="temporary",style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="right"&&r.variant!=="temporary",style:{borderLeft:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="bottom"&&r.variant!=="temporary",style:{borderTop:`1px solid ${(e.vars||e).palette.divider}`}}]}))),je={left:"right",right:"left",top:"down",bottom:"up"};function mt(e){return["left","right"].includes(e)}function ft({direction:e},r){return e==="rtl"&&mt(r)?je[r]:r}const gt=u.forwardRef(function(r,o){const n=me({props:r,name:"MuiDrawer"}),s=K(),l=De(),i={enter:s.transitions.duration.enteringScreen,exit:s.transitions.duration.leavingScreen},{anchor:d="left",BackdropProps:f,children:h,className:m,elevation:v=16,hideBackdrop:y=!1,ModalProps:{BackdropProps:z,...H}={},onClose:I,open:M=!1,PaperProps:j={},SlideProps:C,TransitionComponent:D,transitionDuration:k=i,variant:w="temporary",slots:T={},slotProps:c={},...S}=n,b=u.useRef(!1);u.useEffect(()=>{b.current=!0},[]);const F=ft({direction:l?"rtl":"ltr"},d),R={...n,anchor:d,elevation:v,open:M,variant:w,...S},B=pt(R),P={slots:{transition:D,...T},slotProps:{paper:j,transition:C,...c,backdrop:Te(c.backdrop||{...f,...z},{transitionDuration:k})}},[U,_]=N("root",{ref:o,elementType:ut,className:V(B.root,B.modal,m),shouldForwardComponentProp:!0,ownerState:R,externalForwardedProps:{...P,...S,...H},additionalProps:{open:M,onClose:I,hideBackdrop:y,slots:{backdrop:P.slots.backdrop},slotProps:{backdrop:P.slotProps.backdrop}}}),[O,a]=N("paper",{elementType:xt,shouldForwardComponentProp:!0,className:V(B.paper,j.className),ownerState:R,externalForwardedProps:P,additionalProps:{elevation:w==="temporary"?v:0,square:!0,...w==="temporary"&&{role:"dialog","aria-modal":"true"}}}),[x,L]=N("docked",{elementType:ht,ref:o,className:V(B.root,B.docked,m),ownerState:R,externalForwardedProps:P,additionalProps:S}),[ke,we]=N("transition",{elementType:ct,ownerState:R,externalForwardedProps:P,additionalProps:{in:M,direction:je[F],timeout:k,appear:b.current}}),ae=t.jsx(O,{...a,children:h});if(w==="permanent")return t.jsx(x,{...L,children:ae});const ie=t.jsx(ke,{...we,children:ae});return w==="persistent"?t.jsx(x,{...L,children:ie}):t.jsx(U,{..._,children:ie})}),yt=g([t.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"},"0"),t.jsx("path",{d:"M14 17H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"},"1")]),bt=g(t.jsx("path",{d:"M10.85 12.65h2.3L12 9zM20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12zM14.3 16l-.7-2h-3.2l-.7 2H7.8L11 7h2l3.2 9z"})),jt=g(t.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),vt=g(t.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"})),kt=g(t.jsx("path",{d:"M9.37 5.51c-.18.64-.27 1.31-.27 1.99 0 4.08 3.32 7.4 7.4 7.4.68 0 1.35-.09 1.99-.27C17.45 17.19 14.93 19 12 19c-3.86 0-7-3.14-7-7 0-2.93 1.81-5.45 4.37-6.49M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1"})),wt=g(t.jsx("path",{d:"m14.06 9.02.92.92L5.92 19H5v-.92zM17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29m-3.6 3.19L3 17.25V21h3.75L17.81 9.94z"})),St=g(t.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"})),Mt=g(t.jsx("path",{d:"m12 5.69 5 4.5V18h-2v-6H9v6H7v-7.81zM12 3 2 12h3v8h6v-6h2v6h6v-8h3z"})),Ct=g(t.jsx("path",{d:"M12 9c1.65 0 3 1.35 3 3s-1.35 3-3 3-3-1.35-3-3 1.35-3 3-3m0-2c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z"})),Pt=g(t.jsx("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"})),Et=g([t.jsx("path",{d:"M12 22C6.49 22 2 17.51 2 12S6.49 2 12 2s10 4.04 10 9c0 3.31-2.69 6-6 6h-1.77c-.28 0-.5.22-.5.5 0 .12.05.23.13.33.41.47.64 1.06.64 1.67 0 1.38-1.12 2.5-2.5 2.5m0-18c-4.41 0-8 3.59-8 8s3.59 8 8 8c.28 0 .5-.22.5-.5 0-.16-.08-.28-.14-.35-.41-.46-.63-1.05-.63-1.65 0-1.38 1.12-2.5 2.5-2.5H16c2.21 0 4-1.79 4-4 0-3.86-3.59-7-8-7"},"0"),t.jsx("circle",{cx:"6.5",cy:"11.5",r:"1.5"},"1"),t.jsx("circle",{cx:"9.5",cy:"7.5",r:"1.5"},"2"),t.jsx("circle",{cx:"14.5",cy:"7.5",r:"1.5"},"3"),t.jsx("circle",{cx:"17.5",cy:"11.5",r:"1.5"},"4")]),zt=g(t.jsx("path",{d:"M12 6c3.79 0 7.17 2.13 8.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5C4.83 8.13 8.21 6 12 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4m0 5c1.38 0 2.5 1.12 2.5 2.5S13.38 14 12 14s-2.5-1.12-2.5-2.5S10.62 9 12 9m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7"}));function q(e){return t.jsxs(He,{...e,viewBox:"0 0 24 24",sx:{fill:"none",...e.sx},children:[t.jsx("rect",{x:"3.25",y:"4.75",width:"17.5",height:"14.5",rx:"2.25",stroke:"currentColor",strokeWidth:"1.5"}),t.jsx("line",{x1:"8.5",y1:"5",x2:"8.5",y2:"19",stroke:"currentColor",strokeWidth:"1.5"})]})}const It=/^(.*\/[^/]+\/[^/]+\/(?:dashboards|notebooks)\/([^/]+?))(\/edit)?\/?$/,Dt=/\.malloy(nb)?$/;function Tt(){const{pathname:e}=Z(),r=$e(),o=Oe(),n=It.exec(e);if(!n||o)return null;const[,s,l,i]=n;return Dt.test(l)?null:i?t.jsx(de,{label:"View",icon:t.jsx(zt,{}),onClick:()=>r(s)}):t.jsx(de,{label:"Edit",icon:t.jsx(wt,{}),onClick:()=>r(Ye(s))})}function X({label:e,onClick:r}){return t.jsx(Ne,{clickable:!0,onClick:r,label:e,size:"small","aria-label":`Navigate to ${e}`,sx:o=>({backgroundColor:"transparent",border:`1px solid ${o.palette.divider}`,color:"text.primary",fontWeight:500,fontSize:"0.875rem",height:32,cursor:"pointer",borderRadius:"4px",maxWidth:320,"& .MuiChip-label":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},"&:hover":{backgroundColor:o.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"grey.100"}})})}function Rt(){const e=ye(),r=e["*"]?qe(e["*"]).path:void 0,o=J();return!e.environmentName&&!e.packageName&&!r?null:t.jsx(p,{sx:{display:"flex",alignItems:"center",minWidth:0},children:t.jsxs(at,{"aria-label":"breadcrumb",separator:t.jsx(jt,{sx:{fontSize:14,color:"text.secondary"}}),children:[e.environmentName&&t.jsx(X,{label:e.environmentName,onClick:n=>o(`/${e.environmentName}/`,n)}),e.packageName&&t.jsx(X,{label:e.packageName,onClick:n=>o(`/${e.environmentName}/${e.packageName}/`,n)}),r&&t.jsx(X,{label:r,onClick:n=>o(`/${e.environmentName}/${e.packageName}/${r}`,n)})]})})}const Bt=260,Lt=64;function ve({isCollapsed:e,onToggleCollapse:r,logoHeader:o}){return t.jsxs(p,{sx:{height:"100dvh",width:e?Lt:Bt,flexShrink:0,display:"flex",flexDirection:"column",backgroundColor:"background.paper",transition:"width 0.2s cubic-bezier(0.4, 0, 0.2, 1)",overflow:"hidden"},children:[t.jsx(Ht,{isCollapsed:e,onToggleCollapse:r,logoHeader:o}),t.jsxs(p,{sx:{flex:1,overflowY:"auto",overflowX:"hidden",py:1},children:[t.jsx($t,{isCollapsed:e}),t.jsx(Ot,{isCollapsed:e})]}),t.jsx(Nt,{isCollapsed:e})]})}function Ht({isCollapsed:e,onToggleCollapse:r,logoHeader:o}){const n=J();return o?t.jsxs(p,{sx:{height:56,display:"flex",alignItems:"center",justifyContent:"space-between",px:e?0:2,flexShrink:0},children:[o,t.jsx(Y,{size:"small",onClick:r,"aria-label":e?"Expand sidebar":"Collapse sidebar",children:t.jsx(q,{fontSize:"small"})})]}):t.jsxs(p,{sx:{minHeight:56,display:"flex",flexDirection:e?"column":"row",alignItems:"center",justifyContent:e?"center":"space-between",gap:e?.5:0,py:e?1:0,px:e?0:2,flexShrink:0},children:[t.jsxs(p,{onClick:s=>n("/",s),sx:{display:"flex",alignItems:"center",gap:1,cursor:"pointer",minWidth:0},children:[t.jsx(p,{component:"img",src:"/logo.svg",alt:"Malloy",sx:{width:24,height:24,flexShrink:0}}),!e&&t.jsx(G,{variant:"subtitle1",sx:{color:"text.primary",fontWeight:500,letterSpacing:"-0.025em",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:"Malloy Publisher"})]}),t.jsx(W,{title:e?"Expand sidebar":"Collapse sidebar",placement:"right",children:t.jsx(Y,{size:"small",onClick:r,"aria-label":e?"Expand sidebar":"Collapse sidebar",children:t.jsx(q,{fontSize:"small"})})})]})}function $t({isCollapsed:e}){const o=Z().pathname==="/";return t.jsx(ee,{sx:{py:0},children:t.jsx(oe,{icon:t.jsx(Mt,{fontSize:"small"}),label:"Home",to:"/",selected:o,isCollapsed:e})})}function Ot({isCollapsed:e}){const{apiClients:r}=Ae(),o=ye(),{data:n}=Ve({queryKey:["environments"],queryFn:()=>r.environments.listEnvironments()}),s=n?.data??[];return s.length===0?null:t.jsxs(p,{sx:{mt:1},children:[!e&&t.jsx(G,{variant:"caption",sx:{display:"block",px:3,py:1,color:"text.secondary",fontWeight:500,textTransform:"uppercase",fontSize:"0.6875rem",letterSpacing:"0.5px"},children:"Environments"}),t.jsx(ee,{sx:{py:0},children:s.map(l=>{const i=l.name??"";return t.jsx(oe,{icon:t.jsx(St,{fontSize:"small"}),label:i,to:`/${i}`,selected:o.environmentName===i,isCollapsed:e},i)})})]})}function Nt({isCollapsed:e}){const{pathname:r}=Z(),o=[{label:"Malloy Docs",href:pe.docsHome,icon:t.jsx(yt,{fontSize:"small"}),external:!0},{label:"Publisher Docs",href:pe.publishing,icon:t.jsx(Pt,{fontSize:"small"}),external:!0},{label:"Publisher API",href:"/api-doc.html",icon:t.jsx(vt,{fontSize:"small"}),external:!1}];return t.jsxs(ee,{sx:{py:1},children:[t.jsx(oe,{icon:t.jsx(Et,{fontSize:"small"}),label:"Theme",to:"/settings/theme",selected:r.startsWith("/settings/theme"),isCollapsed:e}),t.jsx(Ft,{isCollapsed:e}),o.map(n=>t.jsx(At,{label:n.label,href:n.href,icon:n.icon,external:n.external,isCollapsed:e},n.label))]})}function oe({icon:e,label:r,to:o,selected:n,isCollapsed:s}){const l=J(),i=t.jsxs(te,{selected:n,onClick:d=>l(o,d),sx:{justifyContent:s?"center":"flex-start",px:s?0:2},children:[t.jsx(re,{sx:{minWidth:s?0:36,justifyContent:"center",color:n?"text.primary":"text.secondary"},children:e}),!s&&t.jsx(ne,{primary:r,primaryTypographyProps:{variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})]});return s?t.jsx(W,{title:r,placement:"right",children:t.jsx(p,{children:i})}):i}function At({label:e,href:r,icon:o,external:n,isCollapsed:s}){const l=t.jsxs(te,{component:"a",href:r,target:n?"_blank":void 0,rel:n?"noopener noreferrer":void 0,sx:{justifyContent:s?"center":"flex-start",px:s?0:2},children:[t.jsx(re,{sx:{minWidth:s?0:36,justifyContent:"center",color:"text.secondary"},children:o}),!s&&t.jsx(ne,{primary:e,primaryTypographyProps:{variant:"body2",sx:{color:"text.secondary",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})]});return s?t.jsx(W,{title:e,placement:"right",children:t.jsx(p,{children:l})}):l}const Vt={light:"dark",dark:"auto",auto:"light"},Wt={light:"Light mode",dark:"Dark mode",auto:"Auto mode"},ue={light:"Light mode (click for dark)",dark:"Dark mode (click for auto)",auto:"Auto mode (follows OS, click for light)"};function Ft({isCollapsed:e}){const{mode:r,userChoice:o,setMode:n,allowUserToggle:s}=We();if(!s)return null;const l=o??r,i=l==="auto"?bt:l==="dark"?kt:Ct,d=t.jsxs(te,{"aria-label":ue[l],onClick:()=>n(Vt[l]),sx:{justifyContent:e?"center":"flex-start",px:e?0:2},children:[t.jsx(re,{sx:{minWidth:e?0:36,justifyContent:"center",color:"text.secondary"},children:t.jsx(i,{fontSize:"small"})}),!e&&t.jsx(ne,{primary:Wt[l],primaryTypographyProps:{variant:"body2",sx:{color:"text.secondary",whiteSpace:"nowrap"}}})]});return t.jsx(W,{title:ue[l],placement:"right",disableHoverListener:!e,children:t.jsx(p,{children:d})})}function Ut({open:e,onClose:r,logoHeader:o}){return t.jsx(gt,{anchor:"left",open:e,onClose:r,ModalProps:{keepMounted:!0},sx:{display:{xs:"block",md:"none"},"& .MuiDrawer-paper":{boxSizing:"border-box",width:260}},children:t.jsx(ve,{isCollapsed:!1,onToggleCollapse:r,logoHeader:o})})}function Yt({headerProps:e}){const r=K(),o=Fe(r.breakpoints.up("md")),[n,s]=u.useState(!1),[l,i]=u.useState(!1);return u.useEffect(()=>{o&&n&&s(!1)},[o,n]),t.jsxs(p,{sx:{height:"100dvh",display:"flex",flexDirection:"row",bgcolor:"background.default"},children:[o&&t.jsx(ve,{isCollapsed:l,onToggleCollapse:()=>i(d=>!d),logoHeader:e?.logoHeader}),t.jsxs(p,{component:"main",sx:{flex:1,display:"flex",flexDirection:"column",minWidth:0},children:[t.jsxs(p,{sx:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"space-between",height:Ue.headerHeight,px:{xs:1,md:3},backgroundColor:"background.default"},children:[t.jsx(p,{sx:{display:{xs:"flex",md:"none"},alignItems:"center",mr:1},children:t.jsx(Y,{size:"small",onClick:()=>s(!0),"aria-label":"Open navigation",children:t.jsx(q,{fontSize:"small"})})}),t.jsx(p,{sx:{flex:1,minWidth:0,display:"flex",alignItems:"center"},children:t.jsx(Rt,{})}),t.jsxs(p,{id:"header-actions-portal",sx:{display:"flex",alignItems:"center",flexShrink:0,gap:1},children:[t.jsx(Tt,{}),e?.endCap]})]}),t.jsx(p,{sx:{flex:1,overflow:"auto",minWidth:320,minHeight:0},children:t.jsx(u.Suspense,{fallback:t.jsx(Xe,{}),children:t.jsx(_e,{})})})]}),t.jsx(Ut,{open:n,onClose:()=>s(!1),logoHeader:e?.logoHeader})]})}export{Yt as default};
1
+ import{c as g,j as t,s as E,B as Se,m as Q,e as le,g as he,a as xe,r as u,u as me,b as Me,d as V,f as fe,T as G,h as K,i as Ce,k as Pe,l as Ee,o as ge,n as ze,p as Ie,t as ce,v as De,w as Te,x as N,y as $,M as Re,P as Be,z as Le,S as He,A as Z,C as $e,D as Oe,I as de,E as ye,q as J,F as p,G as Ne,H as Y,K as W,L as ee,N as Ae,O as Ve,Q as pe,R as We,U as te,V as re,W as ne,X as Fe,Y as Ue,Z as _e,_ as Xe}from"./index-hnA8HjeH.js";import{e as Ye,s as qe}from"./documentRoutes-DGm_-EUy.js";const Qe=g(t.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),Ge=E(Se,{name:"MuiBreadcrumbCollapsed"})(Q(({theme:e})=>({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`,...e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},borderRadius:2,"&:hover, &:focus":{...e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}},"&:active":{boxShadow:e.shadows[0],...e.palette.mode==="light"?{backgroundColor:le(e.palette.grey[200],.12)}:{backgroundColor:le(e.palette.grey[600],.12)}}}))),Ke=E(Qe)({width:24,height:16});function Ze(e){const{slots:r={},slotProps:o={},...n}=e,s=e;return t.jsx("li",{children:t.jsx(Ge,{focusRipple:!0,...n,ownerState:s,children:t.jsx(Ke,{as:r.CollapsedIcon,ownerState:s,...o.collapsedIcon})})})}function Je(e){return he("MuiBreadcrumbs",e)}const et=xe("MuiBreadcrumbs",["root","ol","li","separator"]),tt=e=>{const{classes:r}=e;return fe({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},Je,r)},rt=E(G,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,r)=>[{[`& .${et.li}`]:r.li},r.root]})({}),nt=E("ol",{name:"MuiBreadcrumbs",slot:"Ol"})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),ot=E("li",{name:"MuiBreadcrumbs",slot:"Separator"})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function st(e,r,o,n){return e.reduce((s,l,i)=>(i<e.length-1?s=s.concat(l,t.jsx(ot,{"aria-hidden":!0,className:r,ownerState:n,children:o},`separator-${i}`)):s.push(l),s),[])}const at=u.forwardRef(function(r,o){const n=me({props:r,name:"MuiBreadcrumbs"}),{children:s,className:l,component:i="nav",slots:d={},slotProps:f={},expandText:h="Show path",itemsAfterCollapse:m=1,itemsBeforeCollapse:v=1,maxItems:y=8,separator:z="/",...H}=n,[I,M]=u.useState(!1),j={...n,component:i,expanded:I,expandText:h,itemsAfterCollapse:m,itemsBeforeCollapse:v,maxItems:y,separator:z},C=tt(j),D=Me({elementType:d.CollapsedIcon,externalSlotProps:f.collapsedIcon,ownerState:j}),k=u.useRef(null),w=c=>{const S=()=>{M(!0);const b=k.current.querySelector("a[href],button,[tabindex]");b&&b.focus()};return v+m>=c.length?c:[...c.slice(0,v),t.jsx(Ze,{"aria-label":h,slots:{CollapsedIcon:d.CollapsedIcon},slotProps:{collapsedIcon:D},onClick:S},"ellipsis"),...c.slice(c.length-m,c.length)]},T=u.Children.toArray(s).filter(c=>u.isValidElement(c)).map((c,S)=>t.jsx("li",{className:C.li,children:c},`child-${S}`));return t.jsx(rt,{ref:o,component:i,color:"textSecondary",className:V(C.root,l),ownerState:j,...H,children:t.jsx(nt,{className:C.ol,ref:k,ownerState:j,children:st(I||y&&T.length<=y?T:w(T),C.separator,z,j)})})});function it(e,r,o){const n=r.getBoundingClientRect(),s=o&&o.getBoundingClientRect(),l=ge(r);let i;if(r.fakeTransform)i=r.fakeTransform;else{const h=l.getComputedStyle(r);i=h.getPropertyValue("-webkit-transform")||h.getPropertyValue("transform")}let d=0,f=0;if(i&&i!=="none"&&typeof i=="string"){const h=i.split("(")[1].split(")")[0].split(",");d=parseInt(h[4],10),f=parseInt(h[5],10)}return e==="left"?s?`translateX(${s.right+d-n.left}px)`:`translateX(${l.innerWidth+d-n.left}px)`:e==="right"?s?`translateX(-${n.right-s.left-d}px)`:`translateX(-${n.left+n.width-d}px)`:e==="up"?s?`translateY(${s.bottom+f-n.top}px)`:`translateY(${l.innerHeight+f-n.top}px)`:s?`translateY(-${n.top-s.top+n.height-f}px)`:`translateY(-${n.top+n.height-f}px)`}function lt(e){return typeof e=="function"?e():e}function A(e,r,o){const n=lt(o),s=it(e,r,n);s&&(r.style.webkitTransform=s,r.style.transform=s)}const ct=u.forwardRef(function(r,o){const n=K(),s={enter:n.transitions.easing.easeOut,exit:n.transitions.easing.sharp},l={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:i,appear:d=!0,children:f,container:h,direction:m="down",easing:v=s,in:y,onEnter:z,onEntered:H,onEntering:I,onExit:M,onExited:j,onExiting:C,style:D,timeout:k=l,TransitionComponent:w=Ce,...T}=r,c=u.useRef(null),S=Pe(Ee(f),c,o),b=a=>x=>{a&&(x===void 0?a(c.current):a(c.current,x))},F=b((a,x)=>{A(m,a,h),Ie(a),z&&z(a,x)}),se=b((a,x)=>{const L=ce({timeout:k,style:D,easing:v},{mode:"enter"});a.style.webkitTransition=n.transitions.create("-webkit-transform",{...L}),a.style.transition=n.transitions.create("transform",{...L}),a.style.webkitTransform="none",a.style.transform="none",I&&I(a,x)}),R=b(H),B=b(C),P=b(a=>{const x=ce({timeout:k,style:D,easing:v},{mode:"exit"});a.style.webkitTransition=n.transitions.create("-webkit-transform",x),a.style.transition=n.transitions.create("transform",x),A(m,a,h),M&&M(a)}),U=b(a=>{a.style.webkitTransition="",a.style.transition="",j&&j(a)}),_=a=>{i&&i(c.current,a)},O=u.useCallback(()=>{c.current&&A(m,c.current,h)},[m,h]);return u.useEffect(()=>{if(y||m==="down"||m==="right")return;const a=ze(()=>{c.current&&A(m,c.current,h)}),x=ge(c.current);return x.addEventListener("resize",a),()=>{a.clear(),x.removeEventListener("resize",a)}},[m,y,h]),u.useEffect(()=>{y||O()},[y,O]),t.jsx(w,{nodeRef:c,onEnter:F,onEntered:R,onEntering:se,onExit:P,onExited:U,onExiting:B,addEndListener:_,appear:d,in:y,timeout:k,...T,children:(a,{ownerState:x,...L})=>u.cloneElement(f,{ref:S,style:{visibility:a==="exited"&&!y?"hidden":void 0,...D,...f.props.style},...L})})});function dt(e){return he("MuiDrawer",e)}xe("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const be=(e,r)=>{const{ownerState:o}=e;return[r.root,(o.variant==="permanent"||o.variant==="persistent")&&r.docked,r.modal]},pt=e=>{const{classes:r,anchor:o,variant:n}=e,s={root:["root",`anchor${$(o)}`],docked:[(n==="permanent"||n==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${$(o)}`,n!=="temporary"&&`paperAnchorDocked${$(o)}`]};return fe(s,dt,r)},ut=E(Re,{name:"MuiDrawer",slot:"Root",overridesResolver:be})(Q(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),ht=E("div",{shouldForwardProp:Le,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:be})({flex:"0 0 auto"}),xt=E(Be,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,r)=>{const{ownerState:o}=e;return[r.paper,r[`paperAnchor${$(o.anchor)}`],o.variant!=="temporary"&&r[`paperAnchorDocked${$(o.anchor)}`]]}})(Q(({theme:e})=>({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(e.vars||e).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0,variants:[{props:{anchor:"left"},style:{left:0}},{props:{anchor:"top"},style:{top:0,left:0,right:0,height:"auto",maxHeight:"100%"}},{props:{anchor:"right"},style:{right:0}},{props:{anchor:"bottom"},style:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"}},{props:({ownerState:r})=>r.anchor==="left"&&r.variant!=="temporary",style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="top"&&r.variant!=="temporary",style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="right"&&r.variant!=="temporary",style:{borderLeft:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="bottom"&&r.variant!=="temporary",style:{borderTop:`1px solid ${(e.vars||e).palette.divider}`}}]}))),je={left:"right",right:"left",top:"down",bottom:"up"};function mt(e){return["left","right"].includes(e)}function ft({direction:e},r){return e==="rtl"&&mt(r)?je[r]:r}const gt=u.forwardRef(function(r,o){const n=me({props:r,name:"MuiDrawer"}),s=K(),l=De(),i={enter:s.transitions.duration.enteringScreen,exit:s.transitions.duration.leavingScreen},{anchor:d="left",BackdropProps:f,children:h,className:m,elevation:v=16,hideBackdrop:y=!1,ModalProps:{BackdropProps:z,...H}={},onClose:I,open:M=!1,PaperProps:j={},SlideProps:C,TransitionComponent:D,transitionDuration:k=i,variant:w="temporary",slots:T={},slotProps:c={},...S}=n,b=u.useRef(!1);u.useEffect(()=>{b.current=!0},[]);const F=ft({direction:l?"rtl":"ltr"},d),R={...n,anchor:d,elevation:v,open:M,variant:w,...S},B=pt(R),P={slots:{transition:D,...T},slotProps:{paper:j,transition:C,...c,backdrop:Te(c.backdrop||{...f,...z},{transitionDuration:k})}},[U,_]=N("root",{ref:o,elementType:ut,className:V(B.root,B.modal,m),shouldForwardComponentProp:!0,ownerState:R,externalForwardedProps:{...P,...S,...H},additionalProps:{open:M,onClose:I,hideBackdrop:y,slots:{backdrop:P.slots.backdrop},slotProps:{backdrop:P.slotProps.backdrop}}}),[O,a]=N("paper",{elementType:xt,shouldForwardComponentProp:!0,className:V(B.paper,j.className),ownerState:R,externalForwardedProps:P,additionalProps:{elevation:w==="temporary"?v:0,square:!0,...w==="temporary"&&{role:"dialog","aria-modal":"true"}}}),[x,L]=N("docked",{elementType:ht,ref:o,className:V(B.root,B.docked,m),ownerState:R,externalForwardedProps:P,additionalProps:S}),[ke,we]=N("transition",{elementType:ct,ownerState:R,externalForwardedProps:P,additionalProps:{in:M,direction:je[F],timeout:k,appear:b.current}}),ae=t.jsx(O,{...a,children:h});if(w==="permanent")return t.jsx(x,{...L,children:ae});const ie=t.jsx(ke,{...we,children:ae});return w==="persistent"?t.jsx(x,{...L,children:ie}):t.jsx(U,{..._,children:ie})}),yt=g([t.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"},"0"),t.jsx("path",{d:"M14 17H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"},"1")]),bt=g(t.jsx("path",{d:"M10.85 12.65h2.3L12 9zM20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12zM14.3 16l-.7-2h-3.2l-.7 2H7.8L11 7h2l3.2 9z"})),jt=g(t.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),vt=g(t.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"})),kt=g(t.jsx("path",{d:"M9.37 5.51c-.18.64-.27 1.31-.27 1.99 0 4.08 3.32 7.4 7.4 7.4.68 0 1.35-.09 1.99-.27C17.45 17.19 14.93 19 12 19c-3.86 0-7-3.14-7-7 0-2.93 1.81-5.45 4.37-6.49M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1"})),wt=g(t.jsx("path",{d:"m14.06 9.02.92.92L5.92 19H5v-.92zM17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29m-3.6 3.19L3 17.25V21h3.75L17.81 9.94z"})),St=g(t.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"})),Mt=g(t.jsx("path",{d:"m12 5.69 5 4.5V18h-2v-6H9v6H7v-7.81zM12 3 2 12h3v8h6v-6h2v6h6v-8h3z"})),Ct=g(t.jsx("path",{d:"M12 9c1.65 0 3 1.35 3 3s-1.35 3-3 3-3-1.35-3-3 1.35-3 3-3m0-2c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z"})),Pt=g(t.jsx("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"})),Et=g([t.jsx("path",{d:"M12 22C6.49 22 2 17.51 2 12S6.49 2 12 2s10 4.04 10 9c0 3.31-2.69 6-6 6h-1.77c-.28 0-.5.22-.5.5 0 .12.05.23.13.33.41.47.64 1.06.64 1.67 0 1.38-1.12 2.5-2.5 2.5m0-18c-4.41 0-8 3.59-8 8s3.59 8 8 8c.28 0 .5-.22.5-.5 0-.16-.08-.28-.14-.35-.41-.46-.63-1.05-.63-1.65 0-1.38 1.12-2.5 2.5-2.5H16c2.21 0 4-1.79 4-4 0-3.86-3.59-7-8-7"},"0"),t.jsx("circle",{cx:"6.5",cy:"11.5",r:"1.5"},"1"),t.jsx("circle",{cx:"9.5",cy:"7.5",r:"1.5"},"2"),t.jsx("circle",{cx:"14.5",cy:"7.5",r:"1.5"},"3"),t.jsx("circle",{cx:"17.5",cy:"11.5",r:"1.5"},"4")]),zt=g(t.jsx("path",{d:"M12 6c3.79 0 7.17 2.13 8.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5C4.83 8.13 8.21 6 12 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4m0 5c1.38 0 2.5 1.12 2.5 2.5S13.38 14 12 14s-2.5-1.12-2.5-2.5S10.62 9 12 9m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7"}));function q(e){return t.jsxs(He,{...e,viewBox:"0 0 24 24",sx:{fill:"none",...e.sx},children:[t.jsx("rect",{x:"3.25",y:"4.75",width:"17.5",height:"14.5",rx:"2.25",stroke:"currentColor",strokeWidth:"1.5"}),t.jsx("line",{x1:"8.5",y1:"5",x2:"8.5",y2:"19",stroke:"currentColor",strokeWidth:"1.5"})]})}const It=/^(.*\/[^/]+\/[^/]+\/(?:dashboards|notebooks)\/([^/]+?))(\/edit)?\/?$/,Dt=/\.malloy(nb)?$/;function Tt(){const{pathname:e}=Z(),r=$e(),o=Oe(),n=It.exec(e);if(!n||o)return null;const[,s,l,i]=n;return Dt.test(l)?null:i?t.jsx(de,{label:"View",icon:t.jsx(zt,{}),onClick:()=>r(s)}):t.jsx(de,{label:"Edit",icon:t.jsx(wt,{}),onClick:()=>r(Ye(s))})}function X({label:e,onClick:r}){return t.jsx(Ne,{clickable:!0,onClick:r,label:e,size:"small","aria-label":`Navigate to ${e}`,sx:o=>({backgroundColor:"transparent",border:`1px solid ${o.palette.divider}`,color:"text.primary",fontWeight:500,fontSize:"0.875rem",height:32,cursor:"pointer",borderRadius:"4px",maxWidth:320,"& .MuiChip-label":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},"&:hover":{backgroundColor:o.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"grey.100"}})})}function Rt(){const e=ye(),r=e["*"]?qe(e["*"]).path:void 0,o=J();return!e.environmentName&&!e.packageName&&!r?null:t.jsx(p,{sx:{display:"flex",alignItems:"center",minWidth:0},children:t.jsxs(at,{"aria-label":"breadcrumb",separator:t.jsx(jt,{sx:{fontSize:14,color:"text.secondary"}}),children:[e.environmentName&&t.jsx(X,{label:e.environmentName,onClick:n=>o(`/${e.environmentName}/`,n)}),e.packageName&&t.jsx(X,{label:e.packageName,onClick:n=>o(`/${e.environmentName}/${e.packageName}/`,n)}),r&&t.jsx(X,{label:r,onClick:n=>o(`/${e.environmentName}/${e.packageName}/${r}`,n)})]})})}const Bt=260,Lt=64;function ve({isCollapsed:e,onToggleCollapse:r,logoHeader:o}){return t.jsxs(p,{sx:{height:"100dvh",width:e?Lt:Bt,flexShrink:0,display:"flex",flexDirection:"column",backgroundColor:"background.paper",transition:"width 0.2s cubic-bezier(0.4, 0, 0.2, 1)",overflow:"hidden"},children:[t.jsx(Ht,{isCollapsed:e,onToggleCollapse:r,logoHeader:o}),t.jsxs(p,{sx:{flex:1,overflowY:"auto",overflowX:"hidden",py:1},children:[t.jsx($t,{isCollapsed:e}),t.jsx(Ot,{isCollapsed:e})]}),t.jsx(Nt,{isCollapsed:e})]})}function Ht({isCollapsed:e,onToggleCollapse:r,logoHeader:o}){const n=J();return o?t.jsxs(p,{sx:{height:56,display:"flex",alignItems:"center",justifyContent:"space-between",px:e?0:2,flexShrink:0},children:[o,t.jsx(Y,{size:"small",onClick:r,"aria-label":e?"Expand sidebar":"Collapse sidebar",children:t.jsx(q,{fontSize:"small"})})]}):t.jsxs(p,{sx:{minHeight:56,display:"flex",flexDirection:e?"column":"row",alignItems:"center",justifyContent:e?"center":"space-between",gap:e?.5:0,py:e?1:0,px:e?0:2,flexShrink:0},children:[t.jsxs(p,{onClick:s=>n("/",s),sx:{display:"flex",alignItems:"center",gap:1,cursor:"pointer",minWidth:0},children:[t.jsx(p,{component:"img",src:"/logo.svg",alt:"Malloy",sx:{width:24,height:24,flexShrink:0}}),!e&&t.jsx(G,{variant:"subtitle1",sx:{color:"text.primary",fontWeight:500,letterSpacing:"-0.025em",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:"Malloy Publisher"})]}),t.jsx(W,{title:e?"Expand sidebar":"Collapse sidebar",placement:"right",children:t.jsx(Y,{size:"small",onClick:r,"aria-label":e?"Expand sidebar":"Collapse sidebar",children:t.jsx(q,{fontSize:"small"})})})]})}function $t({isCollapsed:e}){const o=Z().pathname==="/";return t.jsx(ee,{sx:{py:0},children:t.jsx(oe,{icon:t.jsx(Mt,{fontSize:"small"}),label:"Home",to:"/",selected:o,isCollapsed:e})})}function Ot({isCollapsed:e}){const{apiClients:r}=Ae(),o=ye(),{data:n}=Ve({queryKey:["environments"],queryFn:()=>r.environments.listEnvironments()}),s=n?.data??[];return s.length===0?null:t.jsxs(p,{sx:{mt:1},children:[!e&&t.jsx(G,{variant:"caption",sx:{display:"block",px:3,py:1,color:"text.secondary",fontWeight:500,textTransform:"uppercase",fontSize:"0.6875rem",letterSpacing:"0.5px"},children:"Environments"}),t.jsx(ee,{sx:{py:0},children:s.map(l=>{const i=l.name??"";return t.jsx(oe,{icon:t.jsx(St,{fontSize:"small"}),label:i,to:`/${i}`,selected:o.environmentName===i,isCollapsed:e},i)})})]})}function Nt({isCollapsed:e}){const{pathname:r}=Z(),o=[{label:"Malloy Docs",href:pe.docsHome,icon:t.jsx(yt,{fontSize:"small"}),external:!0},{label:"Publisher Docs",href:pe.publishing,icon:t.jsx(Pt,{fontSize:"small"}),external:!0},{label:"Publisher API",href:"/api-doc.html",icon:t.jsx(vt,{fontSize:"small"}),external:!1}];return t.jsxs(ee,{sx:{py:1},children:[t.jsx(oe,{icon:t.jsx(Et,{fontSize:"small"}),label:"Theme",to:"/settings/theme",selected:r.startsWith("/settings/theme"),isCollapsed:e}),t.jsx(Ft,{isCollapsed:e}),o.map(n=>t.jsx(At,{label:n.label,href:n.href,icon:n.icon,external:n.external,isCollapsed:e},n.label))]})}function oe({icon:e,label:r,to:o,selected:n,isCollapsed:s}){const l=J(),i=t.jsxs(te,{selected:n,onClick:d=>l(o,d),sx:{justifyContent:s?"center":"flex-start",px:s?0:2},children:[t.jsx(re,{sx:{minWidth:s?0:36,justifyContent:"center",color:n?"text.primary":"text.secondary"},children:e}),!s&&t.jsx(ne,{primary:r,primaryTypographyProps:{variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})]});return s?t.jsx(W,{title:r,placement:"right",children:t.jsx(p,{children:i})}):i}function At({label:e,href:r,icon:o,external:n,isCollapsed:s}){const l=t.jsxs(te,{component:"a",href:r,target:n?"_blank":void 0,rel:n?"noopener noreferrer":void 0,sx:{justifyContent:s?"center":"flex-start",px:s?0:2},children:[t.jsx(re,{sx:{minWidth:s?0:36,justifyContent:"center",color:"text.secondary"},children:o}),!s&&t.jsx(ne,{primary:e,primaryTypographyProps:{variant:"body2",sx:{color:"text.secondary",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})]});return s?t.jsx(W,{title:e,placement:"right",children:t.jsx(p,{children:l})}):l}const Vt={light:"dark",dark:"auto",auto:"light"},Wt={light:"Light mode",dark:"Dark mode",auto:"Auto mode"},ue={light:"Light mode (click for dark)",dark:"Dark mode (click for auto)",auto:"Auto mode (follows OS, click for light)"};function Ft({isCollapsed:e}){const{mode:r,userChoice:o,setMode:n,allowUserToggle:s}=We();if(!s)return null;const l=o??r,i=l==="auto"?bt:l==="dark"?kt:Ct,d=t.jsxs(te,{"aria-label":ue[l],onClick:()=>n(Vt[l]),sx:{justifyContent:e?"center":"flex-start",px:e?0:2},children:[t.jsx(re,{sx:{minWidth:e?0:36,justifyContent:"center",color:"text.secondary"},children:t.jsx(i,{fontSize:"small"})}),!e&&t.jsx(ne,{primary:Wt[l],primaryTypographyProps:{variant:"body2",sx:{color:"text.secondary",whiteSpace:"nowrap"}}})]});return t.jsx(W,{title:ue[l],placement:"right",disableHoverListener:!e,children:t.jsx(p,{children:d})})}function Ut({open:e,onClose:r,logoHeader:o}){return t.jsx(gt,{anchor:"left",open:e,onClose:r,ModalProps:{keepMounted:!0},sx:{display:{xs:"block",md:"none"},"& .MuiDrawer-paper":{boxSizing:"border-box",width:260}},children:t.jsx(ve,{isCollapsed:!1,onToggleCollapse:r,logoHeader:o})})}function Yt({headerProps:e}){const r=K(),o=Fe(r.breakpoints.up("md")),[n,s]=u.useState(!1),[l,i]=u.useState(!1);return u.useEffect(()=>{o&&n&&s(!1)},[o,n]),t.jsxs(p,{sx:{height:"100dvh",display:"flex",flexDirection:"row",bgcolor:"background.default"},children:[o&&t.jsx(ve,{isCollapsed:l,onToggleCollapse:()=>i(d=>!d),logoHeader:e?.logoHeader}),t.jsxs(p,{component:"main",sx:{flex:1,display:"flex",flexDirection:"column",minWidth:0},children:[t.jsxs(p,{sx:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"space-between",height:Ue.headerHeight,px:{xs:1,md:3},backgroundColor:"background.default"},children:[t.jsx(p,{sx:{display:{xs:"flex",md:"none"},alignItems:"center",mr:1},children:t.jsx(Y,{size:"small",onClick:()=>s(!0),"aria-label":"Open navigation",children:t.jsx(q,{fontSize:"small"})})}),t.jsx(p,{sx:{flex:1,minWidth:0,display:"flex",alignItems:"center"},children:t.jsx(Rt,{})}),t.jsxs(p,{id:"header-actions-portal",sx:{display:"flex",alignItems:"center",flexShrink:0,gap:1},children:[t.jsx(Tt,{}),e?.endCap]})]}),t.jsx(p,{sx:{flex:1,overflow:"auto",minWidth:320,minHeight:0},children:t.jsx(u.Suspense,{fallback:t.jsx(Xe,{}),children:t.jsx(_e,{})})})]}),t.jsx(Ut,{open:n,onClose:()=>s(!1),logoHeader:e?.logoHeader})]})}export{Yt as default};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.es-Bhhg6pWY.js","assets/index-BIqIsMFr.js","assets/index-DUqldpo0.css","assets/ToggleButtonGroup-BKiI79mw.js"])))=>i.map(i=>d[i]);
2
- import{g as B,a as q,$ as f,a0 as G,r as d,u as O,h as H,j as o,d as K,y as P,f as J,s as Q,T as b,m as X,a1 as Y,a2 as L,q as S,a3 as C,D as _,F as m,a4 as Z,a5 as g,a6 as w,a7 as ee,a8 as ne,a9 as T,aa as te,ab as oe,_ as U,ac as F,ad as se,ae,af as re,E as ie,N as le,ag as ce,ah as ue,ai as de,aj as x}from"./index-BIqIsMFr.js";import{s as R}from"./documentRoutes-D_78AAbq.js";function pe(e){return B("MuiLink",e)}const me=q("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),he=({theme:e,ownerState:n})=>{const t=n.color;if("colorSpace"in e&&e.colorSpace){const a=f(e,`palette.${t}.main`)||f(e,`palette.${t}`)||n.color;return e.alpha(a,.4)}const s=f(e,`palette.${t}.main`,!1)||f(e,`palette.${t}`,!1)||n.color,l=f(e,`palette.${t}.mainChannel`)||f(e,`palette.${t}Channel`);return"vars"in e&&l?`rgba(${l} / 0.4)`:G(s,.4)},$={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},xe=e=>{const{classes:n,component:t,focusVisible:s,underline:l}=e,a={root:["root",`underline${P(l)}`,t==="button"&&"button",s&&"focusVisible"]};return J(a,pe,n)},fe=Q(b,{name:"MuiLink",slot:"Root",overridesResolver:(e,n)=>{const{ownerState:t}=e;return[n.root,n[`underline${P(t.underline)}`],t.component==="button"&&n.button]}})(X(({theme:e})=>({variants:[{props:{underline:"none"},style:{textDecoration:"none"}},{props:{underline:"hover"},style:{textDecoration:"none","&:hover":{textDecoration:"underline"}}},{props:{underline:"always"},style:{textDecoration:"underline","&:hover":{textDecorationColor:"inherit"}}},{props:({underline:n,ownerState:t})=>n==="always"&&t.color!=="inherit",style:{textDecorationColor:"var(--Link-underlineColor)"}},{props:({underline:n,ownerState:t})=>n==="always"&&t.color==="inherit",style:e.colorSpace?{textDecorationColor:e.alpha("currentColor",.4)}:null},...Object.entries(e.palette).filter(Y()).map(([n])=>({props:{underline:"always",color:n},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette[n].main,.4)}})),{props:{underline:"always",color:"textPrimary"},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette.text.primary,.4)}},{props:{underline:"always",color:"textSecondary"},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette.text.secondary,.4)}},{props:{underline:"always",color:"textDisabled"},style:{"--Link-underlineColor":(e.vars||e).palette.text.disabled}},{props:{component:"button"},style:{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${me.focusVisible}`]:{outline:"auto"}}}]}))),ye=d.forwardRef(function(n,t){const s=O({props:n,name:"MuiLink"}),l=H(),{className:a,color:r="primary",component:u="a",onBlur:i,onFocus:c,TypographyClasses:p,underline:h="always",variant:v="inherit",sx:k,...D}=s,[M,E]=d.useState(!1),N=y=>{L(y.target)||E(!1),i&&i(y)},I=y=>{L(y.target)&&E(!0),c&&c(y)},j={...s,color:r,component:u,focusVisible:M,underline:h,variant:v},z=xe(j);return o.jsx(fe,{color:r,className:K(z.root,a),classes:p,component:u,onBlur:N,onFocus:I,ref:t,ownerState:j,variant:v,...D,sx:[...$[r]===void 0?[{color:r}]:[],...Array.isArray(k)?k:[k]],style:{...D.style,...h==="always"&&r!=="inherit"&&!$[r]&&{"--Link-underlineColor":he({theme:l,ownerState:j})}}})});function V(e,n){const t=S();return d.useCallback((s,l)=>{const a=new URLSearchParams(s.givens).toString(),r=encodeURIComponent(e),u=encodeURIComponent(n),i=encodeURIComponent(s.dashboard);t(`/${r}/${u}/dashboards/${i}`+(a?`?${a}`:""),l)},[t,e,n])}function A({environmentName:e,packageName:n,notebookPath:t}){const{params:s,onGivensChange:l}=C(),a=V(e,n),r=S(),u=t.endsWith(".malloy"),i=_();return d.useEffect(()=>{if(!u||i)return;const c=()=>void w(()=>import("./index.es-Bhhg6pWY.js"),__vite__mapDeps([0,1,2,3])),p=window.requestIdleCallback;if(p){const v=p(c);return()=>window.cancelIdleCallback?.(v)}const h=setTimeout(c,1500);return()=>clearTimeout(h)},[u,i]),o.jsx(m,{sx:{p:3,maxWidth:1600,mx:"auto"},children:o.jsx(Z,{resourceUri:g({environmentName:e,packageName:n,modelPath:t}),maxResultSize:1024*1024,givens:s,onGivensChange:l,onNavigate:r,onDrillNavigate:a})})}function be(){const[e,n]=d.useState(!1),t=d.useRef(!1),s=d.useRef(!1),l=d.useCallback(i=>{t.current=i,n(i)},[]),a=d.useCallback(()=>{s.current=!0},[]),r=ee(d.useCallback(({currentLocation:i,nextLocation:c})=>t.current&&!s.current&&i.pathname!==c.pathname,[]));d.useEffect(()=>{if(!e)return;const i=c=>{c.preventDefault(),c.returnValue=""};return window.addEventListener("beforeunload",i),()=>window.removeEventListener("beforeunload",i)},[e]);const u=o.jsx(ne,{open:r.state==="blocked",canSave:!1,onKeepEditing:()=>r.reset?.(),onDiscard:()=>r.proceed?.()});return{onDirtyChange:l,leaving:a,dialog:u}}const ge=se.lazy(()=>w(()=>import("./index.es-Bhhg6pWY.js"),__vite__mapDeps([0,1,2,3])).then(e=>({default:e.DashboardEditor})));function ve({environmentName:e,packageName:n,dashboardName:t,kind:s="dashboard",path:l}){const a=be(),r=d.useMemo(()=>s==="dashboard"?T({environmentName:e,packageName:n,dashboardName:t}):te({environmentName:e,packageName:n,notebookName:t}),[s,e,n,t]);return o.jsxs(m,{sx:{p:3,maxWidth:1600,mx:"auto"},children:[o.jsx(oe,{children:o.jsx(d.Suspense,{fallback:o.jsx(U,{text:F.opening("builder")}),children:o.jsx(ge,{resourceUri:g({environmentName:e,packageName:n}),dashboard:t,kind:s,path:l,onDirtyChange:a.onDirtyChange,onEvent:r},`${e}/${n}/${s}/${t}`)})}),a.dialog]})}function ke({environmentName:e,packageName:n,dashboardName:t}){const{params:s,onGivensChange:l}=C(),a=V(e,n),r=d.useMemo(()=>T({environmentName:e,packageName:n,dashboardName:t}),[e,n,t]),u=_();return d.useEffect(()=>{if(u)return;const i=()=>void w(()=>import("./index.es-Bhhg6pWY.js"),__vite__mapDeps([0,1,2,3])),c=window.requestIdleCallback;if(c){const h=c(i);return()=>window.cancelIdleCallback?.(h)}const p=setTimeout(i,1500);return()=>clearTimeout(p)},[u]),o.jsx(m,{sx:{p:3,maxWidth:1600,mx:"auto"},children:o.jsx(ae,{resourceUri:g({environmentName:e,packageName:n}),dashboard:t,givens:s,onGivensChange:l,onNavigate:a,onEvent:r,maxResultSize:1024*1024})})}function W({environmentName:e,packageName:n,routeKind:t,slug:s,edit:l}){const{location:a,settled:r}=re(e,n,t,s);if(!r)return o.jsx(U,{text:F.opening()});const u=a?.kind??t;return l?o.jsx(ve,{environmentName:e,packageName:n,dashboardName:s,kind:u,...a?{path:a.path}:{}}):u==="dashboard"?o.jsx(ke,{environmentName:e,packageName:n,dashboardName:s}):o.jsx(A,{environmentName:e,packageName:n,notebookPath:a?.path??`notebooks/${s}.malloy`})}function we(){const e=ie(),n=e["*"],{server:t}=le(),{params:s,onGivensChange:l}=C();if(!e.environmentName)return o.jsx("div",{children:o.jsx("h2",{children:"Missing environment name"})});if(!e.packageName)return o.jsx("div",{children:o.jsx("h2",{children:"Missing package name"})});const a={p:3,maxWidth:1200,mx:"auto"};if(n?.startsWith("dashboards/")&&!n.endsWith(".malloy")&&!n.endsWith(".malloynb")){const c=n.slice(11),{path:p,edit:h}=R(c);return o.jsx(W,{environmentName:e.environmentName,packageName:e.packageName,routeKind:"dashboard",slug:p,edit:h})}if(n?.startsWith("notebooks/")&&!n.endsWith(".malloy")&&!n.endsWith(".malloynb")){const c=n.slice(10),{path:p,edit:h}=R(c);return o.jsx(W,{environmentName:e.environmentName,packageName:e.packageName,routeKind:"notebook",slug:p,edit:h})}if(n?.startsWith("data-apps/")&&!n.endsWith(".malloy")&&!n.endsWith(".malloynb")){const c=n.slice(10),p=g({environmentName:e.environmentName,packageName:e.packageName,modelPath:c});return o.jsx(ce,{resourceUri:p})}const r=g({environmentName:e.environmentName,packageName:e.packageName,modelPath:n});if(n?.endsWith(".malloy"))return o.jsx(m,{sx:a,children:o.jsx(ue,{resourceUri:r,runOnDemand:!0,maxResultSize:512*1024,givens:s,onGivensChange:l})});if(n?.endsWith(".malloynb"))return o.jsx(A,{environmentName:e.environmentName,packageName:e.packageName,notebookPath:n});const u=/\.[^./]+$/.test(n??""),i=de({server:t,environmentName:e.environmentName,packageName:e.packageName,path:n??""});return o.jsxs(m,{sx:a,children:[o.jsx(b,{variant:"h6",sx:{fontWeight:"fontWeightMedium"},children:"Nothing to open at this path"}),o.jsxs(b,{variant:"body2",color:"text.secondary",sx:{mt:1},children:[o.jsx(m,{component:"span",sx:{fontFamily:x},children:n})," ","does not name a"," ",o.jsx(m,{component:"span",sx:{fontFamily:x},children:".malloy"})," ","or"," ",o.jsx(m,{component:"span",sx:{fontFamily:x},children:".malloynb"})," ","file in package"," ",o.jsx(m,{component:"span",sx:{fontFamily:x},children:e.packageName}),". This address opens"," ",o.jsx(m,{component:"span",sx:{fontFamily:x},children:".malloy"})," ","and"," ",o.jsx(m,{component:"span",sx:{fontFamily:x},children:".malloynb"})," ","files."]}),u&&o.jsxs(b,{variant:"body2",color:"text.secondary",sx:{mt:1},children:["A file from the package's"," ",o.jsx(m,{component:"span",sx:{fontFamily:x},children:"public/"})," ","directory is served at ",o.jsx(ye,{href:i,children:i}),"."]}),o.jsx(b,{variant:"body2",color:"text.secondary",sx:{mt:1},children:"The package lists its models, notebooks, and data apps."})]})}export{we as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.es-B2kJpnhe.js","assets/index-hnA8HjeH.js","assets/index-DUqldpo0.css","assets/ToggleButtonGroup-Bwj7gIJm.js"])))=>i.map(i=>d[i]);
2
+ import{g as B,a as q,$ as f,a0 as G,r as d,u as O,h as H,j as o,d as K,y as P,f as J,s as Q,T as b,m as X,a1 as Y,a2 as L,q as S,a3 as C,D as _,F as m,a4 as Z,a5 as g,a6 as w,a7 as ee,a8 as ne,a9 as T,aa as te,ab as oe,_ as U,ac as F,ad as se,ae,af as re,E as ie,N as le,ag as ce,ah as ue,ai as de,aj as x}from"./index-hnA8HjeH.js";import{s as R}from"./documentRoutes-DGm_-EUy.js";function pe(e){return B("MuiLink",e)}const me=q("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),he=({theme:e,ownerState:n})=>{const t=n.color;if("colorSpace"in e&&e.colorSpace){const a=f(e,`palette.${t}.main`)||f(e,`palette.${t}`)||n.color;return e.alpha(a,.4)}const s=f(e,`palette.${t}.main`,!1)||f(e,`palette.${t}`,!1)||n.color,l=f(e,`palette.${t}.mainChannel`)||f(e,`palette.${t}Channel`);return"vars"in e&&l?`rgba(${l} / 0.4)`:G(s,.4)},$={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},xe=e=>{const{classes:n,component:t,focusVisible:s,underline:l}=e,a={root:["root",`underline${P(l)}`,t==="button"&&"button",s&&"focusVisible"]};return J(a,pe,n)},fe=Q(b,{name:"MuiLink",slot:"Root",overridesResolver:(e,n)=>{const{ownerState:t}=e;return[n.root,n[`underline${P(t.underline)}`],t.component==="button"&&n.button]}})(X(({theme:e})=>({variants:[{props:{underline:"none"},style:{textDecoration:"none"}},{props:{underline:"hover"},style:{textDecoration:"none","&:hover":{textDecoration:"underline"}}},{props:{underline:"always"},style:{textDecoration:"underline","&:hover":{textDecorationColor:"inherit"}}},{props:({underline:n,ownerState:t})=>n==="always"&&t.color!=="inherit",style:{textDecorationColor:"var(--Link-underlineColor)"}},{props:({underline:n,ownerState:t})=>n==="always"&&t.color==="inherit",style:e.colorSpace?{textDecorationColor:e.alpha("currentColor",.4)}:null},...Object.entries(e.palette).filter(Y()).map(([n])=>({props:{underline:"always",color:n},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette[n].main,.4)}})),{props:{underline:"always",color:"textPrimary"},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette.text.primary,.4)}},{props:{underline:"always",color:"textSecondary"},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette.text.secondary,.4)}},{props:{underline:"always",color:"textDisabled"},style:{"--Link-underlineColor":(e.vars||e).palette.text.disabled}},{props:{component:"button"},style:{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${me.focusVisible}`]:{outline:"auto"}}}]}))),ye=d.forwardRef(function(n,t){const s=O({props:n,name:"MuiLink"}),l=H(),{className:a,color:r="primary",component:u="a",onBlur:i,onFocus:c,TypographyClasses:p,underline:h="always",variant:v="inherit",sx:k,...D}=s,[M,E]=d.useState(!1),N=y=>{L(y.target)||E(!1),i&&i(y)},I=y=>{L(y.target)&&E(!0),c&&c(y)},j={...s,color:r,component:u,focusVisible:M,underline:h,variant:v},z=xe(j);return o.jsx(fe,{color:r,className:K(z.root,a),classes:p,component:u,onBlur:N,onFocus:I,ref:t,ownerState:j,variant:v,...D,sx:[...$[r]===void 0?[{color:r}]:[],...Array.isArray(k)?k:[k]],style:{...D.style,...h==="always"&&r!=="inherit"&&!$[r]&&{"--Link-underlineColor":he({theme:l,ownerState:j})}}})});function V(e,n){const t=S();return d.useCallback((s,l)=>{const a=new URLSearchParams(s.givens).toString(),r=encodeURIComponent(e),u=encodeURIComponent(n),i=encodeURIComponent(s.dashboard);t(`/${r}/${u}/dashboards/${i}`+(a?`?${a}`:""),l)},[t,e,n])}function A({environmentName:e,packageName:n,notebookPath:t}){const{params:s,onGivensChange:l}=C(),a=V(e,n),r=S(),u=t.endsWith(".malloy"),i=_();return d.useEffect(()=>{if(!u||i)return;const c=()=>void w(()=>import("./index.es-B2kJpnhe.js"),__vite__mapDeps([0,1,2,3])),p=window.requestIdleCallback;if(p){const v=p(c);return()=>window.cancelIdleCallback?.(v)}const h=setTimeout(c,1500);return()=>clearTimeout(h)},[u,i]),o.jsx(m,{sx:{p:3,maxWidth:1600,mx:"auto"},children:o.jsx(Z,{resourceUri:g({environmentName:e,packageName:n,modelPath:t}),maxResultSize:1024*1024,givens:s,onGivensChange:l,onNavigate:r,onDrillNavigate:a})})}function be(){const[e,n]=d.useState(!1),t=d.useRef(!1),s=d.useRef(!1),l=d.useCallback(i=>{t.current=i,n(i)},[]),a=d.useCallback(()=>{s.current=!0},[]),r=ee(d.useCallback(({currentLocation:i,nextLocation:c})=>t.current&&!s.current&&i.pathname!==c.pathname,[]));d.useEffect(()=>{if(!e)return;const i=c=>{c.preventDefault(),c.returnValue=""};return window.addEventListener("beforeunload",i),()=>window.removeEventListener("beforeunload",i)},[e]);const u=o.jsx(ne,{open:r.state==="blocked",canSave:!1,onKeepEditing:()=>r.reset?.(),onDiscard:()=>r.proceed?.()});return{onDirtyChange:l,leaving:a,dialog:u}}const ge=se.lazy(()=>w(()=>import("./index.es-B2kJpnhe.js"),__vite__mapDeps([0,1,2,3])).then(e=>({default:e.DashboardEditor})));function ve({environmentName:e,packageName:n,dashboardName:t,kind:s="dashboard",path:l}){const a=be(),r=d.useMemo(()=>s==="dashboard"?T({environmentName:e,packageName:n,dashboardName:t}):te({environmentName:e,packageName:n,notebookName:t}),[s,e,n,t]);return o.jsxs(m,{sx:{p:3,maxWidth:1600,mx:"auto"},children:[o.jsx(oe,{children:o.jsx(d.Suspense,{fallback:o.jsx(U,{text:F.opening("builder")}),children:o.jsx(ge,{resourceUri:g({environmentName:e,packageName:n}),dashboard:t,kind:s,path:l,onDirtyChange:a.onDirtyChange,onEvent:r},`${e}/${n}/${s}/${t}`)})}),a.dialog]})}function ke({environmentName:e,packageName:n,dashboardName:t}){const{params:s,onGivensChange:l}=C(),a=V(e,n),r=d.useMemo(()=>T({environmentName:e,packageName:n,dashboardName:t}),[e,n,t]),u=_();return d.useEffect(()=>{if(u)return;const i=()=>void w(()=>import("./index.es-B2kJpnhe.js"),__vite__mapDeps([0,1,2,3])),c=window.requestIdleCallback;if(c){const h=c(i);return()=>window.cancelIdleCallback?.(h)}const p=setTimeout(i,1500);return()=>clearTimeout(p)},[u]),o.jsx(m,{sx:{p:3,maxWidth:1600,mx:"auto"},children:o.jsx(ae,{resourceUri:g({environmentName:e,packageName:n}),dashboard:t,givens:s,onGivensChange:l,onNavigate:a,onEvent:r,maxResultSize:1024*1024})})}function W({environmentName:e,packageName:n,routeKind:t,slug:s,edit:l}){const{location:a,settled:r}=re(e,n,t,s);if(!r)return o.jsx(U,{text:F.opening()});const u=a?.kind??t;return l?o.jsx(ve,{environmentName:e,packageName:n,dashboardName:s,kind:u,...a?{path:a.path}:{}}):u==="dashboard"?o.jsx(ke,{environmentName:e,packageName:n,dashboardName:s}):o.jsx(A,{environmentName:e,packageName:n,notebookPath:a?.path??`notebooks/${s}.malloy`})}function we(){const e=ie(),n=e["*"],{server:t}=le(),{params:s,onGivensChange:l}=C();if(!e.environmentName)return o.jsx("div",{children:o.jsx("h2",{children:"Missing environment name"})});if(!e.packageName)return o.jsx("div",{children:o.jsx("h2",{children:"Missing package name"})});const a={p:3,maxWidth:1200,mx:"auto"};if(n?.startsWith("dashboards/")&&!n.endsWith(".malloy")&&!n.endsWith(".malloynb")){const c=n.slice(11),{path:p,edit:h}=R(c);return o.jsx(W,{environmentName:e.environmentName,packageName:e.packageName,routeKind:"dashboard",slug:p,edit:h})}if(n?.startsWith("notebooks/")&&!n.endsWith(".malloy")&&!n.endsWith(".malloynb")){const c=n.slice(10),{path:p,edit:h}=R(c);return o.jsx(W,{environmentName:e.environmentName,packageName:e.packageName,routeKind:"notebook",slug:p,edit:h})}if(n?.startsWith("data-apps/")&&!n.endsWith(".malloy")&&!n.endsWith(".malloynb")){const c=n.slice(10),p=g({environmentName:e.environmentName,packageName:e.packageName,modelPath:c});return o.jsx(ce,{resourceUri:p})}const r=g({environmentName:e.environmentName,packageName:e.packageName,modelPath:n});if(n?.endsWith(".malloy"))return o.jsx(m,{sx:a,children:o.jsx(ue,{resourceUri:r,runOnDemand:!0,maxResultSize:512*1024,givens:s,onGivensChange:l})});if(n?.endsWith(".malloynb"))return o.jsx(A,{environmentName:e.environmentName,packageName:e.packageName,notebookPath:n});const u=/\.[^./]+$/.test(n??""),i=de({server:t,environmentName:e.environmentName,packageName:e.packageName,path:n??""});return o.jsxs(m,{sx:a,children:[o.jsx(b,{variant:"h6",sx:{fontWeight:"fontWeightMedium"},children:"Nothing to open at this path"}),o.jsxs(b,{variant:"body2",color:"text.secondary",sx:{mt:1},children:[o.jsx(m,{component:"span",sx:{fontFamily:x},children:n})," ","does not name a"," ",o.jsx(m,{component:"span",sx:{fontFamily:x},children:".malloy"})," ","or"," ",o.jsx(m,{component:"span",sx:{fontFamily:x},children:".malloynb"})," ","file in package"," ",o.jsx(m,{component:"span",sx:{fontFamily:x},children:e.packageName}),". This address opens"," ",o.jsx(m,{component:"span",sx:{fontFamily:x},children:".malloy"})," ","and"," ",o.jsx(m,{component:"span",sx:{fontFamily:x},children:".malloynb"})," ","files."]}),u&&o.jsxs(b,{variant:"body2",color:"text.secondary",sx:{mt:1},children:["A file from the package's"," ",o.jsx(m,{component:"span",sx:{fontFamily:x},children:"public/"})," ","directory is served at ",o.jsx(ye,{href:i,children:i}),"."]}),o.jsx(b,{variant:"body2",color:"text.secondary",sx:{mt:1},children:"The package lists its models, notebooks, and data apps."})]})}export{we as default};
@@ -1 +1 @@
1
- import{E as m,q as u,j as e,a5 as d,ak as l}from"./index-BIqIsMFr.js";import{d as g}from"./documentRoutes-D_78AAbq.js";function h(){const{environmentName:n,packageName:a}=m(),s=u();if(n)if(a){const i=d({environmentName:n,packageName:a});return e.jsx(l,{onClickPackageFile:s,onOpenDocument:({kind:r,slug:t,mode:o},c)=>s(g(n,a,r,t,o),c),resourceUri:i})}else return e.jsx("div",{children:e.jsx("h2",{children:"Missing package name"})});else return e.jsx("div",{children:e.jsx("h2",{children:"Missing environment name"})})}export{h as default};
1
+ import{E as m,q as u,j as e,a5 as d,ak as l}from"./index-hnA8HjeH.js";import{d as g}from"./documentRoutes-DGm_-EUy.js";function h(){const{environmentName:n,packageName:a}=m(),s=u();if(n)if(a){const i=d({environmentName:n,packageName:a});return e.jsx(l,{onClickPackageFile:s,onOpenDocument:({kind:r,slug:t,mode:o},c)=>s(g(n,a,r,t,o),c),resourceUri:i})}else return e.jsx("div",{children:e.jsx("h2",{children:"Missing package name"})});else return e.jsx("div",{children:e.jsx("h2",{children:"Missing environment name"})})}export{h as default};
@@ -1,4 +1,4 @@
1
- import{j as $,F as oe,r as p,aN as he,R as ue,h as me,aO as be,at as ye,aP as K,aQ as pe,aR as fe,aS as ge,aT as ve,aU as we,aV as ke,aW as ne}from"./index-BIqIsMFr.js";const v="publisher-drill";function xe(e,t){const r=new Set;let l;try{l=e.getMetadata()?.getAllFields()??[]}catch{return r}const o=new Set;for(const a of l)!a||t(a)||a.tag?.tag("hidden")===void 0&&o.add(a.tag?.text("label")??a.name);for(const a of l){if(!a||!t(a))continue;const n=a.tag?.text("label")??a.name;o.has(n)||r.add(n)}return r}function D(e){const t=/^\s*(\d+)/.exec(e.style?.gridColumn??"");return t?t[1]:void 0}function Ce(e,t){if(t.size!==0)for(const r of e.querySelectorAll(".malloy-table")){const l=n=>n.closest(".malloy-table")===r,o=new Set;for(const n of r.querySelectorAll(".column-cell.th")){if(!l(n))continue;const i=(n.textContent??"").replace(/\u200b/g,"").trim(),b=D(n);b&&t.has(i)&&o.add(b)}if(o.size===0)continue;const a=new Set;for(const n of r.querySelectorAll(`.${v}[tabindex="0"]`)){if(!l(n))continue;const i=D(n);i&&(a.has(i)?n.tabIndex=-1:a.add(i))}for(const n of r.querySelectorAll(".column-cell.td")){if(!l(n))continue;const i=D(n),b=!n.querySelector(".value-null")&&(n.textContent??"").trim()!=="";if(i&&b&&o.has(i)&&!n.querySelector(".malloy-table")){if(n.classList.add(v),n.tabIndex===0)a.add(i);else{const f=a.has(i);f||a.add(i),n.tabIndex=f?-1:0}n.setAttribute("role","button")}}}}function Ae(e){const t=e.closest(".malloy-table"),r=D(e);return!t||!r?[]:Array.from(t.querySelectorAll(`.${v}`)).filter(l=>l.closest(".malloy-table")===t&&D(l)===r)}function le(e,t){const r=Ae(e),l=r.indexOf(e);if(l===-1)return;const o=t==="first"?r[0]:t==="last"?r[r.length-1]:r[Math.min(Math.max(l+t,0),r.length-1)];if(o){for(const a of r)a.tabIndex=a===o?0:-1;return o}}function Se(e){return{background:e.dashboardRoot,tableBackground:e.tableBackground,tableHeaderColor:e.tableHeader,tableBodyColor:e.tableBody,tableBorder:e.border,tablePinnedBackground:e.tableHeaderBackground,tablePinnedBorder:e.pinnedBorder,tableFontSize:`${e.font.size}px`,fontFamily:e.font.family,mapColor:e.mapColor}}function Ee(e){const{foreground:t,axisFaint:r,gridline:l,font:o}=e,a={background:e.background,font:o.family,title:{color:t,font:o.family},axis:{labelColor:t,titleColor:t,domainColor:r,tickColor:r,gridColor:l,labelFont:o.family,titleFont:o.family},legend:{labelColor:t,titleColor:t,labelFont:o.family,titleFont:o.family},header:{labelColor:t,titleColor:t},range:{category:e.series}},n={...a,legend:{...a.legend,orient:"bottom"}};return i=>i==="shape_map"?n:a}function ze(e){if(!e)return;const t=e.tag("theme");if(!t)return;const r={},l=t.tag("palette");if(l){const a={},n=l.textArray("series");n&&n.length>0&&(a.series=n);for(const i of he){const b=l.tag(i);if(!b)continue;const f={},x=b.text("light"),w=b.text("dark");x&&(f.light=x),w&&(f.dark=w),Object.keys(f).length>0&&(a[i]=f)}Object.keys(a).length>0&&(r.palette=a)}const o=t.tag("font");if(o){const a={},n=o.text("family");n&&(a.family=n);const i=o.numeric("size");typeof i=="number"&&Number.isFinite(i)&&(a.size=i),Object.keys(a).length>0&&(r.font=a)}return Object.keys(r).length>0?r:void 0}const B="data-publisher-fill",Re=async(e,t)=>{if(typeof window>"u")throw new Error("MalloyRenderer can only be used in browser environment");const{MalloyRenderer:r}=await fe();return new r({onClick:t,vegaConfigOverride:Ee(e),theme:Se(e),onError:l=>{console.error("Error rendering visualization:",typeof l,l)}}).createViz()};async function Fe(e){if(!e||typeof e!="object")return;const t=e,r=[...Array.isArray(t.model_annotations)?t.model_annotations:[],...Array.isArray(t.source_annotations)?t.source_annotations:[],...Array.isArray(t.annotations)?t.annotations:[]].map(o=>typeof o?.value=="string"?o.value:void 0).filter(o=>!!o);if(r.length===0)return;let l;try{({parseAnnotation:l}=await pe())}catch{return}try{const{tag:o}=l(r);return ze(o)}catch(o){console.warn("Failed to parse # theme.* annotations; chart will render with the shell theme.",{error:o,lines:r});return}}function Te(e,t,r){const l=ge(t,r);for(const[o,a]of Object.entries(l))e.style.setProperty(o,a)}const je=`
1
+ import{j as $,F as oe,r as p,aN as he,R as ue,h as me,aO as be,at as ye,aP as K,aQ as pe,aR as fe,aS as ge,aT as ve,aU as we,aV as ke,aW as ne}from"./index-hnA8HjeH.js";const v="publisher-drill";function xe(e,t){const r=new Set;let l;try{l=e.getMetadata()?.getAllFields()??[]}catch{return r}const o=new Set;for(const a of l)!a||t(a)||a.tag?.tag("hidden")===void 0&&o.add(a.tag?.text("label")??a.name);for(const a of l){if(!a||!t(a))continue;const n=a.tag?.text("label")??a.name;o.has(n)||r.add(n)}return r}function D(e){const t=/^\s*(\d+)/.exec(e.style?.gridColumn??"");return t?t[1]:void 0}function Ce(e,t){if(t.size!==0)for(const r of e.querySelectorAll(".malloy-table")){const l=n=>n.closest(".malloy-table")===r,o=new Set;for(const n of r.querySelectorAll(".column-cell.th")){if(!l(n))continue;const i=(n.textContent??"").replace(/\u200b/g,"").trim(),b=D(n);b&&t.has(i)&&o.add(b)}if(o.size===0)continue;const a=new Set;for(const n of r.querySelectorAll(`.${v}[tabindex="0"]`)){if(!l(n))continue;const i=D(n);i&&(a.has(i)?n.tabIndex=-1:a.add(i))}for(const n of r.querySelectorAll(".column-cell.td")){if(!l(n))continue;const i=D(n),b=!n.querySelector(".value-null")&&(n.textContent??"").trim()!=="";if(i&&b&&o.has(i)&&!n.querySelector(".malloy-table")){if(n.classList.add(v),n.tabIndex===0)a.add(i);else{const f=a.has(i);f||a.add(i),n.tabIndex=f?-1:0}n.setAttribute("role","button")}}}}function Ae(e){const t=e.closest(".malloy-table"),r=D(e);return!t||!r?[]:Array.from(t.querySelectorAll(`.${v}`)).filter(l=>l.closest(".malloy-table")===t&&D(l)===r)}function le(e,t){const r=Ae(e),l=r.indexOf(e);if(l===-1)return;const o=t==="first"?r[0]:t==="last"?r[r.length-1]:r[Math.min(Math.max(l+t,0),r.length-1)];if(o){for(const a of r)a.tabIndex=a===o?0:-1;return o}}function Se(e){return{background:e.dashboardRoot,tableBackground:e.tableBackground,tableHeaderColor:e.tableHeader,tableBodyColor:e.tableBody,tableBorder:e.border,tablePinnedBackground:e.tableHeaderBackground,tablePinnedBorder:e.pinnedBorder,tableFontSize:`${e.font.size}px`,fontFamily:e.font.family,mapColor:e.mapColor}}function Ee(e){const{foreground:t,axisFaint:r,gridline:l,font:o}=e,a={background:e.background,font:o.family,title:{color:t,font:o.family},axis:{labelColor:t,titleColor:t,domainColor:r,tickColor:r,gridColor:l,labelFont:o.family,titleFont:o.family},legend:{labelColor:t,titleColor:t,labelFont:o.family,titleFont:o.family},header:{labelColor:t,titleColor:t},range:{category:e.series}},n={...a,legend:{...a.legend,orient:"bottom"}};return i=>i==="shape_map"?n:a}function ze(e){if(!e)return;const t=e.tag("theme");if(!t)return;const r={},l=t.tag("palette");if(l){const a={},n=l.textArray("series");n&&n.length>0&&(a.series=n);for(const i of he){const b=l.tag(i);if(!b)continue;const f={},x=b.text("light"),w=b.text("dark");x&&(f.light=x),w&&(f.dark=w),Object.keys(f).length>0&&(a[i]=f)}Object.keys(a).length>0&&(r.palette=a)}const o=t.tag("font");if(o){const a={},n=o.text("family");n&&(a.family=n);const i=o.numeric("size");typeof i=="number"&&Number.isFinite(i)&&(a.size=i),Object.keys(a).length>0&&(r.font=a)}return Object.keys(r).length>0?r:void 0}const B="data-publisher-fill",Re=async(e,t)=>{if(typeof window>"u")throw new Error("MalloyRenderer can only be used in browser environment");const{MalloyRenderer:r}=await fe();return new r({onClick:t,vegaConfigOverride:Ee(e),theme:Se(e),onError:l=>{console.error("Error rendering visualization:",typeof l,l)}}).createViz()};async function Fe(e){if(!e||typeof e!="object")return;const t=e,r=[...Array.isArray(t.model_annotations)?t.model_annotations:[],...Array.isArray(t.source_annotations)?t.source_annotations:[],...Array.isArray(t.annotations)?t.annotations:[]].map(o=>typeof o?.value=="string"?o.value:void 0).filter(o=>!!o);if(r.length===0)return;let l;try{({parseAnnotation:l}=await pe())}catch{return}try{const{tag:o}=l(r);return ze(o)}catch(o){console.warn("Failed to parse # theme.* annotations; chart will render with the shell theme.",{error:o,lines:r});return}}function Te(e,t,r){const l=ge(t,r);for(const[o,a]of Object.entries(l))e.style.setProperty(o,a)}const je=`
2
2
  /* Card geometry, through the renderer's OWN theme vars rather than over the top
3
3
  of them. It declares --malloy-theme--dashboard-* on .malloy-render itself and
4
4
  passes each through to the --malloy-render--* the card CSS reads, so a value
@@ -1 +1 @@
1
- import{an as o,j as r,ao as s,ap as n,F as t,T as a}from"./index-BIqIsMFr.js";function x(){const e=o();return console.error(e),r.jsx(s,{maxWidth:"lg",component:"main",sx:{display:"flex",flexDirection:"column",my:2,gap:0},children:r.jsxs(n,{sx:{m:"auto",flexDirection:"column"},children:[r.jsx(t,{sx:{height:"300px"}}),r.jsx("img",{src:"/error.png"}),r.jsx(a,{variant:"subtitle1",children:"An unexpected error occurred"})]})})}export{x as default};
1
+ import{an as o,j as r,ao as s,ap as n,F as t,T as a}from"./index-hnA8HjeH.js";function x(){const e=o();return console.error(e),r.jsx(s,{maxWidth:"lg",component:"main",sx:{display:"flex",flexDirection:"column",my:2,gap:0},children:r.jsxs(n,{sx:{m:"auto",flexDirection:"column"},children:[r.jsx(t,{sx:{height:"300px"}}),r.jsx("img",{src:"/error.png"}),r.jsx(a,{variant:"subtitle1",children:"An unexpected error occurred"})]})})}export{x as default};